2023-01-27 03:22:44 -08:00
import type { INodeProperties } from 'n8n-workflow' ;
2021-03-10 14:51:05 -08:00
2021-12-03 00:44:16 -08:00
export const accountOperations : INodeProperties [ ] = [
2021-03-10 14:51:05 -08:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2021-03-10 14:51:05 -08:00
default : 'getBalances' ,
options : [
{
name : 'Get Balances' ,
value : 'getBalances' ,
2022-05-06 14:01:25 -07:00
description : 'Retrieve balances for all account currencies of this user' ,
2022-07-10 13:50:51 -07:00
action : 'Get balances' ,
2021-03-10 14:51:05 -08:00
} ,
{
name : 'Get Currencies' ,
value : 'getCurrencies' ,
2022-05-06 14:01:25 -07:00
description : 'Retrieve currencies in the borderless account of this user' ,
2022-07-10 13:50:51 -07:00
action : 'Get currencies' ,
2021-03-10 14:51:05 -08:00
} ,
{
name : 'Get Statement' ,
value : 'getStatement' ,
2022-05-06 14:01:25 -07:00
description : 'Retrieve the statement for the borderless account of this user' ,
2022-07-10 13:50:51 -07:00
action : 'Get a statement' ,
2021-03-10 14:51:05 -08:00
} ,
] ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'account' ] ,
2021-03-10 14:51:05 -08:00
} ,
} ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2021-03-10 14:51:05 -08:00
2021-12-03 00:44:16 -08:00
export const accountFields : INodeProperties [ ] = [
2021-03-10 14:51:05 -08:00
// ----------------------------------
// account: getBalances
// ----------------------------------
{
2022-06-03 10:23:49 -07:00
displayName : 'Profile Name or ID' ,
2021-03-10 14:51:05 -08:00
name : 'profileId' ,
type : 'options' ,
required : true ,
default : [ ] ,
typeOptions : {
loadOptionsMethod : 'getProfiles' ,
} ,
2022-08-17 08:50:24 -07:00
description :
'ID of the user profile to retrieve the balance of. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-03-10 14:51:05 -08:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'account' ] ,
operation : [ 'getBalances' ] ,
2021-03-10 14:51:05 -08:00
} ,
} ,
} ,
// ----------------------------------
// account: getStatement
// ----------------------------------
{
2022-06-03 10:23:49 -07:00
displayName : 'Profile Name or ID' ,
2021-03-10 14:51:05 -08:00
name : 'profileId' ,
type : 'options' ,
default : [ ] ,
typeOptions : {
loadOptionsMethod : 'getProfiles' ,
} ,
2022-08-17 08:50:24 -07:00
description :
'ID of the user profile whose account to retrieve the statement of. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-03-10 14:51:05 -08:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'account' ] ,
operation : [ 'getStatement' ] ,
2021-03-10 14:51:05 -08:00
} ,
} ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Borderless Account Name or ID' ,
2021-03-10 14:51:05 -08:00
name : 'borderlessAccountId' ,
type : 'options' ,
default : [ ] ,
required : true ,
typeOptions : {
loadOptionsMethod : 'getBorderlessAccounts' ,
2022-08-17 08:50:24 -07:00
loadOptionsDependsOn : [ 'profileId' ] ,
2021-03-10 14:51:05 -08:00
} ,
2022-08-17 08:50:24 -07:00
description :
'ID of the borderless account to retrieve the statement of. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2021-03-10 14:51:05 -08:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'account' ] ,
operation : [ 'getStatement' ] ,
2021-03-10 14:51:05 -08:00
} ,
} ,
} ,
{
displayName : 'Currency' ,
name : 'currency' ,
type : 'string' ,
default : '' ,
// TODO: preload
2022-05-06 14:01:25 -07:00
description : 'Code of the currency of the borderless account to retrieve the statement of' ,
2021-03-10 14:51:05 -08:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'account' ] ,
operation : [ 'getStatement' ] ,
2021-03-10 14:51:05 -08:00
} ,
} ,
} ,
2022-06-13 13:29:21 -07:00
{
displayName : 'Format' ,
name : 'format' ,
type : 'options' ,
default : 'json' ,
description : 'File format to retrieve the statement in' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'account' ] ,
operation : [ 'getStatement' ] ,
2022-06-13 13:29:21 -07:00
} ,
} ,
options : [
{
name : 'JSON' ,
value : 'json' ,
} ,
{
name : 'CSV' ,
value : 'csv' ,
} ,
{
name : 'PDF' ,
value : 'pdf' ,
} ,
2024-04-29 00:32:08 -07:00
{
name : 'XML (CAMT.053)' ,
value : 'xml' ,
} ,
2022-06-13 13:29:21 -07:00
] ,
} ,
{
2024-01-03 03:08:16 -08:00
displayName : 'Put Output File in Field' ,
2022-06-13 13:29:21 -07:00
name : 'binaryProperty' ,
type : 'string' ,
required : true ,
default : 'data' ,
2024-01-03 03:08:16 -08:00
hint : 'The name of the output binary field to put the file in' ,
2022-06-13 13:29:21 -07:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'account' ] ,
operation : [ 'getStatement' ] ,
2024-04-29 00:32:08 -07:00
format : [ 'csv' , 'pdf' , 'xml' ] ,
2022-06-13 13:29:21 -07:00
} ,
} ,
} ,
{
displayName : 'File Name' ,
name : 'fileName' ,
type : 'string' ,
required : true ,
default : '' ,
placeholder : 'data.pdf' ,
description : 'Name of the file that will be downloaded' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'account' ] ,
operation : [ 'getStatement' ] ,
2024-04-29 00:32:08 -07:00
format : [ 'csv' , 'pdf' , 'xml' ] ,
2022-06-13 13:29:21 -07:00
} ,
} ,
} ,
2021-03-10 14:51:05 -08:00
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'account' ] ,
operation : [ 'getStatement' ] ,
2021-03-10 14:51:05 -08:00
} ,
} ,
options : [
{
displayName : 'Line Style' ,
name : 'lineStyle' ,
type : 'options' ,
default : 'COMPACT' ,
2022-05-06 14:01:25 -07:00
description : 'Line style to retrieve the statement in' ,
2021-03-10 14:51:05 -08:00
options : [
{
name : 'Compact' ,
value : 'COMPACT' ,
2022-05-06 14:01:25 -07:00
description : 'Single line per transaction' ,
2021-03-10 14:51:05 -08:00
} ,
{
name : 'Flat' ,
value : 'FLAT' ,
2022-05-06 14:01:25 -07:00
description : 'Separate lines for transaction fees' ,
2021-03-10 14:51:05 -08:00
} ,
] ,
} ,
{
displayName : 'Range' ,
name : 'range' ,
type : 'fixedCollection' ,
placeholder : 'Add Range' ,
default : { } ,
options : [
{
displayName : 'Range Properties' ,
name : 'rangeProperties' ,
values : [
{
displayName : 'Range Start' ,
name : 'intervalStart' ,
type : 'dateTime' ,
default : '' ,
} ,
{
displayName : 'Range End' ,
name : 'intervalEnd' ,
type : 'dateTime' ,
default : '' ,
} ,
] ,
} ,
] ,
} ,
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;