Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat) add zammad node #2617

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions packages/nodes-base/credentials/ZammadBasicApi.credentials.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import {
ICredentialType,
INodeProperties,
} from 'n8n-workflow';

export class ZammadBasicApi implements ICredentialType {
name = 'zammadBasicApi';
displayName = 'Zammad Basic API';
documentationUrl = 'zammad';
properties: INodeProperties[] = [
{
displayName: 'Zammad URL',
name: 'zammadUrl',
type: 'string',
default: 'https://your_url.zammad.com',
required: true,
},
{
displayName: 'User Name / E-Mail',
name: 'userName',
type: 'string',
default: '',
required: true,
},
{
displayName: 'Password',
name: 'password',
type: 'string',
typeOptions: {
password: true,
},
default: '',
required: true,
},
{
displayName: 'Ignore SSL Issues',
name: 'allowUnauthorizedCerts',
type: 'boolean',
default: false,
},
];
}
53 changes: 53 additions & 0 deletions packages/nodes-base/credentials/ZammadOAuth2Api.credentials.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import {
ICredentialType,
INodeProperties,
} from 'n8n-workflow';

export class ZammadOAuth2Api implements ICredentialType {
name = 'zammadOAuth2Api';
extends = [
'oAuth2Api',
];
displayName = 'OZammad OAuth2 API';
documentationUrl = 'zammad';
properties: INodeProperties[] = [
{
displayName: 'Authorization URL',
name: 'authUrl',
type: 'string',
default: 'https://your_url.zammad.com/oauth/authorize',
required: true,
},
{
displayName: 'Access Token URL',
name: 'accessTokenUrl',
type: 'hidden',
default: 'https://your_url.zammad.com/oauth/token',
required: true,
},
{
displayName: 'Ignore SSL Issues',
name: 'allowUnauthorizedCerts',
type: 'boolean',
default: false,
},
{
displayName: 'Scope',
name: 'scope',
type: 'hidden',
default: '',
},
{
displayName: 'Auth URI Query Parameters',
name: 'authQueryParameters',
type: 'hidden',
default: '',
},
{
displayName: 'Authentication',
name: 'authentication',
type: 'hidden',
default: 'header',
},
];
}
35 changes: 35 additions & 0 deletions packages/nodes-base/credentials/ZammadTokenApi.credentials.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import {
ICredentialType,
INodeProperties,
} from 'n8n-workflow';

export class ZammadTokenApi implements ICredentialType {
name = 'zammadTokenApi';
displayName = 'Zammad Token API';
documentationUrl = 'zammad';
properties: INodeProperties[] = [
{
displayName: 'Zammad URL',
name: 'zammadUrl',
type: 'string',
default: 'https://your_url.zammad.com',
required: true,
},
{
displayName: 'API Key',
name: 'apiKey',
type: 'string',
typeOptions: {
password: true,
},
default: '',
required: true,
},
{
displayName: 'Ignore SSL Issues',
name: 'allowUnauthorizedCerts',
type: 'boolean',
default: false,
},
];
}
173 changes: 173 additions & 0 deletions packages/nodes-base/nodes/Zammad/ArticlesDescription.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
import { INodeProperties } from 'n8n-workflow';

export const articlesDescription = [
// ----------------------------------
// Operation: article
// ----------------------------------
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: ['article'],
api: ['rest'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a article to an object.',
},
{
name: 'List By Ticket ID',
value: 'listByTicketId',
description: 'Get all articles by the ticket ID.',
},
{
name: 'Show',
value: 'show',
description: 'Get specific article.',
},
],
default: 'create',
description: 'The operation to perform.',
},
// ----------------------------------
// Fields: article
// ----------------------------------
{
displayName: 'Ticket ID',
name: 'ticket_id',
type: 'number',
default: 0,
required: true,
displayOptions: {
show: {
operation: ['create', 'listByTicketId'],
resource: ['article'],
api: ['rest'],
},
},
description: 'The ticket ID of the article.',
},
{
displayName: 'ID',
name: 'id',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: ['show'],
resource: ['article'],
api: ['rest'],
},
},
description: 'The ID of the article.',
},
{
displayName: 'Body',
name: 'body',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: ['create'],
resource: ['article'],
api: ['rest'],
},
},
description: 'The body of the article.',
},
{
displayName: 'Additional Fields',
name: 'optionalFields',
type: 'collection',
displayOptions: {
show: {
operation: ['create', 'update'],
resource: ['article'],
api: ['rest'],
},
},
default: {},
description: 'Additional optional fields of the article.',
placeholder: 'Add Field',
options: [
{
displayName: 'To',
name: 'to',
type: 'string',
default: '',
description: 'The recipient.',
},
{
displayName: 'CC',
name: 'cc',
type: 'string',
default: '',
description: 'The cc recipient.',
},
{
displayName: 'Reply to',
name: 'reply_to',
type: 'string',
default: '',
description: 'The reply to info.',
},
{
displayName: 'In Reply to',
name: 'in_reply_to',
type: 'string',
default: '',
description: 'What this article is a reply to.',
},
{
displayName: 'Message ID',
name: 'message_id',
type: 'string',
default: '',
description: 'The message ID.',
},
{
displayName: 'Subject',
name: 'subject',
type: 'string',
default: '',
description: 'The subject of the article.',
},
{
displayName: 'Content Type',
name: 'content_type',
type: 'string',
default: '',
description: 'The content type of the article.',
},
{
displayName: 'Type',
name: 'type',
type: 'string',
default: '',
description: 'The type of the article.',
},
{
displayName: 'Internal?',
name: 'internal',
type: 'boolean',
default: false,
description: 'If article is internal.',
},
{
displayName: 'Time Unit',
name: 'time_unit',
type: 'string',
default: '',
description:
'The time unit of the article. This is ignored by the API but documented, so it is left here.',
},
],
},
] as INodeProperties[];
Loading