Commit graph

6 commits

Author SHA1 Message Date
Iván Ovejero a783288338
Enforce type checking in all node params (#2509) 2021-12-03 09:44:16 +01:00
Omar Ajoue 7ce7285f7a
Load credentials from the database (#1741)
* Changes to types so that credentials can be always loaded from DB

This first commit changes all return types from the execute functions
and calls to get credentials to be async so we can use await.

This is a first step as previously credentials were loaded in memory and
always available. We will now be loading them from the DB which requires
turning the whole call chain async.

* Fix updated files

* Removed unnecessary credential loading to improve performance

* Fix typo

*  Fix issue

* Updated new nodes to load credentials async

*  Remove not needed comment

Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-08-20 18:57:30 +02:00
Iván Ovejero eb05e90197
Add QuickBooks transactions report (#2040)
* add get QBO report: transaction list

* merge upstream with n8n master

* Update QuickBooks.node.ts

* add back transaction list resource

*  Refactor transactions list expansion

*  Alphabetize options

*  Fix param type of source account types

*  Add missing description

*  Improve memo display name

*  Fix default values

*  Fix casing

* 🔥 Remove logging

*  Remove time from dates

* 🔨 Rename operation

*  Add simplify response toggle

* 🐛 Fix issue when transaction:getReport does not return data

Co-authored-by: Calvin Tan <calvin14@gmail.com>
Co-authored-by: ricardo <ricardoespinoza105@gmail.com>
2021-08-13 11:45:26 +02:00
Iván Ovejero 91a5bc3bc4
Separate scopes and add purchase operations to QuickBooks node (#1859)
* allow qbo to use accounting or payment scopes separately

* added purchase get and getall

* removed irrelevant field options

*  Sort alphabetically

* 🔥 Remove unused file

* ✏️ Fix description casing

*  Add credentials type

* ✏️ Fix resource dividers

* 🔨 Format import

* ✏️ Fix documentation link

*  Refactor credentials

*  Use multiOptions for scopes

* 🔥 Remove payment scope

The payment scope is used only by the QuickBooks Payments API, but this node implements the QuickBooks Online API, which only needs the accounting scope.

* 🚚 Rename node to QuickBooks Online

This reflects the specific API implemented in this node and allows for a future QuickBooks Payments node. Until node versioning is released, only display name changed.

Co-authored-by: Calvin Tan <calvin14@gmail.com>
2021-06-27 13:21:11 +02:00
Iván Ovejero 1d27a9e87e
Improve node error handling (#1309)
* Add path mapping and response error interfaces

* Add error handling and throwing functionality

* Refactor error handling into a single function

* Re-implement error handling in Hacker News node

* Fix linting details

* Re-implement error handling in Spotify node

* Re-implement error handling in G Suite Admin node

* 🚧 create basic setup NodeError

* 🚧 add httpCodes

* 🚧 add path priolist

* 🚧 handle statusCode in error, adjust interfaces

* 🚧 fixing type issues w/Ivan

* 🚧 add error exploration

* 👔 fix linter issues

* 🔧 improve object check

* 🚧 remove path passing from NodeApiError

* 🚧 add multi error + refactor findProperty method

* 👔 allow any

* 🔧 handle multi error message callback

*  change return type of callback

*  add customCallback to MultiError

* 🚧 refactor to use INode

* 🔨 handle arrays, continue search after first null property found

* 🚫 refactor method access

* 🚧 setup NodeErrorView

*  change timestamp to Date.now

* 📚 Add documentation for methods and constants

* 🚧 change message setting

* 🚚 move NodeErrors to workflow

*  add new ErrorView for Nodes

* 🎨 improve error notification

* 🎨 refactor interfaces

*  add WorkflowOperationError, refactor error throwing

* 👕 fix linter issues

* 🎨 rename param

* 🐛 fix handling normal errors

*  add usage of NodeApiError

* 🎨 fix throw new error instead of constructor

* 🎨 remove unnecessary code/comments

* 🎨 adjusted spacing + updated status messages

* 🎨 fix tab indentation

*  Replace current errors with custom errors (#1576)

*  Introduce NodeApiError in catch blocks

*  Introduce NodeOperationError in nodes

*  Add missing errors and remove incompatible

*  Fix NodeOperationError in incompatible nodes

* 🔧 Adjust error handling in missed nodes

PayPal, FileMaker, Reddit, Taiga and Facebook Graph API nodes

* 🔨 Adjust Strava Trigger node error handling

* 🔨 Adjust AWS nodes error handling

* 🔨 Remove duplicate instantiation of NodeApiError

* 🐛 fix strava trigger node error handling

* Add XML parsing to NodeApiError constructor (#1633)

* 🐛 Remove type annotation from catch variable

*  Add XML parsing to NodeApiError

*  Simplify error handling in Rekognition node

*  Pass in XML flag in generic functions

* 🔥 Remove try/catch wrappers at call sites

* 🔨 Refactor setting description from XML

* 🔨 Refactor let to const in resource loaders

*  Find property in parsed XML

*  Change let to const

* 🔥 Remove unneeded try/catch block

* 👕 Fix linting issues

* 🐛 Fix errors from merge conflict resolution

*  Add custom errors to latest contributions

* 👕 Fix linting issues

*  Refactor MongoDB helpers for custom errors

* 🐛 Correct custom error type

*  Apply feedback to A nodes

*  Apply feedback to missed A node

*  Apply feedback to B-D nodes

*  Apply feedback to E-F nodes

*  Apply feedback to G nodes

*  Apply feedback to H-L nodes

*  Apply feedback to M nodes

*  Apply feedback to P nodes

*  Apply feedback to R nodes

*  Apply feedback to S nodes

*  Apply feedback to T nodes

*  Apply feedback to V-Z nodes

*  Add HTTP code to iterable node error

* 🔨 Standardize e as error

* 🔨 Standardize err as error

*  Fix error handling for non-standard nodes

Co-authored-by: Ben Hesseldieck <b.hesseldieck@gmail.com>

Co-authored-by: Ben Hesseldieck <b.hesseldieck@gmail.com>
Co-authored-by: Ben Hesseldieck <1849459+BHesseldieck@users.noreply.github.com>
2021-04-16 18:33:36 +02:00
Iván Ovejero 5baa31b053
Add QuickBooks node (#1365)
* Add OAuth2 credentials

* Adjust credentials params

* Add node to listing

* Add initial node scaffolding

* Remove unused credentials params

* Add customer search with select statement

* Add pagination to customer search

* Add customer creation functionality

* Add customer update functionality

* Small formatting fix

* Adjust property name casing for consistency

* Adjust customer operations for consistency

* Handle large QuickBooks listings

* Add initial estimate resource description

* Add estimate resource retrieval operations

* Refactor customer billing address

* Simplify customer billing address

* Fix casing for customer additional fields

* Adjust types to accommodate loadOptions functions

* Add loadOptions for customers to estimate

* Sort customer update fields alphabetically

* Refactor estimate line into standalone file

* Add stub for PDF retrieval operation

* Add invoice resource description and execute branches

* Implement estimate PDF download functionality

* Place descriptions in their own dir

* Add get and getAll for invoices

* Add send functionality to invoices

* Refactor handling of binary data

* Add invoice voiding functionality

* Add invoice deletion functionality

* Refactor resources into subdirs and add interfaces

* Add get and getAll for bill

* Add payment description

* Add get and getAll for payment

* Make variables in endpoints consistent

* Refactor interfaces for consistency

* Add interface for item resource

* Fill in fields for all resources

* Minor fixes in defaults and descriptions

* Refactor loader

* Add all resources to execute function

* Fix line property duplication

* Add get and getAll for vendor

* Optimize description imports

* Add creation for customer and bill

* Add update operation for bill

* Refactor create and update for customer

* Implement employee create and update

* Implement create and update for estimate

* Make address params more consistent

* Add create and update to payment

* Add item operations

* Add create and delete operations for invoice

* Refactor binary data handler

* Refactor generic functions

* Add create and update operations for vendor

* Fix build

* Fix total amount in bill:update

* Fix balance in bill:update

* Remove currency from bill:update

* Implement reference retrieval in bill:update

* Fix failing params in customer:update

* Fix param in employee:update

* Implement reference retrieval in estimate:update

* Fix failing params in estimate:update

* Fix failing params in invoice:update

* Fix failing param in vendor:update

* Implement reference retrieval in payment:update

* Remove unused interfaces

* Rename line property function

* Remove hared directory

* Refactor reference and sync token retrieval

* Fix line structure in bill:create

* Fix line structure in estimate:create

* Flatten responses

* Refactor line processing

* Remove unused interfaces

* Add endpoint documentation

* Fix payment:void content type

* Fix default for bill line item

* Hide auth URI query parameters

* Hide auth header parameter

* Add switch for credentials environment

* Adjust OAuth2 callback to accommodate realmId

* Retrieve realmId from OAuth2 flow

*  Improvements

* Reposition dividers

* Add IDs to display names of reference fields

* Add estimate:delete and bill:delete

* Load items in lines for bill, estimate and invoice

* Add filename for binary property in PDF download

*  Improvements

* Adjust field description

* Implement estimate:send

* Adjust field description

* Adjust custom field descriptions

* Add missing period to description

*  Minor improvements on QuickBooks-Node

* Add descriptions for bill

* Add descriptions for customer

* Add descriptions for employee

* Add descriptions for estimate

* Add descriptions for invoice

* Add descriptions for payment

* Add descriptions for vendor

Co-authored-by: ricardo <ricardoespinoza105@gmail.com>
Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
2021-02-13 17:27:08 +01:00