Skip to content

Commit

Permalink
[MAIN] [STRATCONN] added depends_on conditions on salesforce actions (s…
Browse files Browse the repository at this point in the history
…egmentio#2081)

* added depends_on conditions on salesforce actions

* updated conditions for depends_on fields

* Updated depends on condition for delete operation in salesforce actions

* Updated depends on conditions for salesforce actions

Contact, lead, opportunity

* Added depends on for cases action in salesforce
  • Loading branch information
AnkitSegment authored Jul 9, 2024
1 parent 93087d2 commit 862516f
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {
validateLookup,
enable_batching,
recordMatcherOperator,
batch_size
batch_size,
hideIfDeleteOperation
} from '../sf-properties'
import type { Payload } from './generated-types'

Expand All @@ -34,7 +35,8 @@ const action: ActionDefinition<Settings, Payload> = {
type: 'string',
default: {
'@path': '$.traits.name'
}
},
depends_on: hideIfDeleteOperation
},
account_number: {
label: 'Account Number',
Expand All @@ -43,7 +45,8 @@ const action: ActionDefinition<Settings, Payload> = {
type: 'string',
default: {
'@path': '$.groupId'
}
},
depends_on: hideIfDeleteOperation
},
number_of_employees: {
label: 'Number of employees',
Expand All @@ -55,7 +58,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.employees' },
else: { '@path': '$.properties.employees' }
}
}
},
depends_on: hideIfDeleteOperation
},
billing_city: {
label: 'Billing City',
Expand All @@ -67,7 +71,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.address.city' },
else: { '@path': '$.properties.address.city' }
}
}
},
depends_on: hideIfDeleteOperation
},
billing_postal_code: {
label: 'Billing Postal Code',
Expand All @@ -79,7 +84,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.address.postal_code' },
else: { '@path': '$.properties.address.postal_code' }
}
}
},
depends_on: hideIfDeleteOperation
},
billing_country: {
label: 'Billing Country',
Expand All @@ -91,7 +97,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.address.country' },
else: { '@path': '$.properties.address.country' }
}
}
},
depends_on: hideIfDeleteOperation
},
billing_street: {
label: 'Billing Street',
Expand All @@ -103,7 +110,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.address.street' },
else: { '@path': '$.properties.address.street' }
}
}
},
depends_on: hideIfDeleteOperation
},
billing_state: {
label: 'Billing State',
Expand All @@ -115,32 +123,38 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.address.state' },
else: { '@path': '$.properties.address.state' }
}
}
},
depends_on: hideIfDeleteOperation
},
shipping_city: {
label: 'Shipping City',
description: 'City for the shipping address of the account.',
type: 'string'
type: 'string',
depends_on: hideIfDeleteOperation
},
shipping_postal_code: {
label: 'Shipping Postal Code',
description: 'Postal code for the shipping address of the account.',
type: 'string'
type: 'string',
depends_on: hideIfDeleteOperation
},
shipping_country: {
label: 'Shipping Country',
description: 'Country for the shipping address of the account.',
type: 'string'
type: 'string',
depends_on: hideIfDeleteOperation
},
shipping_street: {
label: 'Shipping Street',
description: 'Street address for the shipping address of the account.',
type: 'string'
type: 'string',
depends_on: hideIfDeleteOperation
},
shipping_state: {
label: 'Shipping State',
description: 'State for the shipping address of the account.',
type: 'string'
type: 'string',
depends_on: hideIfDeleteOperation
},
phone: {
label: 'Phone',
Expand All @@ -152,7 +166,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.phone' },
else: { '@path': '$.properties.phone' }
}
}
},
depends_on: hideIfDeleteOperation
},
description: {
label: 'Description',
Expand All @@ -164,7 +179,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.description' },
else: { '@path': '$.properties.description' }
}
}
},
depends_on: hideIfDeleteOperation
},
website: {
label: 'Website',
Expand All @@ -176,7 +192,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.website' },
else: { '@path': '$.properties.website' }
}
}
},
depends_on: hideIfDeleteOperation
},
customFields: customFields
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {
validateLookup,
enable_batching,
recordMatcherOperator,
batch_size
batch_size,
hideIfDeleteOperation
} from '../sf-properties'
import Salesforce, { generateSalesforceRequest } from '../sf-operations'

