2022-08-17 08:50:24 -07:00
import { INodeProperties } from 'n8n-workflow' ;
2020-10-01 22:31:41 -07:00
2021-12-03 00:44:16 -08:00
export const userProfileOperations : INodeProperties [ ] = [
2020-10-01 22:31:41 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-10-01 22:31:41 -07:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'userProfile' ] ,
2020-10-01 22:31:41 -07:00
} ,
} ,
options : [
{
name : 'Get' ,
value : 'get' ,
2022-08-17 08:50:24 -07:00
description : "Get your user's profile" ,
2022-07-10 13:50:51 -07:00
action : 'Get a user profile' ,
2020-10-01 22:31:41 -07:00
} ,
{
name : 'Update' ,
value : 'update' ,
2022-08-17 08:50:24 -07:00
description : "Update user's profile" ,
2022-07-10 13:50:51 -07:00
action : 'Update a user profile' ,
2020-10-01 22:31:41 -07:00
} ,
] ,
default : 'get' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-10-01 22:31:41 -07:00
2021-12-03 00:44:16 -08:00
export const userProfileFields : INodeProperties [ ] = [
2020-12-13 01:47:52 -08:00
/* -------------------------------------------------------------------------- */
/* userProfile:update */
/* -------------------------------------------------------------------------- */
2020-10-01 22:31:41 -07:00
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'userProfile' ] ,
operation : [ 'update' ] ,
2020-10-01 22:31:41 -07:00
} ,
} ,
options : [
{
displayName : 'Custom Fields' ,
name : 'customFieldUi' ,
placeholder : 'Add Custom Fields' ,
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
} ,
default : { } ,
options : [
{
name : 'customFieldValues' ,
displayName : 'Custom Field' ,
values : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Field Name or ID' ,
2020-10-01 22:31:41 -07:00
name : 'id' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getTeamFields' ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'ID of the field to set. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-10-01 22:31:41 -07:00
} ,
{
displayName : 'Field Value' ,
name : 'value' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Value of the field to set' ,
2020-10-01 22:31:41 -07:00
} ,
{
displayName : 'Alt' ,
name : 'alt' ,
type : 'string' ,
default : '' ,
} ,
] ,
} ,
] ,
} ,
{
displayName : 'Email' ,
name : 'email' ,
type : 'string' ,
2022-06-20 07:54:01 -07:00
placeholder : 'name@email.com' ,
2020-10-01 22:31:41 -07:00
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'This field can only be changed by admins for users on paid teams' ,
2020-10-01 22:31:41 -07:00
} ,
{
displayName : 'First Name' ,
name : 'first_name' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Last Name' ,
name : 'last_name' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Status Emoji' ,
name : 'status_emoji' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Is a string referencing an emoji enabled for the Slack team, such as :mountain_railway:' ,
2020-10-01 22:31:41 -07:00
} ,
{
displayName : 'Status Expiration' ,
name : 'status_expiration' ,
type : 'dateTime' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Is an integer specifying seconds since the epoch, more commonly known as "UNIX time". Providing 0 or omitting this field results in a custom status that will not expire.' ,
2020-10-01 22:31:41 -07:00
} ,
{
displayName : 'Status Text' ,
name : 'status_text' ,
type : 'string' ,
default : '' ,
2022-06-03 10:23:49 -07:00
description : 'Allows up to 100 characters, though we strongly encourage brevity' ,
2020-10-01 22:31:41 -07:00
} ,
{
displayName : 'User ID' ,
name : 'user' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'ID of user to change. This argument may only be specified by team admins on paid teams.' ,
2020-10-01 22:31:41 -07:00
} ,
] ,
} ,
2020-12-13 01:47:52 -08:00
/* -------------------------------------------------------------------------- */
/* userProfile:get */
/* -------------------------------------------------------------------------- */
2020-10-01 22:31:41 -07:00
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'userProfile' ] ,
operation : [ 'get' ] ,
2020-10-01 22:31:41 -07:00
} ,
} ,
options : [
{
displayName : 'Include Labels' ,
name : 'include_labels' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether to include labels for each ID in custom profile fields' ,
2020-10-01 22:31:41 -07:00
} ,
{
displayName : 'User ID' ,
name : 'user' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'User to retrieve profile info for' ,
2020-10-01 22:31:41 -07:00
} ,
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;