AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
feat(attio): add AI actions and output schemas (#16105)
Kishan Parmar4a5e25f8331e
diff --git a/bun.lock b/bun.lockindex 7c064272752..da2fdc0dae7 100644--- a/bun.lock+++ b/bun.lock@@ -852,12 +852,13 @@},"packages/pieces/community/attio": {"name": "@activepieces/piece-attio",- "version": "0.2.0",+ "version": "0.3.0","dependencies": {"@activepieces/core-piece-types": "workspace:*","@activepieces/core-utils": "workspace:*","@activepieces/pieces-common": "workspace:*","@activepieces/pieces-framework": "workspace:*",+ "form-data": "4.0.6",},"devDependencies": {"tslib": "2.6.2",diff --git a/packages/pieces/community/attio/package.json b/packages/pieces/community/attio/package.jsonindex 07763c3d1c3..e62dd51a9ea 100644--- a/packages/pieces/community/attio/package.json+++ b/packages/pieces/community/attio/package.json@@ -1,6 +1,6 @@{"name": "@activepieces/piece-attio",- "version": "0.2.0",+ "version": "0.3.0","main": "./dist/src/index.js","types": "./dist/src/index.d.ts","scripts": {@@ -12,7 +12,8 @@"@activepieces/pieces-common": "workspace:*","@activepieces/pieces-framework": "workspace:*","@activepieces/core-piece-types": "workspace:*",- "@activepieces/core-utils": "workspace:*"+ "@activepieces/core-utils": "workspace:*",+ "form-data": "4.0.6"},"devDependencies": {"tslib": "2.6.2"diff --git a/packages/pieces/community/attio/src/index.ts b/packages/pieces/community/attio/src/index.tsindex 73df1674ddc..431de8f04d9 100644--- a/packages/pieces/community/attio/src/index.ts+++ b/packages/pieces/community/attio/src/index.ts@@ -16,6 +16,7 @@ import { listTasksAction } from './lib/actions/list-tasks';import { getTaskAction } from './lib/actions/get-task';import { deleteTaskAction } from './lib/actions/delete-task';import { updateTaskAction } from './lib/actions/update-task';+import { attioAiActions } from './lib/actions/ai';// Import triggersimport { recordCreatedTrigger } from './lib/triggers/record-created';@@ -31,7 +32,7 @@ export const attio = createPiece({displayName: 'Attio',description: 'Modern, collaborative CRM platform built to be fully customizable and real-time.',auth: attioAuth,- minimumSupportedRelease: '0.36.1',+ minimumSupportedRelease: '0.88.2',logoUrl: 'https://cdn.activepieces.com/pieces/attio.png',categories: [PieceCategory.SALES_AND_CRM],authors: ['AnkitSharmaOnGithub', 'kishanprmr', 'onyedikachi-david'],@@ -50,6 +51,7 @@ export const attio = createPiece({getTaskAction,deleteTaskAction,updateTaskAction,+ ...attioAiActions,createCustomApiCallAction({auth: attioAuth,baseUrl: () => BASE_URL,diff --git a/packages/pieces/community/attio/src/lib/actions/ai/create-attribute.ts b/packages/pieces/community/attio/src/lib/actions/ai/create-attribute.tsnew file mode 100644index 00000000000..8c2fb5e6fea--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/create-attribute.ts@@ -0,0 +1,61 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioGetAttributeOutputSchema } from '../../output-schemas';++export const attioCreateAttributeAction = createAction({+ auth: attioAuth,+ name: 'attio_create_attribute',+ outputSchema: attioGetAttributeOutputSchema,+ displayName: 'Create Attribute',+ description: 'Creates an attribute on an object or list.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Creates a new attribute (field) on an object or list. Attributes cannot be deleted through the API, only archived with Update Attribute. Record-reference and currency types need Config.',+ idempotent: false,+ },+ props: {+ target: attioAi.targetProp(),+ identifier: attioAi.identifierProp(),+ title: Property.ShortText({ displayName: 'Title', required: true }),+ api_slug: Property.ShortText({ displayName: 'API Slug', description: 'Unique snake_case slug.', required: true }),+ type: Property.ShortText({+ displayName: 'Type',+ description: 'One of `text`, `number`, `checkbox`, `currency`, `date`, `timestamp`, `rating`, `status`, `select`, `record-reference`, `actor-reference`, `location`, `domain`, `email-address`, `phone-number`.',+ required: true,+ }),+ description: Property.LongText({ displayName: 'Description', required: false }),+ is_required: Property.Checkbox({ displayName: 'Required', required: false }),+ is_unique: Property.Checkbox({ displayName: 'Unique', required: false }),+ is_multiselect: Property.Checkbox({ displayName: 'Multiselect', required: false }),+ config: Property.Json({+ displayName: 'Config',+ description: 'Type-specific config, e.g. {"currency": {"default_currency_code": "USD", "display_type": "symbol"}} or {"record_reference": {"allowed_objects": ["people"]}}.',+ required: false,+ }),+ },+ async run(context) {+ const { target, identifier, title, api_slug, type, description, is_required, is_unique, is_multiselect, config } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.POST,+ resourceUri: `/${target}/${identifier}/attributes`,+ body: {+ data: {+ title,+ api_slug,+ type,+ description: description ?? null,+ is_required: is_required ?? false,+ is_unique: is_unique ?? false,+ is_multiselect: is_multiselect ?? false,+ config: config ?? {},+ },+ },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/create-call-recording.ts b/packages/pieces/community/attio/src/lib/actions/ai/create-call-recording.tsnew file mode 100644index 00000000000..e50cb5a8152--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/create-call-recording.ts@@ -0,0 +1,56 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioCreateCallRecordingOutputSchema } from '../../output-schemas';++export const attioCreateCallRecordingAction = createAction({+ auth: attioAuth,+ name: 'attio_create_call_recording',+ outputSchema: attioCreateCallRecordingOutputSchema,+ displayName: 'Create Call Recording',+ description: 'Attaches a call recording and transcript to a meeting.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Attaches a call recording to a meeting from a video URL and/or transcript segments. Always include a transcript. Rate limited to 1 request per second. Not idempotent.',+ idempotent: false,+ },+ props: {+ meeting_id: Property.ShortText({ displayName: 'Meeting ID', description: 'From List Meetings or Create Meeting.', required: true }),+ video_url: Property.ShortText({ displayName: 'Video URL', description: 'Publicly reachable URL of the recording.', required: false }),+ transcript: Property.Array({+ displayName: 'Transcript',+ description: 'Transcript segments in order.',+ required: true,+ properties: {+ speech: Property.LongText({ displayName: 'Speech', required: true }),+ start_time: Property.Number({ displayName: 'Start Time', description: 'Seconds from the start.', required: true }),+ end_time: Property.Number({ displayName: 'End Time', description: 'Seconds from the start.', required: true }),+ speaker_name: Property.ShortText({ displayName: 'Speaker Name', required: true }),+ speaker_email: Property.ShortText({ displayName: 'Speaker Email', required: false }),+ },+ }),+ },+ async run(context) {+ const { meeting_id, video_url, transcript } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.POST,+ resourceUri: `/meetings/${meeting_id}/call_recordings`,+ body: {+ data: attioAi.compact({+ video_url,+ transcript: attioAi.records(transcript).map((segment) => ({+ speech: segment['speech'],+ start_time: segment['start_time'],+ end_time: segment['end_time'],+ speaker: attioAi.compact({ name: segment['speaker_name'], email_address: segment['speaker_email'] }),+ })),+ }),+ },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/create-comment.ts b/packages/pieces/community/attio/src/lib/actions/ai/create-comment.tsnew file mode 100644index 00000000000..08ca3eb03f3--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/create-comment.ts@@ -0,0 +1,47 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioCreateCommentOutputSchema } from '../../output-schemas';++export const attioCreateCommentAction = createAction({+ auth: attioAuth,+ name: 'attio_create_comment',+ outputSchema: attioCreateCommentOutputSchema,+ displayName: 'Create Comment',+ description: 'Comments on a record, a list entry, or replies in a thread.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Posts a comment as a workspace member (ID from List Workspace Members). Give exactly one target: Thread ID to reply, Object with Record ID for a record, or List with Entry ID for a list entry. Not idempotent.',+ idempotent: false,+ },+ props: {+ content: Property.LongText({ displayName: 'Content', required: true }),+ author_id: Property.ShortText({ displayName: 'Author ID', description: 'Workspace member ID, from List Workspace Members.', required: true }),+ thread_id: Property.ShortText({ displayName: 'Thread ID', description: 'Reply in this thread.', required: false }),+ object: Property.ShortText({ displayName: 'Object', description: 'Object slug, with Record ID.', required: false }),+ record_id: Property.ShortText({ displayName: 'Record ID', required: false }),+ list: Property.ShortText({ displayName: 'List', description: 'List slug or ID, with Entry ID.', required: false }),+ entry_id: Property.ShortText({ displayName: 'Entry ID', required: false }),+ },+ async run(context) {+ const { content, author_id, thread_id, object, record_id, list, entry_id } = context.propsValue;+ const targets = [thread_id, object && record_id, list && entry_id].filter(Boolean);+ if (targets.length !== 1) {+ throw new Error('Provide exactly one target: Thread ID, Object with Record ID, or List with Entry ID.');+ }+ const target = thread_id+ ? { thread_id }+ : object && record_id+ ? { record: { object, record_id } }+ : { entry: { list, entry_id } };+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.POST,+ resourceUri: `/comments`,+ body: { data: { format: 'plaintext', content, author: { type: 'workspace-member', id: author_id }, ...target } },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/create-folder.ts b/packages/pieces/community/attio/src/lib/actions/ai/create-folder.tsnew file mode 100644index 00000000000..c1b5458775f--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/create-folder.ts@@ -0,0 +1,36 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioCreateFolderOutputSchema } from '../../output-schemas';++export const attioCreateFolderAction = createAction({+ auth: attioAuth,+ name: 'attio_create_folder',+ outputSchema: attioCreateFolderOutputSchema,+ displayName: 'Create Folder',+ description: 'Creates a folder on a record.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Creates a native folder in the files of a record. Not idempotent.',+ idempotent: false,+ },+ props: {+ object: attioAi.objectProp(),+ record_id: attioAi.recordIdProp({ description: 'ID of the record the files belong to.' }),+ name: Property.ShortText({ displayName: 'Name', required: true }),+ parent_folder_id: Property.ShortText({ displayName: 'Parent Folder ID', description: 'Folder to put it in; empty for the root.', required: false }),+ },+ async run(context) {+ const { object, record_id, name, parent_folder_id } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.POST,+ resourceUri: `/files`,+ body: attioAi.compact({ object, record_id, file_type: 'folder', name, parent_folder_id }),+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/create-list-entry.ts b/packages/pieces/community/attio/src/lib/actions/ai/create-list-entry.tsnew file mode 100644index 00000000000..10861d6bcf8--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/create-list-entry.ts@@ -0,0 +1,40 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { createEntryOutputSchema } from '../../output-schemas';++export const attioCreateListEntryAction = createAction({+ auth: attioAuth,+ name: 'attio_create_list_entry',+ outputSchema: createEntryOutputSchema,+ displayName: 'Create List Entry',+ description: 'Adds a record to a list.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Adds a record to a list as a new entry, optionally setting list-specific values. A record can be added to the same list more than once; use Upsert List Entry to avoid duplicates.',+ idempotent: false,+ },+ props: {+ list: attioAi.listProp(),+ parent_object: attioAi.objectProp(),+ parent_record_id: attioAi.recordIdProp({ description: 'ID of the record to add to the list.' }),+ entry_values: attioAi.valuesProp({+ displayName: 'Entry Values',+ description: 'List-specific attribute values keyed by attribute slug, e.g. {"stage": "Qualified"}. Use List Attributes with target `lists` for slugs.',+ required: false,+ }),+ },+ async run(context) {+ const { list, parent_object, parent_record_id, entry_values } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.POST,+ resourceUri: `/lists/${list}/entries`,+ body: { data: { parent_object, parent_record_id, entry_values: entry_values ?? {} } },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/create-list.ts b/packages/pieces/community/attio/src/lib/actions/ai/create-list.tsnew file mode 100644index 00000000000..e18256b6f7c--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/create-list.ts@@ -0,0 +1,48 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioCreateListOutputSchema } from '../../output-schemas';++export const attioCreateListAction = createAction({+ auth: attioAuth,+ name: 'attio_create_list',+ outputSchema: attioCreateListOutputSchema,+ displayName: 'Create List',+ description: 'Creates a new list for an object.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Creates a new list whose entries are records of the parent object. Lists cannot be deleted through the API. Workspace access other than Full access may need a paid plan; Full access works on every plan. Not idempotent.',+ idempotent: false,+ },+ props: {+ name: Property.ShortText({ displayName: 'Name', required: true }),+ api_slug: Property.ShortText({ displayName: 'API Slug', description: 'Unique snake_case slug, e.g. `enterprise_pipeline`.', required: true }),+ parent_object: attioAi.objectProp(),+ workspace_access: Property.StaticDropdown({+ displayName: 'Workspace Access',+ description: 'Access level for all workspace members. Full access works on every plan.',+ required: true,+ options: {+ disabled: false,+ options: [+ { label: 'Full access', value: 'full-access' },+ { label: 'Read and write', value: 'read-and-write' },+ { label: 'Read only', value: 'read-only' },+ ],+ },+ }),+ },+ async run(context) {+ const { name, api_slug, parent_object, workspace_access } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.POST,+ resourceUri: `/lists`,+ body: { data: { name, api_slug, parent_object, workspace_access, workspace_member_access: [] } },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/create-meeting.ts b/packages/pieces/community/attio/src/lib/actions/ai/create-meeting.tsnew file mode 100644index 00000000000..6a3970d6a7a--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/create-meeting.ts@@ -0,0 +1,77 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioCreateMeetingOutputSchema } from '../../output-schemas';++export const attioCreateMeetingAction = createAction({+ auth: attioAuth,+ name: 'attio_create_meeting',+ outputSchema: attioCreateMeetingOutputSchema,+ displayName: 'Create Meeting',+ description: 'Creates a meeting with participants and linked records.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Creates a meeting, e.g. to log an external call before attaching a recording with Create Call Recording. Not idempotent: repeated calls create duplicates.',+ idempotent: false,+ },+ props: {+ title: Property.ShortText({ displayName: 'Title', required: true }),+ description: Property.LongText({ displayName: 'Description', required: false }),+ start: Property.DateTime({ displayName: 'Start', required: true }),+ end: Property.DateTime({ displayName: 'End', required: true }),+ is_all_day: Property.Checkbox({ displayName: 'All Day', description: 'Only the dates of Start and End are used.', required: false }),+ timezone: Property.ShortText({ displayName: 'Timezone', description: 'IANA timezone, e.g. `Europe/London`.', required: false }),+ participants: Property.Array({+ displayName: 'Participants',+ required: true,+ properties: {+ email_address: Property.ShortText({ displayName: 'Email', required: true }),+ name: Property.ShortText({ displayName: 'Name', required: false }),+ is_organizer: Property.Checkbox({ displayName: 'Organizer', required: false }),+ status: Property.StaticDropdown({+ displayName: 'Status',+ description: 'Defaults to accepted.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Accepted', value: 'accepted' },+ { label: 'Tentative', value: 'tentative' },+ { label: 'Declined', value: 'declined' },+ { label: 'Pending', value: 'pending' },+ ],+ },+ }),+ },+ }),+ linked_records: attioAi.linkedRecordsProp({ description: 'Records to link to the meeting.' }),+ },+ async run(context) {+ const { title, description, start, end, is_all_day, timezone, participants, linked_records } = context.propsValue;+ const toTime = (value: string) => (is_all_day ? { date: value.slice(0, 10) } : { datetime: value, timezone: timezone ?? null });+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.POST,+ resourceUri: `/meetings`,+ body: {+ data: {+ title,+ description: description ?? '',+ start: toTime(start),+ end: toTime(end),+ is_all_day: is_all_day ?? false,+ participants: attioAi.records(participants).map((participant) => ({+ ...attioAi.compact({ email_address: participant['email_address'], name: participant['name'] }),+ is_organizer: participant['is_organizer'] === true,+ status: participant['status'] ?? 'accepted',+ })),+ linked_records: attioAi.records(linked_records),+ },+ },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/create-note.ts b/packages/pieces/community/attio/src/lib/actions/ai/create-note.tsnew file mode 100644index 00000000000..a1bf2d1e712--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/create-note.ts@@ -0,0 +1,49 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioCreateNoteOutputSchema } from '../../output-schemas';++export const attioCreateNoteAction = createAction({+ auth: attioAuth,+ name: 'attio_create_note',+ outputSchema: attioCreateNoteOutputSchema,+ displayName: 'Create Note',+ description: 'Creates a note on a record.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Creates a note on a record, in plain text or markdown, optionally linked to a meeting. Not idempotent: each call adds a new note.',+ idempotent: false,+ },+ props: {+ parent_object: attioAi.objectProp(),+ parent_record_id: attioAi.recordIdProp({ description: 'ID of the record the note belongs to.' }),+ title: Property.ShortText({ displayName: 'Title', required: true }),+ content: Property.LongText({ displayName: 'Content', required: true }),+ format: Property.StaticDropdown({+ displayName: 'Format',+ description: 'Defaults to plain text.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Plain text', value: 'plaintext' },+ { label: 'Markdown', value: 'markdown' },+ ],+ },+ }),+ meeting_id: Property.ShortText({ displayName: 'Meeting ID', description: 'Optional meeting to link, from List Meetings.', required: false }),+ },+ async run(context) {+ const { parent_object, parent_record_id, title, content, format, meeting_id } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.POST,+ resourceUri: `/notes`,+ body: { data: attioAi.compact({ parent_object, parent_record_id, title, content, format: format ?? 'plaintext', meeting_id }) },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/create-object.ts b/packages/pieces/community/attio/src/lib/actions/ai/create-object.tsnew file mode 100644index 00000000000..de39a8026de--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/create-object.ts@@ -0,0 +1,34 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioCreateObjectOutputSchema } from '../../output-schemas';++export const attioCreateObjectAction = createAction({+ auth: attioAuth,+ name: 'attio_create_object',+ outputSchema: attioCreateObjectOutputSchema,+ displayName: 'Create Object',+ description: 'Creates a custom object.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Creates a new custom object type in the workspace. Add attributes to it with Create Attribute. Not idempotent; slugs must be unique.',+ idempotent: false,+ },+ props: {+ api_slug: Property.ShortText({ displayName: 'API Slug', description: 'Unique snake_case slug, e.g. `projects`.', required: true }),+ singular_noun: Property.ShortText({ displayName: 'Singular Noun', description: 'e.g. `Project`.', required: true }),+ plural_noun: Property.ShortText({ displayName: 'Plural Noun', description: 'e.g. `Projects`.', required: true }),+ },+ async run(context) {+ const { api_slug, singular_noun, plural_noun } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.POST,+ resourceUri: `/objects`,+ body: { data: { api_slug, singular_noun, plural_noun } },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/create-record.ts b/packages/pieces/community/attio/src/lib/actions/ai/create-record.tsnew file mode 100644index 00000000000..e5a1857eebd--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/create-record.ts@@ -0,0 +1,39 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { AttioRecordResponse } from '../../common/types';+import { attioCreateRecordOutputSchema } from '../../output-schemas';++export const attioCreateRecordAction = createAction({+ auth: attioAuth,+ name: 'attio_create_record',+ outputSchema: attioCreateRecordOutputSchema,+ displayName: 'Create Record',+ description: 'Creates a record in any Attio object.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Creates a new record (person, company, deal or custom object) with the given attribute values. Use Upsert Record instead when the record may already exist. Not idempotent: each call creates a separate record.',+ idempotent: false,+ },+ props: {+ object: attioAi.objectProp(),+ values: attioAi.valuesProp({+ displayName: 'Values',+ description: 'Attribute values keyed by attribute slug, e.g. {"name": "Acme", "domains": ["acme.com"]}. Use List Attributes for slugs and types.',+ required: true,+ }),+ },+ async run(context) {+ const { object, values } = context.propsValue;+ const response = await attioApiCall<{ data: AttioRecordResponse }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.POST,+ resourceUri: `/objects/${object}/records`,+ body: { data: { values } },+ });+ return attioAi.flattenRecord(response.data);+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/create-select-option.ts b/packages/pieces/community/attio/src/lib/actions/ai/create-select-option.tsnew file mode 100644index 00000000000..d9adef7a2e6--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/create-select-option.ts@@ -0,0 +1,36 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioCreateSelectOptionOutputSchema } from '../../output-schemas';++export const attioCreateSelectOptionAction = createAction({+ auth: attioAuth,+ name: 'attio_create_select_option',+ outputSchema: attioCreateSelectOptionOutputSchema,+ displayName: 'Create Select Option',+ description: 'Adds an option to a select attribute.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Adds a new option to a select or multiselect attribute. Options cannot be deleted, only archived with Update Select Option. Not idempotent.',+ idempotent: false,+ },+ props: {+ target: attioAi.targetProp(),+ identifier: attioAi.identifierProp(),+ attribute: attioAi.attributeProp(),+ title: Property.ShortText({ displayName: 'Title', required: true }),+ },+ async run(context) {+ const { target, identifier, attribute, title } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.POST,+ resourceUri: `/${target}/${identifier}/attributes/${attribute}/options`,+ body: { data: { title } },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/create-status.ts b/packages/pieces/community/attio/src/lib/actions/ai/create-status.tsnew file mode 100644index 00000000000..023467a6a5c--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/create-status.ts@@ -0,0 +1,38 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioCreateStatusOutputSchema } from '../../output-schemas';++export const attioCreateStatusAction = createAction({+ auth: attioAuth,+ name: 'attio_create_status',+ outputSchema: attioCreateStatusOutputSchema,+ displayName: 'Create Status',+ description: 'Adds a status to a status attribute.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Adds a new status, e.g. a deal stage, to a status attribute. Statuses cannot be deleted, only archived with Update Status. Not idempotent.',+ idempotent: false,+ },+ props: {+ target: attioAi.targetProp(),+ identifier: attioAi.identifierProp(),+ attribute: attioAi.attributeProp(),+ title: Property.ShortText({ displayName: 'Title', required: true }),+ celebration_enabled: Property.Checkbox({ displayName: 'Celebration Enabled', description: 'Show a celebration when a record reaches this status.', required: false }),+ target_time_in_status: Property.ShortText({ displayName: 'Target Time in Status', description: 'ISO 8601 duration, e.g. `P7D`.', required: false }),+ },+ async run(context) {+ const { target, identifier, attribute, title, celebration_enabled, target_time_in_status } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.POST,+ resourceUri: `/${target}/${identifier}/attributes/${attribute}/statuses`,+ body: { data: { title, celebration_enabled: celebration_enabled ?? false, target_time_in_status: target_time_in_status ?? null } },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/create-task.ts b/packages/pieces/community/attio/src/lib/actions/ai/create-task.tsnew file mode 100644index 00000000000..14dd30afacf--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/create-task.ts@@ -0,0 +1,58 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioCreateTaskOutputSchema } from '../../output-schemas';++export const attioCreateTaskAction = createAction({+ auth: attioAuth,+ name: 'attio_create_task',+ outputSchema: attioCreateTaskOutputSchema,+ displayName: 'Create Task',+ description: 'Creates a task, optionally linked to records and assigned.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Creates a task with optional deadline, linked records and assignees (by workspace member email). Task content cannot be changed later. Not idempotent.',+ idempotent: false,+ },+ props: {+ content: Property.LongText({ displayName: 'Content', required: true }),+ deadline_at: Property.DateTime({ displayName: 'Deadline', required: false }),+ is_completed: Property.Checkbox({ displayName: 'Completed', required: false }),+ linked_records: Property.Array({+ displayName: 'Linked Records',+ description: 'Records to link the task to.',+ required: false,+ properties: {+ target_object: Property.ShortText({ displayName: 'Object', description: 'Object slug, e.g. `companies`.', required: true }),+ target_record_id: Property.ShortText({ displayName: 'Record ID', required: true }),+ },+ }),+ assignee_emails: Property.Array({+ displayName: 'Assignee Emails',+ description: 'Workspace member email addresses to assign.',+ required: false,+ }),+ },+ async run(context) {+ const { content, deadline_at, is_completed, linked_records, assignee_emails } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.POST,+ resourceUri: `/tasks`,+ body: {+ data: {+ content,+ format: 'plaintext',+ deadline_at: deadline_at ?? null,+ is_completed: is_completed ?? false,+ linked_records: attioAi.records(linked_records),+ assignees: attioAi.strings(assignee_emails).map((email) => ({ workspace_member_email_address: email })),+ },+ },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/delete-call-recording.ts b/packages/pieces/community/attio/src/lib/actions/ai/delete-call-recording.tsnew file mode 100644index 00000000000..fb78875f803--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/delete-call-recording.ts@@ -0,0 +1,32 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioDeleteCallRecordingOutputSchema } from '../../output-schemas';++export const attioDeleteCallRecordingAction = createAction({+ auth: attioAuth,+ name: 'attio_delete_call_recording',+ outputSchema: attioDeleteCallRecordingOutputSchema,+ displayName: 'Delete Call Recording',+ description: 'Permanently deletes a call recording.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description: 'Permanently deletes a call recording and its transcript. Cannot be undone.',+ idempotent: false,+ },+ props: {+ meeting_id: Property.ShortText({ displayName: 'Meeting ID', description: 'From List Meetings or Create Meeting.', required: true }),+ call_recording_id: Property.ShortText({ displayName: 'Call Recording ID', description: 'From List Call Recordings.', required: true }),+ },+ async run(context) {+ const { meeting_id, call_recording_id } = context.propsValue;+ await attioApiCall({+ accessToken: context.auth.secret_text,+ method: HttpMethod.DELETE,+ resourceUri: `/meetings/${meeting_id}/call_recordings/${call_recording_id}`,+ });+ return { success: true, call_recording_id };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/delete-comment.ts b/packages/pieces/community/attio/src/lib/actions/ai/delete-comment.tsnew file mode 100644index 00000000000..92d51ad3455--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/delete-comment.ts@@ -0,0 +1,31 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioDeleteCommentOutputSchema } from '../../output-schemas';++export const attioDeleteCommentAction = createAction({+ auth: attioAuth,+ name: 'attio_delete_comment',+ outputSchema: attioDeleteCommentOutputSchema,+ displayName: 'Delete Comment',+ description: 'Permanently deletes a comment.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description: 'Permanently deletes a comment. Deleting the first comment of a thread deletes the whole thread. Cannot be undone.',+ idempotent: false,+ },+ props: {+ comment_id: Property.ShortText({ displayName: 'Comment ID', description: 'From List Threads or Create Comment.', required: true }),+ },+ async run(context) {+ const { comment_id } = context.propsValue;+ await attioApiCall({+ accessToken: context.auth.secret_text,+ method: HttpMethod.DELETE,+ resourceUri: `/comments/${comment_id}`,+ });+ return { success: true, comment_id };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/delete-file.ts b/packages/pieces/community/attio/src/lib/actions/ai/delete-file.tsnew file mode 100644index 00000000000..efa551bd963--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/delete-file.ts@@ -0,0 +1,31 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioDeleteFileOutputSchema } from '../../output-schemas';++export const attioDeleteFileAction = createAction({+ auth: attioAuth,+ name: 'attio_delete_file',+ outputSchema: attioDeleteFileOutputSchema,+ displayName: 'Delete File',+ description: 'Permanently deletes a file or folder.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description: 'Permanently deletes a file or folder; deleting a folder deletes everything inside it. Cannot be undone.',+ idempotent: false,+ },+ props: {+ file_id: Property.ShortText({ displayName: 'File ID', description: 'From List Files.', required: true }),+ },+ async run(context) {+ const { file_id } = context.propsValue;+ await attioApiCall({+ accessToken: context.auth.secret_text,+ method: HttpMethod.DELETE,+ resourceUri: `/files/${file_id}`,+ });+ return { success: true, file_id };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/delete-list-entry.ts b/packages/pieces/community/attio/src/lib/actions/ai/delete-list-entry.tsnew file mode 100644index 00000000000..03565a23549--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/delete-list-entry.ts@@ -0,0 +1,33 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioDeleteListEntryOutputSchema } from '../../output-schemas';++export const attioDeleteListEntryAction = createAction({+ auth: attioAuth,+ name: 'attio_delete_list_entry',+ outputSchema: attioDeleteListEntryOutputSchema,+ displayName: 'Delete List Entry',+ description: 'Removes an entry from a list.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description: 'Removes an entry from a list. The parent record itself is not deleted. Cannot be undone.',+ idempotent: false,+ },+ props: {+ list: attioAi.listProp(),+ entry_id: attioAi.entryIdProp(),+ },+ async run(context) {+ const { list, entry_id } = context.propsValue;+ await attioApiCall({+ accessToken: context.auth.secret_text,+ method: HttpMethod.DELETE,+ resourceUri: `/lists/${list}/entries/${entry_id}`,+ });+ return { success: true, entry_id };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/delete-meeting.ts b/packages/pieces/community/attio/src/lib/actions/ai/delete-meeting.tsnew file mode 100644index 00000000000..974458412dc--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/delete-meeting.ts@@ -0,0 +1,31 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioDeleteMeetingOutputSchema } from '../../output-schemas';++export const attioDeleteMeetingAction = createAction({+ auth: attioAuth,+ name: 'attio_delete_meeting',+ outputSchema: attioDeleteMeetingOutputSchema,+ displayName: 'Delete Meeting',+ description: 'Permanently deletes a meeting created through the API.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description: 'Permanently deletes a meeting and its recordings. Meetings from calendar sync cannot be deleted this way. Cannot be undone.',+ idempotent: false,+ },+ props: {+ meeting_id: Property.ShortText({ displayName: 'Meeting ID', description: 'From List Meetings or Create Meeting.', required: true }),+ },+ async run(context) {+ const { meeting_id } = context.propsValue;+ await attioApiCall({+ accessToken: context.auth.secret_text,+ method: HttpMethod.DELETE,+ resourceUri: `/meetings/${meeting_id}`,+ });+ return { success: true, meeting_id };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/delete-note.ts b/packages/pieces/community/attio/src/lib/actions/ai/delete-note.tsnew file mode 100644index 00000000000..90bac70a5a1--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/delete-note.ts@@ -0,0 +1,31 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioDeleteNoteOutputSchema } from '../../output-schemas';++export const attioDeleteNoteAction = createAction({+ auth: attioAuth,+ name: 'attio_delete_note',+ outputSchema: attioDeleteNoteOutputSchema,+ displayName: 'Delete Note',+ description: 'Permanently deletes a note.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description: 'Permanently deletes a note by ID. Cannot be undone.',+ idempotent: false,+ },+ props: {+ note_id: Property.ShortText({ displayName: 'Note ID', description: 'From List Notes or Create Note.', required: true }),+ },+ async run(context) {+ const { note_id } = context.propsValue;+ await attioApiCall({+ accessToken: context.auth.secret_text,+ method: HttpMethod.DELETE,+ resourceUri: `/notes/${note_id}`,+ });+ return { success: true, note_id };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/delete-object.ts b/packages/pieces/community/attio/src/lib/actions/ai/delete-object.tsnew file mode 100644index 00000000000..8e268dc8f68--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/delete-object.ts@@ -0,0 +1,32 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioDeleteObjectOutputSchema } from '../../output-schemas';++export const attioDeleteObjectAction = createAction({+ auth: attioAuth,+ name: 'attio_delete_object',+ outputSchema: attioDeleteObjectOutputSchema,+ displayName: 'Delete Object',+ description: 'Permanently deletes a custom object and all of its records.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description: 'Permanently deletes a custom object together with every record, attribute and list that depends on it. Only custom objects can be deleted; system objects such as people and companies are refused. Cannot be undone.',+ idempotent: false,+ },+ props: {+ object: attioAi.objectProp(),+ },+ async run(context) {+ const { object } = context.propsValue;+ await attioApiCall({+ accessToken: context.auth.secret_text,+ method: HttpMethod.DELETE,+ resourceUri: `/objects/${object}`,+ });+ return { success: true, object };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/delete-record.ts b/packages/pieces/community/attio/src/lib/actions/ai/delete-record.tsnew file mode 100644index 00000000000..acc812ced4d--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/delete-record.ts@@ -0,0 +1,33 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioDeleteRecordOutputSchema } from '../../output-schemas';++export const attioDeleteRecordAction = createAction({+ auth: attioAuth,+ name: 'attio_delete_record',+ outputSchema: attioDeleteRecordOutputSchema,+ displayName: 'Delete Record',+ description: 'Permanently deletes a record.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description: 'Permanently deletes a record by object and record ID. This cannot be undone.',+ idempotent: false,+ },+ props: {+ object: attioAi.objectProp(),+ record_id: attioAi.recordIdProp(),+ },+ async run(context) {+ const { object, record_id } = context.propsValue;+ await attioApiCall({+ accessToken: context.auth.secret_text,+ method: HttpMethod.DELETE,+ resourceUri: `/objects/${object}/records/${record_id}`,+ });+ return { success: true, record_id };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/delete-task.ts b/packages/pieces/community/attio/src/lib/actions/ai/delete-task.tsnew file mode 100644index 00000000000..18cb501c8a9--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/delete-task.ts@@ -0,0 +1,31 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioDeleteTaskOutputSchema } from '../../output-schemas';++export const attioDeleteTaskAction = createAction({+ auth: attioAuth,+ name: 'attio_delete_task',+ outputSchema: attioDeleteTaskOutputSchema,+ displayName: 'Delete Task',+ description: 'Permanently deletes a task.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description: 'Permanently deletes a task by ID. Cannot be undone.',+ idempotent: false,+ },+ props: {+ task_id: Property.ShortText({ displayName: 'Task ID', description: 'From List Tasks or Create Task.', required: true }),+ },+ async run(context) {+ const { task_id } = context.propsValue;+ await attioApiCall({+ accessToken: context.auth.secret_text,+ method: HttpMethod.DELETE,+ resourceUri: `/tasks/${task_id}`,+ });+ return { success: true, task_id };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/download-file.ts b/packages/pieces/community/attio/src/lib/actions/ai/download-file.tsnew file mode 100644index 00000000000..f2e363a2d8d--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/download-file.ts@@ -0,0 +1,39 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioDownloadFileOutputSchema } from '../../output-schemas';++export const attioDownloadFileAction = createAction({+ auth: attioAuth,+ name: 'attio_download_file',+ outputSchema: attioDownloadFileOutputSchema,+ displayName: 'Download File',+ description: 'Downloads a file stored in Attio.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description: 'Downloads a native Attio file and returns it as a file reference with its name and type. Folders and connected files cannot be downloaded.',+ idempotent: true,+ },+ props: {+ file_id: Property.ShortText({ displayName: 'File ID', description: 'From List Files.', required: true }),+ },+ async run(context) {+ const { file_id } = context.propsValue;+ const meta = await attioApiCall<{ data: { name?: string; content_type?: string; content_size?: number } }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/files/${file_id}`,+ });+ const content = await attioApiCall<ArrayBuffer>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/files/${file_id}/download`,+ responseType: 'arraybuffer',+ });+ const fileName = meta.data.name ?? file_id;+ const file = await context.files.write({ fileName, data: Buffer.from(content) });+ return { file, name: fileName, content_type: meta.data.content_type ?? null, content_size: meta.data.content_size ?? null };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/get-attribute.ts b/packages/pieces/community/attio/src/lib/actions/ai/get-attribute.tsnew file mode 100644index 00000000000..1228ea198fa--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/get-attribute.ts@@ -0,0 +1,34 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioGetAttributeOutputSchema } from '../../output-schemas';++export const attioGetAttributeAction = createAction({+ auth: attioAuth,+ name: 'attio_get_attribute',+ outputSchema: attioGetAttributeOutputSchema,+ displayName: 'Get Attribute',+ description: 'Gets an attribute of an object or list.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description: 'Gets one attribute by slug or ID, including its type and configuration.',+ idempotent: true,+ },+ props: {+ target: attioAi.targetProp(),+ identifier: attioAi.identifierProp(),+ attribute: attioAi.attributeProp(),+ },+ async run(context) {+ const { target, identifier, attribute } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/${target}/${identifier}/attributes/${attribute}`,+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/get-call-recording.ts b/packages/pieces/community/attio/src/lib/actions/ai/get-call-recording.tsnew file mode 100644index 00000000000..707557b1d49--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/get-call-recording.ts@@ -0,0 +1,32 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioGetCallRecordingOutputSchema } from '../../output-schemas';++export const attioGetCallRecordingAction = createAction({+ auth: attioAuth,+ name: 'attio_get_call_recording',+ outputSchema: attioGetCallRecordingOutputSchema,+ displayName: 'Get Call Recording',+ description: 'Gets a call recording with its transcript.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description: 'Gets one call recording, including its transcript when processing has finished (status `completed`).',+ idempotent: true,+ },+ props: {+ meeting_id: Property.ShortText({ displayName: 'Meeting ID', description: 'From List Meetings or Create Meeting.', required: true }),+ call_recording_id: Property.ShortText({ displayName: 'Call Recording ID', description: 'From List Call Recordings.', required: true }),+ },+ async run(context) {+ const { meeting_id, call_recording_id } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/meetings/${meeting_id}/call_recordings/${call_recording_id}`,+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/get-comment.ts b/packages/pieces/community/attio/src/lib/actions/ai/get-comment.tsnew file mode 100644index 00000000000..ad71307a21d--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/get-comment.ts@@ -0,0 +1,31 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioCreateCommentOutputSchema } from '../../output-schemas';++export const attioGetCommentAction = createAction({+ auth: attioAuth,+ name: 'attio_get_comment',+ outputSchema: attioCreateCommentOutputSchema,+ displayName: 'Get Comment',+ description: 'Gets a comment by its ID.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description: 'Gets one comment by ID, with its thread, author and the record or entry it is on.',+ idempotent: true,+ },+ props: {+ comment_id: Property.ShortText({ displayName: 'Comment ID', description: 'From List Threads or Create Comment.', required: true }),+ },+ async run(context) {+ const { comment_id } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/comments/${comment_id}`,+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/get-file.ts b/packages/pieces/community/attio/src/lib/actions/ai/get-file.tsnew file mode 100644index 00000000000..7f590ad77a1--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/get-file.ts@@ -0,0 +1,31 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioGetFileOutputSchema } from '../../output-schemas';++export const attioGetFileAction = createAction({+ auth: attioAuth,+ name: 'attio_get_file',+ outputSchema: attioGetFileOutputSchema,+ displayName: 'Get File',+ description: 'Gets a file or folder entry by its ID.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description: 'Gets metadata of one file or folder. Use Download File for the content.',+ idempotent: true,+ },+ props: {+ file_id: Property.ShortText({ displayName: 'File ID', description: 'From List Files.', required: true }),+ },+ async run(context) {+ const { file_id } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/files/${file_id}`,+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/get-list-entry.ts b/packages/pieces/community/attio/src/lib/actions/ai/get-list-entry.tsnew file mode 100644index 00000000000..e9a0e75f143--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/get-list-entry.ts@@ -0,0 +1,33 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { createEntryOutputSchema } from '../../output-schemas';++export const attioGetListEntryAction = createAction({+ auth: attioAuth,+ name: 'attio_get_list_entry',+ outputSchema: createEntryOutputSchema,+ displayName: 'Get List Entry',+ description: 'Gets a list entry by its ID.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description: 'Gets one list entry by list and entry ID, with its list-specific values.',+ idempotent: true,+ },+ props: {+ list: attioAi.listProp(),+ entry_id: attioAi.entryIdProp(),+ },+ async run(context) {+ const { list, entry_id } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/lists/${list}/entries/${entry_id}`,+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/get-list.ts b/packages/pieces/community/attio/src/lib/actions/ai/get-list.tsnew file mode 100644index 00000000000..f449e558924--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/get-list.ts@@ -0,0 +1,32 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioCreateListOutputSchema } from '../../output-schemas';++export const attioGetListAction = createAction({+ auth: attioAuth,+ name: 'attio_get_list',+ outputSchema: attioCreateListOutputSchema,+ displayName: 'Get List',+ description: 'Gets a list by its slug or ID.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description: 'Gets one list by slug or ID, including its parent object and access settings.',+ idempotent: true,+ },+ props: {+ list: attioAi.listProp(),+ },+ async run(context) {+ const { list } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/lists/${list}`,+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/get-meeting.ts b/packages/pieces/community/attio/src/lib/actions/ai/get-meeting.tsnew file mode 100644index 00000000000..13f6c300547--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/get-meeting.ts@@ -0,0 +1,31 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioCreateMeetingOutputSchema } from '../../output-schemas';++export const attioGetMeetingAction = createAction({+ auth: attioAuth,+ name: 'attio_get_meeting',+ outputSchema: attioCreateMeetingOutputSchema,+ displayName: 'Get Meeting',+ description: 'Gets a meeting by its ID.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description: 'Gets one meeting by ID, with participants and linked records. Use List Call Recordings for its recordings.',+ idempotent: true,+ },+ props: {+ meeting_id: Property.ShortText({ displayName: 'Meeting ID', description: 'From List Meetings or Create Meeting.', required: true }),+ },+ async run(context) {+ const { meeting_id } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/meetings/${meeting_id}`,+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/get-note.ts b/packages/pieces/community/attio/src/lib/actions/ai/get-note.tsnew file mode 100644index 00000000000..004470d6cfa--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/get-note.ts@@ -0,0 +1,31 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioCreateNoteOutputSchema } from '../../output-schemas';++export const attioGetNoteAction = createAction({+ auth: attioAuth,+ name: 'attio_get_note',+ outputSchema: attioCreateNoteOutputSchema,+ displayName: 'Get Note',+ description: 'Gets a note by its ID.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description: 'Gets one note by ID, with its title and content in plaintext and markdown.',+ idempotent: true,+ },+ props: {+ note_id: Property.ShortText({ displayName: 'Note ID', description: 'From List Notes or Create Note.', required: true }),+ },+ async run(context) {+ const { note_id } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/notes/${note_id}`,+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/get-object.ts b/packages/pieces/community/attio/src/lib/actions/ai/get-object.tsnew file mode 100644index 00000000000..2c88b100d7f--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/get-object.ts@@ -0,0 +1,32 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioCreateObjectOutputSchema } from '../../output-schemas';++export const attioGetObjectAction = createAction({+ auth: attioAuth,+ name: 'attio_get_object',+ outputSchema: attioCreateObjectOutputSchema,+ displayName: 'Get Object',+ description: 'Gets an object by its slug or ID.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description: 'Gets one object by slug or ID, with its singular and plural names.',+ idempotent: true,+ },+ props: {+ object: attioAi.objectProp(),+ },+ async run(context) {+ const { object } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/objects/${object}`,+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/get-record.ts b/packages/pieces/community/attio/src/lib/actions/ai/get-record.tsnew file mode 100644index 00000000000..54508b20468--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/get-record.ts@@ -0,0 +1,34 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { AttioRecordResponse } from '../../common/types';+import { attioCreateRecordOutputSchema } from '../../output-schemas';++export const attioGetRecordAction = createAction({+ auth: attioAuth,+ name: 'attio_get_record',+ outputSchema: attioCreateRecordOutputSchema,+ displayName: 'Get Record',+ description: 'Gets a record by its ID.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description: 'Gets one record by object and record ID, with its attribute values flattened. Use Query Records or Search Records to find the ID first.',+ idempotent: true,+ },+ props: {+ object: attioAi.objectProp(),+ record_id: attioAi.recordIdProp(),+ },+ async run(context) {+ const { object, record_id } = context.propsValue;+ const response = await attioApiCall<{ data: AttioRecordResponse }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/objects/${object}/records/${record_id}`,+ });+ return attioAi.flattenRecord(response.data);+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/get-self.ts b/packages/pieces/community/attio/src/lib/actions/ai/get-self.tsnew file mode 100644index 00000000000..b93c2825a03--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/get-self.ts@@ -0,0 +1,29 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioGetSelfOutputSchema } from '../../output-schemas';++export const attioGetSelfAction = createAction({+ auth: attioAuth,+ name: 'attio_get_self',+ outputSchema: attioGetSelfOutputSchema,+ displayName: 'Get Current Token',+ description: 'Identifies the access token, its workspace and scopes.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description: 'Returns whether the token is active, its workspace and granted scopes. Use it to check which actions the connection can run.',+ idempotent: true,+ },+ props: {++ },+ async run(context) {+ return attioApiCall<Record<string, unknown>>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: '/self',+ });+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/get-task.ts b/packages/pieces/community/attio/src/lib/actions/ai/get-task.tsnew file mode 100644index 00000000000..ec33fc711cb--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/get-task.ts@@ -0,0 +1,31 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioCreateTaskOutputSchema } from '../../output-schemas';++export const attioGetTaskAction = createAction({+ auth: attioAuth,+ name: 'attio_get_task',+ outputSchema: attioCreateTaskOutputSchema,+ displayName: 'Get Task',+ description: 'Gets a task by its ID.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description: 'Gets one task by ID, with its content, deadline, assignees and linked records.',+ idempotent: true,+ },+ props: {+ task_id: Property.ShortText({ displayName: 'Task ID', description: 'From List Tasks or Create Task.', required: true }),+ },+ async run(context) {+ const { task_id } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/tasks/${task_id}`,+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/get-thread.ts b/packages/pieces/community/attio/src/lib/actions/ai/get-thread.tsnew file mode 100644index 00000000000..b6dc350200d--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/get-thread.ts@@ -0,0 +1,35 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioGetThreadOutputSchema } from '../../output-schemas';++export const attioGetThreadAction = createAction({+ auth: attioAuth,+ name: 'attio_get_thread',+ outputSchema: attioGetThreadOutputSchema,+ displayName: 'Get Thread',+ description: 'Gets a comment thread and pages through its comments.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description: 'Gets a thread with its comments, oldest first, up to 250 per page. Pass the returned cursor to read more.',+ idempotent: true,+ },+ props: {+ thread_id: Property.ShortText({ displayName: 'Thread ID', description: 'From List Threads or a comment.', required: true }),+ limit: attioAi.limitProp({ max: 250 }),+ cursor: attioAi.cursorProp(),+ },+ async run(context) {+ const { thread_id, limit, cursor } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown>; pagination: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/threads/${thread_id}`,+ query: { limit, cursor },+ });+ return { ...response.data, next_cursor: response.pagination?.['next_cursor'] ?? null };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/get-workspace-member.ts b/packages/pieces/community/attio/src/lib/actions/ai/get-workspace-member.tsnew file mode 100644index 00000000000..6a0f4262dbf--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/get-workspace-member.ts@@ -0,0 +1,31 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioGetWorkspaceMemberOutputSchema } from '../../output-schemas';++export const attioGetWorkspaceMemberAction = createAction({+ auth: attioAuth,+ name: 'attio_get_workspace_member',+ outputSchema: attioGetWorkspaceMemberOutputSchema,+ displayName: 'Get Workspace Member',+ description: 'Gets a workspace member by ID.',+ audience: 'ai',+ classification: 'READ',+ aiMetadata: {+ description: 'Gets one workspace member by ID.',+ idempotent: true,+ },+ props: {+ workspace_member_id: Property.ShortText({ displayName: 'Workspace Member ID', description: 'From List Workspace Members.', required: true }),+ },+ async run(context) {+ const { workspace_member_id } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/workspace_members/${workspace_member_id}`,+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/index.ts b/packages/pieces/community/attio/src/lib/actions/ai/index.tsnew file mode 100644index 00000000000..fc5eb2e93c1--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/index.ts@@ -0,0 +1,157 @@+import { attioCreateAttributeAction } from './create-attribute';+import { attioCreateCallRecordingAction } from './create-call-recording';+import { attioCreateCommentAction } from './create-comment';+import { attioCreateFolderAction } from './create-folder';+import { attioCreateListEntryAction } from './create-list-entry';+import { attioCreateListAction } from './create-list';+import { attioCreateMeetingAction } from './create-meeting';+import { attioCreateNoteAction } from './create-note';+import { attioCreateObjectAction } from './create-object';+import { attioCreateRecordAction } from './create-record';+import { attioCreateSelectOptionAction } from './create-select-option';+import { attioCreateStatusAction } from './create-status';+import { attioCreateTaskAction } from './create-task';+import { attioDeleteCallRecordingAction } from './delete-call-recording';+import { attioDeleteCommentAction } from './delete-comment';+import { attioDeleteFileAction } from './delete-file';+import { attioDeleteListEntryAction } from './delete-list-entry';+import { attioDeleteMeetingAction } from './delete-meeting';+import { attioDeleteNoteAction } from './delete-note';+import { attioDeleteObjectAction } from './delete-object';+import { attioDeleteRecordAction } from './delete-record';+import { attioDeleteTaskAction } from './delete-task';+import { attioDownloadFileAction } from './download-file';+import { attioGetAttributeAction } from './get-attribute';+import { attioGetCallRecordingAction } from './get-call-recording';+import { attioGetCommentAction } from './get-comment';+import { attioGetFileAction } from './get-file';+import { attioGetListEntryAction } from './get-list-entry';+import { attioGetListAction } from './get-list';+import { attioGetMeetingAction } from './get-meeting';+import { attioGetNoteAction } from './get-note';+import { attioGetObjectAction } from './get-object';+import { attioGetRecordAction } from './get-record';+import { attioGetSelfAction } from './get-self';+import { attioGetTaskAction } from './get-task';+import { attioGetThreadAction } from './get-thread';+import { attioGetWorkspaceMemberAction } from './get-workspace-member';+import { attioLinkMeetingRecordsAction } from './link-meeting-records';+import { attioListAttributesAction } from './list-attributes';+import { attioListCallRecordingsAction } from './list-call-recordings';+import { attioListFilesAction } from './list-files';+import { attioListListEntryAttributeValuesAction } from './list-list-entry-attribute-values';+import { attioListListViewsAction } from './list-list-views';+import { attioListListsAction } from './list-lists';+import { attioListMeetingsAction } from './list-meetings';+import { attioListNotesAction } from './list-notes';+import { attioListObjectViewsAction } from './list-object-views';+import { attioListObjectsAction } from './list-objects';+import { attioListRecordAttributeValuesAction } from './list-record-attribute-values';+import { attioListRecordEntriesAction } from './list-record-entries';+import { attioListSelectOptionsAction } from './list-select-options';+import { attioListStatusesAction } from './list-statuses';+import { attioListTasksAction } from './list-tasks';+import { attioListThreadsAction } from './list-threads';+import { attioListWorkspaceMembersAction } from './list-workspace-members';+import { attioMergeRecordsAction } from './merge-records';+import { attioOverwriteListEntryAction } from './overwrite-list-entry';+import { attioOverwriteRecordAction } from './overwrite-record';+import { attioQueryListEntriesAction } from './query-list-entries';+import { attioQueryRecordsAction } from './query-records';+import { attioReplaceMeetingRecordsAction } from './replace-meeting-records';+import { attioSearchRecordsAction } from './search-records';+import { attioUnsubscribeEmailsAction } from './unsubscribe-emails';+import { attioUpdateAttributeAction } from './update-attribute';+import { attioUpdateListEntryAction } from './update-list-entry';+import { attioUpdateListAction } from './update-list';+import { attioUpdateNoteAction } from './update-note';+import { attioUpdateObjectAction } from './update-object';+import { attioUpdateRecordAction } from './update-record';+import { attioUpdateSelectOptionAction } from './update-select-option';+import { attioUpdateStatusAction } from './update-status';+import { attioUpdateTaskAction } from './update-task';+import { attioUploadFileAction } from './upload-file';+import { attioUpsertListEntryAction } from './upsert-list-entry';+import { attioUpsertRecordAction } from './upsert-record';+import { attioWriteListEntryAttributeValuesAction } from './write-list-entry-attribute-values';+import { attioWriteRecordAttributeValuesAction } from './write-record-attribute-values';++export const attioAiActions = [+ attioCreateAttributeAction,+ attioCreateCallRecordingAction,+ attioCreateCommentAction,+ attioCreateFolderAction,+ attioCreateListEntryAction,+ attioCreateListAction,+ attioCreateMeetingAction,+ attioCreateNoteAction,+ attioCreateObjectAction,+ attioCreateRecordAction,+ attioCreateSelectOptionAction,+ attioCreateStatusAction,+ attioCreateTaskAction,+ attioDeleteCallRecordingAction,+ attioDeleteCommentAction,+ attioDeleteFileAction,+ attioDeleteListEntryAction,+ attioDeleteMeetingAction,+ attioDeleteNoteAction,+ attioDeleteObjectAction,+ attioDeleteRecordAction,+ attioDeleteTaskAction,+ attioDownloadFileAction,+ attioGetAttributeAction,+ attioGetCallRecordingAction,+ attioGetCommentAction,+ attioGetFileAction,+ attioGetListEntryAction,+ attioGetListAction,+ attioGetMeetingAction,+ attioGetNoteAction,+ attioGetObjectAction,+ attioGetRecordAction,+ attioGetSelfAction,+ attioGetTaskAction,+ attioGetThreadAction,+ attioGetWorkspaceMemberAction,+ attioLinkMeetingRecordsAction,+ attioListAttributesAction,+ attioListCallRecordingsAction,+ attioListFilesAction,+ attioListListEntryAttributeValuesAction,+ attioListListViewsAction,+ attioListListsAction,+ attioListMeetingsAction,+ attioListNotesAction,+ attioListObjectViewsAction,+ attioListObjectsAction,+ attioListRecordAttributeValuesAction,+ attioListRecordEntriesAction,+ attioListSelectOptionsAction,+ attioListStatusesAction,+ attioListTasksAction,+ attioListThreadsAction,+ attioListWorkspaceMembersAction,+ attioMergeRecordsAction,+ attioOverwriteListEntryAction,+ attioOverwriteRecordAction,+ attioQueryListEntriesAction,+ attioQueryRecordsAction,+ attioReplaceMeetingRecordsAction,+ attioSearchRecordsAction,+ attioUnsubscribeEmailsAction,+ attioUpdateAttributeAction,+ attioUpdateListEntryAction,+ attioUpdateListAction,+ attioUpdateNoteAction,+ attioUpdateObjectAction,+ attioUpdateRecordAction,+ attioUpdateSelectOptionAction,+ attioUpdateStatusAction,+ attioUpdateTaskAction,+ attioUploadFileAction,+ attioUpsertListEntryAction,+ attioUpsertRecordAction,+ attioWriteListEntryAttributeValuesAction,+ attioWriteRecordAttributeValuesAction,+];diff --git a/packages/pieces/community/attio/src/lib/actions/ai/link-meeting-records.ts b/packages/pieces/community/attio/src/lib/actions/ai/link-meeting-records.tsnew file mode 100644index 00000000000..677a208b707--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/link-meeting-records.ts@@ -0,0 +1,34 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioCreateMeetingOutputSchema } from '../../output-schemas';++export const attioLinkMeetingRecordsAction = createAction({+ auth: attioAuth,+ name: 'attio_link_meeting_records',+ outputSchema: attioCreateMeetingOutputSchema,+ displayName: 'Link Meeting Records',+ description: 'Links records to a meeting, keeping existing links.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Adds records to the meeting linked records; already-linked records are ignored and existing links are kept. Use Replace Meeting Records to unlink.',+ idempotent: true,+ },+ props: {+ meeting_id: Property.ShortText({ displayName: 'Meeting ID', description: 'From List Meetings or Create Meeting.', required: true }),+ linked_records: attioAi.linkedRecordsProp({ description: 'Records to link to the meeting.' }),+ },+ async run(context) {+ const { meeting_id, linked_records } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.PATCH,+ resourceUri: `/meetings/${meeting_id}`,+ body: { data: { linked_records: attioAi.records(linked_records) } },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/list-attributes.ts b/packages/pieces/community/attio/src/lib/actions/ai/list-attributes.tsnew file mode 100644index 00000000000..d3b5c7f042e--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/list-attributes.ts@@ -0,0 +1,37 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioListAttributesOutputSchema } from '../../output-schemas';++export const attioListAttributesAction = createAction({+ auth: attioAuth,+ name: 'attio_list_attributes',+ outputSchema: attioListAttributesOutputSchema,+ displayName: 'List Attributes',+ description: 'Lists the attributes of an object or list.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description: 'Lists attributes (fields) of an object or list with their slug, type and settings. Use it before writing values to learn slugs and types.',+ idempotent: true,+ },+ props: {+ target: attioAi.targetProp(),+ identifier: attioAi.identifierProp(),+ limit: attioAi.limitProp({ max: 1000 }),+ offset: attioAi.offsetProp(),+ show_archived: Property.Checkbox({ displayName: 'Show Archived', description: 'Include archived items.', required: false }),+ },+ async run(context) {+ const { target, identifier, limit, offset, show_archived } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown>[] }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/${target}/${identifier}/attributes`,+ query: { limit, offset, show_archived: show_archived ? 'true' : undefined },+ });+ return { attributes: response.data, count: response.data.length };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/list-call-recordings.ts b/packages/pieces/community/attio/src/lib/actions/ai/list-call-recordings.tsnew file mode 100644index 00000000000..51fd7bb33dd--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/list-call-recordings.ts@@ -0,0 +1,35 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioListCallRecordingsOutputSchema } from '../../output-schemas';++export const attioListCallRecordingsAction = createAction({+ auth: attioAuth,+ name: 'attio_list_call_recordings',+ outputSchema: attioListCallRecordingsOutputSchema,+ displayName: 'List Call Recordings',+ description: 'Lists the call recordings of a meeting.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description: 'Lists call recordings of a meeting with their status. Use Get Call Recording for the transcript.',+ idempotent: true,+ },+ props: {+ meeting_id: Property.ShortText({ displayName: 'Meeting ID', description: 'From List Meetings or Create Meeting.', required: true }),+ limit: attioAi.limitProp({ max: 200 }),+ cursor: attioAi.cursorProp(),+ },+ async run(context) {+ const { meeting_id, limit, cursor } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown>[]; pagination: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/meetings/${meeting_id}/call_recordings`,+ query: { limit, cursor },+ });+ return { call_recordings: response.data, count: response.data.length, next_cursor: response.pagination?.['next_cursor'] ?? null };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/list-files.ts b/packages/pieces/community/attio/src/lib/actions/ai/list-files.tsnew file mode 100644index 00000000000..87b01f838ec--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/list-files.ts@@ -0,0 +1,51 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioListFilesOutputSchema } from '../../output-schemas';++export const attioListFilesAction = createAction({+ auth: attioAuth,+ name: 'attio_list_files',+ outputSchema: attioListFilesOutputSchema,+ displayName: 'List Files',+ description: 'Lists files and folders on a record.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description: 'Lists files and folders attached to a record, optionally inside one folder or from one storage provider.',+ idempotent: true,+ },+ props: {+ object: attioAi.objectProp(),+ record_id: attioAi.recordIdProp({ description: 'ID of the record the files belong to.' }),+ parent_folder_id: Property.ShortText({ displayName: 'Parent Folder ID', description: 'Only list this folder.', required: false }),+ storage_provider: Property.StaticDropdown({+ displayName: 'Storage Provider',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Attio', value: 'attio' },+ { label: 'Dropbox', value: 'dropbox' },+ { label: 'Box', value: 'box' },+ { label: 'Google Drive', value: 'google-drive' },+ { label: 'Microsoft OneDrive', value: 'microsoft-onedrive' },+ ],+ },+ }),+ limit: attioAi.limitProp({ max: 200 }),+ cursor: attioAi.cursorProp(),+ },+ async run(context) {+ const { object, record_id, parent_folder_id, storage_provider, limit, cursor } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown>[]; pagination: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/files`,+ query: { object, record_id, parent_folder_id, storage_provider, limit, cursor },+ });+ return { files: response.data, count: response.data.length, next_cursor: response.pagination?.['next_cursor'] ?? null };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/list-list-entry-attribute-values.ts b/packages/pieces/community/attio/src/lib/actions/ai/list-list-entry-attribute-values.tsnew file mode 100644index 00000000000..50408d3f12d--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/list-list-entry-attribute-values.ts@@ -0,0 +1,42 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioListListEntryAttributeValuesOutputSchema } from '../../output-schemas';++export const attioListListEntryAttributeValuesAction = createAction({+ auth: attioAuth,+ name: 'attio_list_list_entry_attribute_values',+ outputSchema: attioListListEntryAttributeValuesOutputSchema,+ displayName: 'List List Entry Attribute Values',+ description: 'Lists current or historic values of one attribute on a list entry.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description: 'Lists the values of one list attribute on an entry, optionally including historic values to see how it changed, e.g. stage history.',+ idempotent: true,+ },+ props: {+ list: attioAi.listProp(),+ entry_id: attioAi.entryIdProp(),+ attribute: attioAi.attributeProp(),+ show_historic: Property.Checkbox({+ displayName: 'Show Historic',+ description: 'Include values that are no longer active.',+ required: false,+ }),+ limit: attioAi.limitProp({ max: 500 }),+ offset: attioAi.offsetProp(),+ },+ async run(context) {+ const { list, entry_id, attribute, show_historic, limit, offset } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown>[] }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/lists/${list}/entries/${entry_id}/attributes/${attribute}/values`,+ query: { show_historic: show_historic ? 'true' : undefined, limit, offset },+ });+ return { values: response.data, count: response.data.length };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/list-list-views.ts b/packages/pieces/community/attio/src/lib/actions/ai/list-list-views.tsnew file mode 100644index 00000000000..f350133fb1a--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/list-list-views.ts@@ -0,0 +1,36 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioListListViewsOutputSchema } from '../../output-schemas';++export const attioListListViewsAction = createAction({+ auth: attioAuth,+ name: 'attio_list_list_views',+ outputSchema: attioListListViewsOutputSchema,+ displayName: 'List List Views',+ description: 'Lists the saved views of a list.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description: 'Lists saved views for a list, with their IDs and titles.',+ idempotent: true,+ },+ props: {+ list: attioAi.listProp(),+ show_archived: Property.Checkbox({ displayName: 'Show Archived', description: 'Include archived views.', required: false }),+ limit: attioAi.limitProp({ max: 100 }),+ cursor: attioAi.cursorProp(),+ },+ async run(context) {+ const { list, show_archived, limit, cursor } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown>[]; pagination: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/lists/${list}/views`,+ query: { show_archived: show_archived ? 'true' : undefined, limit, cursor },+ });+ return { views: response.data, count: response.data.length, next_cursor: response.pagination?.['next_cursor'] ?? null };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/list-lists.ts b/packages/pieces/community/attio/src/lib/actions/ai/list-lists.tsnew file mode 100644index 00000000000..fc6cebf2f39--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/list-lists.ts@@ -0,0 +1,30 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioListListsOutputSchema } from '../../output-schemas';++export const attioListListsAction = createAction({+ auth: attioAuth,+ name: 'attio_list_lists',+ outputSchema: attioListListsOutputSchema,+ displayName: 'List Lists',+ description: 'Lists all lists in the workspace.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description: 'Lists every list in the workspace with its ID, slug and parent object. Use it to resolve a list name to the slug or ID the list-entry actions need.',+ idempotent: true,+ },+ props: {++ },+ async run(context) {+ const response = await attioApiCall<{ data: Record<string, unknown>[] }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: '/lists',+ });+ return { lists: response.data, count: response.data.length };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/list-meetings.ts b/packages/pieces/community/attio/src/lib/actions/ai/list-meetings.tsnew file mode 100644index 00000000000..fb0ee491e65--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/list-meetings.ts@@ -0,0 +1,50 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioListMeetingsOutputSchema } from '../../output-schemas';++export const attioListMeetingsAction = createAction({+ auth: attioAuth,+ name: 'attio_list_meetings',+ outputSchema: attioListMeetingsOutputSchema,+ displayName: 'List Meetings',+ description: 'Lists meetings, with optional filters.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description: 'Lists meetings, optionally filtered by linked record, participant emails or time range, sorted by start time. Paginate with the returned cursor.',+ idempotent: true,+ },+ props: {+ linked_object: Property.ShortText({ displayName: 'Linked Object', description: 'Object slug, with Linked Record ID.', required: false }),+ linked_record_id: Property.ShortText({ displayName: 'Linked Record ID', required: false }),+ participants: Property.ShortText({ displayName: 'Participants', description: 'Comma-separated participant email addresses.', required: false }),+ ends_from: Property.DateTime({ displayName: 'Ends From', description: 'Only meetings ending at or after this time.', required: false }),+ starts_before: Property.DateTime({ displayName: 'Starts Before', description: 'Only meetings starting before this time.', required: false }),+ sort: Property.StaticDropdown({+ displayName: 'Sort',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Start (oldest first)', value: 'start_asc' },+ { label: 'Start (newest first)', value: 'start_desc' },+ ],+ },+ }),+ limit: attioAi.limitProp({ max: 200 }),+ cursor: attioAi.cursorProp(),+ },+ async run(context) {+ const { linked_object, linked_record_id, participants, ends_from, starts_before, sort, limit, cursor } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown>[]; pagination: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/meetings`,+ query: { linked_object, linked_record_id, participants, ends_from, starts_before, sort, limit, cursor },+ });+ return { meetings: response.data, count: response.data.length, next_cursor: response.pagination?.['next_cursor'] ?? null };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/list-notes.ts b/packages/pieces/community/attio/src/lib/actions/ai/list-notes.tsnew file mode 100644index 00000000000..f439be027af--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/list-notes.ts@@ -0,0 +1,36 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioListNotesOutputSchema } from '../../output-schemas';++export const attioListNotesAction = createAction({+ auth: attioAuth,+ name: 'attio_list_notes',+ outputSchema: attioListNotesOutputSchema,+ displayName: 'List Notes',+ description: 'Lists notes, optionally for one record.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description: 'Lists notes in the workspace, or only those on one record when Parent Object and Parent Record ID are given. Returns plaintext and markdown content.',+ idempotent: true,+ },+ props: {+ parent_object: Property.ShortText({ displayName: 'Parent Object', description: 'Object slug, e.g. `people`. Use with Parent Record ID.', required: false }),+ parent_record_id: Property.ShortText({ displayName: 'Parent Record ID', required: false }),+ limit: attioAi.limitProp({ max: 50 }),+ offset: attioAi.offsetProp(),+ },+ async run(context) {+ const { parent_object, parent_record_id, limit, offset } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown>[] }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/notes`,+ query: { parent_object, parent_record_id, limit, offset },+ });+ return { notes: response.data, count: response.data.length };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/list-object-views.ts b/packages/pieces/community/attio/src/lib/actions/ai/list-object-views.tsnew file mode 100644index 00000000000..93f0c4e55a5--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/list-object-views.ts@@ -0,0 +1,36 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioListObjectViewsOutputSchema } from '../../output-schemas';++export const attioListObjectViewsAction = createAction({+ auth: attioAuth,+ name: 'attio_list_object_views',+ outputSchema: attioListObjectViewsOutputSchema,+ displayName: 'List Object Views',+ description: 'Lists the saved views of an object.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description: 'Lists saved views for an object. A view ID can be used as `filter_view_id` context when browsing records in the Attio UI.',+ idempotent: true,+ },+ props: {+ object: attioAi.objectProp(),+ show_archived: Property.Checkbox({ displayName: 'Show Archived', description: 'Include archived views.', required: false }),+ limit: attioAi.limitProp({ max: 100 }),+ cursor: attioAi.cursorProp(),+ },+ async run(context) {+ const { object, show_archived, limit, cursor } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown>[]; pagination: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/objects/${object}/views`,+ query: { show_archived: show_archived ? 'true' : undefined, limit, cursor },+ });+ return { views: response.data, count: response.data.length, next_cursor: response.pagination?.['next_cursor'] ?? null };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/list-objects.ts b/packages/pieces/community/attio/src/lib/actions/ai/list-objects.tsnew file mode 100644index 00000000000..0013bced56f--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/list-objects.ts@@ -0,0 +1,30 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioListObjectsOutputSchema } from '../../output-schemas';++export const attioListObjectsAction = createAction({+ auth: attioAuth,+ name: 'attio_list_objects',+ outputSchema: attioListObjectsOutputSchema,+ displayName: 'List Objects',+ description: 'Lists all objects in the workspace.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description: 'Lists every object (people, companies, deals, users, workspaces and custom objects) with its ID and slug. Use it to find the object slug other actions need.',+ idempotent: true,+ },+ props: {++ },+ async run(context) {+ const response = await attioApiCall<{ data: Record<string, unknown>[] }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/objects`,+ });+ return { objects: response.data, count: response.data.length };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/list-record-attribute-values.ts b/packages/pieces/community/attio/src/lib/actions/ai/list-record-attribute-values.tsnew file mode 100644index 00000000000..3a7f7a5a385--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/list-record-attribute-values.ts@@ -0,0 +1,42 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioListRecordAttributeValuesOutputSchema } from '../../output-schemas';++export const attioListRecordAttributeValuesAction = createAction({+ auth: attioAuth,+ name: 'attio_list_record_attribute_values',+ outputSchema: attioListRecordAttributeValuesOutputSchema,+ displayName: 'List Record Attribute Values',+ description: 'Lists current or historic values of one attribute on a record.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description: 'Lists the values of one attribute on a record, optionally including historic values to see how it changed over time. Historic values are not available for some attribute types (e.g. COMINT or enriched attributes).',+ idempotent: true,+ },+ props: {+ object: attioAi.objectProp(),+ record_id: attioAi.recordIdProp(),+ attribute: attioAi.attributeProp(),+ show_historic: Property.Checkbox({+ displayName: 'Show Historic',+ description: 'Include values that are no longer active.',+ required: false,+ }),+ limit: attioAi.limitProp({ max: 500 }),+ offset: attioAi.offsetProp(),+ },+ async run(context) {+ const { object, record_id, attribute, show_historic, limit, offset } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown>[] }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/objects/${object}/records/${record_id}/attributes/${attribute}/values`,+ query: { show_historic: show_historic ? 'true' : undefined, limit, offset },+ });+ return { values: response.data, count: response.data.length };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/list-record-entries.ts b/packages/pieces/community/attio/src/lib/actions/ai/list-record-entries.tsnew file mode 100644index 00000000000..a6bf3ed2fa1--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/list-record-entries.ts@@ -0,0 +1,36 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioListRecordEntriesOutputSchema } from '../../output-schemas';++export const attioListRecordEntriesAction = createAction({+ auth: attioAuth,+ name: 'attio_list_record_entries',+ outputSchema: attioListRecordEntriesOutputSchema,+ displayName: 'List Record Entries',+ description: 'Lists the list entries a record belongs to.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description: 'Lists every list entry whose parent is this record, i.e. which lists the record is in, with list and entry IDs for the list-entry actions.',+ idempotent: true,+ },+ props: {+ object: attioAi.objectProp(),+ record_id: attioAi.recordIdProp(),+ limit: attioAi.limitProp({ max: 1000 }),+ offset: attioAi.offsetProp(),+ },+ async run(context) {+ const { object, record_id, limit, offset } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown>[] }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/objects/${object}/records/${record_id}/entries`,+ query: { limit, offset },+ });+ return { entries: response.data, count: response.data.length };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/list-select-options.ts b/packages/pieces/community/attio/src/lib/actions/ai/list-select-options.tsnew file mode 100644index 00000000000..fa5bcc11ac7--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/list-select-options.ts@@ -0,0 +1,36 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioListSelectOptionsOutputSchema } from '../../output-schemas';++export const attioListSelectOptionsAction = createAction({+ auth: attioAuth,+ name: 'attio_list_select_options',+ outputSchema: attioListSelectOptionsOutputSchema,+ displayName: 'List Select Options',+ description: 'Lists the options of a select attribute.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description: 'Lists the options of a select or multiselect attribute, with IDs and titles to use when writing values.',+ idempotent: true,+ },+ props: {+ target: attioAi.targetProp(),+ identifier: attioAi.identifierProp(),+ attribute: attioAi.attributeProp(),+ show_archived: Property.Checkbox({ displayName: 'Show Archived', description: 'Include archived items.', required: false }),+ },+ async run(context) {+ const { target, identifier, attribute, show_archived } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown>[] }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/${target}/${identifier}/attributes/${attribute}/options`,+ query: { show_archived: show_archived ? 'true' : undefined },+ });+ return { options: response.data, count: response.data.length };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/list-statuses.ts b/packages/pieces/community/attio/src/lib/actions/ai/list-statuses.tsnew file mode 100644index 00000000000..79ba5469b56--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/list-statuses.ts@@ -0,0 +1,36 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioListStatusesOutputSchema } from '../../output-schemas';++export const attioListStatusesAction = createAction({+ auth: attioAuth,+ name: 'attio_list_statuses',+ outputSchema: attioListStatusesOutputSchema,+ displayName: 'List Statuses',+ description: 'Lists the statuses of a status attribute.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description: 'Lists the statuses of a status attribute, e.g. deal stages, with IDs and titles to use when writing values.',+ idempotent: true,+ },+ props: {+ target: attioAi.targetProp(),+ identifier: attioAi.identifierProp(),+ attribute: attioAi.attributeProp(),+ show_archived: Property.Checkbox({ displayName: 'Show Archived', description: 'Include archived items.', required: false }),+ },+ async run(context) {+ const { target, identifier, attribute, show_archived } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown>[] }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/${target}/${identifier}/attributes/${attribute}/statuses`,+ query: { show_archived: show_archived ? 'true' : undefined },+ });+ return { statuses: response.data, count: response.data.length };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/list-tasks.ts b/packages/pieces/community/attio/src/lib/actions/ai/list-tasks.tsnew file mode 100644index 00000000000..a83b649b8ba--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/list-tasks.ts@@ -0,0 +1,51 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioListTasksOutputSchema } from '../../output-schemas';++export const attioListTasksAction = createAction({+ auth: attioAuth,+ name: 'attio_list_tasks',+ outputSchema: attioListTasksOutputSchema,+ displayName: 'List Tasks',+ description: 'Lists tasks, with optional filters.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description: 'Lists tasks, optionally filtered by linked record, assignee or completion, and sorted by creation or completion date.',+ idempotent: true,+ },+ props: {+ linked_object: Property.ShortText({ displayName: 'Linked Object', description: 'Object slug, e.g. `people`. Use with Linked Record ID.', required: false }),+ linked_record_id: Property.ShortText({ displayName: 'Linked Record ID', required: false }),+ assignee: Property.ShortText({ displayName: 'Assignee', description: 'Workspace member email or ID.', required: false }),+ is_completed: attioAi.optionalBooleanProp({ displayName: 'Completed', description: 'Leave empty for all tasks.' }),+ sort: Property.StaticDropdown({+ displayName: 'Sort',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Created (oldest first)', value: 'created_at:asc' },+ { label: 'Created (newest first)', value: 'created_at:desc' },+ { label: 'Completed (oldest first)', value: 'completed_at:asc' },+ { label: 'Completed (newest first)', value: 'completed_at:desc' },+ ],+ },+ }),+ limit: attioAi.limitProp({ max: 500 }),+ offset: attioAi.offsetProp(),+ },+ async run(context) {+ const { linked_object, linked_record_id, assignee, is_completed, sort, limit, offset } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown>[] }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/tasks`,+ query: { linked_object, linked_record_id, assignee, is_completed, sort, limit, offset },+ });+ return { tasks: response.data, count: response.data.length };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/list-threads.ts b/packages/pieces/community/attio/src/lib/actions/ai/list-threads.tsnew file mode 100644index 00000000000..5db00d4fe66--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/list-threads.ts@@ -0,0 +1,38 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioListThreadsOutputSchema } from '../../output-schemas';++export const attioListThreadsAction = createAction({+ auth: attioAuth,+ name: 'attio_list_threads',+ outputSchema: attioListThreadsOutputSchema,+ displayName: 'List Threads',+ description: 'Lists comment threads on a record or list entry.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description: 'Lists comment threads on a record (Object with Record ID) or a list entry (List with Entry ID). Each thread includes up to 80 replies; use Get Thread for more.',+ idempotent: true,+ },+ props: {+ object: Property.ShortText({ displayName: 'Object', description: 'Object slug, with Record ID.', required: false }),+ record_id: Property.ShortText({ displayName: 'Record ID', required: false }),+ list: Property.ShortText({ displayName: 'List', description: 'List slug or ID, with Entry ID.', required: false }),+ entry_id: Property.ShortText({ displayName: 'Entry ID', required: false }),+ limit: attioAi.limitProp({ max: 50 }),+ offset: attioAi.offsetProp(),+ },+ async run(context) {+ const { object, record_id, list, entry_id, limit, offset } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown>[] }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/threads`,+ query: { object, record_id, list, entry_id, limit, offset },+ });+ return { threads: response.data, count: response.data.length };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/list-workspace-members.ts b/packages/pieces/community/attio/src/lib/actions/ai/list-workspace-members.tsnew file mode 100644index 00000000000..f31d8ef4540--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/list-workspace-members.ts@@ -0,0 +1,30 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioListWorkspaceMembersOutputSchema } from '../../output-schemas';++export const attioListWorkspaceMembersAction = createAction({+ auth: attioAuth,+ name: 'attio_list_workspace_members',+ outputSchema: attioListWorkspaceMembersOutputSchema,+ displayName: 'List Workspace Members',+ description: 'Lists the members of the workspace.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description: 'Lists workspace members with ID, name, email and access level. Use it to resolve a person to the member ID or email that tasks, comments and actor attributes need.',+ idempotent: true,+ },+ props: {++ },+ async run(context) {+ const response = await attioApiCall<{ data: Record<string, unknown>[] }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.GET,+ resourceUri: `/workspace_members`,+ });+ return { members: response.data, count: response.data.length };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/merge-records.ts b/packages/pieces/community/attio/src/lib/actions/ai/merge-records.tsnew file mode 100644index 00000000000..9cdf9f98b2d--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/merge-records.ts@@ -0,0 +1,35 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioMergeRecordsOutputSchema } from '../../output-schemas';++export const attioMergeRecordsAction = createAction({+ auth: attioAuth,+ name: 'attio_merge_records',+ outputSchema: attioMergeRecordsOutputSchema,+ displayName: 'Merge Records',+ description: 'Merges two records of the same object into one.',+ audience: 'ai',+ classification: 'DESTRUCTIVE',+ aiMetadata: {+ description: 'Merges the secondary record into the primary one; where both have a value the primary wins, and the secondary record is removed. This cannot be undone. Both IDs must belong to the same object.',+ idempotent: false,+ },+ props: {+ object: attioAi.objectProp(),+ primary_record_id: attioAi.recordIdProp({ description: 'ID of the record to keep.' }),+ secondary_record_id: attioAi.recordIdProp({ description: 'ID of the record merged into the primary and then removed.' }),+ },+ async run(context) {+ const { object, primary_record_id, secondary_record_id } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.POST,+ resourceUri: `/objects/${object}/records/merge`,+ body: { data: { primary_record_id, secondary_record_id } },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/overwrite-list-entry.ts b/packages/pieces/community/attio/src/lib/actions/ai/overwrite-list-entry.tsnew file mode 100644index 00000000000..af4045adf3d--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/overwrite-list-entry.ts@@ -0,0 +1,39 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { createEntryOutputSchema } from '../../output-schemas';++export const attioOverwriteListEntryAction = createAction({+ auth: attioAuth,+ name: 'attio_overwrite_list_entry',+ outputSchema: createEntryOutputSchema,+ displayName: 'Overwrite List Entry',+ description: 'Updates values on a list entry, replacing multiselect attributes.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Updates the supplied values on a list entry, replacing (not appending to) multiselect values. Use Update List Entry to append instead.',+ idempotent: true,+ },+ props: {+ list: attioAi.listProp(),+ entry_id: attioAi.entryIdProp(),+ entry_values: attioAi.valuesProp({+ displayName: 'Entry Values',+ description: 'List-specific attribute values keyed by attribute slug, e.g. {"stage": "Qualified"}. Use List Attributes with target `lists` for slugs.',+ required: true,+ }),+ },+ async run(context) {+ const { list, entry_id, entry_values } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.PUT,+ resourceUri: `/lists/${list}/entries/${entry_id}`,+ body: { data: { entry_values } },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/overwrite-record.ts b/packages/pieces/community/attio/src/lib/actions/ai/overwrite-record.tsnew file mode 100644index 00000000000..f1948676f2e--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/overwrite-record.ts@@ -0,0 +1,40 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { AttioRecordResponse } from '../../common/types';+import { attioCreateRecordOutputSchema } from '../../output-schemas';++export const attioOverwriteRecordAction = createAction({+ auth: attioAuth,+ name: 'attio_overwrite_record',+ outputSchema: attioCreateRecordOutputSchema,+ displayName: 'Overwrite Record',+ description: 'Updates attribute values on a record, replacing multiselect attributes.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Updates the supplied attribute values on a record, replacing (not appending to) multiselect values. Attributes not supplied are left untouched. Use Update Record to append instead.',+ idempotent: true,+ },+ props: {+ object: attioAi.objectProp(),+ record_id: attioAi.recordIdProp(),+ values: attioAi.valuesProp({+ displayName: 'Values',+ description: 'Attribute values keyed by attribute slug, e.g. {"name": "Acme", "domains": ["acme.com"]}. Use List Attributes for slugs and types.',+ required: true,+ }),+ },+ async run(context) {+ const { object, record_id, values } = context.propsValue;+ const response = await attioApiCall<{ data: AttioRecordResponse }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.PUT,+ resourceUri: `/objects/${object}/records/${record_id}`,+ body: { data: { values } },+ });+ return attioAi.flattenRecord(response.data);+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/query-list-entries.ts b/packages/pieces/community/attio/src/lib/actions/ai/query-list-entries.tsnew file mode 100644index 00000000000..7959dffe32b--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/query-list-entries.ts@@ -0,0 +1,41 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioQueryListEntriesOutputSchema } from '../../output-schemas';++export const attioQueryListEntriesAction = createAction({+ auth: attioAuth,+ name: 'attio_query_list_entries',+ outputSchema: attioQueryListEntriesOutputSchema,+ displayName: 'Query List Entries',+ description: 'Lists entries in a list, with optional filter and sort.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description: 'Lists entries of one list, optionally filtered and sorted by list or parent-record attributes, e.g. {"stage": "Won"}. Paginate with Limit and Offset.',+ idempotent: true,+ },+ props: {+ list: attioAi.listProp(),+ filter: Property.Json({+ displayName: 'Filter',+ description: 'Attio filter object, e.g. {"stage": "Won"}.',+ required: false,+ }),+ sorts: attioAi.sortsProp(),+ limit: attioAi.limitProp({ max: 500 }),+ offset: attioAi.offsetProp(),+ },+ async run(context) {+ const { list, filter, sorts, limit, offset } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown>[] }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.POST,+ resourceUri: `/lists/${list}/entries/query`,+ body: attioAi.compact({ filter: attioAi.nonEmptyFilter(filter), sorts: sorts && sorts.length > 0 ? sorts : undefined, limit: limit ?? 50, offset }),+ });+ return { entries: response.data, count: response.data.length };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/query-records.ts b/packages/pieces/community/attio/src/lib/actions/ai/query-records.tsnew file mode 100644index 00000000000..01b12f75343--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/query-records.ts@@ -0,0 +1,43 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { AttioRecordResponse } from '../../common/types';+import { attioQueryRecordsOutputSchema } from '../../output-schemas';++export const attioQueryRecordsAction = createAction({+ auth: attioAuth,+ name: 'attio_query_records',+ outputSchema: attioQueryRecordsOutputSchema,+ displayName: 'Query Records',+ description: 'Lists records in an object, with optional filter and sort.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description: 'Lists records of one object, optionally filtered and sorted with Attio filter syntax, e.g. {"name": "Acme"} or {"email_addresses": {"$contains": "@acme.com"}}. Use Search Records for fuzzy text search across objects. Paginate with Limit and Offset.',+ idempotent: true,+ },+ props: {+ object: attioAi.objectProp(),+ filter: Property.Json({+ displayName: 'Filter',+ description: 'Attio filter object, e.g. {"name": "Acme"} or {"$and": [...]}.',+ required: false,+ }),+ sorts: attioAi.sortsProp(),+ limit: attioAi.limitProp({ max: 500 }),+ offset: attioAi.offsetProp(),+ },+ async run(context) {+ const { object, filter, sorts, limit, offset } = context.propsValue;+ const response = await attioApiCall<{ data: AttioRecordResponse[] }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.POST,+ resourceUri: `/objects/${object}/records/query`,+ body: attioAi.compact({ filter: attioAi.nonEmptyFilter(filter), sorts: sorts && sorts.length > 0 ? sorts : undefined, limit: limit ?? 50, offset }),+ });+ const records = response.data.map((record) => attioAi.flattenRecord(record));+ return { records, count: records.length };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/replace-meeting-records.ts b/packages/pieces/community/attio/src/lib/actions/ai/replace-meeting-records.tsnew file mode 100644index 00000000000..6063658c7c7--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/replace-meeting-records.ts@@ -0,0 +1,34 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioCreateMeetingOutputSchema } from '../../output-schemas';++export const attioReplaceMeetingRecordsAction = createAction({+ auth: attioAuth,+ name: 'attio_replace_meeting_records',+ outputSchema: attioCreateMeetingOutputSchema,+ displayName: 'Replace Meeting Records',+ description: 'Replaces all records linked to a meeting.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Sets the meeting linked records to exactly the given list; any record not in it is unlinked, including ones linked automatically.',+ idempotent: true,+ },+ props: {+ meeting_id: Property.ShortText({ displayName: 'Meeting ID', description: 'From List Meetings or Create Meeting.', required: true }),+ linked_records: attioAi.linkedRecordsProp({ description: 'Records to link to the meeting.' }),+ },+ async run(context) {+ const { meeting_id, linked_records } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.PUT,+ resourceUri: `/meetings/${meeting_id}`,+ body: { data: { linked_records: attioAi.records(linked_records) } },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/search-records.ts b/packages/pieces/community/attio/src/lib/actions/ai/search-records.tsnew file mode 100644index 00000000000..258391299a0--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/search-records.ts@@ -0,0 +1,43 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioSearchRecordsOutputSchema } from '../../output-schemas';++export const attioSearchRecordsAction = createAction({+ auth: attioAuth,+ name: 'attio_search_records',+ outputSchema: attioSearchRecordsOutputSchema,+ displayName: 'Search Records',+ description: 'Fuzzy-searches records across objects by name, domain, email or phone.',+ audience: 'ai',+ classification: 'SEARCH',+ aiMetadata: {+ description: 'Fuzzy-searches records by text (names, domains, emails, phone numbers) across the given objects. Results are eventually consistent and may miss very recent changes; use Query Records for exact filters. Returns record IDs for Get Record.',+ idempotent: true,+ },+ props: {+ query: Property.ShortText({+ displayName: 'Query',+ description: 'Text to search for. An empty string returns default results.',+ required: true,+ }),+ objects: Property.Array({+ displayName: 'Objects',+ description: 'Object slugs or IDs to search, e.g. `people`, `companies`.',+ required: true,+ }),+ limit: attioAi.limitProp({ max: 25 }),+ },+ async run(context) {+ const { query, objects, limit } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown>[] }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.POST,+ resourceUri: '/objects/records/search',+ body: { query, objects: attioAi.strings(objects), limit: limit ?? 25, request_as: { type: 'workspace' } },+ });+ return { results: response.data, count: response.data.length };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/unsubscribe-emails.ts b/packages/pieces/community/attio/src/lib/actions/ai/unsubscribe-emails.tsnew file mode 100644index 00000000000..827fe6d9e1e--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/unsubscribe-emails.ts@@ -0,0 +1,37 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioUnsubscribeEmailsOutputSchema } from '../../output-schemas';++export const attioUnsubscribeEmailsAction = createAction({+ auth: attioAuth,+ name: 'attio_unsubscribe_emails',+ outputSchema: attioUnsubscribeEmailsOutputSchema,+ displayName: 'Unsubscribe Emails',+ description: 'Adds email addresses to the sequence unsubscribe list.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Adds email addresses to the workspace sequence unsubscribe list, so they cannot be enrolled in sequences and active enrolments stop. The API cannot remove addresses again. Re-adding an address is harmless.',+ idempotent: true,+ },+ props: {+ email_addresses: Property.Array({ displayName: 'Email Addresses', required: true }),+ },+ async run(context) {+ const { email_addresses } = context.propsValue;+ const emails = attioAi.strings(email_addresses);+ if (emails.length === 0) {+ throw new Error('Provide at least one email address.');+ }+ const response = await attioApiCall<{ data: Record<string, unknown>[] }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.POST,+ resourceUri: '/sequences/unsubscribed_emails',+ body: { data: { email_addresses: emails } },+ });+ return { unsubscribed: response.data, count: response.data.length };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/update-attribute.ts b/packages/pieces/community/attio/src/lib/actions/ai/update-attribute.tsnew file mode 100644index 00000000000..5b094b98d16--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/update-attribute.ts@@ -0,0 +1,52 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioGetAttributeOutputSchema } from '../../output-schemas';++export const attioUpdateAttributeAction = createAction({+ auth: attioAuth,+ name: 'attio_update_attribute',+ outputSchema: attioGetAttributeOutputSchema,+ displayName: 'Update Attribute',+ description: 'Updates or archives an attribute.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Updates only the supplied fields of an attribute. Set Archived to Yes to archive it (the API has no delete).',+ idempotent: true,+ },+ props: {+ target: attioAi.targetProp(),+ identifier: attioAi.identifierProp(),+ attribute: attioAi.attributeProp(),+ title: Property.ShortText({ displayName: 'Title', required: false }),+ api_slug: Property.ShortText({ displayName: 'API Slug', required: false }),+ description: Property.LongText({ displayName: 'Description', required: false }),+ is_required: attioAi.optionalBooleanProp({ displayName: 'Required', description: 'Leave empty to keep the current setting.' }),+ is_unique: attioAi.optionalBooleanProp({ displayName: 'Unique', description: 'Leave empty to keep the current setting.' }),+ is_archived: attioAi.optionalBooleanProp({ displayName: 'Archived', description: 'Yes archives the attribute; No restores it.' }),+ config: Property.Json({ displayName: 'Config', description: 'Type-specific config to change.', required: false }),+ },+ async run(context) {+ const { target, identifier, attribute, title, api_slug, description, is_required, is_unique, is_archived, config } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.PATCH,+ resourceUri: `/${target}/${identifier}/attributes/${attribute}`,+ body: {+ data: attioAi.compact({+ title,+ api_slug,+ description,+ is_required: attioAi.toBoolean(is_required),+ is_unique: attioAi.toBoolean(is_unique),+ is_archived: attioAi.toBoolean(is_archived),+ config,+ }),+ },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/update-list-entry.ts b/packages/pieces/community/attio/src/lib/actions/ai/update-list-entry.tsnew file mode 100644index 00000000000..e8e153c6cc1--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/update-list-entry.ts@@ -0,0 +1,39 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { createEntryOutputSchema } from '../../output-schemas';++export const attioUpdateListEntryAction = createAction({+ auth: attioAuth,+ name: 'attio_update_list_entry',+ outputSchema: createEntryOutputSchema,+ displayName: 'Update List Entry',+ description: 'Updates values on a list entry, appending to multiselect attributes.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Updates only the supplied values on a list entry; multiselect values are appended. Use Overwrite List Entry to replace multiselect values.',+ idempotent: false,+ },+ props: {+ list: attioAi.listProp(),+ entry_id: attioAi.entryIdProp(),+ entry_values: attioAi.valuesProp({+ displayName: 'Entry Values',+ description: 'List-specific attribute values keyed by attribute slug, e.g. {"stage": "Qualified"}. Use List Attributes with target `lists` for slugs.',+ required: true,+ }),+ },+ async run(context) {+ const { list, entry_id, entry_values } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.PATCH,+ resourceUri: `/lists/${list}/entries/${entry_id}`,+ body: { data: { entry_values } },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/update-list.ts b/packages/pieces/community/attio/src/lib/actions/ai/update-list.tsnew file mode 100644index 00000000000..6ed8043ef2c--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/update-list.ts@@ -0,0 +1,47 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioCreateListOutputSchema } from '../../output-schemas';++export const attioUpdateListAction = createAction({+ auth: attioAuth,+ name: 'attio_update_list',+ outputSchema: attioCreateListOutputSchema,+ displayName: 'Update List',+ description: 'Updates the name, slug or access of a list.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Updates only the supplied fields of a list; omitted fields keep their current value.',+ idempotent: true,+ },+ props: {+ list: attioAi.listProp(),+ name: Property.ShortText({ displayName: 'Name', required: false }),+ api_slug: Property.ShortText({ displayName: 'API Slug', required: false }),+ workspace_access: Property.StaticDropdown({+ displayName: 'Workspace Access',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Full access', value: 'full-access' },+ { label: 'Read and write', value: 'read-and-write' },+ { label: 'Read only', value: 'read-only' },+ ],+ },+ }),+ },+ async run(context) {+ const { list, name, api_slug, workspace_access } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.PATCH,+ resourceUri: `/lists/${list}`,+ body: { data: attioAi.compact({ name, api_slug, workspace_access }) },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/update-note.ts b/packages/pieces/community/attio/src/lib/actions/ai/update-note.tsnew file mode 100644index 00000000000..57d59e06648--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/update-note.ts@@ -0,0 +1,47 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioCreateNoteOutputSchema } from '../../output-schemas';++export const attioUpdateNoteAction = createAction({+ auth: attioAuth,+ name: 'attio_update_note',+ outputSchema: attioCreateNoteOutputSchema,+ displayName: 'Update Note',+ description: 'Updates the title or content of a note.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Updates only the supplied fields of a note. Content replaces the existing body.',+ idempotent: true,+ },+ props: {+ note_id: Property.ShortText({ displayName: 'Note ID', description: 'From List Notes or Create Note.', required: true }),+ title: Property.ShortText({ displayName: 'Title', required: false }),+ content: Property.LongText({ displayName: 'Content', description: 'Replaces the whole note body.', required: false }),+ format: Property.StaticDropdown({+ displayName: 'Format',+ description: 'Format of Content. Defaults to plain text.',+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Plain text', value: 'plaintext' },+ { label: 'Markdown', value: 'markdown' },+ ],+ },+ }),+ },+ async run(context) {+ const { note_id, title, content, format } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.PATCH,+ resourceUri: `/notes/${note_id}`,+ body: { data: attioAi.compact({ title, content, format: content ? (format ?? 'plaintext') : undefined }) },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/update-object.ts b/packages/pieces/community/attio/src/lib/actions/ai/update-object.tsnew file mode 100644index 00000000000..2745d1f2a9e--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/update-object.ts@@ -0,0 +1,36 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioCreateObjectOutputSchema } from '../../output-schemas';++export const attioUpdateObjectAction = createAction({+ auth: attioAuth,+ name: 'attio_update_object',+ outputSchema: attioCreateObjectOutputSchema,+ displayName: 'Update Object',+ description: 'Updates the slug or names of an object.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Updates only the supplied fields of an object. Changing the slug breaks integrations that use the old one.',+ idempotent: true,+ },+ props: {+ object: attioAi.objectProp(),+ api_slug: Property.ShortText({ displayName: 'API Slug', required: false }),+ singular_noun: Property.ShortText({ displayName: 'Singular Noun', required: false }),+ plural_noun: Property.ShortText({ displayName: 'Plural Noun', required: false }),+ },+ async run(context) {+ const { object, api_slug, singular_noun, plural_noun } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.PATCH,+ resourceUri: `/objects/${object}`,+ body: { data: attioAi.compact({ api_slug, singular_noun, plural_noun }) },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/update-record.ts b/packages/pieces/community/attio/src/lib/actions/ai/update-record.tsnew file mode 100644index 00000000000..5046431e828--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/update-record.ts@@ -0,0 +1,40 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { AttioRecordResponse } from '../../common/types';+import { attioCreateRecordOutputSchema } from '../../output-schemas';++export const attioUpdateRecordAction = createAction({+ auth: attioAuth,+ name: 'attio_update_record',+ outputSchema: attioCreateRecordOutputSchema,+ displayName: 'Update Record',+ description: 'Updates attribute values on a record, appending to multiselect attributes.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Updates only the supplied attribute values on a record; other attributes are left untouched. Multiselect values are appended to existing ones; use Overwrite Record to replace them.',+ idempotent: false,+ },+ props: {+ object: attioAi.objectProp(),+ record_id: attioAi.recordIdProp(),+ values: attioAi.valuesProp({+ displayName: 'Values',+ description: 'Attribute values keyed by attribute slug, e.g. {"name": "Acme", "domains": ["acme.com"]}. Use List Attributes for slugs and types.',+ required: true,+ }),+ },+ async run(context) {+ const { object, record_id, values } = context.propsValue;+ const response = await attioApiCall<{ data: AttioRecordResponse }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.PATCH,+ resourceUri: `/objects/${object}/records/${record_id}`,+ body: { data: { values } },+ });+ return attioAi.flattenRecord(response.data);+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/update-select-option.ts b/packages/pieces/community/attio/src/lib/actions/ai/update-select-option.tsnew file mode 100644index 00000000000..310a86808e0--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/update-select-option.ts@@ -0,0 +1,38 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioCreateSelectOptionOutputSchema } from '../../output-schemas';++export const attioUpdateSelectOptionAction = createAction({+ auth: attioAuth,+ name: 'attio_update_select_option',+ outputSchema: attioCreateSelectOptionOutputSchema,+ displayName: 'Update Select Option',+ description: 'Renames or archives a select option.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Renames or archives a select option; omitted fields are unchanged.',+ idempotent: true,+ },+ props: {+ target: attioAi.targetProp(),+ identifier: attioAi.identifierProp(),+ attribute: attioAi.attributeProp(),+ option: Property.ShortText({ displayName: 'Option', description: 'Option ID or title, from List Select Options.', required: true }),+ title: Property.ShortText({ displayName: 'Title', required: false }),+ is_archived: attioAi.optionalBooleanProp({ displayName: 'Archived', description: 'Yes archives the option; No restores it.' }),+ },+ async run(context) {+ const { target, identifier, attribute, option, title, is_archived } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.PATCH,+ resourceUri: `/${target}/${identifier}/attributes/${attribute}/options/${option}`,+ body: { data: attioAi.compact({ title, is_archived: attioAi.toBoolean(is_archived) }) },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/update-status.ts b/packages/pieces/community/attio/src/lib/actions/ai/update-status.tsnew file mode 100644index 00000000000..eed9e1611f7--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/update-status.ts@@ -0,0 +1,47 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioCreateStatusOutputSchema } from '../../output-schemas';++export const attioUpdateStatusAction = createAction({+ auth: attioAuth,+ name: 'attio_update_status',+ outputSchema: attioCreateStatusOutputSchema,+ displayName: 'Update Status',+ description: 'Renames, configures or archives a status.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Updates only the supplied fields of a status; set Archived to Yes to archive it.',+ idempotent: true,+ },+ props: {+ target: attioAi.targetProp(),+ identifier: attioAi.identifierProp(),+ attribute: attioAi.attributeProp(),+ status: Property.ShortText({ displayName: 'Status', description: 'Status ID or title, from List Statuses.', required: true }),+ title: Property.ShortText({ displayName: 'Title', required: false }),+ celebration_enabled: attioAi.optionalBooleanProp({ displayName: 'Celebration Enabled', description: 'Leave empty to keep the current setting.' }),+ target_time_in_status: Property.ShortText({ displayName: 'Target Time in Status', description: 'ISO 8601 duration, e.g. `P7D`.', required: false }),+ is_archived: attioAi.optionalBooleanProp({ displayName: 'Archived', description: 'Yes archives the status; No restores it.' }),+ },+ async run(context) {+ const { target, identifier, attribute, status, title, celebration_enabled, target_time_in_status, is_archived } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.PATCH,+ resourceUri: `/${target}/${identifier}/attributes/${attribute}/statuses/${status}`,+ body: {+ data: attioAi.compact({+ title,+ celebration_enabled: attioAi.toBoolean(celebration_enabled),+ target_time_in_status,+ is_archived: attioAi.toBoolean(is_archived),+ }),+ },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/update-task.ts b/packages/pieces/community/attio/src/lib/actions/ai/update-task.tsnew file mode 100644index 00000000000..93683270389--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/update-task.ts@@ -0,0 +1,58 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioUpdateTaskOutputSchema } from '../../output-schemas';++export const attioUpdateTaskAction = createAction({+ auth: attioAuth,+ name: 'attio_update_task',+ outputSchema: attioUpdateTaskOutputSchema,+ displayName: 'Update Task',+ description: 'Updates the deadline, completion, links or assignees of a task.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Updates only the supplied fields of a task. Linked Records and Assignee Emails replace the current ones when given; leaving them empty keeps the current ones, so links and assignees cannot be cleared to none. Content cannot be changed.',+ idempotent: true,+ },+ props: {+ task_id: Property.ShortText({ displayName: 'Task ID', description: 'From List Tasks or Create Task.', required: true }),+ deadline_at: Property.DateTime({ displayName: 'Deadline', required: false }),+ is_completed: attioAi.optionalBooleanProp({ displayName: 'Completed', description: 'Leave empty to keep the current state.' }),+ linked_records: Property.Array({+ displayName: 'Linked Records',+ description: 'Records to link the task to.',+ required: false,+ properties: {+ target_object: Property.ShortText({ displayName: 'Object', description: 'Object slug, e.g. `companies`.', required: true }),+ target_record_id: Property.ShortText({ displayName: 'Record ID', required: true }),+ },+ }),+ assignee_emails: Property.Array({+ displayName: 'Assignee Emails',+ description: 'Workspace member email addresses to assign.',+ required: false,+ }),+ },+ async run(context) {+ const { task_id, deadline_at, is_completed, linked_records, assignee_emails } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.PATCH,+ resourceUri: `/tasks/${task_id}`,+ body: {+ data: attioAi.compact({+ deadline_at,+ is_completed: attioAi.toBoolean(is_completed),+ linked_records: linked_records && linked_records.length > 0 ? attioAi.records(linked_records) : undefined,+ assignees: assignee_emails && assignee_emails.length > 0+ ? attioAi.strings(assignee_emails).map((email) => ({ workspace_member_email_address: email }))+ : undefined,+ }),+ },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/upload-file.ts b/packages/pieces/community/attio/src/lib/actions/ai/upload-file.tsnew file mode 100644index 00000000000..79963afb008--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/upload-file.ts@@ -0,0 +1,45 @@+import FormData from 'form-data';+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioGetFileOutputSchema } from '../../output-schemas';++export const attioUploadFileAction = createAction({+ auth: attioAuth,+ name: 'attio_upload_file',+ outputSchema: attioGetFileOutputSchema,+ displayName: 'Upload File',+ description: 'Uploads a file to a record.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Uploads a file to the native files of a record, optionally into a folder. Not idempotent.',+ idempotent: false,+ },+ props: {+ object: attioAi.objectProp(),+ record_id: attioAi.recordIdProp({ description: 'ID of the record the files belong to.' }),+ file: Property.File({ displayName: 'File', required: true }),+ parent_folder_id: Property.ShortText({ displayName: 'Parent Folder ID', description: 'Folder to put it in; empty for the root.', required: false }),+ },+ async run(context) {+ const { object, record_id, file, parent_folder_id } = context.propsValue;+ const form = new FormData();+ form.append('file', file.data, file.filename);+ form.append('object', object);+ form.append('record_id', record_id);+ if (parent_folder_id) {+ form.append('parent_folder_id', parent_folder_id);+ }+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.POST,+ resourceUri: `/files/upload`,+ body: form,+ headers: form.getHeaders(),+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/upsert-list-entry.ts b/packages/pieces/community/attio/src/lib/actions/ai/upsert-list-entry.tsnew file mode 100644index 00000000000..11d4d052a55--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/upsert-list-entry.ts@@ -0,0 +1,40 @@+import { createAction } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { createEntryOutputSchema } from '../../output-schemas';++export const attioUpsertListEntryAction = createAction({+ auth: attioAuth,+ name: 'attio_upsert_list_entry',+ outputSchema: createEntryOutputSchema,+ displayName: 'Upsert List Entry',+ description: 'Adds a record to a list, or updates its entry if already there.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Adds the record to the list, or updates its existing entry if the record is already in the list. Prefer this over Create List Entry to avoid duplicate entries. Multiselect values are replaced.',+ idempotent: true,+ },+ props: {+ list: attioAi.listProp(),+ parent_object: attioAi.objectProp(),+ parent_record_id: attioAi.recordIdProp({ description: 'ID of the record to add to the list.' }),+ entry_values: attioAi.valuesProp({+ displayName: 'Entry Values',+ description: 'List-specific attribute values keyed by attribute slug, e.g. {"stage": "Qualified"}. Use List Attributes with target `lists` for slugs.',+ required: false,+ }),+ },+ async run(context) {+ const { list, parent_object, parent_record_id, entry_values } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown> }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.PUT,+ resourceUri: `/lists/${list}/entries`,+ body: { data: { parent_object, parent_record_id, entry_values: entry_values ?? {} } },+ });+ return response.data;+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/upsert-record.ts b/packages/pieces/community/attio/src/lib/actions/ai/upsert-record.tsnew file mode 100644index 00000000000..f1e46352715--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/upsert-record.ts@@ -0,0 +1,45 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { AttioRecordResponse } from '../../common/types';+import { attioCreateRecordOutputSchema } from '../../output-schemas';++export const attioUpsertRecordAction = createAction({+ auth: attioAuth,+ name: 'attio_upsert_record',+ outputSchema: attioCreateRecordOutputSchema,+ displayName: 'Upsert Record',+ description: 'Creates a record, or updates it if one matches a unique attribute.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Creates a record or updates the existing one whose unique matching attribute (e.g. `email_addresses` for people, `domains` for companies) equals the supplied value. Prefer this over Create Record to avoid duplicates. Multiselect values are added to existing ones.',+ idempotent: true,+ },+ props: {+ object: attioAi.objectProp(),+ matching_attribute: Property.ShortText({+ displayName: 'Matching Attribute',+ description: 'Slug or ID of a unique attribute used to find an existing record, e.g. `email_addresses` or `domains`. Its value must be included in Values.',+ required: true,+ }),+ values: attioAi.valuesProp({+ displayName: 'Values',+ description: 'Attribute values keyed by attribute slug, e.g. {"name": "Acme", "domains": ["acme.com"]}. Use List Attributes for slugs and types.',+ required: true,+ }),+ },+ async run(context) {+ const { object, matching_attribute, values } = context.propsValue;+ const response = await attioApiCall<{ data: AttioRecordResponse }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.PUT,+ resourceUri: `/objects/${object}/records`,+ query: { matching_attribute },+ body: { data: { values } },+ });+ return attioAi.flattenRecord(response.data);+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/write-list-entry-attribute-values.ts b/packages/pieces/community/attio/src/lib/actions/ai/write-list-entry-attribute-values.tsnew file mode 100644index 00000000000..c6e16df112d--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/write-list-entry-attribute-values.ts@@ -0,0 +1,58 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioListRecordAttributeValuesOutputSchema } from '../../output-schemas';++export const attioWriteListEntryAttributeValuesAction = createAction({+ auth: attioAuth,+ name: 'attio_write_list_entry_attribute_values',+ outputSchema: attioListRecordAttributeValuesOutputSchema,+ displayName: 'Write List Entry Attribute Values',+ description: 'Replaces the full value history of one attribute on a list entry.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Replaces the entire value history of one list attribute on an entry, e.g. to backfill stage history. Existing history for that attribute is overwritten. Use Update List Entry to just set the current value.',+ idempotent: true,+ },+ props: {+ list: attioAi.listProp(),+ entry_id: attioAi.entryIdProp(),+ attribute: attioAi.attributeProp(),+ values: Property.Array({+ displayName: 'Values',+ description: 'The full value history to write. Each value needs the time it became active.',+ required: true,+ properties: {+ value: Property.ShortText({+ displayName: 'Value',+ description: 'The value. JSON is parsed, e.g. `42`, `true` or {"currency_value": 10}; anything else is sent as text.',+ required: true,+ }),+ active_from: Property.ShortText({ displayName: 'Active From', description: 'ISO 8601 timestamp.', required: true }),+ active_until: Property.ShortText({ displayName: 'Active Until', description: 'ISO 8601 timestamp; leave empty for the current value.', required: false }),+ },+ }),+ },+ async run(context) {+ const { list, entry_id, attribute, values } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown>[] }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.PUT,+ resourceUri: `/lists/${list}/entries/${entry_id}/attributes/${attribute}/values`,+ body: {+ data: {+ values: attioAi.records(values).map((item) => ({+ value: attioAi.parseLooseValue(item['value']),+ active_from: item['active_from'],+ active_until: item['active_until'] ?? null,+ })),+ replace_history: true,+ },+ },+ });+ return { values: response.data, count: response.data.length };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/ai/write-record-attribute-values.ts b/packages/pieces/community/attio/src/lib/actions/ai/write-record-attribute-values.tsnew file mode 100644index 00000000000..90c257d07ec--- /dev/null+++ b/packages/pieces/community/attio/src/lib/actions/ai/write-record-attribute-values.ts@@ -0,0 +1,58 @@+import { createAction, Property } from '@activepieces/pieces-framework';+import { HttpMethod } from '@activepieces/pieces-common';+import { attioAuth } from '../../auth';+import { attioApiCall } from '../../common/client';+import { attioAi } from '../../common/ai';+import { attioListRecordAttributeValuesOutputSchema } from '../../output-schemas';++export const attioWriteRecordAttributeValuesAction = createAction({+ auth: attioAuth,+ name: 'attio_write_record_attribute_values',+ outputSchema: attioListRecordAttributeValuesOutputSchema,+ displayName: 'Write Record Attribute Values',+ description: 'Replaces the full value history of one attribute on a record.',+ audience: 'ai',+ classification: 'WRITE',+ aiMetadata: {+ description: 'Replaces the entire value history of one attribute on a record, e.g. to backfill historic deal stages. Existing history for that attribute is overwritten. Use Update Record to just set the current value.',+ idempotent: true,+ },+ props: {+ object: attioAi.objectProp(),+ record_id: attioAi.recordIdProp(),+ attribute: attioAi.attributeProp(),+ values: Property.Array({+ displayName: 'Values',+ description: 'The full value history to write. Each value needs the time it became active.',+ required: true,+ properties: {+ value: Property.ShortText({+ displayName: 'Value',+ description: 'The value. JSON is parsed, e.g. `42`, `true` or {"currency_value": 10}; anything else is sent as text.',+ required: true,+ }),+ active_from: Property.ShortText({ displayName: 'Active From', description: 'ISO 8601 timestamp.', required: true }),+ active_until: Property.ShortText({ displayName: 'Active Until', description: 'ISO 8601 timestamp; leave empty for the current value.', required: false }),+ },+ }),+ },+ async run(context) {+ const { object, record_id, attribute, values } = context.propsValue;+ const response = await attioApiCall<{ data: Record<string, unknown>[] }>({+ accessToken: context.auth.secret_text,+ method: HttpMethod.PUT,+ resourceUri: `/objects/${object}/records/${record_id}/attributes/${attribute}/values`,+ body: {+ data: {+ values: attioAi.records(values).map((item) => ({+ value: attioAi.parseLooseValue(item['value']),+ active_from: item['active_from'],+ active_until: item['active_until'] ?? null,+ })),+ replace_history: true,+ },+ },+ });+ return { values: response.data, count: response.data.length };+ },+});diff --git a/packages/pieces/community/attio/src/lib/actions/create-entry.ts b/packages/pieces/community/attio/src/lib/actions/create-entry.tsindex ae424e35883..759a7910563 100644--- a/packages/pieces/community/attio/src/lib/actions/create-entry.ts+++ b/packages/pieces/community/attio/src/lib/actions/create-entry.ts@@ -8,13 +8,15 @@ import {listIdDropdown,listParentObjectIdDropdown,} from '../common/props';+import { createEntryOutputSchema } from '../output-schemas';export const createEntryAction = createAction({name: 'create_entry',+ outputSchema: createEntryOutputSchema,classification: 'WRITE',displayName: 'Create List Entry',description: 'Add a record to a specified list.',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Adds an existing record to a specified Attio list as a new entry, optionally setting the list-specific entry attribute values. Requires the list, the parent record\'s object type, and the parent record ID. Not idempotent — each call creates another entry, so the same record can be added to the list multiple times.', idempotent: false },auth: attioAuth,props: {diff --git a/packages/pieces/community/attio/src/lib/actions/create-note.ts b/packages/pieces/community/attio/src/lib/actions/create-note.tsindex c128b4da846..c8fe3db04ff 100644--- a/packages/pieces/community/attio/src/lib/actions/create-note.ts+++ b/packages/pieces/community/attio/src/lib/actions/create-note.ts@@ -3,13 +3,15 @@ import { HttpMethod } from '@activepieces/pieces-common';import { attioAuth } from '../auth';import { attioApiCall } from '../common/client';import { objectTypeIdDropdown } from '../common/props';+import { attioCreateNoteOutputSchema } from '../output-schemas';export const createNoteAction = createAction({name: 'create_note',+ outputSchema: attioCreateNoteOutputSchema,classification: 'WRITE',displayName: 'Create Note',description: 'Creates a new note on a record.',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Creates a note attached to a specific record, with a title and body content interpreted as either plaintext or markdown. Requires the parent object type, the parent record ID, and the note text. Not idempotent — each call appends another note to the record.', idempotent: false },auth: attioAuth,props: {diff --git a/packages/pieces/community/attio/src/lib/actions/create-record.ts b/packages/pieces/community/attio/src/lib/actions/create-record.tsindex 26a2ce4444b..5becef3179e 100644--- a/packages/pieces/community/attio/src/lib/actions/create-record.ts+++ b/packages/pieces/community/attio/src/lib/actions/create-record.ts@@ -3,13 +3,15 @@ import { HttpMethod } from '@activepieces/pieces-common';import { attioAuth } from '../auth';import { attioApiCall } from '../common/client';import { formatInputFields, objectFields, objectTypeIdDropdown } from '../common/props';+import { createRecordOutputSchema } from '../output-schemas';export const createRecordAction = createAction({name: 'create_record',+ outputSchema: createRecordOutputSchema,classification: 'WRITE',displayName: 'Create Record',description: 'Creates a new record such as peron,company or deal.',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Creates a new record (person, company, deal, or any custom object type) in Attio with the given attribute values. Choose this to add a brand-new CRM entity; the object type must be selected and its attributes supplied. Not idempotent — each call creates a separate record even with identical input.', idempotent: false },auth: attioAuth,props: {diff --git a/packages/pieces/community/attio/src/lib/actions/create-task.ts b/packages/pieces/community/attio/src/lib/actions/create-task.tsindex 9789aac613b..4604a931b89 100644--- a/packages/pieces/community/attio/src/lib/actions/create-task.ts+++ b/packages/pieces/community/attio/src/lib/actions/create-task.ts@@ -3,14 +3,16 @@ import { HttpMethod } from '@activepieces/pieces-common';import { attioAuth } from '../auth';import { attioApiCall } from '../common/client';import { linkedRecordDropdown, objectTypeIdDropdown } from '../common/props';+import { createTaskOutputSchema } from '../output-schemas';export const createTaskAction = createAction({auth: attioAuth,name: 'create_task',+ outputSchema: createTaskOutputSchema,classification: 'WRITE',displayName: 'Create Task',description: 'Create a new task in Attio, optionally linked to a record and assigned to a member.',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Creates a new task in Attio with text content, optionally a deadline, completion flag, a linked record (object type plus record ID), and an assignee by workspace member email. Choose this to add a to-do item, optionally tied to a CRM record. Not idempotent — each call creates a separate task.', idempotent: false },props: {content: Property.LongText({diff --git a/packages/pieces/community/attio/src/lib/actions/delete-task.ts b/packages/pieces/community/attio/src/lib/actions/delete-task.tsindex e70dd480353..4deaee83a97 100644--- a/packages/pieces/community/attio/src/lib/actions/delete-task.ts+++ b/packages/pieces/community/attio/src/lib/actions/delete-task.ts@@ -3,14 +3,16 @@ import { HttpMethod } from '@activepieces/pieces-common';import { attioAuth } from '../auth';import { attioApiCall } from '../common/client';import { taskIdDropdown } from '../common/props';+import { deleteTaskOutputSchema } from '../output-schemas';export const deleteTaskAction = createAction({auth: attioAuth,name: 'delete_task',+ outputSchema: deleteTaskOutputSchema,classification: 'DESTRUCTIVE',displayName: 'Delete Task',description: 'Permanently delete a task by its ID.',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Permanently deletes a task identified by its ID. Use this to remove a task you no longer need; the deletion cannot be undone. Effectively idempotent on end-state — once the task is gone, repeating the call has no further effect (though the second call may error on the missing task).', idempotent: true },props: {task_id: taskIdDropdown({diff --git a/packages/pieces/community/attio/src/lib/actions/find-list-entry.ts b/packages/pieces/community/attio/src/lib/actions/find-list-entry.tsindex dd974039eb6..a1b99e7691c 100644--- a/packages/pieces/community/attio/src/lib/actions/find-list-entry.ts+++ b/packages/pieces/community/attio/src/lib/actions/find-list-entry.ts@@ -2,17 +2,19 @@ import { createAction } from '@activepieces/pieces-framework';import { HttpMethod } from '@activepieces/pieces-common';import { attioAuth } from '../auth';import { attioPaginatedApiCall, buildMembersMap, normalizeRecord } from '../common/client';-import { AttioRecordResponse } from '../common/types';+import { AttioListEntryResponse } from '../common/types';import { formatInputFields, listFields, listIdDropdown } from '../common/props';+import { findListEntryOutputSchema } from '../output-schemas';export const findListEntryAction = createAction({name: 'find_list_entry',+ outputSchema: findListEntryOutputSchema,classification: 'SEARCH',displayName: 'Find List Entry',description:'Search for entries in a specific list in Attio using filters and return matching results.',- audience: 'both',- aiMetadata: { description: 'Queries the entries of a specific Attio list, returning entries that match the supplied attribute filters (leaving filters empty returns all entries in the list). Use this to find list entries before updating or referencing them. Read-only and idempotent.', idempotent: true },+ audience: 'human',+ aiMetadata: { description: 'Queries the entries of a specific Attio list, returning entries that match the supplied attribute filters; at least one filter is required. Use this to find list entries before updating or referencing them. Read-only and idempotent.', idempotent: true },auth: attioAuth,props: {listId: listIdDropdown({@@ -32,8 +34,12 @@ export const findListEntryAction = createAction({const formattedFields = await formatInputFields(accessToken, 'lists', listId, inputFields, true);+ if (Object.keys(formattedFields).length === 0) {+ throw new Error('Provide at least one attribute filter.');+ }+// https://docs.attio.com/rest-api/endpoint-reference/entries/list-entries- const records = await attioPaginatedApiCall<AttioRecordResponse>({+ const entries = await attioPaginatedApiCall<AttioListEntryResponse>({method: HttpMethod.POST,accessToken,resourceUri: `/lists/${listId}/entries/query`,@@ -42,6 +48,7 @@ export const findListEntryAction = createAction({},});+ const records = entries.map(({ entry_values, ...entry }) => ({ ...entry, values: entry_values }));const membersMap = await buildMembersMap(accessToken, records);return {found: records.length > 0,diff --git a/packages/pieces/community/attio/src/lib/actions/find-record.ts b/packages/pieces/community/attio/src/lib/actions/find-record.tsindex e810b224940..4a510e08827 100644--- a/packages/pieces/community/attio/src/lib/actions/find-record.ts+++ b/packages/pieces/community/attio/src/lib/actions/find-record.ts@@ -4,14 +4,16 @@ import { attioAuth } from '../auth';import { formatInputFields, objectFields, objectTypeIdDropdown } from '../common/props';import { attioApiCall, attioPaginatedApiCall, buildMembersMap, normalizeRecord } from '../common/client';import { AttioRecordResponse } from '../common/types';+import { findRecordOutputSchema } from '../output-schemas';export const findRecordAction = createAction({name: 'find_record',+ outputSchema: findRecordOutputSchema,classification: 'SEARCH',displayName: 'Find Record',description: 'Search for records in Attio using filters and return matching results.',- audience: 'both',- aiMetadata: { description: 'Looks up records of a chosen Attio object type. Operates in two modes: supply a Record ID to fetch that exact record (all attribute filters are then ignored), or leave it empty and provide attribute filters to query for matching records (empty filters return all records). Use this to resolve a record before updating or referencing it. Read-only and idempotent.', idempotent: true },+ audience: 'human',+ aiMetadata: { description: 'Looks up records of a chosen Attio object type. Operates in two modes: supply a Record ID to fetch that exact record (all attribute filters are then ignored), or leave it empty and provide at least one attribute filter to query for matching records (fails when no filter is given). Use this to resolve a record before updating or referencing it. Read-only and idempotent.', idempotent: true },auth: attioAuth,props: {objectTypeId: objectTypeIdDropdown({@@ -57,6 +59,10 @@ export const findRecordAction = createAction({true,);+ if (Object.keys(formattedFields).length === 0) {+ throw new Error('Provide a Record ID or at least one attribute filter.');+ }+// https://docs.attio.com/rest-api/endpoint-reference/records/list-recordsconst records = await attioPaginatedApiCall<AttioRecordResponse>({method: HttpMethod.POST,diff --git a/packages/pieces/community/attio/src/lib/actions/get-call-transcript.ts b/packages/pieces/community/attio/src/lib/actions/get-call-transcript.tsindex 462a0dfce41..8af125d6976 100644--- a/packages/pieces/community/attio/src/lib/actions/get-call-transcript.ts+++ b/packages/pieces/community/attio/src/lib/actions/get-call-transcript.ts@@ -3,14 +3,16 @@ import { HttpMethod } from '@activepieces/pieces-common';import { attioApiCall } from '../common/client';import { attioAuth } from '../auth';import { callRecordingIdDropdown, meetingIdDropdown } from '../common/props';+import { getCallTranscriptOutputSchema } from '../output-schemas';export const getCallTranscriptAction = createAction({auth: attioAuth,name: 'get_call_transcript',+ outputSchema: getCallTranscriptOutputSchema,classification: 'READ',displayName: 'Get Call Transcript',description: 'Fetches the full transcript for a given call recording.',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Retrieves the full transcript for a specific call recording, identified by its meeting ID and call recording ID. Use this to obtain the spoken text of a recorded call, typically after a call-recording event. Read-only and idempotent.', idempotent: true },props: {meeting_id: meetingIdDropdown({diff --git a/packages/pieces/community/attio/src/lib/actions/get-record.ts b/packages/pieces/community/attio/src/lib/actions/get-record.tsindex f594aa80a19..abc6b941c45 100644--- a/packages/pieces/community/attio/src/lib/actions/get-record.ts+++ b/packages/pieces/community/attio/src/lib/actions/get-record.ts@@ -4,13 +4,15 @@ import { attioAuth } from '../auth';import { objectTypeIdDropdown } from '../common/props';import { attioApiCall, buildMembersMap, normalizeRecord } from '../common/client';import { AttioRecordResponse } from '../common/types';+import { attioCreateRecordOutputSchema } from '../output-schemas';export const getRecordAction = createAction({name: 'get_record',+ outputSchema: attioCreateRecordOutputSchema,classification: 'READ',displayName: 'Get Record',description: 'Retrieve a single record by ID and return its normalized attribute values.',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Fetches one record by its exact ID within a given Attio object type and returns its normalized attribute values. Choose this when you already have the record ID and want its current data; use Find Record instead when you need to search by attributes. Read-only and idempotent.', idempotent: true },auth: attioAuth,props: {diff --git a/packages/pieces/community/attio/src/lib/actions/get-task.ts b/packages/pieces/community/attio/src/lib/actions/get-task.tsindex 5dd6016bb7b..04cb40abb6d 100644--- a/packages/pieces/community/attio/src/lib/actions/get-task.ts+++ b/packages/pieces/community/attio/src/lib/actions/get-task.ts@@ -3,14 +3,16 @@ import { HttpMethod } from '@activepieces/pieces-common';import { attioAuth } from '../auth';import { attioApiCall } from '../common/client';import { taskIdDropdown } from '../common/props';+import { createTaskOutputSchema } from '../output-schemas';export const getTaskAction = createAction({auth: attioAuth,name: 'get_task',+ outputSchema: createTaskOutputSchema,classification: 'READ',displayName: 'Get Task',description: 'Fetch a single task by its ID.',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Fetches a single task by its ID and returns its details. Choose this when you already have the task ID; use List Tasks to find a task by its attributes. Read-only and idempotent.', idempotent: true },props: {task_id: taskIdDropdown({diff --git a/packages/pieces/community/attio/src/lib/actions/list-tasks.ts b/packages/pieces/community/attio/src/lib/actions/list-tasks.tsindex b97e8f70001..e3ac946a37e 100644--- a/packages/pieces/community/attio/src/lib/actions/list-tasks.ts+++ b/packages/pieces/community/attio/src/lib/actions/list-tasks.ts@@ -3,14 +3,16 @@ import { HttpMethod } from '@activepieces/pieces-common';import { attioAuth } from '../auth';import { attioApiCall } from '../common/client';import { linkedRecordDropdown, objectTypeIdDropdown } from '../common/props';+import { listTasksOutputSchema } from '../output-schemas';export const listTasksAction = createAction({auth: attioAuth,name: 'list_tasks',+ outputSchema: listTasksOutputSchema,classification: 'SEARCH',displayName: 'List Tasks',description: 'List tasks with optional filters by linked record, assignee, or completion status.',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Lists tasks in Attio, optionally narrowed by linked object type, linked record, assignee (member email/ID, or "null" for unassigned), and completion status. With no filters it returns all tasks. Use this to find tasks before getting or updating one. Read-only and idempotent.', idempotent: true },props: {linked_object: objectTypeIdDropdown({diff --git a/packages/pieces/community/attio/src/lib/actions/update-entry.ts b/packages/pieces/community/attio/src/lib/actions/update-entry.tsindex cc22c15d51b..474ebc6dc3d 100644--- a/packages/pieces/community/attio/src/lib/actions/update-entry.ts+++ b/packages/pieces/community/attio/src/lib/actions/update-entry.ts@@ -3,13 +3,15 @@ import { HttpMethod } from '@activepieces/pieces-common';import { attioAuth } from '../auth';import { attioApiCall } from '../common/client';import { formatInputFields, listFields, listIdDropdown } from '../common/props';+import { createEntryOutputSchema } from '../output-schemas';export const updateEntryAction = createAction({name: 'update_entry',+ outputSchema: createEntryOutputSchema,classification: 'WRITE',displayName: 'Update List Entry',description: 'Update the attributes of an existing entry in a list.',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Updates the list-specific attribute values of an existing list entry, identified by its list and entry ID (multiselect values are appended). Choose this to change an entry already on a list rather than to add a record to a list. Idempotent for scalar values — re-applying the same values leaves the entry unchanged.', idempotent: true },auth: attioAuth,props: {diff --git a/packages/pieces/community/attio/src/lib/actions/update-record.ts b/packages/pieces/community/attio/src/lib/actions/update-record.tsindex d9c5f9cad22..d1e74396929 100644--- a/packages/pieces/community/attio/src/lib/actions/update-record.ts+++ b/packages/pieces/community/attio/src/lib/actions/update-record.ts@@ -3,13 +3,15 @@ import { HttpMethod } from '@activepieces/pieces-common';import { attioAuth } from '../auth';import { attioApiCall } from '../common/client';import { formatInputFields, objectFields, objectTypeIdDropdown } from '../common/props';+import { createRecordOutputSchema } from '../output-schemas';export const updateRecordAction = createAction({name: 'update_record',+ outputSchema: createRecordOutputSchema,classification: 'WRITE',displayName: 'Update Record',description: 'Update an existing record with new attribute values.',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Updates an existing record in a given Attio object type by record ID, overwriting the supplied attribute values (multiselect values are appended). Choose this when you already know the record ID and want to change its fields. Idempotent — re-applying the same values leaves the record in the same state.', idempotent: true },auth: attioAuth,props: {diff --git a/packages/pieces/community/attio/src/lib/actions/update-task.ts b/packages/pieces/community/attio/src/lib/actions/update-task.tsindex 5f81bb794b1..1ba7dc87479 100644--- a/packages/pieces/community/attio/src/lib/actions/update-task.ts+++ b/packages/pieces/community/attio/src/lib/actions/update-task.ts@@ -4,14 +4,16 @@ import { attioAuth } from '../auth';import { attioApiCall } from '../common/client';import { linkedRecordDropdown, objectTypeIdDropdown, taskIdDropdown } from '../common/props';import { isNil } from '@activepieces/pieces-framework';+import { updateTaskOutputSchema } from '../output-schemas';export const updateTaskAction = createAction({auth: attioAuth,name: 'update_task',+ outputSchema: updateTaskOutputSchema,classification: 'WRITE',displayName: 'Update Task',description: 'Update an existing task in Attio.',- audience: 'both',+ audience: 'human',aiMetadata: { description: 'Updates an existing task by ID, changing any supplied fields: content, deadline, completion status, linked record, or assignee email. At least one field must be provided. Choose this to modify a task you already know the ID of. Idempotent — re-applying the same values leaves the task in the same state.', idempotent: true },props: {task_id: taskIdDropdown({diff --git a/packages/pieces/community/attio/src/lib/common/ai.ts b/packages/pieces/community/attio/src/lib/common/ai.tsnew file mode 100644index 00000000000..6f3e9bdedea--- /dev/null+++ b/packages/pieces/community/attio/src/lib/common/ai.ts@@ -0,0 +1,209 @@+import { Property } from '@activepieces/pieces-framework';+import { normalizeRecord } from './client';+import { AttioRecordResponse } from './types';++function objectProp() {+ return Property.ShortText({+ displayName: 'Object',+ description: 'Object slug or ID, e.g. `people`, `companies`, `deals`. Use List Objects to find custom objects.',+ required: true,+ });+}++function recordIdProp({ description }: { description?: string } = {}) {+ return Property.ShortText({+ displayName: 'Record ID',+ description: description ?? 'Record ID (`id.record_id`), from Query Records, Search Records or Create Record.',+ required: true,+ });+}++function listProp() {+ return Property.ShortText({+ displayName: 'List',+ description: 'List slug or ID. Use List Lists to find it.',+ required: true,+ });+}++function entryIdProp() {+ return Property.ShortText({+ displayName: 'Entry ID',+ description: 'List entry ID (`id.entry_id`), from Query List Entries or Create List Entry.',+ required: true,+ });+}++function attributeProp() {+ return Property.ShortText({+ displayName: 'Attribute',+ description: 'Attribute slug or ID. Use List Attributes to find it.',+ required: true,+ });+}++function targetProp() {+ return Property.StaticDropdown({+ displayName: 'Target',+ description: 'Whether the attribute belongs to an object or a list.',+ required: true,+ options: {+ disabled: false,+ options: [+ { label: 'Object', value: 'objects' },+ { label: 'List', value: 'lists' },+ ],+ },+ });+}++function identifierProp() {+ return Property.ShortText({+ displayName: 'Object or List',+ description: 'Slug or ID of the object or list the attribute belongs to.',+ required: true,+ });+}++function valuesProp<R extends boolean>({ displayName, description, required }: { displayName: string; description: string; required: R }) {+ return Property.Json({ displayName, description, required });+}++function limitProp({ max }: { max: number }) {+ return Property.Number({+ displayName: 'Limit',+ description: `Maximum number of results to return (up to ${max}).`,+ required: false,+ });+}++function offsetProp() {+ return Property.Number({+ displayName: 'Offset',+ description: 'Number of results to skip, for pagination.',+ required: false,+ });+}++function cursorProp() {+ return Property.ShortText({+ displayName: 'Cursor',+ description: 'Pagination cursor from the previous response (`pagination.next_cursor`).',+ required: false,+ });+}++function optionalBooleanProp({ displayName, description }: { displayName: string; description: string }) {+ return Property.StaticDropdown({+ displayName,+ description,+ required: false,+ options: {+ disabled: false,+ options: [+ { label: 'Yes', value: 'true' },+ { label: 'No', value: 'false' },+ ],+ },+ });+}++function sortsProp() {+ return Property.Array({+ displayName: 'Sorts',+ description: 'Sort order, applied in sequence.',+ required: false,+ properties: {+ attribute: Property.ShortText({ displayName: 'Attribute', description: 'Attribute slug or ID to sort by.', required: true }),+ field: Property.ShortText({ displayName: 'Field', description: 'Optional sub-field, e.g. `last_name` for a name attribute.', required: false }),+ direction: Property.StaticDropdown({+ displayName: 'Direction',+ required: true,+ options: {+ disabled: false,+ options: [+ { label: 'Ascending', value: 'asc' },+ { label: 'Descending', value: 'desc' },+ ],+ },+ }),+ },+ });+}++function linkedRecordsProp({ description }: { description: string }) {+ return Property.Array({+ displayName: 'Linked Records',+ description,+ required: false,+ properties: {+ object: Property.ShortText({ displayName: 'Object', description: 'Object slug or ID, e.g. `people`.', required: true }),+ record_id: Property.ShortText({ displayName: 'Record ID', required: true }),+ },+ });+}++function toBoolean(value: string | undefined): boolean | undefined {+ if (value === 'true') return true;+ if (value === 'false') return false;+ return undefined;+}++function compact(input: Record<string, unknown>): Record<string, unknown> {+ return Object.fromEntries(Object.entries(input).filter(([, value]) => value !== undefined && value !== null && value !== ''));+}++function nonEmptyFilter(filter: unknown): unknown {+ return isRecord(filter) && Object.keys(filter).length === 0 ? undefined : filter;+}++function isRecord(value: unknown): value is Record<string, unknown> {+ return typeof value === 'object' && value !== null && !Array.isArray(value);+}++function records(items: unknown[] | undefined): Record<string, unknown>[] {+ return (items ?? []).filter(isRecord);+}++function strings(items: unknown[] | undefined): string[] {+ return (items ?? []).filter((item): item is string => typeof item === 'string' && item.trim() !== '');+}++function flattenRecord(record: AttioRecordResponse): Record<string, unknown> {+ return normalizeRecord(record, {});+}++function parseLooseValue(value: unknown): unknown {+ if (typeof value !== 'string') return value;+ try {+ const parsed: unknown = JSON.parse(value);+ return parsed;+ } catch {+ return value;+ }+}++export const attioAi = {+ objectProp,+ recordIdProp,+ listProp,+ entryIdProp,+ attributeProp,+ targetProp,+ identifierProp,+ valuesProp,+ limitProp,+ offsetProp,+ cursorProp,+ optionalBooleanProp,+ sortsProp,+ linkedRecordsProp,+ toBoolean,+ compact,+ nonEmptyFilter,+ isRecord,+ records,+ strings,+ flattenRecord,+ parseLooseValue,+};diff --git a/packages/pieces/community/attio/src/lib/common/client.ts b/packages/pieces/community/attio/src/lib/common/client.tsindex 20334d8fd17..804de88a83a 100644--- a/packages/pieces/community/attio/src/lib/common/client.ts+++ b/packages/pieces/community/attio/src/lib/common/client.ts@@ -18,6 +18,8 @@ export type AttioApiCallParams = {query?: Record<string, string | number | string[] | undefined>;body?: any;retries?: number;+ headers?: Record<string, string>;+ responseType?: HttpRequest['responseType'];};export async function attioApiCall<T extends HttpMessageBody>({@@ -27,6 +29,8 @@ export async function attioApiCall<T extends HttpMessageBody>({query,body,retries,+ headers,+ responseType,}: AttioApiCallParams): Promise<T> {const qs: QueryParams = {};@@ -48,6 +52,8 @@ export async function attioApiCall<T extends HttpMessageBody>({queryParams: qs,body,retries,+ headers,+ responseType,};const response = await httpClient.sendRequest<T>(request);@@ -98,7 +104,7 @@ export async function attioPaginatedApiCall<T extends HttpMessageBody>({export async function buildMembersMap(accessToken: string,- records: AttioRecordResponse[],+ records: Pick<AttioRecordResponse, 'values'>[],): Promise<Record<string, WorkspaceMemberResponse>> {const actorIds = new Set<string>();for (const record of records) {@@ -177,7 +183,7 @@ function extractAttributeValue(}export function normalizeRecord(- record: AttioRecordResponse,+ record: Pick<AttioRecordResponse, 'values'>,membersMap: Record<string, WorkspaceMemberResponse>,): Record<string, unknown> {const flatValues: Record<string, unknown> = {};diff --git a/packages/pieces/community/attio/src/lib/common/types.ts b/packages/pieces/community/attio/src/lib/common/types.tsindex 56fe988dfcf..d19029d233c 100644--- a/packages/pieces/community/attio/src/lib/common/types.ts+++ b/packages/pieces/community/attio/src/lib/common/types.ts@@ -85,6 +85,18 @@ export interface AttioRecordResponse {values: Record<string, AttioAttributeValue[]>;}+export interface AttioListEntryResponse {+ id: {+ workspace_id: string;+ list_id: string;+ entry_id: string;+ };+ parent_record_id: string;+ parent_object: string;+ created_at: string;+ entry_values: Record<string, AttioAttributeValue[]>;+}+export interface WorkspaceMemberResponse {id: {workspace_id: string;diff --git a/packages/pieces/community/attio/src/lib/output-schemas.ts b/packages/pieces/community/attio/src/lib/output-schemas.tsnew file mode 100644index 00000000000..fa19e29ecf1--- /dev/null+++ b/packages/pieces/community/attio/src/lib/output-schemas.ts@@ -0,0 +1,718 @@+import { OutputSchema } from '@activepieces/pieces-framework';++const actorFields: OutputSchema['fields'] = [+ { key: 'type', label: 'Type' },+ { key: 'id', label: 'ID' },+];++const createdByActorField: OutputSchema['fields'][number] = {+ key: 'created_by_actor',+ label: 'Created By',+ children: actorFields,+};++const recordFields: OutputSchema['fields'] = [+ {+ key: 'id',+ label: 'ID',+ children: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'object_id', label: 'Object ID' },+ { key: 'record_id', label: 'Record ID' },+ ],+ },+ { key: 'created_at', label: 'Created At', format: 'datetime' },+ { key: 'web_url', label: 'Web URL', format: 'url' },+ { key: 'values', label: 'Values', dynamicKey: true },+];++const entryFields: OutputSchema['fields'] = [+ {+ key: 'id',+ label: 'ID',+ children: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'list_id', label: 'List ID' },+ { key: 'entry_id', label: 'Entry ID' },+ ],+ },+ { key: 'parent_record_id', label: 'Parent Record ID' },+ { key: 'parent_object', label: 'Parent Object' },+ { key: 'created_at', label: 'Created At', format: 'datetime' },+ { key: 'entry_values', label: 'Entry Values', dynamicKey: true },+];++const attributeValueFields: OutputSchema['fields'] = [+ { key: 'active_from', label: 'Active From', format: 'datetime' },+ { key: 'active_until', label: 'Active Until', format: 'datetime' },+ createdByActorField,+ { key: 'value', label: 'Value' },+ { key: 'attribute_type', label: 'Attribute Type' },+];++const attributeFields: OutputSchema['fields'] = [+ {+ key: 'id',+ label: 'ID',+ children: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'object_id', label: 'Object ID' },+ { key: 'attribute_id', label: 'Attribute ID' },+ ],+ },+ { key: 'title', label: 'Title' },+ { key: 'description', label: 'Description' },+ { key: 'api_slug', label: 'API Slug' },+ { key: 'type', label: 'Type' },+ { key: 'is_system_attribute', label: 'System Attribute', format: 'boolean' },+ { key: 'is_writable', label: 'Writable', format: 'boolean' },+ { key: 'is_required', label: 'Required', format: 'boolean' },+ { key: 'is_unique', label: 'Unique', format: 'boolean' },+ { key: 'is_multiselect', label: 'Multiselect', format: 'boolean' },+ { key: 'is_default_value_enabled', label: 'Default Value Enabled', format: 'boolean' },+ { key: 'is_archived', label: 'Archived', format: 'boolean' },+ { key: 'default_value', label: 'Default Value' },+ {+ key: 'relationship',+ label: 'Relationship',+ children: [+ {+ key: 'id',+ label: 'ID',+ children: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'object_id', label: 'Object ID' },+ { key: 'attribute_id', label: 'Attribute ID' },+ ],+ },+ { key: 'object_slug', label: 'Object Slug' },+ { key: 'api_slug', label: 'API Slug' },+ { key: 'is_multiselect', label: 'Multiselect', format: 'boolean' },+ { key: 'title', label: 'Title' },+ ],+ },+ { key: 'created_at', label: 'Created At', format: 'datetime' },+];++const selectOptionFields: OutputSchema['fields'] = [+ {+ key: 'id',+ label: 'ID',+ children: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'object_id', label: 'Object ID' },+ { key: 'attribute_id', label: 'Attribute ID' },+ { key: 'option_id', label: 'Option ID' },+ ],+ },+ { key: 'title', label: 'Title' },+ { key: 'is_archived', label: 'Archived', format: 'boolean' },+];++const statusFields: OutputSchema['fields'] = [+ {+ key: 'id',+ label: 'ID',+ children: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'object_id', label: 'Object ID' },+ { key: 'attribute_id', label: 'Attribute ID' },+ { key: 'status_id', label: 'Status ID' },+ ],+ },+ { key: 'title', label: 'Title' },+ { key: 'is_archived', label: 'Archived', format: 'boolean' },+ { key: 'target_time_in_status', label: 'Target Time In Status', format: 'duration' },+ { key: 'celebration_enabled', label: 'Celebration Enabled', format: 'boolean' },+];++const objectFields: OutputSchema['fields'] = [+ {+ key: 'id',+ label: 'ID',+ children: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'object_id', label: 'Object ID' },+ ],+ },+ { key: 'api_slug', label: 'API Slug' },+ { key: 'singular_noun', label: 'Singular Noun' },+ { key: 'plural_noun', label: 'Plural Noun' },+ { key: 'created_at', label: 'Created At', format: 'datetime' },+];++const listFields: OutputSchema['fields'] = [+ {+ key: 'id',+ label: 'ID',+ children: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'list_id', label: 'List ID' },+ ],+ },+ { key: 'api_slug', label: 'API Slug' },+ { key: 'name', label: 'Name' },+ { key: 'parent_object', label: 'Parent Object' },+ { key: 'workspace_access', label: 'Workspace Access' },+ { key: 'workspace_member_access', label: 'Workspace Member Access' },+ createdByActorField,+ { key: 'created_at', label: 'Created At', format: 'datetime' },+];++const noteFields: OutputSchema['fields'] = [+ {+ key: 'id',+ label: 'ID',+ children: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'note_id', label: 'Note ID' },+ ],+ },+ { key: 'parent_object', label: 'Parent Object' },+ { key: 'parent_record_id', label: 'Parent Record ID' },+ { key: 'title', label: 'Title' },+ { key: 'meeting_id', label: 'Meeting ID' },+ { key: 'content_plaintext', label: 'Content (Plain Text)' },+ { key: 'content_markdown', label: 'Content (Markdown)' },+ { key: 'tags', label: 'Tags' },+ createdByActorField,+ { key: 'created_at', label: 'Created At', format: 'datetime' },+];++const taskFields: OutputSchema['fields'] = [+ {+ key: 'id',+ label: 'ID',+ children: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'task_id', label: 'Task ID' },+ ],+ },+ { key: 'content_plaintext', label: 'Content' },+ { key: 'is_completed', label: 'Completed', format: 'boolean' },+ { key: 'completed_at', label: 'Completed At', format: 'datetime' },+ { key: 'deadline_at', label: 'Deadline', format: 'datetime' },+ {+ key: 'linked_records',+ label: 'Linked Records',+ listItems: [+ { key: 'target_object_id', label: 'Object ID' },+ { key: 'target_record_id', label: 'Record ID' },+ ],+ },+ {+ key: 'assignees',+ label: 'Assignees',+ listItems: [+ { key: 'referenced_actor_type', label: 'Actor Type' },+ { key: 'referenced_actor_id', label: 'Actor ID' },+ ],+ },+ createdByActorField,+ { key: 'created_at', label: 'Created At', format: 'datetime' },+];++const commentFields: OutputSchema['fields'] = [+ {+ key: 'id',+ label: 'ID',+ children: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'comment_id', label: 'Comment ID' },+ ],+ },+ { key: 'thread_id', label: 'Thread ID' },+ { key: 'content_plaintext', label: 'Content' },+ { key: 'author', label: 'Author', children: actorFields },+ {+ key: 'record',+ label: 'Record',+ children: [+ { key: 'record_id', label: 'Record ID' },+ { key: 'object_id', label: 'Object ID' },+ ],+ },+ { key: 'entry', label: 'Entry' },+ { key: 'resolved_at', label: 'Resolved At', format: 'datetime' },+ { key: 'resolved_by', label: 'Resolved By' },+ { key: 'created_at', label: 'Created At', format: 'datetime' },+];++const threadIdField: OutputSchema['fields'][number] = {+ key: 'id',+ label: 'ID',+ children: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'thread_id', label: 'Thread ID' },+ ],+};++const meetingTimeFields: OutputSchema['fields'] = [+ { key: 'datetime', label: 'Date Time', format: 'datetime' },+ { key: 'timezone', label: 'Timezone' },+];++const meetingFields: OutputSchema['fields'] = [+ {+ key: 'id',+ label: 'ID',+ children: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'meeting_id', label: 'Meeting ID' },+ ],+ },+ { key: 'title', label: 'Title' },+ { key: 'description', label: 'Description' },+ { key: 'is_all_day', label: 'All Day', format: 'boolean' },+ { key: 'start', label: 'Start', children: meetingTimeFields },+ { key: 'end', label: 'End', children: meetingTimeFields },+ {+ key: 'participants',+ label: 'Participants',+ labelKey: 'email_address',+ listItems: [+ { key: 'email_address', label: 'Email', format: 'email' },+ { key: 'name', label: 'Name' },+ { key: 'status', label: 'Status' },+ { key: 'is_organizer', label: 'Organizer', format: 'boolean' },+ ],+ },+ {+ key: 'linked_records',+ label: 'Linked Records',+ listItems: [+ { key: 'object_slug', label: 'Object Slug' },+ { key: 'object_id', label: 'Object ID' },+ { key: 'record_id', label: 'Record ID' },+ ],+ },+ createdByActorField,+ { key: 'created_at', label: 'Created At', format: 'datetime' },+];++const callRecordingIdField: OutputSchema['fields'][number] = {+ key: 'id',+ label: 'ID',+ children: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'meeting_id', label: 'Meeting ID' },+ { key: 'call_recording_id', label: 'Call Recording ID' },+ ],+};++const callRecordingFields: OutputSchema['fields'] = [+ callRecordingIdField,+ { key: 'status', label: 'Status' },+ { key: 'web_url', label: 'Web URL', format: 'url' },+ createdByActorField,+ { key: 'created_at', label: 'Created At', format: 'datetime' },+];++const transcriptSegmentFields: OutputSchema['fields'] = [+ { key: 'speech', label: 'Speech' },+ { key: 'start_time', label: 'Start Time (s)', format: 'number' },+ { key: 'end_time', label: 'End Time (s)', format: 'number' },+ { key: 'speaker', label: 'Speaker', children: [{ key: 'name', label: 'Name' }] },+];++const fileFields: OutputSchema['fields'] = [+ {+ key: 'id',+ label: 'ID',+ children: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'file_id', label: 'File ID' },+ ],+ },+ { key: 'name', label: 'Name' },+ { key: 'file_type', label: 'File Type' },+ { key: 'content_type', label: 'Content Type' },+ { key: 'content_size', label: 'Size', format: 'filesize' },+ { key: 'parent_folder_id', label: 'Parent Folder ID' },+ { key: 'object_id', label: 'Object ID' },+ { key: 'object_slug', label: 'Object Slug' },+ { key: 'record_id', label: 'Record ID' },+ { key: 'storage_provider', label: 'Storage Provider' },+ createdByActorField,+ { key: 'created_at', label: 'Created At', format: 'datetime' },+];++const workspaceMemberFields: OutputSchema['fields'] = [+ {+ key: 'id',+ label: 'ID',+ children: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'workspace_member_id', label: 'Workspace Member ID' },+ ],+ },+ { key: 'first_name', label: 'First Name' },+ { key: 'last_name', label: 'Last Name' },+ { key: 'email_address', label: 'Email', format: 'email' },+ { key: 'avatar_url', label: 'Avatar', format: 'image' },+ { key: 'access_level', label: 'Access Level' },+ { key: 'created_at', label: 'Created At', format: 'datetime' },+];++const countField: OutputSchema['fields'][number] = { key: 'count', label: 'Count', format: 'number' };+const nextCursorField: OutputSchema['fields'][number] = { key: 'next_cursor', label: 'Next Cursor' };++function deleteSchema({ idKey, idLabel }: { idKey: string; idLabel: string }): OutputSchema {+ return {+ fields: [+ { key: 'success', label: 'Success', format: 'boolean' },+ { key: idKey, label: idLabel },+ ],+ };+}++export const attioCreateRecordOutputSchema: OutputSchema = { fields: recordFields };++export const createRecordOutputSchema: OutputSchema = { fields: recordFields };++export const findRecordOutputSchema: OutputSchema = {+ fields: [+ { key: 'found', label: 'Found', format: 'boolean' },+ { key: 'result', label: 'Records', listItems: recordFields },+ ],+};++export const attioQueryRecordsOutputSchema: OutputSchema = {+ fields: [{ key: 'records', label: 'Records', listItems: recordFields }, countField],+};++export const attioSearchRecordsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'results',+ label: 'Results',+ labelKey: 'record_text',+ listItems: [+ {+ key: 'id',+ label: 'ID',+ children: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'object_id', label: 'Object ID' },+ { key: 'record_id', label: 'Record ID' },+ ],+ },+ { key: 'object_slug', label: 'Object Slug' },+ { key: 'record_text', label: 'Record Text' },+ { key: 'record_image', label: 'Record Image', format: 'image' },+ { key: 'domains', label: 'Domains' },+ ],+ },+ countField,+ ],+};++export const attioMergeRecordsOutputSchema: OutputSchema = {+ fields: [{ key: 'new_record_id', label: 'Merged Record ID' }],+};++export const attioListRecordAttributeValuesOutputSchema: OutputSchema = {+ fields: [{ key: 'values', label: 'Values', listItems: attributeValueFields }, countField],+};++export const attioListListEntryAttributeValuesOutputSchema: OutputSchema = {+ fields: [{ key: 'values', label: 'Values', listItems: attributeValueFields }, countField],+};++export const attioListRecordEntriesOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'entries',+ label: 'Entries',+ labelKey: 'list_api_slug',+ listItems: [+ { key: 'entry_id', label: 'Entry ID' },+ { key: 'list_id', label: 'List ID' },+ { key: 'list_api_slug', label: 'List API Slug' },+ { key: 'created_at', label: 'Created At', format: 'datetime' },+ ],+ },+ countField,+ ],+};++export const createEntryOutputSchema: OutputSchema = { fields: entryFields };++export const attioQueryListEntriesOutputSchema: OutputSchema = {+ fields: [{ key: 'entries', label: 'Entries', listItems: entryFields }, countField],+};++export const findListEntryOutputSchema: OutputSchema = {+ fields: [+ { key: 'found', label: 'Found', format: 'boolean' },+ {+ key: 'result',+ label: 'Entries',+ listItems: [+ {+ key: 'id',+ label: 'ID',+ children: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'list_id', label: 'List ID' },+ { key: 'entry_id', label: 'Entry ID' },+ ],+ },+ { key: 'parent_record_id', label: 'Parent Record ID' },+ { key: 'parent_object', label: 'Parent Object' },+ { key: 'created_at', label: 'Created At', format: 'datetime' },+ { key: 'values', label: 'Values', dynamicKey: true },+ ],+ },+ ],+};++export const attioGetAttributeOutputSchema: OutputSchema = { fields: attributeFields };++export const attioListAttributesOutputSchema: OutputSchema = {+ fields: [{ key: 'attributes', label: 'Attributes', labelKey: 'title', listItems: attributeFields }, countField],+};++export const attioCreateSelectOptionOutputSchema: OutputSchema = { fields: selectOptionFields };++export const attioListSelectOptionsOutputSchema: OutputSchema = {+ fields: [{ key: 'options', label: 'Options', labelKey: 'title', listItems: selectOptionFields }, countField],+};++export const attioCreateStatusOutputSchema: OutputSchema = { fields: statusFields };++export const attioListStatusesOutputSchema: OutputSchema = {+ fields: [{ key: 'statuses', label: 'Statuses', labelKey: 'title', listItems: statusFields }, countField],+};++export const attioCreateObjectOutputSchema: OutputSchema = { fields: objectFields };++export const attioListObjectsOutputSchema: OutputSchema = {+ fields: [{ key: 'objects', label: 'Objects', labelKey: 'plural_noun', listItems: objectFields }, countField],+};++export const attioListObjectViewsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'views',+ label: 'Views',+ labelKey: 'title',+ listItems: [+ {+ key: 'id',+ label: 'ID',+ children: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'object_id', label: 'Object ID' },+ { key: 'view_id', label: 'View ID' },+ ],+ },+ { key: 'title', label: 'Title' },+ { key: 'created_at', label: 'Created At', format: 'datetime' },+ ],+ },+ countField,+ nextCursorField,+ ],+};++export const attioCreateListOutputSchema: OutputSchema = { fields: listFields };++export const attioListListsOutputSchema: OutputSchema = {+ fields: [{ key: 'lists', label: 'Lists', labelKey: 'name', listItems: listFields }, countField],+};++export const attioListListViewsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'views',+ label: 'Views',+ labelKey: 'title',+ listItems: [+ {+ key: 'id',+ label: 'ID',+ children: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'list_id', label: 'List ID' },+ { key: 'view_id', label: 'View ID' },+ ],+ },+ { key: 'title', label: 'Title' },+ { key: 'created_at', label: 'Created At', format: 'datetime' },+ ],+ },+ countField,+ nextCursorField,+ ],+};++export const attioCreateNoteOutputSchema: OutputSchema = { fields: noteFields };++export const attioListNotesOutputSchema: OutputSchema = {+ fields: [{ key: 'notes', label: 'Notes', labelKey: 'title', listItems: noteFields }, countField],+};++export const attioCreateTaskOutputSchema: OutputSchema = { fields: taskFields };++export const attioUpdateTaskOutputSchema: OutputSchema = { fields: taskFields };++export const createTaskOutputSchema: OutputSchema = { fields: taskFields };++export const updateTaskOutputSchema: OutputSchema = { fields: taskFields };++export const attioListTasksOutputSchema: OutputSchema = {+ fields: [{ key: 'tasks', label: 'Tasks', labelKey: 'content_plaintext', listItems: taskFields }, countField],+};++export const listTasksOutputSchema: OutputSchema = {+ fields: [+ { key: 'found', label: 'Found', format: 'boolean' },+ { key: 'result', label: 'Tasks', labelKey: 'content_plaintext', listItems: taskFields },+ ],+};++export const deleteTaskOutputSchema: OutputSchema = {+ fields: [{ key: 'success', label: 'Success', format: 'boolean' }],+};++export const attioCreateCommentOutputSchema: OutputSchema = { fields: commentFields };++export const attioGetThreadOutputSchema: OutputSchema = {+ fields: [+ threadIdField,+ { key: 'comments', label: 'Comments', labelKey: 'content_plaintext', listItems: commentFields },+ { key: 'created_at', label: 'Created At', format: 'datetime' },+ nextCursorField,+ ],+};++export const attioListThreadsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'threads',+ label: 'Threads',+ listItems: [+ threadIdField,+ { key: 'comments', label: 'Comments', labelKey: 'content_plaintext', listItems: commentFields },+ { key: 'has_more_comments', label: 'Has More Comments', format: 'boolean' },+ { key: 'created_at', label: 'Created At', format: 'datetime' },+ ],+ },+ countField,+ ],+};++export const attioCreateMeetingOutputSchema: OutputSchema = { fields: meetingFields };++export const attioListMeetingsOutputSchema: OutputSchema = {+ fields: [{ key: 'meetings', label: 'Meetings', labelKey: 'title', listItems: meetingFields }, countField, nextCursorField],+};++export const attioCreateCallRecordingOutputSchema: OutputSchema = { fields: callRecordingFields };++export const attioListCallRecordingsOutputSchema: OutputSchema = {+ fields: [{ key: 'call_recordings', label: 'Call Recordings', listItems: callRecordingFields }, countField, nextCursorField],+};++export const attioGetCallRecordingOutputSchema: OutputSchema = {+ fields: [+ ...callRecordingFields,+ { key: 'video_url', label: 'Video URL', format: 'url' },+ {+ key: 'transcript',+ label: 'Transcript',+ children: [+ { key: 'segments', label: 'Segments', labelKey: 'speech', listItems: transcriptSegmentFields },+ { key: 'raw_transcript', label: 'Raw Transcript' },+ ],+ },+ ],+};++export const getCallTranscriptOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'data',+ label: 'Transcript',+ children: [+ callRecordingIdField,+ { key: 'transcript', label: 'Segments', labelKey: 'speech', listItems: transcriptSegmentFields },+ { key: 'raw_transcript', label: 'Raw Transcript' },+ { key: 'web_url', label: 'Web URL', format: 'url' },+ ],+ },+ { key: 'pagination', label: 'Pagination', children: [nextCursorField] },+ ],+};++export const callRecordingCreatedOutputSchema: OutputSchema = {+ fields: [+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'meeting_id', label: 'Meeting ID' },+ { key: 'call_recording_id', label: 'Call Recording ID' },+ ],+};++export const attioCreateFolderOutputSchema: OutputSchema = {+ fields: fileFields.filter((field) => field.key !== 'content_type' && field.key !== 'content_size'),+};++export const attioGetFileOutputSchema: OutputSchema = { fields: fileFields };++export const attioListFilesOutputSchema: OutputSchema = {+ fields: [{ key: 'files', label: 'Files', labelKey: 'name', listItems: fileFields }, countField, nextCursorField],+};++export const attioDownloadFileOutputSchema: OutputSchema = {+ fields: [+ { key: 'file', label: 'File', format: 'url' },+ { key: 'name', label: 'Name' },+ { key: 'content_type', label: 'Content Type' },+ { key: 'content_size', label: 'Size', format: 'filesize' },+ ],+};++export const attioGetWorkspaceMemberOutputSchema: OutputSchema = { fields: workspaceMemberFields };++export const attioListWorkspaceMembersOutputSchema: OutputSchema = {+ fields: [{ key: 'members', label: 'Members', labelKey: 'email_address', listItems: workspaceMemberFields }, countField],+};++export const attioGetSelfOutputSchema: OutputSchema = {+ fields: [+ { key: 'active', label: 'Active', format: 'boolean' },+ { key: 'workspace_id', label: 'Workspace ID' },+ { key: 'workspace_name', label: 'Workspace Name' },+ { key: 'workspace_slug', label: 'Workspace Slug' },+ { key: 'workspace_logo_url', label: 'Workspace Logo', format: 'image' },+ { key: 'authorized_by_workspace_member_id', label: 'Authorized By Member ID' },+ { key: 'token_level', label: 'Token Level' },+ { key: 'scope', label: 'Scopes' },+ ],+};++export const attioUnsubscribeEmailsOutputSchema: OutputSchema = {+ fields: [+ {+ key: 'unsubscribed',+ label: 'Unsubscribed',+ labelKey: 'email_address',+ listItems: [+ { key: 'email_address', label: 'Email', format: 'email' },+ { key: 'created_at', label: 'Created At', format: 'datetime' },+ ],+ },+ countField,+ ],+};++export const attioDeleteRecordOutputSchema = deleteSchema({ idKey: 'record_id', idLabel: 'Record ID' });+export const attioDeleteListEntryOutputSchema = deleteSchema({ idKey: 'entry_id', idLabel: 'Entry ID' });+export const attioDeleteObjectOutputSchema = deleteSchema({ idKey: 'object', idLabel: 'Object' });+export const attioDeleteNoteOutputSchema = deleteSchema({ idKey: 'note_id', idLabel: 'Note ID' });+export const attioDeleteTaskOutputSchema = deleteSchema({ idKey: 'task_id', idLabel: 'Task ID' });+export const attioDeleteCommentOutputSchema = deleteSchema({ idKey: 'comment_id', idLabel: 'Comment ID' });+export const attioDeleteMeetingOutputSchema = deleteSchema({ idKey: 'meeting_id', idLabel: 'Meeting ID' });+export const attioDeleteCallRecordingOutputSchema = deleteSchema({ idKey: 'call_recording_id', idLabel: 'Call Recording ID' });+export const attioDeleteFileOutputSchema = deleteSchema({ idKey: 'file_id', idLabel: 'File ID' });diff --git a/packages/pieces/community/attio/src/lib/triggers/call-recording-created.ts b/packages/pieces/community/attio/src/lib/triggers/call-recording-created.tsindex bc63c458389..49985a24e02 100644--- a/packages/pieces/community/attio/src/lib/triggers/call-recording-created.ts+++ b/packages/pieces/community/attio/src/lib/triggers/call-recording-created.ts@@ -4,12 +4,14 @@ import { attioApiCall, verifyWebhookSignature } from '../common/client';import { attioAuth } from '../auth';import { CallRecordingResponse, CallRecordingWebhookPayload, MeetingResponse, WebhookResponse } from '../common/types';import { isNil } from '@activepieces/pieces-framework';+import { callRecordingCreatedOutputSchema } from '../output-schemas';const TRIGGER_KEY = 'call-recording-created-trigger';export const callRecordingCreatedTrigger = createTrigger({auth: attioAuth,name: 'call_recording_created',+ outputSchema: callRecordingCreatedOutputSchema,classification: 'READ',displayName: 'Call Recording Created',description: 'Triggers when a call recording finishes and its media upload is complete.',diff --git a/packages/pieces/community/attio/src/lib/triggers/list-entry-created.ts b/packages/pieces/community/attio/src/lib/triggers/list-entry-created.tsindex ca9d7bc3f32..74127838003 100644--- a/packages/pieces/community/attio/src/lib/triggers/list-entry-created.ts+++ b/packages/pieces/community/attio/src/lib/triggers/list-entry-created.ts@@ -5,11 +5,13 @@ import { attioAuth } from '../auth';import { listIdDropdown } from '../common/props';import { ListWebhookPayload, WebhookResponse } from '../common/types';import { isNil } from '@activepieces/pieces-framework';+import { createEntryOutputSchema } from '../output-schemas';const TRIGGER_KEY = 'new-list-entry-trigger';export const listEntryCreatedTrigger = createTrigger({name: 'list_entry_created',+ outputSchema: createEntryOutputSchema,classification: 'READ',displayName: 'List Entry Created',description: 'Triggers when a new entry is added.',diff --git a/packages/pieces/community/attio/src/lib/triggers/list-entry-updated.ts b/packages/pieces/community/attio/src/lib/triggers/list-entry-updated.tsindex 4c7fd9b2856..cbad2286fd0 100644--- a/packages/pieces/community/attio/src/lib/triggers/list-entry-updated.ts+++ b/packages/pieces/community/attio/src/lib/triggers/list-entry-updated.ts@@ -5,11 +5,13 @@ import { attioAuth } from '../auth';import { listIdDropdown } from '../common/props';import { ListWebhookPayload, WebhookResponse } from '../common/types';import { isNil } from '@activepieces/pieces-framework';+import { createEntryOutputSchema } from '../output-schemas';const TRIGGER_KEY = 'updated-list-entry-trigger';export const listEntryUpdatedTrigger = createTrigger({name: 'list_entry_updated',+ outputSchema: createEntryOutputSchema,classification: 'READ',displayName: 'List Entry Updated',description: 'Triggers when an existing entry is updated.',diff --git a/packages/pieces/community/attio/src/lib/triggers/record-created.ts b/packages/pieces/community/attio/src/lib/triggers/record-created.tsindex e735971d966..7badbc9e6bd 100644--- a/packages/pieces/community/attio/src/lib/triggers/record-created.ts+++ b/packages/pieces/community/attio/src/lib/triggers/record-created.ts@@ -5,12 +5,14 @@ import { attioAuth } from '../auth';import { objectTypeIdDropdown } from '../common/props';import { ObjectWebhookPayload, WebhookResponse } from '../common/types';import { isNil } from '@activepieces/pieces-framework';+import { createRecordOutputSchema } from '../output-schemas';const TRIGGER_KEY = 'new-record-trigger';export const recordCreatedTrigger = createTrigger({auth: attioAuth,name: 'record_created',+ outputSchema: createRecordOutputSchema,classification: 'READ',displayName: 'Record Created',description: 'Triggers when a new record such as person,company or deal is created.',diff --git a/packages/pieces/community/attio/src/lib/triggers/record-updated.ts b/packages/pieces/community/attio/src/lib/triggers/record-updated.tsindex d44d0260e56..350dd857593 100644--- a/packages/pieces/community/attio/src/lib/triggers/record-updated.ts+++ b/packages/pieces/community/attio/src/lib/triggers/record-updated.ts@@ -5,11 +5,13 @@ import { attioAuth } from '../auth';import { objectAttributeDropdown, objectTypeIdDropdown } from '../common/props';import { AttributeResponse, ObjectWebhookPayload, WebhookResponse } from '../common/types';import { isNil } from '@activepieces/pieces-framework';+import { createRecordOutputSchema } from '../output-schemas';const TRIGGER_KEY = 'updated-record-trigger';export const recordUpdatedTrigger = createTrigger({name: 'record_updated',+ outputSchema: createRecordOutputSchema,classification: 'READ',displayName: 'Record Updated',description: