-
Notifications
You must be signed in to change notification settings - Fork 5
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
[WIP] feat: add crm/contracts for pipedrive #372
base: main
Are you sure you want to change the base?
Conversation
810d5dd
to
4fbc04f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, thanks for the update on the progress!
I mostly have just nitpicks - and one issue that's a bit more important.
superface.run({ | ||
useCase: 'Create', | ||
input: { | ||
email: '[email protected]', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's best practice to use example.com
or example.org
for such purposes; that way, you can also avoid some potential spam on your domain 😅
|
||
return { | ||
title = "Unknown error" | ||
detail = `Unknown error occurred. Status: ${statusCode}. IPData provider error info: ${detail}.` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's IPData
?
} | ||
} | ||
|
||
operation GetOrCreateOrganizatio { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
operation GetOrCreateOrganizatio { | |
operation GetOrCreateOrganization { |
|
||
operation GetOrCreateOrganizatio { | ||
|
||
data = call GetOrganizationByName(input = args.input) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way of calling ends up silently throwing away the error if the operation call fails, see:
https://superface.ai/docs/comlink/reference/map#calling-operation
This may be useful in some cases - but here it may result in e.g. creating duplicate organizations, in case the operation falls intermittently, or due to some other reason.
It'd be best to use the "Calling with a handler" syntax (documented in the link above)
@@ -57,3 +57,5 @@ superface/grid | |||
|
|||
# Superface compiled capabilities | |||
grid/**/*.ast.json | |||
|
|||
.idea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably shouldn't be a part of this PR? :)
(Also, I assume you're using WebStorm for the TypeScript part?)
body = { | ||
name: [input.firstName, input.lastName].join(" "), | ||
email: [{ | ||
label: "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label: "", |
Please note that only value is required.
Probably best to remove, if there's no reason to keep it
|
||
}], | ||
phone: [{ | ||
label: "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
label: "", |
Ditto
} | ||
} | ||
|
||
organization = call GetOrCreateOrganizatio(input = input) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
organization = call GetOrCreateOrganizatio(input = input) | |
organization = call GetOrCreateOrganization(input = input) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ends up silently throwing away the error, see https://superface.ai/docs/comlink/reference/map#calling-operation
} | ||
} | ||
|
||
// https://developers.pipedrive.com/docs/api/v1/Persons#searchPersons |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once again, ❤️ for linking the docs :)
|
||
request "application/json" { | ||
query { | ||
// operator does not exist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// operator does not exist | |
// PipeDrive doesn't support search operators |
Description
This PR adds Pipedrive provider and impl. of use cases for crm/contracts profile
Motivation and Context
Types of changes
Checklist: