2023-01-27 03:22:44 -08:00
import type { INodeProperties } from 'n8n-workflow' ;
2020-02-25 11:50:42 -08:00
2021-12-03 00:44:16 -08:00
export const organizationOperations : INodeProperties [ ] = [
2020-02-25 11:50:42 -08:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-02-25 11:50:42 -08:00
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'organization' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
2020-03-08 14:16:06 -07:00
description : 'Create an organization' ,
2022-07-10 13:50:51 -07:00
action : 'Create an organization' ,
2020-02-25 11:50:42 -08:00
} ,
{
name : 'Delete' ,
value : 'delete' ,
2020-03-08 14:16:06 -07:00
description : 'Delete an organization' ,
2022-07-10 13:50:51 -07:00
action : 'Delete an organization' ,
2020-02-25 11:50:42 -08:00
} ,
{
name : 'Get' ,
value : 'get' ,
2020-03-08 14:16:06 -07:00
description : 'Get an organization' ,
2022-07-10 13:50:51 -07:00
action : 'Get an organization' ,
2020-02-25 11:50:42 -08:00
} ,
{
2022-09-07 07:51:14 -07:00
name : 'Get Many' ,
2020-02-25 11:50:42 -08:00
value : 'getAll' ,
2022-09-13 03:36:36 -07:00
description : 'Get many organizations' ,
2022-09-08 08:10:13 -07:00
action : 'Get many organizations' ,
2020-02-25 11:50:42 -08:00
} ,
{
name : 'Update' ,
value : 'update' ,
2020-03-08 14:16:06 -07:00
description : 'Update an organization' ,
2022-07-10 13:50:51 -07:00
action : 'Update an organization' ,
2020-02-25 11:50:42 -08:00
} ,
] ,
default : 'create' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-02-25 11:50:42 -08:00
2021-12-03 00:44:16 -08:00
export const organizationFields : INodeProperties [ ] = [
2021-01-30 09:47:27 -08:00
/* -------------------------------------------------------------------------- */
/* organization:create */
/* -------------------------------------------------------------------------- */
2020-02-25 11:50:42 -08:00
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'organization' ] ,
operation : [ 'create' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The name of the organization' ,
2020-02-25 11:50:42 -08:00
} ,
{
displayName : 'Domain' ,
name : 'domain' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'organization' ] ,
operation : [ 'create' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'The domain name of the organization' ,
2020-02-25 11:50:42 -08:00
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'organization' ] ,
operation : [ 'create' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
options : [
{
2022-06-20 07:54:01 -07:00
displayName : 'Person Names or IDs' ,
2020-02-25 11:50:42 -08:00
name : 'persons' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getPersons' ,
} ,
default : [ ] ,
2022-08-01 13:47:55 -07:00
description :
'Persons that the new organization will be associated with. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-02-25 11:50:42 -08:00
} ,
] ,
} ,
2021-01-30 09:47:27 -08:00
/* -------------------------------------------------------------------------- */
/* organization:update */
/* -------------------------------------------------------------------------- */
2020-02-25 11:50:42 -08:00
{
displayName : 'Organization ID' ,
name : 'organizationId' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'organization' ] ,
operation : [ 'update' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Unique identifier for the organization' ,
2020-02-25 11:50:42 -08:00
} ,
{
displayName : 'Update Fields' ,
name : 'updateFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'organization' ] ,
operation : [ 'update' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
options : [
{
displayName : 'Domain' ,
name : 'domain' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The domain name of the organization' ,
2020-02-25 11:50:42 -08:00
} ,
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'The name of the organization' ,
2020-02-25 11:50:42 -08:00
} ,
{
2022-06-20 07:54:01 -07:00
displayName : 'Person Names or IDs' ,
2020-02-25 11:50:42 -08:00
name : 'persons' ,
type : 'multiOptions' ,
typeOptions : {
loadOptionsMethod : 'getPersons' ,
} ,
default : [ ] ,
2022-08-01 13:47:55 -07:00
description :
'Persons that the new organization will be associated with. Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-02-25 11:50:42 -08:00
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-25 11:50:42 -08:00
} ,
2021-01-30 09:47:27 -08:00
/* -------------------------------------------------------------------------- */
/* organization:get */
/* -------------------------------------------------------------------------- */
2020-02-25 11:50:42 -08:00
{
displayName : 'Organization ID' ,
name : 'organizationId' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'organization' ] ,
operation : [ 'get' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Unique identifier for the organization' ,
2020-02-25 11:50:42 -08:00
} ,
{
displayName : 'Options' ,
name : 'options' ,
type : 'collection' ,
2024-07-29 05:27:23 -07:00
placeholder : 'Add option' ,
2020-02-25 11:50:42 -08:00
default : { } ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'organization' ] ,
operation : [ 'get' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
options : [
{
displayName : 'With Interaction Dates' ,
name : 'withInteractionDates' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether interaction dates will be present on the returned resources' ,
2020-02-25 11:50:42 -08:00
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-25 11:50:42 -08:00
} ,
2021-01-30 09:47:27 -08:00
/* -------------------------------------------------------------------------- */
/* organization:getAll */
/* -------------------------------------------------------------------------- */
2020-02-25 11:50:42 -08:00
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'organization' ] ,
operation : [ 'getAll' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2020-02-25 11:50:42 -08:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'organization' ] ,
operation : [ 'getAll' ] ,
returnAll : [ false ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 10 ,
} ,
default : 5 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-02-25 11:50:42 -08:00
} ,
{
displayName : 'Options' ,
name : 'options' ,
type : 'collection' ,
2024-07-29 05:27:23 -07:00
placeholder : 'Add option' ,
2020-02-25 11:50:42 -08:00
default : { } ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'organization' ] ,
operation : [ 'getAll' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
options : [
{
displayName : 'Term' ,
name : 'term' ,
type : 'string' ,
default : '' ,
2022-08-01 13:47:55 -07:00
description :
'A string used to search all the organizations in your team’ s address book. This could be an email address, a first name or a last name.' ,
2020-02-25 11:50:42 -08:00
} ,
{
displayName : 'With Interaction Dates' ,
name : 'withInteractionDates' ,
type : 'boolean' ,
default : false ,
2022-06-20 07:54:01 -07:00
description : 'Whether interaction dates will be present on the returned resources' ,
2020-02-25 11:50:42 -08:00
} ,
2020-10-22 06:46:03 -07:00
] ,
2020-02-25 11:50:42 -08:00
} ,
2021-01-30 09:47:27 -08:00
/* -------------------------------------------------------------------------- */
/* organization:delete */
/* -------------------------------------------------------------------------- */
2020-02-25 11:50:42 -08:00
{
displayName : 'Organization ID' ,
name : 'organizationId' ,
type : 'string' ,
required : true ,
default : '' ,
displayOptions : {
show : {
2022-08-01 13:47:55 -07:00
resource : [ 'organization' ] ,
operation : [ 'delete' ] ,
2020-02-25 11:50:42 -08:00
} ,
} ,
2022-05-06 14:01:25 -07:00
description : 'Unique identifier for the organization' ,
2020-02-25 11:50:42 -08:00
} ,
2021-12-03 00:44:16 -08:00
] ;