:sparkles: Add Onfleet Node & Trigger (#2845)
* feat: added Onfleet nodes
Added Onfleet nodes for working with different endpoints like:
organizations, administrators, workers, hubs, teams, destinations, recipients,
containers and webhooks.
* style: fixed typos, arrays uniformity, unnecesary files
* refactor: changed add to create in comments and labels
* feat: added name field to onfleet trigger node
* feat: added team endpoints to onfleet node
Added team auto-dispatch and driver time estimate endpoints to Onfleet
node
* style: remove dots in descriptions and fixed some typos
* feat: added fixes according to comments made on the n8n PR
added new fixed collections, refactored the code according to comments
made on the n8n pr
* fix: fixed recipient and destination cretion
* docs: added docstrings for format some functions
added docstrings for new functions addded for formatting the destination
and recipient objects
* style: formatting the code according to n8n nodelinter
* fix: typos and better descriptions
* [INT-510] n8n: Address additional problems from n8n code review (#5)
* Fixed some error creating a worker, moving some fields under additional fields collection
* Fixed returned values for delete operations, making some changes for style code
* Added operational error since required property is not working for dateTime fields
* :zap: Improvements to #2593
* :zap: Improvements
* :bug: Fix issue with wrong interface
* :zap: Improvements
* :zap: Improvements
* :zap: Minor improvement
Co-authored-by: Santiago Botero Ruiz <santiago.botero@devsavant.ai>
Co-authored-by: ilsemaj <james.li.upenn@gmail.com>
Co-authored-by: Santiago Botero Ruiz <39206812+YokySantiago@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2022-02-28 00:48:17 -08:00
|
|
|
import {
|
|
|
|
ICredentialsDecrypted,
|
|
|
|
ICredentialTestFunctions,
|
|
|
|
IDataObject,
|
|
|
|
INodeCredentialTestResult,
|
|
|
|
INodeExecutionData,
|
|
|
|
INodeType,
|
|
|
|
INodeTypeDescription,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
2022-08-17 08:50:24 -07:00
|
|
|
import { taskFields, taskOperations } from './descriptions/TaskDescription';
|
:sparkles: Add Onfleet Node & Trigger (#2845)
* feat: added Onfleet nodes
Added Onfleet nodes for working with different endpoints like:
organizations, administrators, workers, hubs, teams, destinations, recipients,
containers and webhooks.
* style: fixed typos, arrays uniformity, unnecesary files
* refactor: changed add to create in comments and labels
* feat: added name field to onfleet trigger node
* feat: added team endpoints to onfleet node
Added team auto-dispatch and driver time estimate endpoints to Onfleet
node
* style: remove dots in descriptions and fixed some typos
* feat: added fixes according to comments made on the n8n PR
added new fixed collections, refactored the code according to comments
made on the n8n pr
* fix: fixed recipient and destination cretion
* docs: added docstrings for format some functions
added docstrings for new functions addded for formatting the destination
and recipient objects
* style: formatting the code according to n8n nodelinter
* fix: typos and better descriptions
* [INT-510] n8n: Address additional problems from n8n code review (#5)
* Fixed some error creating a worker, moving some fields under additional fields collection
* Fixed returned values for delete operations, making some changes for style code
* Added operational error since required property is not working for dateTime fields
* :zap: Improvements to #2593
* :zap: Improvements
* :bug: Fix issue with wrong interface
* :zap: Improvements
* :zap: Improvements
* :zap: Minor improvement
Co-authored-by: Santiago Botero Ruiz <santiago.botero@devsavant.ai>
Co-authored-by: ilsemaj <james.li.upenn@gmail.com>
Co-authored-by: Santiago Botero Ruiz <39206812+YokySantiago@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2022-02-28 00:48:17 -08:00
|
|
|
|
2022-08-17 08:50:24 -07:00
|
|
|
import { IExecuteFunctions } from 'n8n-core';
|
:sparkles: Add Onfleet Node & Trigger (#2845)
* feat: added Onfleet nodes
Added Onfleet nodes for working with different endpoints like:
organizations, administrators, workers, hubs, teams, destinations, recipients,
containers and webhooks.
* style: fixed typos, arrays uniformity, unnecesary files
* refactor: changed add to create in comments and labels
* feat: added name field to onfleet trigger node
* feat: added team endpoints to onfleet node
Added team auto-dispatch and driver time estimate endpoints to Onfleet
node
* style: remove dots in descriptions and fixed some typos
* feat: added fixes according to comments made on the n8n PR
added new fixed collections, refactored the code according to comments
made on the n8n pr
* fix: fixed recipient and destination cretion
* docs: added docstrings for format some functions
added docstrings for new functions addded for formatting the destination
and recipient objects
* style: formatting the code according to n8n nodelinter
* fix: typos and better descriptions
* [INT-510] n8n: Address additional problems from n8n code review (#5)
* Fixed some error creating a worker, moving some fields under additional fields collection
* Fixed returned values for delete operations, making some changes for style code
* Added operational error since required property is not working for dateTime fields
* :zap: Improvements to #2593
* :zap: Improvements
* :bug: Fix issue with wrong interface
* :zap: Improvements
* :zap: Improvements
* :zap: Minor improvement
Co-authored-by: Santiago Botero Ruiz <santiago.botero@devsavant.ai>
Co-authored-by: ilsemaj <james.li.upenn@gmail.com>
Co-authored-by: Santiago Botero Ruiz <39206812+YokySantiago@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2022-02-28 00:48:17 -08:00
|
|
|
|
2022-08-17 08:50:24 -07:00
|
|
|
import { destinationFields, destinationOperations } from './descriptions/DestinationDescription';
|
:sparkles: Add Onfleet Node & Trigger (#2845)
* feat: added Onfleet nodes
Added Onfleet nodes for working with different endpoints like:
organizations, administrators, workers, hubs, teams, destinations, recipients,
containers and webhooks.
* style: fixed typos, arrays uniformity, unnecesary files
* refactor: changed add to create in comments and labels
* feat: added name field to onfleet trigger node
* feat: added team endpoints to onfleet node
Added team auto-dispatch and driver time estimate endpoints to Onfleet
node
* style: remove dots in descriptions and fixed some typos
* feat: added fixes according to comments made on the n8n PR
added new fixed collections, refactored the code according to comments
made on the n8n pr
* fix: fixed recipient and destination cretion
* docs: added docstrings for format some functions
added docstrings for new functions addded for formatting the destination
and recipient objects
* style: formatting the code according to n8n nodelinter
* fix: typos and better descriptions
* [INT-510] n8n: Address additional problems from n8n code review (#5)
* Fixed some error creating a worker, moving some fields under additional fields collection
* Fixed returned values for delete operations, making some changes for style code
* Added operational error since required property is not working for dateTime fields
* :zap: Improvements to #2593
* :zap: Improvements
* :bug: Fix issue with wrong interface
* :zap: Improvements
* :zap: Improvements
* :zap: Minor improvement
Co-authored-by: Santiago Botero Ruiz <santiago.botero@devsavant.ai>
Co-authored-by: ilsemaj <james.li.upenn@gmail.com>
Co-authored-by: Santiago Botero Ruiz <39206812+YokySantiago@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2022-02-28 00:48:17 -08:00
|
|
|
|
2022-08-17 08:50:24 -07:00
|
|
|
import { resourceLoaders } from './GenericFunctions';
|
:sparkles: Add Onfleet Node & Trigger (#2845)
* feat: added Onfleet nodes
Added Onfleet nodes for working with different endpoints like:
organizations, administrators, workers, hubs, teams, destinations, recipients,
containers and webhooks.
* style: fixed typos, arrays uniformity, unnecesary files
* refactor: changed add to create in comments and labels
* feat: added name field to onfleet trigger node
* feat: added team endpoints to onfleet node
Added team auto-dispatch and driver time estimate endpoints to Onfleet
node
* style: remove dots in descriptions and fixed some typos
* feat: added fixes according to comments made on the n8n PR
added new fixed collections, refactored the code according to comments
made on the n8n pr
* fix: fixed recipient and destination cretion
* docs: added docstrings for format some functions
added docstrings for new functions addded for formatting the destination
and recipient objects
* style: formatting the code according to n8n nodelinter
* fix: typos and better descriptions
* [INT-510] n8n: Address additional problems from n8n code review (#5)
* Fixed some error creating a worker, moving some fields under additional fields collection
* Fixed returned values for delete operations, making some changes for style code
* Added operational error since required property is not working for dateTime fields
* :zap: Improvements to #2593
* :zap: Improvements
* :bug: Fix issue with wrong interface
* :zap: Improvements
* :zap: Improvements
* :zap: Minor improvement
Co-authored-by: Santiago Botero Ruiz <santiago.botero@devsavant.ai>
Co-authored-by: ilsemaj <james.li.upenn@gmail.com>
Co-authored-by: Santiago Botero Ruiz <39206812+YokySantiago@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2022-02-28 00:48:17 -08:00
|
|
|
|
2022-08-17 08:50:24 -07:00
|
|
|
import { recipientFields, recipientOperations } from './descriptions/RecipientDescription';
|
:sparkles: Add Onfleet Node & Trigger (#2845)
* feat: added Onfleet nodes
Added Onfleet nodes for working with different endpoints like:
organizations, administrators, workers, hubs, teams, destinations, recipients,
containers and webhooks.
* style: fixed typos, arrays uniformity, unnecesary files
* refactor: changed add to create in comments and labels
* feat: added name field to onfleet trigger node
* feat: added team endpoints to onfleet node
Added team auto-dispatch and driver time estimate endpoints to Onfleet
node
* style: remove dots in descriptions and fixed some typos
* feat: added fixes according to comments made on the n8n PR
added new fixed collections, refactored the code according to comments
made on the n8n pr
* fix: fixed recipient and destination cretion
* docs: added docstrings for format some functions
added docstrings for new functions addded for formatting the destination
and recipient objects
* style: formatting the code according to n8n nodelinter
* fix: typos and better descriptions
* [INT-510] n8n: Address additional problems from n8n code review (#5)
* Fixed some error creating a worker, moving some fields under additional fields collection
* Fixed returned values for delete operations, making some changes for style code
* Added operational error since required property is not working for dateTime fields
* :zap: Improvements to #2593
* :zap: Improvements
* :bug: Fix issue with wrong interface
* :zap: Improvements
* :zap: Improvements
* :zap: Minor improvement
Co-authored-by: Santiago Botero Ruiz <santiago.botero@devsavant.ai>
Co-authored-by: ilsemaj <james.li.upenn@gmail.com>
Co-authored-by: Santiago Botero Ruiz <39206812+YokySantiago@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2022-02-28 00:48:17 -08:00
|
|
|
|
2022-08-17 08:50:24 -07:00
|
|
|
import { organizationFields, organizationOperations } from './descriptions/OrganizationDescription';
|
:sparkles: Add Onfleet Node & Trigger (#2845)
* feat: added Onfleet nodes
Added Onfleet nodes for working with different endpoints like:
organizations, administrators, workers, hubs, teams, destinations, recipients,
containers and webhooks.
* style: fixed typos, arrays uniformity, unnecesary files
* refactor: changed add to create in comments and labels
* feat: added name field to onfleet trigger node
* feat: added team endpoints to onfleet node
Added team auto-dispatch and driver time estimate endpoints to Onfleet
node
* style: remove dots in descriptions and fixed some typos
* feat: added fixes according to comments made on the n8n PR
added new fixed collections, refactored the code according to comments
made on the n8n pr
* fix: fixed recipient and destination cretion
* docs: added docstrings for format some functions
added docstrings for new functions addded for formatting the destination
and recipient objects
* style: formatting the code according to n8n nodelinter
* fix: typos and better descriptions
* [INT-510] n8n: Address additional problems from n8n code review (#5)
* Fixed some error creating a worker, moving some fields under additional fields collection
* Fixed returned values for delete operations, making some changes for style code
* Added operational error since required property is not working for dateTime fields
* :zap: Improvements to #2593
* :zap: Improvements
* :bug: Fix issue with wrong interface
* :zap: Improvements
* :zap: Improvements
* :zap: Minor improvement
Co-authored-by: Santiago Botero Ruiz <santiago.botero@devsavant.ai>
Co-authored-by: ilsemaj <james.li.upenn@gmail.com>
Co-authored-by: Santiago Botero Ruiz <39206812+YokySantiago@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2022-02-28 00:48:17 -08:00
|
|
|
|
2022-08-17 08:50:24 -07:00
|
|
|
import { adminFields, adminOperations } from './descriptions/AdministratorDescription';
|
:sparkles: Add Onfleet Node & Trigger (#2845)
* feat: added Onfleet nodes
Added Onfleet nodes for working with different endpoints like:
organizations, administrators, workers, hubs, teams, destinations, recipients,
containers and webhooks.
* style: fixed typos, arrays uniformity, unnecesary files
* refactor: changed add to create in comments and labels
* feat: added name field to onfleet trigger node
* feat: added team endpoints to onfleet node
Added team auto-dispatch and driver time estimate endpoints to Onfleet
node
* style: remove dots in descriptions and fixed some typos
* feat: added fixes according to comments made on the n8n PR
added new fixed collections, refactored the code according to comments
made on the n8n pr
* fix: fixed recipient and destination cretion
* docs: added docstrings for format some functions
added docstrings for new functions addded for formatting the destination
and recipient objects
* style: formatting the code according to n8n nodelinter
* fix: typos and better descriptions
* [INT-510] n8n: Address additional problems from n8n code review (#5)
* Fixed some error creating a worker, moving some fields under additional fields collection
* Fixed returned values for delete operations, making some changes for style code
* Added operational error since required property is not working for dateTime fields
* :zap: Improvements to #2593
* :zap: Improvements
* :bug: Fix issue with wrong interface
* :zap: Improvements
* :zap: Improvements
* :zap: Minor improvement
Co-authored-by: Santiago Botero Ruiz <santiago.botero@devsavant.ai>
Co-authored-by: ilsemaj <james.li.upenn@gmail.com>
Co-authored-by: Santiago Botero Ruiz <39206812+YokySantiago@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2022-02-28 00:48:17 -08:00
|
|
|
|
2022-08-17 08:50:24 -07:00
|
|
|
import { hubFields, hubOperations } from './descriptions/HubDescription';
|
:sparkles: Add Onfleet Node & Trigger (#2845)
* feat: added Onfleet nodes
Added Onfleet nodes for working with different endpoints like:
organizations, administrators, workers, hubs, teams, destinations, recipients,
containers and webhooks.
* style: fixed typos, arrays uniformity, unnecesary files
* refactor: changed add to create in comments and labels
* feat: added name field to onfleet trigger node
* feat: added team endpoints to onfleet node
Added team auto-dispatch and driver time estimate endpoints to Onfleet
node
* style: remove dots in descriptions and fixed some typos
* feat: added fixes according to comments made on the n8n PR
added new fixed collections, refactored the code according to comments
made on the n8n pr
* fix: fixed recipient and destination cretion
* docs: added docstrings for format some functions
added docstrings for new functions addded for formatting the destination
and recipient objects
* style: formatting the code according to n8n nodelinter
* fix: typos and better descriptions
* [INT-510] n8n: Address additional problems from n8n code review (#5)
* Fixed some error creating a worker, moving some fields under additional fields collection
* Fixed returned values for delete operations, making some changes for style code
* Added operational error since required property is not working for dateTime fields
* :zap: Improvements to #2593
* :zap: Improvements
* :bug: Fix issue with wrong interface
* :zap: Improvements
* :zap: Improvements
* :zap: Minor improvement
Co-authored-by: Santiago Botero Ruiz <santiago.botero@devsavant.ai>
Co-authored-by: ilsemaj <james.li.upenn@gmail.com>
Co-authored-by: Santiago Botero Ruiz <39206812+YokySantiago@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2022-02-28 00:48:17 -08:00
|
|
|
|
2022-08-17 08:50:24 -07:00
|
|
|
import { workerFields, workerOperations } from './descriptions/WorkerDescription';
|
:sparkles: Add Onfleet Node & Trigger (#2845)
* feat: added Onfleet nodes
Added Onfleet nodes for working with different endpoints like:
organizations, administrators, workers, hubs, teams, destinations, recipients,
containers and webhooks.
* style: fixed typos, arrays uniformity, unnecesary files
* refactor: changed add to create in comments and labels
* feat: added name field to onfleet trigger node
* feat: added team endpoints to onfleet node
Added team auto-dispatch and driver time estimate endpoints to Onfleet
node
* style: remove dots in descriptions and fixed some typos
* feat: added fixes according to comments made on the n8n PR
added new fixed collections, refactored the code according to comments
made on the n8n pr
* fix: fixed recipient and destination cretion
* docs: added docstrings for format some functions
added docstrings for new functions addded for formatting the destination
and recipient objects
* style: formatting the code according to n8n nodelinter
* fix: typos and better descriptions
* [INT-510] n8n: Address additional problems from n8n code review (#5)
* Fixed some error creating a worker, moving some fields under additional fields collection
* Fixed returned values for delete operations, making some changes for style code
* Added operational error since required property is not working for dateTime fields
* :zap: Improvements to #2593
* :zap: Improvements
* :bug: Fix issue with wrong interface
* :zap: Improvements
* :zap: Improvements
* :zap: Minor improvement
Co-authored-by: Santiago Botero Ruiz <santiago.botero@devsavant.ai>
Co-authored-by: ilsemaj <james.li.upenn@gmail.com>
Co-authored-by: Santiago Botero Ruiz <39206812+YokySantiago@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2022-02-28 00:48:17 -08:00
|
|
|
|
|
|
|
// import {
|
|
|
|
// webhookFields,
|
|
|
|
// webhookOperations,
|
|
|
|
// } from './descriptions/WebhookDescription';
|
|
|
|
|
2022-08-17 08:50:24 -07:00
|
|
|
import { containerFields, containerOperations } from './descriptions/ContainerDescription';
|
:sparkles: Add Onfleet Node & Trigger (#2845)
* feat: added Onfleet nodes
Added Onfleet nodes for working with different endpoints like:
organizations, administrators, workers, hubs, teams, destinations, recipients,
containers and webhooks.
* style: fixed typos, arrays uniformity, unnecesary files
* refactor: changed add to create in comments and labels
* feat: added name field to onfleet trigger node
* feat: added team endpoints to onfleet node
Added team auto-dispatch and driver time estimate endpoints to Onfleet
node
* style: remove dots in descriptions and fixed some typos
* feat: added fixes according to comments made on the n8n PR
added new fixed collections, refactored the code according to comments
made on the n8n pr
* fix: fixed recipient and destination cretion
* docs: added docstrings for format some functions
added docstrings for new functions addded for formatting the destination
and recipient objects
* style: formatting the code according to n8n nodelinter
* fix: typos and better descriptions
* [INT-510] n8n: Address additional problems from n8n code review (#5)
* Fixed some error creating a worker, moving some fields under additional fields collection
* Fixed returned values for delete operations, making some changes for style code
* Added operational error since required property is not working for dateTime fields
* :zap: Improvements to #2593
* :zap: Improvements
* :bug: Fix issue with wrong interface
* :zap: Improvements
* :zap: Improvements
* :zap: Minor improvement
Co-authored-by: Santiago Botero Ruiz <santiago.botero@devsavant.ai>
Co-authored-by: ilsemaj <james.li.upenn@gmail.com>
Co-authored-by: Santiago Botero Ruiz <39206812+YokySantiago@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2022-02-28 00:48:17 -08:00
|
|
|
|
2022-08-17 08:50:24 -07:00
|
|
|
import { teamFields, teamOperations } from './descriptions/TeamDescription';
|
:sparkles: Add Onfleet Node & Trigger (#2845)
* feat: added Onfleet nodes
Added Onfleet nodes for working with different endpoints like:
organizations, administrators, workers, hubs, teams, destinations, recipients,
containers and webhooks.
* style: fixed typos, arrays uniformity, unnecesary files
* refactor: changed add to create in comments and labels
* feat: added name field to onfleet trigger node
* feat: added team endpoints to onfleet node
Added team auto-dispatch and driver time estimate endpoints to Onfleet
node
* style: remove dots in descriptions and fixed some typos
* feat: added fixes according to comments made on the n8n PR
added new fixed collections, refactored the code according to comments
made on the n8n pr
* fix: fixed recipient and destination cretion
* docs: added docstrings for format some functions
added docstrings for new functions addded for formatting the destination
and recipient objects
* style: formatting the code according to n8n nodelinter
* fix: typos and better descriptions
* [INT-510] n8n: Address additional problems from n8n code review (#5)
* Fixed some error creating a worker, moving some fields under additional fields collection
* Fixed returned values for delete operations, making some changes for style code
* Added operational error since required property is not working for dateTime fields
* :zap: Improvements to #2593
* :zap: Improvements
* :bug: Fix issue with wrong interface
* :zap: Improvements
* :zap: Improvements
* :zap: Minor improvement
Co-authored-by: Santiago Botero Ruiz <santiago.botero@devsavant.ai>
Co-authored-by: ilsemaj <james.li.upenn@gmail.com>
Co-authored-by: Santiago Botero Ruiz <39206812+YokySantiago@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2022-02-28 00:48:17 -08:00
|
|
|
|
2022-08-17 08:50:24 -07:00
|
|
|
import { OptionsWithUri } from 'request';
|
:sparkles: Add Onfleet Node & Trigger (#2845)
* feat: added Onfleet nodes
Added Onfleet nodes for working with different endpoints like:
organizations, administrators, workers, hubs, teams, destinations, recipients,
containers and webhooks.
* style: fixed typos, arrays uniformity, unnecesary files
* refactor: changed add to create in comments and labels
* feat: added name field to onfleet trigger node
* feat: added team endpoints to onfleet node
Added team auto-dispatch and driver time estimate endpoints to Onfleet
node
* style: remove dots in descriptions and fixed some typos
* feat: added fixes according to comments made on the n8n PR
added new fixed collections, refactored the code according to comments
made on the n8n pr
* fix: fixed recipient and destination cretion
* docs: added docstrings for format some functions
added docstrings for new functions addded for formatting the destination
and recipient objects
* style: formatting the code according to n8n nodelinter
* fix: typos and better descriptions
* [INT-510] n8n: Address additional problems from n8n code review (#5)
* Fixed some error creating a worker, moving some fields under additional fields collection
* Fixed returned values for delete operations, making some changes for style code
* Added operational error since required property is not working for dateTime fields
* :zap: Improvements to #2593
* :zap: Improvements
* :bug: Fix issue with wrong interface
* :zap: Improvements
* :zap: Improvements
* :zap: Minor improvement
Co-authored-by: Santiago Botero Ruiz <santiago.botero@devsavant.ai>
Co-authored-by: ilsemaj <james.li.upenn@gmail.com>
Co-authored-by: Santiago Botero Ruiz <39206812+YokySantiago@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2022-02-28 00:48:17 -08:00
|
|
|
|
|
|
|
import { Onfleet as OnfleetMethods } from './Onfleet';
|
|
|
|
export class Onfleet implements INodeType {
|
|
|
|
description: INodeTypeDescription = {
|
|
|
|
displayName: 'Onfleet',
|
|
|
|
name: 'onfleet',
|
|
|
|
icon: 'file:Onfleet.svg',
|
|
|
|
group: ['input'],
|
|
|
|
version: 1,
|
|
|
|
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
|
|
description: 'Consume Onfleet API',
|
|
|
|
defaults: {
|
|
|
|
name: 'Onfleet',
|
|
|
|
},
|
|
|
|
inputs: ['main'],
|
|
|
|
outputs: ['main'],
|
|
|
|
credentials: [
|
|
|
|
{
|
|
|
|
name: 'onfleetApi',
|
|
|
|
required: true,
|
|
|
|
testedBy: 'onfleetApiTest',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
properties: [
|
|
|
|
// List of option resources
|
|
|
|
{
|
|
|
|
displayName: 'Resource',
|
|
|
|
name: 'resource',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
:sparkles: Add Onfleet Node & Trigger (#2845)
* feat: added Onfleet nodes
Added Onfleet nodes for working with different endpoints like:
organizations, administrators, workers, hubs, teams, destinations, recipients,
containers and webhooks.
* style: fixed typos, arrays uniformity, unnecesary files
* refactor: changed add to create in comments and labels
* feat: added name field to onfleet trigger node
* feat: added team endpoints to onfleet node
Added team auto-dispatch and driver time estimate endpoints to Onfleet
node
* style: remove dots in descriptions and fixed some typos
* feat: added fixes according to comments made on the n8n PR
added new fixed collections, refactored the code according to comments
made on the n8n pr
* fix: fixed recipient and destination cretion
* docs: added docstrings for format some functions
added docstrings for new functions addded for formatting the destination
and recipient objects
* style: formatting the code according to n8n nodelinter
* fix: typos and better descriptions
* [INT-510] n8n: Address additional problems from n8n code review (#5)
* Fixed some error creating a worker, moving some fields under additional fields collection
* Fixed returned values for delete operations, making some changes for style code
* Added operational error since required property is not working for dateTime fields
* :zap: Improvements to #2593
* :zap: Improvements
* :bug: Fix issue with wrong interface
* :zap: Improvements
* :zap: Improvements
* :zap: Minor improvement
Co-authored-by: Santiago Botero Ruiz <santiago.botero@devsavant.ai>
Co-authored-by: ilsemaj <james.li.upenn@gmail.com>
Co-authored-by: Santiago Botero Ruiz <39206812+YokySantiago@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2022-02-28 00:48:17 -08:00
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Admin',
|
|
|
|
value: 'admin',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Container',
|
|
|
|
value: 'container',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Destination',
|
|
|
|
value: 'destination',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Hub',
|
|
|
|
value: 'hub',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Organization',
|
|
|
|
value: 'organization',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Recipient',
|
|
|
|
value: 'recipient',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Task',
|
|
|
|
value: 'task',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Team',
|
|
|
|
value: 'team',
|
|
|
|
},
|
|
|
|
// {
|
|
|
|
// name: 'Webhook',
|
|
|
|
// value: 'webhook',
|
|
|
|
// },
|
|
|
|
{
|
|
|
|
name: 'Worker',
|
|
|
|
value: 'worker',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'task',
|
|
|
|
description: 'The resource to perform operations on',
|
|
|
|
},
|
|
|
|
// Operations & fields
|
|
|
|
...adminOperations,
|
|
|
|
...adminFields,
|
|
|
|
...containerOperations,
|
|
|
|
...containerFields,
|
|
|
|
...destinationOperations,
|
|
|
|
...destinationFields,
|
|
|
|
...hubOperations,
|
|
|
|
...hubFields,
|
|
|
|
...organizationOperations,
|
|
|
|
...organizationFields,
|
|
|
|
...recipientOperations,
|
|
|
|
...recipientFields,
|
|
|
|
...taskOperations,
|
|
|
|
...taskFields,
|
|
|
|
...teamOperations,
|
|
|
|
...teamFields,
|
|
|
|
// ...webhookOperations,
|
|
|
|
// ...webhookFields,
|
|
|
|
...workerOperations,
|
|
|
|
...workerFields,
|
|
|
|
],
|
|
|
|
};
|
|
|
|
|
|
|
|
methods = {
|
|
|
|
credentialTest: {
|
2022-08-17 08:50:24 -07:00
|
|
|
async onfleetApiTest(
|
|
|
|
this: ICredentialTestFunctions,
|
|
|
|
credential: ICredentialsDecrypted,
|
|
|
|
): Promise<INodeCredentialTestResult> {
|
:sparkles: Add Onfleet Node & Trigger (#2845)
* feat: added Onfleet nodes
Added Onfleet nodes for working with different endpoints like:
organizations, administrators, workers, hubs, teams, destinations, recipients,
containers and webhooks.
* style: fixed typos, arrays uniformity, unnecesary files
* refactor: changed add to create in comments and labels
* feat: added name field to onfleet trigger node
* feat: added team endpoints to onfleet node
Added team auto-dispatch and driver time estimate endpoints to Onfleet
node
* style: remove dots in descriptions and fixed some typos
* feat: added fixes according to comments made on the n8n PR
added new fixed collections, refactored the code according to comments
made on the n8n pr
* fix: fixed recipient and destination cretion
* docs: added docstrings for format some functions
added docstrings for new functions addded for formatting the destination
and recipient objects
* style: formatting the code according to n8n nodelinter
* fix: typos and better descriptions
* [INT-510] n8n: Address additional problems from n8n code review (#5)
* Fixed some error creating a worker, moving some fields under additional fields collection
* Fixed returned values for delete operations, making some changes for style code
* Added operational error since required property is not working for dateTime fields
* :zap: Improvements to #2593
* :zap: Improvements
* :bug: Fix issue with wrong interface
* :zap: Improvements
* :zap: Improvements
* :zap: Minor improvement
Co-authored-by: Santiago Botero Ruiz <santiago.botero@devsavant.ai>
Co-authored-by: ilsemaj <james.li.upenn@gmail.com>
Co-authored-by: Santiago Botero Ruiz <39206812+YokySantiago@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2022-02-28 00:48:17 -08:00
|
|
|
const credentials = credential.data as IDataObject;
|
|
|
|
|
|
|
|
const options: OptionsWithUri = {
|
|
|
|
headers: {
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
'User-Agent': 'n8n-onfleet',
|
|
|
|
},
|
|
|
|
auth: {
|
|
|
|
user: credentials.apiKey as string,
|
|
|
|
pass: '',
|
|
|
|
},
|
|
|
|
method: 'GET',
|
|
|
|
uri: 'https://onfleet.com/api/v2/auth/test',
|
|
|
|
json: true,
|
|
|
|
};
|
|
|
|
|
|
|
|
try {
|
|
|
|
await this.helpers.request(options);
|
|
|
|
return {
|
|
|
|
status: 'OK',
|
|
|
|
message: 'Authentication successful',
|
|
|
|
};
|
|
|
|
} catch (error) {
|
|
|
|
return {
|
|
|
|
status: 'Error',
|
|
|
|
message: `Auth settings are not valid: ${error}`,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
loadOptions: resourceLoaders,
|
|
|
|
};
|
|
|
|
|
|
|
|
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
2022-12-02 03:53:59 -08:00
|
|
|
const resource = this.getNodeParameter('resource', 0);
|
|
|
|
const operation = this.getNodeParameter('operation', 0);
|
:sparkles: Add Onfleet Node & Trigger (#2845)
* feat: added Onfleet nodes
Added Onfleet nodes for working with different endpoints like:
organizations, administrators, workers, hubs, teams, destinations, recipients,
containers and webhooks.
* style: fixed typos, arrays uniformity, unnecesary files
* refactor: changed add to create in comments and labels
* feat: added name field to onfleet trigger node
* feat: added team endpoints to onfleet node
Added team auto-dispatch and driver time estimate endpoints to Onfleet
node
* style: remove dots in descriptions and fixed some typos
* feat: added fixes according to comments made on the n8n PR
added new fixed collections, refactored the code according to comments
made on the n8n pr
* fix: fixed recipient and destination cretion
* docs: added docstrings for format some functions
added docstrings for new functions addded for formatting the destination
and recipient objects
* style: formatting the code according to n8n nodelinter
* fix: typos and better descriptions
* [INT-510] n8n: Address additional problems from n8n code review (#5)
* Fixed some error creating a worker, moving some fields under additional fields collection
* Fixed returned values for delete operations, making some changes for style code
* Added operational error since required property is not working for dateTime fields
* :zap: Improvements to #2593
* :zap: Improvements
* :bug: Fix issue with wrong interface
* :zap: Improvements
* :zap: Improvements
* :zap: Minor improvement
Co-authored-by: Santiago Botero Ruiz <santiago.botero@devsavant.ai>
Co-authored-by: ilsemaj <james.li.upenn@gmail.com>
Co-authored-by: Santiago Botero Ruiz <39206812+YokySantiago@users.noreply.github.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2022-02-28 00:48:17 -08:00
|
|
|
const items = this.getInputData();
|
|
|
|
|
|
|
|
const operations: { [key: string]: Function } = {
|
|
|
|
task: OnfleetMethods.executeTaskOperations,
|
|
|
|
destination: OnfleetMethods.executeDestinationOperations,
|
|
|
|
organization: OnfleetMethods.executeOrganizationOperations,
|
|
|
|
admin: OnfleetMethods.executeAdministratorOperations,
|
|
|
|
recipient: OnfleetMethods.executeRecipientOperations,
|
|
|
|
hub: OnfleetMethods.executeHubOperations,
|
|
|
|
worker: OnfleetMethods.executeWorkerOperations,
|
|
|
|
webhook: OnfleetMethods.executeWebhookOperations,
|
|
|
|
container: OnfleetMethods.executeContainerOperations,
|
|
|
|
team: OnfleetMethods.executeTeamOperations,
|
|
|
|
};
|
|
|
|
|
|
|
|
const responseData = await operations[resource].call(this, `${resource}s`, operation, items);
|
|
|
|
|
|
|
|
// Map data to n8n data
|
|
|
|
return [this.helpers.returnJsonArray(responseData)];
|
|
|
|
}
|
|
|
|
}
|