2021-02-05 00:25:41 -08:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const affiliateMetadataOperations: INodeProperties[] = [
|
2021-02-05 00:25:41 -08:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2021-02-05 00:25:41 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'affiliateMetadata',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Add',
|
|
|
|
value: 'add',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Add metadata to affiliate',
|
2021-02-05 00:25:41 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Remove',
|
|
|
|
value: 'remove',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Remove metadata from affiliate',
|
2021-02-05 00:25:41 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Update',
|
|
|
|
value: 'update',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Update affiliate\'s metadata',
|
2021-02-05 00:25:41 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'add',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2021-02-05 00:25:41 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const affiliateMetadataFields: INodeProperties[] = [
|
2021-02-05 00:25:41 -08:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* affiliateMetadata:add */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Affiliate ID',
|
|
|
|
name: 'affiliateId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
2021-12-03 00:44:16 -08:00
|
|
|
default: '',
|
2021-02-05 00:25:41 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'affiliateMetadata',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'add',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID of the affiliate',
|
2021-02-05 00:25:41 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Metadata',
|
|
|
|
name: 'metadataUi',
|
|
|
|
placeholder: 'Add Metadata',
|
|
|
|
type: 'fixedCollection',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'affiliateMetadata',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'add',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2022-04-22 09:29:51 -07:00
|
|
|
default: {},
|
2021-02-05 00:25:41 -08:00
|
|
|
typeOptions: {
|
|
|
|
multipleValues: true,
|
|
|
|
},
|
|
|
|
description: 'Meta data',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'metadataValues',
|
|
|
|
displayName: 'Metadata',
|
|
|
|
values: [
|
|
|
|
{
|
|
|
|
displayName: 'Key',
|
|
|
|
name: 'key',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Name of the metadata key to add',
|
2021-02-05 00:25:41 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Value',
|
|
|
|
name: 'value',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Value to set for the metadata key',
|
2021-02-05 00:25:41 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* ffiliateMetadata:remove */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Affiliate ID',
|
|
|
|
name: 'affiliateId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
2021-12-03 00:44:16 -08:00
|
|
|
default: '',
|
2021-02-05 00:25:41 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'affiliateMetadata',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'remove',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID of the affiliate',
|
2021-02-05 00:25:41 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Key',
|
|
|
|
name: 'key',
|
|
|
|
type: 'string',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'affiliateMetadata',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'remove',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Name of the metadata key to remove',
|
2021-02-05 00:25:41 -08:00
|
|
|
},
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* affiliateMetadata:update */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Affiliate ID',
|
|
|
|
name: 'affiliateId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
2021-12-03 00:44:16 -08:00
|
|
|
default: '',
|
2021-02-05 00:25:41 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'affiliateMetadata',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'update',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'The ID of the affiliate',
|
2021-02-05 00:25:41 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Key',
|
|
|
|
name: 'key',
|
|
|
|
type: 'string',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'affiliateMetadata',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'update',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Name of the metadata key to update',
|
2021-02-05 00:25:41 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Value',
|
|
|
|
name: 'value',
|
|
|
|
type: 'string',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'affiliateMetadata',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'update',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Value to set for the metadata key',
|
2021-02-05 00:25:41 -08:00
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|