2021-03-10 14:51:05 -08:00
import {
INodeProperties ,
} from 'n8n-workflow' ;
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 : {
resource : [
'account' ,
] ,
} ,
} ,
} ,
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-07-14 13:05:11 -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 : {
resource : [
'account' ,
] ,
operation : [
'getBalances' ,
] ,
} ,
} ,
} ,
// ----------------------------------
// 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-07-14 13:05:11 -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 : {
resource : [
'account' ,
] ,
operation : [
'getStatement' ,
] ,
} ,
} ,
} ,
{
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' ,
loadOptionsDependsOn : [
'profileId' ,
] ,
} ,
2022-07-14 13:05:11 -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 : {
resource : [
'account' ,
] ,
operation : [
'getStatement' ,
] ,
} ,
} ,
} ,
{
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 : {
resource : [
'account' ,
] ,
operation : [
'getStatement' ,
] ,
} ,
} ,
} ,
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 : {
resource : [
'account' ,
] ,
operation : [
'getStatement' ,
] ,
} ,
} ,
options : [
{
name : 'JSON' ,
value : 'json' ,
} ,
{
name : 'CSV' ,
value : 'csv' ,
} ,
{
name : 'PDF' ,
value : 'pdf' ,
} ,
] ,
} ,
{
displayName : 'Binary Property' ,
name : 'binaryProperty' ,
type : 'string' ,
required : true ,
default : 'data' ,
description : 'Name of the binary property to which to write to' ,
displayOptions : {
show : {
resource : [
'account' ,
] ,
operation : [
'getStatement' ,
] ,
format : [
'csv' ,
'pdf' ,
] ,
} ,
} ,
} ,
{
displayName : 'File Name' ,
name : 'fileName' ,
type : 'string' ,
required : true ,
default : '' ,
placeholder : 'data.pdf' ,
description : 'Name of the file that will be downloaded' ,
displayOptions : {
show : {
resource : [
'account' ,
] ,
operation : [
'getStatement' ,
] ,
format : [
'csv' ,
'pdf' ,
] ,
} ,
} ,
} ,
2021-03-10 14:51:05 -08:00
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
resource : [
'account' ,
] ,
operation : [
'getStatement' ,
] ,
} ,
} ,
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
] ;