diff --git a/components/attio/package.json b/components/attio/package.json index a817f7de21633..e74624a9a7544 100644 --- a/components/attio/package.json +++ b/components/attio/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/attio", - "version": "0.1.1", + "version": "0.2.0", "description": "Pipedream Attio Components", "main": "attio.app.mjs", "keywords": [ diff --git a/components/attio/sources/list-entry-deleted-instant/list-entry-deleted-instant.mjs b/components/attio/sources/list-entry-deleted-instant/list-entry-deleted-instant.mjs new file mode 100644 index 0000000000000..121a90a04d387 --- /dev/null +++ b/components/attio/sources/list-entry-deleted-instant/list-entry-deleted-instant.mjs @@ -0,0 +1,46 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "attio-list-entry-deleted-instant", + name: "List Entry Deleted (Instant)", + description: "Emit new event when a list entry is deleted (i.e. when a record is removed from a list).", + version: "0.0.1", + type: "source", + dedupe: "unique", + props: { + ...common.props, + listId: { + propDefinition: [ + common.props.attio, + "listId", + ], + }, + }, + methods: { + ...common.methods, + getEventType() { + return "list-entry.deleted"; + }, + getFilter() { + return { + "$and": [ + { + field: "id.list_id", + operator: "equals", + value: this.listId, + }, + ], + }; + }, + generateMeta(entry) { + return { + id: entry.id.entry_id, + summary: `Deleted Entry with ID: ${entry.id.entry_id}`, + ts: Date.now(), + }; + }, + }, + sampleEmit, +}; diff --git a/components/attio/sources/list-entry-deleted-instant/test-event.mjs b/components/attio/sources/list-entry-deleted-instant/test-event.mjs new file mode 100644 index 0000000000000..3751928712e76 --- /dev/null +++ b/components/attio/sources/list-entry-deleted-instant/test-event.mjs @@ -0,0 +1,14 @@ +export default { + "event_type": "list-entry.deleted", + "id": { + "workspace_id": "21e6dc8b-aa9f-4970-bdce-fa207cf3a7d9", + "list_id": "dd41a385-c7cd-4832-ad57-c9a824b32ba4", + "entry_id": "7ce64af0-9d4a-4899-88c8-6d74258ca8ef" + }, + "parent_object_id": "6a3d5e81-0de0-4e96-a535-957b28ba8211", + "parent_record_id": "64561036-ee99-47f7-926c-66bf43808dcf", + "actor": { + "type": "api-token", + "id": "76602e62-6767-4975-9e3f-751d5ce80a05" + } +} \ No newline at end of file diff --git a/components/attio/sources/list-entry-updated-instant/list-entry-updated-instant.mjs b/components/attio/sources/list-entry-updated-instant/list-entry-updated-instant.mjs new file mode 100644 index 0000000000000..97970cdab82ef --- /dev/null +++ b/components/attio/sources/list-entry-updated-instant/list-entry-updated-instant.mjs @@ -0,0 +1,47 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "attio-list-entry-updated-instant", + name: "List Entry Updated (Instant)", + description: "Emit new event when an existing list entry is updated (i.e. when a list attribute is changed for a specific list entry, e.g. when setting \"Owner\")", + version: "0.0.1", + type: "source", + dedupe: "unique", + props: { + ...common.props, + listId: { + propDefinition: [ + common.props.attio, + "listId", + ], + }, + }, + methods: { + ...common.methods, + getEventType() { + return "list-entry.updated"; + }, + getFilter() { + return { + "$and": [ + { + field: "id.list_id", + operator: "equals", + value: this.listId, + }, + ], + }; + }, + generateMeta(entry) { + const ts = Date.now(); + return { + id: `${entry.id.entry_id}-${ts}`, + summary: `Updated Entry with ID: ${entry.id.entry_id}`, + ts, + }; + }, + }, + sampleEmit, +}; diff --git a/components/attio/sources/list-entry-updated-instant/test-event.mjs b/components/attio/sources/list-entry-updated-instant/test-event.mjs new file mode 100644 index 0000000000000..1287e0fb841db --- /dev/null +++ b/components/attio/sources/list-entry-updated-instant/test-event.mjs @@ -0,0 +1,15 @@ +export default { + "event_type": "list-entry.updated", + "id": { + "workspace_id": "21e6dc8b-aa9f-4970-bdce-fa207cf3a7d9", + "list_id": "dd41a385-c7cd-4832-ad57-c9a824b32ba4", + "entry_id": "d7b73c9c-5b91-45df-bf3f-677b9bd563eb", + "attribute_id": "82b07502-9c9d-4996-a46f-4a5b687015d5" + }, + "parent_object_id": "6a3d5e81-0de0-4e96-a535-957b28ba8211", + "parent_record_id": "6a3cce50-9589-4f94-be16-8aa0a80c46e1", + "actor": { + "type": "workspace-member", + "id": "3ccf848d-58e5-4ccb-88d7-d85944eda037" + } +} \ No newline at end of file diff --git a/components/attio/sources/new-note-instant/new-note-instant.mjs b/components/attio/sources/new-note-instant/new-note-instant.mjs new file mode 100644 index 0000000000000..96beab68b8b21 --- /dev/null +++ b/components/attio/sources/new-note-instant/new-note-instant.mjs @@ -0,0 +1,26 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "attio-new-note-instant", + name: "New Note (Instant)", + description: "Emit new event when a new note is created.", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getEventType() { + return "note.created"; + }, + generateMeta(note) { + return { + id: note.id.note_id, + summary: `New Note with ID: ${note.id.note_id}`, + ts: Date.now(), + }; + }, + }, + sampleEmit, +}; diff --git a/components/attio/sources/new-note-instant/test-event.mjs b/components/attio/sources/new-note-instant/test-event.mjs new file mode 100644 index 0000000000000..72901adeff289 --- /dev/null +++ b/components/attio/sources/new-note-instant/test-event.mjs @@ -0,0 +1,13 @@ +export default { + "event_type": "note.created", + "id": { + "workspace_id": "21e6dc8b-aa9f-4970-bdce-fa207cf3a7d9", + "note_id": "cc2a06ee-61ae-4a9b-bf1b-4e9774270061" + }, + "parent_object_id": "6a3d5e81-0de0-4e96-a535-957b28ba8211", + "parent_record_id": "64561036-ee99-47f7-926c-66bf43808dcf", + "actor": { + "type": "workspace-member", + "id": "3ccf848d-58e5-4ccb-88d7-d85944eda037" + } +} \ No newline at end of file diff --git a/components/attio/sources/new-object-attribute-instant/new-object-attribute-instant.mjs b/components/attio/sources/new-object-attribute-instant/new-object-attribute-instant.mjs new file mode 100644 index 0000000000000..f76c29e6268e4 --- /dev/null +++ b/components/attio/sources/new-object-attribute-instant/new-object-attribute-instant.mjs @@ -0,0 +1,26 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "attio-new-object-attribute-instant", + name: "New Object Attribute (Instant)", + description: "Emit new event when an object attribute is created (e.g. when defining a new attribute \"Rating\" on the company object)", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getEventType() { + return "object-attribute.created"; + }, + generateMeta(attribute) { + return { + id: attribute.id.attribute_id, + summary: `New Object Attribute with ID: ${attribute.id.attribute_id}`, + ts: Date.now(), + }; + }, + }, + sampleEmit, +}; diff --git a/components/attio/sources/new-object-attribute-instant/test-event.mjs b/components/attio/sources/new-object-attribute-instant/test-event.mjs new file mode 100644 index 0000000000000..a240821b2e2c1 --- /dev/null +++ b/components/attio/sources/new-object-attribute-instant/test-event.mjs @@ -0,0 +1,12 @@ +export default { + "event_type": "object-attribute.created", + "id": { + "workspace_id": "21e6dc8b-aa9f-4970-bdce-fa207cf3a7d9", + "object_id": "6a3d5e81-0de0-4e96-a535-957b28ba8211", + "attribute_id": "44a18da2-582e-4e65-9349-9b49b9bb7a14" + }, + "actor": { + "type": "workspace-member", + "id": "3ccf848d-58e5-4ccb-88d7-d85944eda037" + } +} \ No newline at end of file diff --git a/components/attio/sources/note-updated-instant/note-updated-instant.mjs b/components/attio/sources/note-updated-instant/note-updated-instant.mjs new file mode 100644 index 0000000000000..64aaa4dc8fa5b --- /dev/null +++ b/components/attio/sources/note-updated-instant/note-updated-instant.mjs @@ -0,0 +1,26 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "attio-note-updated-instant", + name: "Note Updated (Instant)", + description: "Emit new event when the title of a note is modified. Body updates do not currently trigger webhooks.", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getEventType() { + return "note.updated"; + }, + generateMeta(note) { + return { + id: note.id.note_id, + summary: `Updated Note with ID: ${note.id.note_id}`, + ts: Date.now(), + }; + }, + }, + sampleEmit, +}; diff --git a/components/attio/sources/note-updated-instant/test-event.mjs b/components/attio/sources/note-updated-instant/test-event.mjs new file mode 100644 index 0000000000000..64531ddcb1e7b --- /dev/null +++ b/components/attio/sources/note-updated-instant/test-event.mjs @@ -0,0 +1,13 @@ +export default { + "event_type": "note.updated", + "id": { + "workspace_id": "21e6dc8b-aa9f-4970-bdce-fa207cf3a7d9", + "note_id": "cc2a06ee-61ae-4a9b-bf1b-4e9774270061" + }, + "parent_object_id": "6a3d5e81-0de0-4e96-a535-957b28ba8211", + "parent_record_id": "64561036-ee99-47f7-926c-66bf43808dcf", + "actor": { + "type": "workspace-member", + "id": "3ccf848d-58e5-4ccb-88d7-d85944eda037" + } +} \ No newline at end of file diff --git a/components/attio/sources/object-attribute-updated-instant/object-attribute-updated-instant.mjs b/components/attio/sources/object-attribute-updated-instant/object-attribute-updated-instant.mjs new file mode 100644 index 0000000000000..4ccb8c0112607 --- /dev/null +++ b/components/attio/sources/object-attribute-updated-instant/object-attribute-updated-instant.mjs @@ -0,0 +1,27 @@ +import common from "../common/base.mjs"; +import sampleEmit from "./test-event.mjs"; + +export default { + ...common, + key: "attio-object-attribute-updated-instant", + name: "Object Attribute Updated (Instant)", + description: "Emit new event when an object attribute is updated (e.g. when renaming the \"Rating\" attribute to \"Score\" on the company object)", + version: "0.0.1", + type: "source", + dedupe: "unique", + methods: { + ...common.methods, + getEventType() { + return "object-attribute.updated"; + }, + generateMeta(attribute) { + const ts = Date.now(); + return { + id: `${attribute.id.attribute_id}-${ts}`, + summary: `New Object Attribute with ID: ${attribute.id.attribute_id}`, + ts, + }; + }, + }, + sampleEmit, +}; diff --git a/components/attio/sources/object-attribute-updated-instant/test-event.mjs b/components/attio/sources/object-attribute-updated-instant/test-event.mjs new file mode 100644 index 0000000000000..c65e340708f1a --- /dev/null +++ b/components/attio/sources/object-attribute-updated-instant/test-event.mjs @@ -0,0 +1,12 @@ +export default { + "event_type": "object-attribute.updated", + "id": { + "workspace_id": "21e6dc8b-aa9f-4970-bdce-fa207cf3a7d9", + "object_id": "6a3d5e81-0de0-4e96-a535-957b28ba8211", + "attribute_id": "44a18da2-582e-4e65-9349-9b49b9bb7a14" + }, + "actor": { + "type": "workspace-member", + "id": "3ccf848d-58e5-4ccb-88d7-d85944eda037" + } +} \ No newline at end of file