2020-08-25 01:50:39 -07:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const userOperations: INodeProperties[] = [
|
2020-08-25 01:50:39 -07:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'user',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Get All',
|
|
|
|
value: 'getAll',
|
|
|
|
description: 'Get all users',
|
2020-10-22 06:46:03 -07:00
|
|
|
},
|
2020-08-25 01:50:39 -07:00
|
|
|
],
|
|
|
|
default: 'getAll',
|
|
|
|
description: 'The operation to perform.',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-08-25 01:50:39 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const userFields: INodeProperties[] = [
|
2020-08-25 01:51:16 -07:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* user:getAll */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-08-25 01:50:39 -07:00
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'user',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: false,
|
|
|
|
description: 'If all results should be returned or only up to a given limit.',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
2020-08-25 01:51:16 -07:00
|
|
|
default: 100,
|
2020-08-25 01:50:39 -07:00
|
|
|
required: true,
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
2020-10-22 06:46:03 -07:00
|
|
|
maxValue: 200,
|
2020-08-25 01:50:39 -07:00
|
|
|
},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'user',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
returnAll: [
|
2020-10-22 06:46:03 -07:00
|
|
|
false,
|
|
|
|
],
|
2020-08-25 01:50:39 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
description: 'Number of subscription records to return per page.',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'JSON Parameters',
|
|
|
|
name: 'jsonParameters',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'user',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2020-08-25 01:51:16 -07:00
|
|
|
displayName: 'Additional Fields',
|
2020-08-25 01:50:39 -07:00
|
|
|
name: 'additionalFieldsJson',
|
|
|
|
type: 'json',
|
|
|
|
typeOptions: {
|
|
|
|
alwaysOpenEditWindow: true,
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'user',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
jsonParameters: [
|
|
|
|
true,
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
description: `Attributes in JSON form.`,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'user',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'getAll',
|
|
|
|
],
|
|
|
|
jsonParameters: [
|
2020-10-22 06:46:03 -07:00
|
|
|
false,
|
|
|
|
],
|
2020-08-25 01:50:39 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: {},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Plan ID',
|
|
|
|
name: 'planId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
description: 'Filter: The subscription plan ID.',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Subscription ID',
|
|
|
|
name: 'subscriptionId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
description: 'A specific user subscription ID.',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'State',
|
|
|
|
name: 'state',
|
|
|
|
type: 'options',
|
|
|
|
default: 'active',
|
|
|
|
description: 'Filter: The user subscription status. Returns all active, past_due, trialing and paused subscription plans if not specified.',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Active',
|
2020-10-22 06:46:03 -07:00
|
|
|
value: 'active',
|
2020-08-25 01:50:39 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Past Due',
|
2020-10-22 06:46:03 -07:00
|
|
|
value: 'past_due',
|
2020-08-25 01:50:39 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Paused',
|
2020-10-22 06:46:03 -07:00
|
|
|
value: 'paused',
|
2020-08-25 01:50:39 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Trialing',
|
2020-10-22 06:46:03 -07:00
|
|
|
value: 'trialing',
|
2020-08-25 01:50:39 -07:00
|
|
|
},
|
2020-10-22 06:46:03 -07:00
|
|
|
],
|
2020-08-25 01:50:39 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|