2022-08-17 08:50:24 -07:00
import { INodeProperties } from 'n8n-workflow' ;
2021-09-05 06:13:25 -07:00
2021-12-03 00:44:16 -08:00
export const organizationOperations : INodeProperties [ ] = [
2021-09-05 06:13:25 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2021-09-05 06:13:25 -07:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'organization' ] ,
2021-09-05 06:13:25 -07:00
} ,
} ,
options : [
2022-06-03 10:23:49 -07:00
{
name : 'Count' ,
value : 'count' ,
description : 'Count organizations' ,
2022-07-10 13:50:51 -07:00
action : 'Count organizations' ,
2022-06-03 10:23:49 -07:00
} ,
2021-09-05 06:13:25 -07:00
{
name : 'Create' ,
value : 'create' ,
description : 'Create an organization' ,
2022-07-10 13:50:51 -07:00
action : 'Create an organization' ,
2021-09-05 06:13:25 -07:00
} ,
{
name : 'Delete' ,
value : 'delete' ,
description : 'Delete an organization' ,
2022-07-10 13:50:51 -07:00
action : 'Delete an organization' ,
2021-09-05 06:13:25 -07:00
} ,
{
name : 'Get' ,
value : 'get' ,
description : 'Get an organization' ,
2022-07-10 13:50:51 -07:00
action : 'Get an organization' ,
2021-09-05 06:13:25 -07:00
} ,
{
name : 'Get All' ,
value : 'getAll' ,
description : 'Get all organizations' ,
2022-07-10 13:50:51 -07:00
action : 'Get all organizations' ,
2021-09-05 06:13:25 -07:00
} ,
{
name : 'Get Related Data' ,
value : 'getRelatedData' ,
description : 'Get data related to the organization' ,
2022-07-10 13:50:51 -07:00
action : 'Get data related to an organization' ,
2021-09-05 06:13:25 -07:00
} ,
{
name : 'Update' ,
value : 'update' ,
description : 'Update a organization' ,
2022-07-10 13:50:51 -07:00
action : 'Update an organization' ,
2021-09-05 06:13:25 -07:00
} ,
] ,
default : 'create' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2021-09-05 06:13:25 -07:00
2021-12-03 00:44:16 -08:00
export const organizationFields : INodeProperties [ ] = [
2022-08-17 08:50:24 -07:00
/* -------------------------------------------------------------------------- */
/* organization:create */
/* -------------------------------------------------------------------------- */
2021-09-05 06:13:25 -07:00
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'organization' ] ,
operation : [ 'create' ] ,
2021-09-05 06:13:25 -07:00
} ,
} ,
required : true ,
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'organization' ] ,
operation : [ 'create' ] ,
2021-09-05 06:13:25 -07:00
} ,
} ,
options : [
{
displayName : 'Details' ,
name : 'details' ,
type : 'string' ,
default : '' ,
description : 'Details obout the organization, such as the address' ,
} ,
{
displayName : 'Domain Names' ,
name : 'domain_names' ,
type : 'string' ,
default : '' ,
description : 'Comma-separated domain names associated with this organization' ,
} ,
{
displayName : 'Notes' ,
name : 'notes' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Organization Fields' ,
name : 'organizationFieldsUi' ,
placeholder : 'Add Organization Field' ,
2022-08-17 08:50:24 -07:00
description : "Values of custom fields in the organization's profile" ,
2021-09-05 06:13:25 -07:00
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
} ,
default : { } ,
options : [
{
name : 'organizationFieldValues' ,
displayName : 'Field' ,
values : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Field Name or ID' ,
2021-09-05 06:13:25 -07:00
name : 'field' ,
type : 'options' ,
2022-08-17 08:50:24 -07:00
description :
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2021-09-05 06:13:25 -07:00
typeOptions : {
loadOptionsMethod : 'getOrganizationFields' ,
} ,
default : '' ,
} ,
{
displayName : 'Value' ,
name : 'value' ,
type : 'string' ,
default : '' ,
} ,
] ,
} ,
] ,
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Tag Names or IDs' ,
2021-09-05 06:13:25 -07:00
name : 'tags' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getTags' ,
} ,
default : [ ] ,
2022-08-17 08:50:24 -07:00
description :
'IDs of tags applied to this organization. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-09-05 06:13:25 -07:00
} ,
] ,
} ,
2022-08-17 08:50:24 -07:00
/* -------------------------------------------------------------------------- */
/* organization:update */
/* -------------------------------------------------------------------------- */
2021-09-05 06:13:25 -07:00
{
displayName : 'Organization ID' ,
name : 'id' ,
type : 'string' ,
default : '' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'organization' ] ,
operation : [ 'update' ] ,
2021-09-05 06:13:25 -07:00
} ,
} ,
} ,
{
displayName : 'Update Fields' ,
name : 'updateFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'organization' ] ,
operation : [ 'update' ] ,
2021-09-05 06:13:25 -07:00
} ,
} ,
options : [
{
displayName : 'Details' ,
name : 'details' ,
type : 'string' ,
default : '' ,
description : 'Details obout the organization, such as the address' ,
} ,
{
displayName : 'Domain Names' ,
name : 'domain_names' ,
type : 'string' ,
default : '' ,
description : 'Comma-separated domain names associated with this organization' ,
} ,
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Notes' ,
name : 'notes' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Organization Fields' ,
name : 'organizationFieldsUi' ,
placeholder : 'Add Organization Field' ,
2022-08-17 08:50:24 -07:00
description : "Values of custom fields in the organization's profile" ,
2021-09-05 06:13:25 -07:00
type : 'fixedCollection' ,
typeOptions : {
multipleValues : true ,
} ,
default : { } ,
options : [
{
name : 'organizationFieldValues' ,
displayName : 'Field' ,
values : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Field Name or ID' ,
2021-09-05 06:13:25 -07:00
name : 'field' ,
type : 'options' ,
2022-08-17 08:50:24 -07:00
description :
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2021-09-05 06:13:25 -07:00
typeOptions : {
loadOptionsMethod : 'getOrganizationFields' ,
} ,
default : '' ,
} ,
{
displayName : 'Value' ,
name : 'value' ,
type : 'string' ,
default : '' ,
} ,
] ,
} ,
] ,
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Tag Names or IDs' ,
2021-09-05 06:13:25 -07:00
name : 'tags' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getTags' ,
} ,
default : [ ] ,
2022-08-17 08:50:24 -07:00
description :
'IDs of tags applied to this organization. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-09-05 06:13:25 -07:00
} ,
] ,
} ,
2022-08-17 08:50:24 -07:00
/* -------------------------------------------------------------------------- */
/* organization:get */
/* -------------------------------------------------------------------------- */
2021-09-05 06:13:25 -07:00
{
displayName : 'Organization ID' ,
name : 'id' ,
type : 'string' ,
default : '' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'organization' ] ,
operation : [ 'get' ] ,
2021-09-05 06:13:25 -07:00
} ,
} ,
} ,
2022-08-17 08:50:24 -07:00
/* -------------------------------------------------------------------------- */
/* organization:getAll */
/* -------------------------------------------------------------------------- */
2021-09-05 06:13:25 -07:00
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'organization' ] ,
operation : [ 'getAll' ] ,
2021-09-05 06:13:25 -07:00
} ,
} ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2021-09-05 06:13:25 -07:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'organization' ] ,
operation : [ 'getAll' ] ,
returnAll : [ false ] ,
2021-09-05 06:13:25 -07:00
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 100 ,
} ,
default : 100 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2021-09-05 06:13:25 -07:00
} ,
2022-08-17 08:50:24 -07:00
/* -------------------------------------------------------------------------- */
/* organization:delete */
/* -------------------------------------------------------------------------- */
2021-09-05 06:13:25 -07:00
{
displayName : 'Organization ID' ,
name : 'id' ,
type : 'string' ,
default : '' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'organization' ] ,
operation : [ 'delete' ] ,
2021-09-05 06:13:25 -07:00
} ,
} ,
} ,
2022-08-17 08:50:24 -07:00
/* -------------------------------------------------------------------------- */
/* organization:getRelatedData */
/* -------------------------------------------------------------------------- */
2021-09-05 06:13:25 -07:00
{
displayName : 'Organization ID' ,
name : 'id' ,
type : 'string' ,
default : '' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'organization' ] ,
operation : [ 'getRelatedData' ] ,
2021-09-05 06:13:25 -07:00
} ,
} ,
} ,
2021-12-03 00:44:16 -08:00
] ;