mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-10 22:54:05 -08:00
65820b3b54
* ✨ Create Freshservice node * 👕 Fix lintings * ⚡ Adjust from agent to department * ⚡ Adjust from location to ticket * 👕 Fix lintings * ✏️ Improve descriptions * 🔥 Remove logging * 🔥 Remove unused helper * ✏️ Fix helper documentation * ⚡ Simplify roles in agent:create * 🔥 Remove logging * ⚡ Minor improvements * ✏️ Adjust dynamic lists descriptions * ⚡ Set default values for problem:create * ⚡ Set default values for change:create * ⚡ Handle deletion with empty response * ⚡ Update getCredentials call to new style * ✏️ Reword multiOptions descriptions * ⚡ Add special handling for validation errors * 🔥 Remove concatenated name from filters * ⚡ Fix additional params in announcement:create * ✏️ Clarify asset display ID vs asset ID * ⚡ Fix asset:update arg typo * ⚡ Fix predefined filters in change:getAll * ⚡ Fix software status options * ✏️ Reword created_at in ticket:getAll * ⚡ Add status to ticket:update * 👕 Fix lint * ⚡ Improvements * ⚡ Minor improvements Co-authored-by: ricardo <ricardoespinoza105@gmail.com> Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
327 lines
5.6 KiB
TypeScript
327 lines
5.6 KiB
TypeScript
import {
|
|
INodeProperties,
|
|
} from 'n8n-workflow';
|
|
|
|
export const locationOperations = [
|
|
{
|
|
displayName: 'Operation',
|
|
name: 'operation',
|
|
type: 'options',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'location',
|
|
],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
name: 'Create',
|
|
value: 'create',
|
|
description: 'Create a location',
|
|
},
|
|
{
|
|
name: 'Delete',
|
|
value: 'delete',
|
|
description: 'Delete a location',
|
|
},
|
|
{
|
|
name: 'Get',
|
|
value: 'get',
|
|
description: 'Retrieve a location',
|
|
},
|
|
{
|
|
name: 'Get All',
|
|
value: 'getAll',
|
|
description: 'Retrieve all locations',
|
|
},
|
|
{
|
|
name: 'Update',
|
|
value: 'update',
|
|
description: 'Update a location',
|
|
},
|
|
],
|
|
default: 'create',
|
|
},
|
|
] as INodeProperties[];
|
|
|
|
export const locationFields = [
|
|
// ----------------------------------------
|
|
// location: create
|
|
// ----------------------------------------
|
|
{
|
|
displayName: 'Name',
|
|
name: 'name',
|
|
description: 'Name of the location',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'location',
|
|
],
|
|
operation: [
|
|
'create',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Additional Fields',
|
|
name: 'additionalFields',
|
|
type: 'collection',
|
|
placeholder: 'Add Field',
|
|
default: {},
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'location',
|
|
],
|
|
operation: [
|
|
'create',
|
|
],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Address',
|
|
name: 'address',
|
|
placeholder: 'Add Address Fields',
|
|
type: 'fixedCollection',
|
|
default: {},
|
|
options: [
|
|
{
|
|
displayName: 'Address Details',
|
|
name: 'addressFields',
|
|
values: [
|
|
{
|
|
displayName: 'Line 1',
|
|
name: 'line1',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Line 2',
|
|
name: 'line2',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'City',
|
|
name: 'city',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Country',
|
|
name: 'country',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'State',
|
|
name: 'state',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Zip Code',
|
|
name: 'zipcode',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
|
|
// ----------------------------------------
|
|
// location: delete
|
|
// ----------------------------------------
|
|
{
|
|
displayName: 'Location ID',
|
|
name: 'locationId',
|
|
description: 'ID of the location to delete',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'location',
|
|
],
|
|
operation: [
|
|
'delete',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
|
|
// ----------------------------------------
|
|
// location: get
|
|
// ----------------------------------------
|
|
{
|
|
displayName: 'Location ID',
|
|
name: 'locationId',
|
|
description: 'ID of the location to retrieve',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'location',
|
|
],
|
|
operation: [
|
|
'get',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
|
|
// ----------------------------------------
|
|
// location: getAll
|
|
// ----------------------------------------
|
|
{
|
|
displayName: 'Return All',
|
|
name: 'returnAll',
|
|
type: 'boolean',
|
|
default: false,
|
|
description: 'Whether to return all results or only up to a given limit',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'location',
|
|
],
|
|
operation: [
|
|
'getAll',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Limit',
|
|
name: 'limit',
|
|
type: 'number',
|
|
default: 50,
|
|
description: 'How many results to return',
|
|
typeOptions: {
|
|
minValue: 1,
|
|
},
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'location',
|
|
],
|
|
operation: [
|
|
'getAll',
|
|
],
|
|
returnAll: [
|
|
false,
|
|
],
|
|
},
|
|
},
|
|
},
|
|
|
|
// ----------------------------------------
|
|
// location: update
|
|
// ----------------------------------------
|
|
{
|
|
displayName: 'Location ID',
|
|
name: 'locationId',
|
|
description: 'ID of the location to update',
|
|
type: 'string',
|
|
required: true,
|
|
default: '',
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'location',
|
|
],
|
|
operation: [
|
|
'update',
|
|
],
|
|
},
|
|
},
|
|
},
|
|
{
|
|
displayName: 'Update Fields',
|
|
name: 'updateFields',
|
|
type: 'collection',
|
|
placeholder: 'Add Field',
|
|
default: {},
|
|
displayOptions: {
|
|
show: {
|
|
resource: [
|
|
'location',
|
|
],
|
|
operation: [
|
|
'update',
|
|
],
|
|
},
|
|
},
|
|
options: [
|
|
{
|
|
displayName: 'Name',
|
|
name: 'name',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Address',
|
|
name: 'address',
|
|
placeholder: 'Add Address Fields',
|
|
type: 'fixedCollection',
|
|
default: {},
|
|
options: [
|
|
{
|
|
displayName: 'Address Details',
|
|
name: 'addressFields',
|
|
values: [
|
|
{
|
|
displayName: 'Line 1',
|
|
name: 'line1',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Line 2',
|
|
name: 'line2',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'City',
|
|
name: 'city',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Country',
|
|
name: 'country',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'State',
|
|
name: 'state',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
{
|
|
displayName: 'Zip Code',
|
|
name: 'zipcode',
|
|
type: 'string',
|
|
default: '',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
] as INodeProperties[];
|