- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.5k
Attio CRM Triggers #14696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Attio CRM Triggers #14696
Changes from all commits
      Commits
    
    
            Show all changes
          
          
            3 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      
    File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
          
            46 changes: 46 additions & 0 deletions
          
          46 
        
  components/attio/sources/list-entry-deleted-instant/list-entry-deleted-instant.mjs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -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, | ||
| }; | 
        
          
          
            14 changes: 14 additions & 0 deletions
          
          14 
        
  components/attio/sources/list-entry-deleted-instant/test-event.mjs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -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" | ||
| } | ||
| } | 
        
          
          
            47 changes: 47 additions & 0 deletions
          
          47 
        
  components/attio/sources/list-entry-updated-instant/list-entry-updated-instant.mjs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -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, | ||
| }; | ||
        
          
          
            15 changes: 15 additions & 0 deletions
          
          15 
        
  components/attio/sources/list-entry-updated-instant/test-event.mjs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -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" | ||
| } | ||
| } | 
        
          
          
            26 changes: 26 additions & 0 deletions
          
          26 
        
  components/attio/sources/new-note-instant/new-note-instant.mjs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -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(), | ||
| }; | ||
| }, | ||
| }, | ||
|         
                  michelle0927 marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
| sampleEmit, | ||
| }; | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -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" | ||
| } | ||
| } | 
        
          
          
            26 changes: 26 additions & 0 deletions
          
          26 
        
  components/attio/sources/new-object-attribute-instant/new-object-attribute-instant.mjs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -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, | ||
| }; | 
        
          
          
            12 changes: 12 additions & 0 deletions
          
          12 
        
  components/attio/sources/new-object-attribute-instant/test-event.mjs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -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" | ||
| } | ||
| } | 
        
          
          
            26 changes: 26 additions & 0 deletions
          
          26 
        
  components/attio/sources/note-updated-instant/note-updated-instant.mjs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -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, | ||
| }; | 
        
          
          
            13 changes: 13 additions & 0 deletions
          
          13 
        
  components/attio/sources/note-updated-instant/test-event.mjs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -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" | ||
| } | ||
| } | 
        
          
          
            27 changes: 27 additions & 0 deletions
          
          27 
        
  ...nents/attio/sources/object-attribute-updated-instant/object-attribute-updated-instant.mjs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -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", | ||
|         
                  michelle0927 marked this conversation as resolved.
              Show resolved
            Hide resolved | ||
| 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, | ||
| }; | ||
        
          
          
            12 changes: 12 additions & 0 deletions
          
          12 
        
  components/attio/sources/object-attribute-updated-instant/test-event.mjs
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -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" | ||
| } | ||
| } | 
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.