Expand All @@ -30,7 +31,8 @@ const action: ActionDefinition<Settings, Payload> = {
description: {
label: 'Description',
description: 'A text description of the case.',
type: 'string'
type: 'string',
depends_on: hideIfDeleteOperation
},
customFields: customFields
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {
validateLookup,
enable_batching,
recordMatcherOperator,
batch_size
batch_size,
hideIfDeleteOperation
} from '../sf-properties'
import Salesforce, { generateSalesforceRequest } from '../sf-operations'

Expand All @@ -37,7 +38,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.last_name' },
else: { '@path': '$.properties.last_name' }
}
}
},
depends_on: hideIfDeleteOperation
},
first_name: {
label: 'First Name',
Expand All @@ -49,13 +51,15 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.first_name' },
else: { '@path': '$.properties.first_name' }
}
}
},
depends_on: hideIfDeleteOperation
},
account_id: {
label: 'Account ID',
description:
'The ID of the account that this contact is associated with. This is the Salesforce-generated ID assigned to the account during creation (i.e. 0018c00002CDThnAAH).',
type: 'string'
type: 'string',
depends_on: hideIfDeleteOperation
},
email: {
label: 'Email',
Expand All @@ -67,7 +71,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.email' },
else: { '@path': '$.properties.email' }
}
}
},
depends_on: hideIfDeleteOperation
},
mailing_city: {
label: 'Mailing City',
Expand All @@ -79,7 +84,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.address.city' },
else: { '@path': '$.properties.address.city' }
}
}
},
depends_on: hideIfDeleteOperation
},
mailing_postal_code: {
label: 'Mailing Postal Code',
Expand All @@ -91,7 +97,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.address.postal_code' },
else: { '@path': '$.properties.address.postal_code' }
}
}
},
depends_on: hideIfDeleteOperation
},
mailing_country: {
label: 'Mailing Country',
Expand All @@ -103,7 +110,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.address.country' },
else: { '@path': '$.properties.address.country' }
}
}
},
depends_on: hideIfDeleteOperation
},
mailing_street: {
label: 'Mailing Street',
Expand All @@ -115,7 +123,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.address.street' },
else: { '@path': '$.properties.address.street' }
}
}
},
depends_on: hideIfDeleteOperation
},
mailing_state: {
label: 'Mailing State',
Expand All @@ -127,7 +136,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.address.state' },
else: { '@path': '$.properties.address.state' }
}
}
},
depends_on: hideIfDeleteOperation
},
customFields: customFields
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {
validateLookup,
enable_batching,
recordMatcherOperator,
batch_size
batch_size,
hideIfDeleteOperation
} from '../sf-properties'
import Salesforce, { generateSalesforceRequest } from '../sf-operations'

Expand Down Expand Up @@ -38,7 +39,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.company' },
else: { '@path': '$.properties.company' }
}
}
},
depends_on: hideIfDeleteOperation
},
last_name: {
label: 'Last Name',
Expand All @@ -50,7 +52,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.last_name' },
else: { '@path': '$.properties.last_name' }
}
}
},
depends_on: hideIfDeleteOperation
},
first_name: {
label: 'First Name',
Expand All @@ -62,7 +65,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.first_name' },
else: { '@path': '$.properties.first_name' }
}
}
},
depends_on: hideIfDeleteOperation
},
email: {
label: 'Email',
Expand All @@ -74,7 +78,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.email' },
else: { '@path': '$.properties.email' }
}
}
},
depends_on: hideIfDeleteOperation
},
city: {
label: 'City',
Expand All @@ -86,7 +91,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.address.city' },
else: { '@path': '$.properties.address.city' }
}
}
},
depends_on: hideIfDeleteOperation
},
postal_code: {
label: 'Postal Code',
Expand All @@ -98,7 +104,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.address.postal_code' },
else: { '@path': '$.properties.address.postal_code' }
}
}
},
depends_on: hideIfDeleteOperation
},
country: {
label: 'Country',
Expand All @@ -110,7 +117,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.address.country' },
else: { '@path': '$.properties.address.country' }
}
}
},
depends_on: hideIfDeleteOperation
},
street: {
label: 'Street',
Expand All @@ -122,7 +130,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.address.street' },
else: { '@path': '$.properties.address.street' }
}
}
},
depends_on: hideIfDeleteOperation
},
state: {
label: 'State',
Expand All @@ -134,7 +143,8 @@ const action: ActionDefinition<Settings, Payload> = {
then: { '@path': '$.traits.address.state' },
else: { '@path': '$.properties.address.state' }
}
}
},
depends_on: hideIfDeleteOperation
},
customFields: customFields
},
Expand Down
Loading

0 comments on commit 862516f

Please sign in to comment.