2021-03-10 14:51:05 -08:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const exchangeRateOperations: 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: 'get',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'exchangeRate',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
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 exchangeRateFields: INodeProperties[] = [
|
2021-03-10 14:51:05 -08:00
|
|
|
// ----------------------------------
|
|
|
|
// exchangeRate: get
|
|
|
|
// ----------------------------------
|
|
|
|
{
|
|
|
|
displayName: 'Source Currency',
|
|
|
|
name: 'source',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Code of the source currency to retrieve the exchange rate for',
|
2021-03-10 14:51:05 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'exchangeRate',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Target Currency',
|
|
|
|
name: 'target',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Code of the target currency to retrieve the exchange rate for',
|
2021-03-10 14:51:05 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'exchangeRate',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'exchangeRate',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Interval',
|
|
|
|
name: 'interval',
|
|
|
|
type: 'options',
|
|
|
|
default: 'day',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Day',
|
|
|
|
value: 'day',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Hour',
|
|
|
|
value: 'hour',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Minute',
|
|
|
|
value: 'minute',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Range',
|
|
|
|
name: 'range',
|
|
|
|
type: 'fixedCollection',
|
|
|
|
placeholder: 'Add Range',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Range of time to retrieve the exchange rate for',
|
2021-03-10 14:51:05 -08:00
|
|
|
default: {},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Range Properties',
|
|
|
|
name: 'rangeProperties',
|
|
|
|
values: [
|
|
|
|
{
|
|
|
|
displayName: 'Range Start',
|
|
|
|
name: 'from',
|
|
|
|
type: 'dateTime',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Range End',
|
|
|
|
name: 'to',
|
|
|
|
type: 'dateTime',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Time',
|
|
|
|
name: 'time',
|
|
|
|
type: 'dateTime',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Point in time to retrieve the exchange rate for',
|
2021-03-10 14:51:05 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|