2021-02-21 02:00:27 -08:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const userOperations: INodeProperties[] = [
|
2021-02-21 02:00:27 -08:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2021-02-21 02:00:27 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'user',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Create a new user',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Create a user',
|
2021-02-21 02:00:27 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Delete',
|
|
|
|
value: 'delete',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Delete a user',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Delete a user',
|
2021-02-21 02:00:27 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Retrieve a user',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get a user',
|
2021-02-21 02:00:27 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'create',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2021-02-21 02:00:27 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const userFields: INodeProperties[] = [
|
2021-02-21 02:00:27 -08:00
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* user:create */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Username',
|
|
|
|
name: 'username',
|
|
|
|
type: 'string',
|
2021-12-03 00:44:16 -08:00
|
|
|
default: '',
|
2021-02-21 02:00:27 -08:00
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'user',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Email Address',
|
|
|
|
name: 'emailAddress',
|
|
|
|
type: 'string',
|
2021-12-03 00:44:16 -08:00
|
|
|
default: '',
|
2021-02-21 02:00:27 -08:00
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'user',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Display Name',
|
|
|
|
name: 'displayName',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'user',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'user',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'create',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Password',
|
|
|
|
name: 'password',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
description: 'Password for the user. If a password is not set, a random password is generated.',
|
|
|
|
typeOptions: {
|
|
|
|
password: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Notification',
|
|
|
|
name: 'notification',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
2022-06-20 07:54:01 -07:00
|
|
|
description: 'Whether to send the user an email confirmation that they have been added to Jira',
|
2021-02-21 02:00:27 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* user:delete */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Account ID',
|
|
|
|
name: 'accountId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Account ID of the user to delete',
|
2021-02-21 02:00:27 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'user',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'delete',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* user:get */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
{
|
|
|
|
displayName: 'Account ID',
|
|
|
|
name: 'accountId',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Account ID of the user to retrieve',
|
2021-02-21 02:00:27 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'user',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'user',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Expand',
|
|
|
|
name: 'expand',
|
|
|
|
type: 'multiOptions',
|
|
|
|
default: [],
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Include more information about the user',
|
2021-02-21 02:00:27 -08:00
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Groups',
|
|
|
|
value: 'groups',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Include all groups to which the user belongs',
|
2021-02-21 02:00:27 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Application Roles',
|
|
|
|
value: 'applicationRoles',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Include details of all the applications the user can access',
|
2021-02-21 02:00:27 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|