Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Commit

Permalink
fix: throw error if url type used for hubspot, update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmarshall committed Dec 11, 2023
1 parent 83aaa86 commit e0673ce
Show file tree
Hide file tree
Showing 15 changed files with 85 additions and 43 deletions.
4 changes: 2 additions & 2 deletions docs/docs/api/v2/crm/create-custom-object-schema.api.mdx

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions docs/docs/api/v2/crm/create-property.api.mdx

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/docs/api/v2/crm/get-custom-object-schema.api.mdx

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/docs/api/v2/crm/get-property.api.mdx

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/docs/api/v2/crm/list-properties-preview.api.mdx

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/docs/api/v2/crm/register-property.api.mdx

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/docs/api/v2/crm/update-custom-object-schema.api.mdx

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions docs/docs/api/v2/crm/update-property.api.mdx

Large diffs are not rendered by default.

12 changes: 10 additions & 2 deletions openapi/common/components/schemas/property_type.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ enum:
description: |
Type of the field.
:::note
`picklist` and `multipicklist` property types are currently only supported in Salesforce and Hubspot
:::
:::note
`url` property type currently is only natively supported in Salesforce.
:::
Support:
<table>
Expand Down Expand Up @@ -75,9 +83,9 @@ description: |
</tr>
<tr>
<td>url</td>
<td>string-text</td>
<td>Not Supported</td>
<td>Url</td>
<td>varchar_auto</td>
<td>Not Supported</td>
</tr>
</tbody>
</table>
6 changes: 3 additions & 3 deletions openapi/v2/crm/openapi.bundle.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions openapi/v2/crm/paths/metadata/properties@{object_name}.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ post:
summary: Create property
description: |
Creates a custom property in the provider and registers it in Supaglue.
:::note
This endpoint is only supported for Salesforce and Hubspot currently.
:::
tags:
- Properties
security:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ patch:
:::note
This feature is only available in Preview to select customers on our Enterprise plan. [Contact us](mailto:team@supaglue.com) for more information.
:::
:::note
This endpoint is only supported for Salesforce and Hubspot currently.
:::
tags:
- Properties
security:
Expand Down
26 changes: 10 additions & 16 deletions packages/core/remotes/impl/hubspot/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,33 +577,27 @@ export const toHubspotTypeAndFieldType = (
propertyType: PropertyType
): { type: PropertyUpdateTypeEnum; fieldType: PropertyUpdateFieldTypeEnum } => {
switch (propertyType) {
case 'text': {
case 'text':
return { type: 'string', fieldType: 'text' };
}
case 'textarea': {
case 'textarea':
return { type: 'string', fieldType: 'textarea' };
}
case 'number': {
case 'number':
return { type: 'number', fieldType: 'number' };
}
case 'picklist': {
case 'picklist':
return { type: 'enumeration', fieldType: 'select' };
}
case 'multipicklist': {
case 'multipicklist':
return { type: 'enumeration', fieldType: 'checkbox' };
}
case 'date': {
case 'date':
return { type: 'date', fieldType: 'date' };
}
case 'datetime': {
case 'datetime':
return {
type: 'datetime',
fieldType: 'date',
};
}
case 'boolean': {
case 'boolean':
return { type: 'bool', fieldType: 'booleancheckbox' };
}
case 'url':
throw new BadRequestError('url type is unsupported');
default:
return { type: 'string', fieldType: 'text' };
}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/remotes/impl/pipedrive/mappers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,13 @@ export const fromPipedriveUserToUser = (user: PipedriveRecord): User => {
export const fromPipedriveEmailsToEmailAddresses = (emails: { label: string; value: string }[]): EmailAddress[] => {
return emails
.filter(({ label }) => label === 'work' || label === 'primary')
.map((email) => ({ emailAddress: email.value, emailAddressType: email.label } as EmailAddress));
.map((email) => ({ emailAddress: email.value, emailAddressType: email.label }) as EmailAddress);
};

export const fromPipedrivePhonesToPhoneNumbers = (phoneNumbers: { label: string; value: string }[]): PhoneNumber[] => {
return phoneNumbers
.filter(({ label }) => label === 'mobile' || label === 'primary' || label === 'fax')
.map((phoneNumber) => ({ phoneNumber: phoneNumber.value, phoneNumberType: phoneNumber.label } as PhoneNumber));
.map((phoneNumber) => ({ phoneNumber: phoneNumber.value, phoneNumberType: phoneNumber.label }) as PhoneNumber);
};

export const fromPipedriveOrganizationToAddresses = (organization: PipedriveRecord): Address[] => {
Expand Down
28 changes: 26 additions & 2 deletions packages/schemas/gen/v2/crm.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e0673ce

Please sign in to comment.