2021-02-04 00:37:03 -08:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const userOperations: INodeProperties[] = [
|
2021-02-04 00:37:03 -08:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2021-02-04 00:37:03 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'user',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get a user',
|
2021-02-04 00:37:03 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'get',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2021-02-04 00:37:03 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const userFields: INodeProperties[] = [
|
2021-02-04 00:37:03 -08:00
|
|
|
{
|
|
|
|
displayName: 'Username',
|
|
|
|
name: 'username',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Reddit ID of the user to retrieve',
|
2021-02-04 00:37:03 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'user',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Details',
|
|
|
|
name: 'details',
|
|
|
|
type: 'options',
|
|
|
|
required: true,
|
|
|
|
default: 'about',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Details of the user to retrieve',
|
2021-02-04 00:37:03 -08:00
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'About',
|
|
|
|
value: 'about',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Comments',
|
|
|
|
value: 'comments',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Gilded',
|
|
|
|
value: 'gilded',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Overview',
|
|
|
|
value: 'overview',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Submitted',
|
|
|
|
value: 'submitted',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'user',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
2021-02-04 00:37:03 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'user',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
details: [
|
|
|
|
'overview',
|
|
|
|
'submitted',
|
|
|
|
'comments',
|
|
|
|
'gilded',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
default: 100,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Max number of results to return',
|
2021-02-04 00:37:03 -08:00
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 100,
|
|
|
|
},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'user',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
details: [
|
|
|
|
'comments',
|
|
|
|
'gilded',
|
|
|
|
'overview',
|
|
|
|
'submitted',
|
|
|
|
],
|
|
|
|
returnAll: [
|
|
|
|
false,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|