@couleetech/n8n-nodes-enlightenedmsp 1.8.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ import { GraphqlBase } from './GraphqlBase';
2
+ declare class CreateTodoGraphql extends GraphqlBase {
3
+ createTodo(variables: {
4
+ title?: string;
5
+ description?: string;
6
+ dueDate?: Date;
7
+ ticketBlocking?: boolean;
8
+ autotaskTicketId?: number;
9
+ isOnsite?: boolean;
10
+ estimatedMinutes?: number;
11
+ createdByModuleName?: string;
12
+ createdByModuleId?: string;
13
+ }): Promise<any>;
14
+ }
15
+ export { CreateTodoGraphql };
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateTodoGraphql = void 0;
4
+ const GraphqlBase_1 = require("./GraphqlBase");
5
+ class CreateTodoGraphql extends GraphqlBase_1.GraphqlBase {
6
+ async createTodo(variables) {
7
+ const query = `
8
+ mutation CreateTodo(
9
+ $title: String
10
+ $description: String
11
+ $dueDate: Date
12
+ $ticketBlocking: Boolean
13
+ $autotaskTicketId: Float
14
+ $isOnsite: Boolean
15
+ $estimatedMinutes: Float
16
+ $createdByModuleName: String
17
+ $createdByModuleId: String
18
+ ) {
19
+ createTodosTodo(
20
+ title: $title
21
+ description: $description
22
+ dueDate: $dueDate
23
+ ticketBlocking: $ticketBlocking
24
+ autotaskTicketId: $autotaskTicketId
25
+ isOnsite: $isOnsite
26
+ estimatedMinutes: $estimatedMinutes
27
+ createdByModuleName: $createdByModuleName
28
+ createdByModuleId: $createdByModuleId
29
+ ) {
30
+ id
31
+ title
32
+ description
33
+ dueDate
34
+ ticketBlocking
35
+ autotaskTicketId
36
+ isOnsite
37
+ estimatedMinutes
38
+ createdByModuleName
39
+ createdByModuleId
40
+ createdAt
41
+ }
42
+ }
43
+ `;
44
+ return this.executeGraphql(query, variables);
45
+ }
46
+ }
47
+ exports.CreateTodoGraphql = CreateTodoGraphql;
@@ -0,0 +1,5 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class CreateTodo implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateTodo = void 0;
4
+ const CreateTodo_graphql_1 = require("./CreateTodo.graphql");
5
+ const GraphqlBase_1 = require("./GraphqlBase");
6
+ class CreateTodo {
7
+ constructor() {
8
+ this.description = {
9
+ displayName: 'Create Todo',
10
+ name: 'createTodo',
11
+ icon: 'file:enlightenedmsp.svg',
12
+ group: ['transform'],
13
+ version: 1,
14
+ description: 'Create a new todo in EnlightenedMSP',
15
+ defaults: {
16
+ name: 'Create Todo',
17
+ },
18
+ inputs: ["main"],
19
+ outputs: ["main"],
20
+ credentials: [
21
+ {
22
+ name: 'enlightenedMspGraphql',
23
+ required: true,
24
+ },
25
+ ],
26
+ properties: [
27
+ {
28
+ displayName: 'Title',
29
+ name: 'title',
30
+ type: 'string',
31
+ default: '',
32
+ required: true,
33
+ description: 'Title of the todo',
34
+ },
35
+ {
36
+ displayName: 'Description',
37
+ name: 'description',
38
+ type: 'string',
39
+ typeOptions: {
40
+ rows: 4,
41
+ },
42
+ default: '',
43
+ description: 'Description of the todo',
44
+ },
45
+ {
46
+ displayName: 'Due Date',
47
+ name: 'dueDate',
48
+ type: 'dateTime',
49
+ default: '',
50
+ description: 'Due date for the todo',
51
+ },
52
+ {
53
+ displayName: 'Ticket Blocking',
54
+ name: 'ticketBlocking',
55
+ type: 'boolean',
56
+ default: false,
57
+ description: 'Whether this todo blocks the ticket',
58
+ },
59
+ {
60
+ displayName: 'Autotask Ticket ID',
61
+ name: 'autotaskTicketId',
62
+ type: 'number',
63
+ default: 0,
64
+ description: 'ID of the associated Autotask ticket',
65
+ },
66
+ {
67
+ displayName: 'Is Onsite',
68
+ name: 'isOnsite',
69
+ type: 'boolean',
70
+ default: false,
71
+ description: 'Whether this todo requires onsite work',
72
+ },
73
+ {
74
+ displayName: 'Estimated Minutes',
75
+ name: 'estimatedMinutes',
76
+ type: 'number',
77
+ default: 0,
78
+ description: 'Estimated time to complete in minutes',
79
+ },
80
+ ],
81
+ };
82
+ }
83
+ async execute() {
84
+ const items = this.getInputData();
85
+ const returnData = [];
86
+ const length = items.length;
87
+ const { endpoint, apiKey } = await GraphqlBase_1.GraphqlBase.getCredentials(this);
88
+ const createTodoGraphql = new CreateTodo_graphql_1.CreateTodoGraphql(endpoint, apiKey);
89
+ for (let i = 0; i < length; i++) {
90
+ try {
91
+ const title = this.getNodeParameter('title', i);
92
+ const description = this.getNodeParameter('description', i);
93
+ const dueDate = this.getNodeParameter('dueDate', i);
94
+ const ticketBlocking = this.getNodeParameter('ticketBlocking', i);
95
+ const autotaskTicketId = this.getNodeParameter('autotaskTicketId', i);
96
+ const isOnsite = this.getNodeParameter('isOnsite', i);
97
+ const estimatedMinutes = this.getNodeParameter('estimatedMinutes', i);
98
+ const variables = {
99
+ title,
100
+ description,
101
+ dueDate: dueDate ? new Date(dueDate) : undefined,
102
+ ticketBlocking,
103
+ autotaskTicketId: autotaskTicketId || undefined,
104
+ isOnsite,
105
+ estimatedMinutes: estimatedMinutes || undefined,
106
+ createdByModuleName: 'N8N_WORKFLOW',
107
+ createdByModuleId: `${this.getNode().id}`,
108
+ };
109
+ const result = await createTodoGraphql.createTodo(variables);
110
+ returnData.push({
111
+ json: result.createTodosTodo,
112
+ });
113
+ }
114
+ catch (error) {
115
+ if (this.continueOnFail()) {
116
+ returnData.push({
117
+ json: {
118
+ error: error.message,
119
+ },
120
+ });
121
+ continue;
122
+ }
123
+ throw error;
124
+ }
125
+ }
126
+ return [returnData];
127
+ }
128
+ }
129
+ exports.CreateTodo = CreateTodo;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@couleetech/n8n-nodes-enlightenedmsp",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "n8n node for EnlightenedMSP ticketing and workflow automation",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",