n8n-nodes-team-dynamix 0.1.2

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.
package/LICENSE.md ADDED
@@ -0,0 +1,19 @@
1
+ Copyright 2022 n8n
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+ this software and associated documentation files (the "Software"), to deal in
5
+ the Software without restriction, including without limitation the rights to
6
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7
+ of the Software, and to permit persons to whom the Software is furnished to do
8
+ so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,133 @@
1
+ # n8n-nodes-team-dynamix
2
+
3
+ An n8n community node package providing integration with the TeamDynamix API for ticket management and knowledge base operations.
4
+
5
+ **Status:** n8n Community Node Package | **Node Type:** Integration | **License:** MIT
6
+
7
+ For developers and collaborators: This repository follows n8n community node standards and publishing requirements. See [N8N_COMMUNITY_NODE_REQUIREMENTS.md](./N8N_COMMUNITY_NODE_REQUIREMENTS.md) and [CONTRIBUTING.md](./CONTRIBUTING.md) for detailed information.
8
+
9
+ ## Features
10
+
11
+ - **TeamDynamix API Credential** - Multiple authentication modes (User Login, Admin Login, Token)
12
+ - **Ticket Operations:**
13
+ - Create tickets
14
+ - Get many tickets (with filtering and pagination)
15
+ - Update tickets
16
+ - Delete tickets
17
+ - Add feed entries to tickets
18
+ - **Knowledge Base Operations:** KB article access
19
+ - **Automatic Publishing:** CI/CD pipeline automatically publishes updates to npm
20
+
21
+ ## Installation
22
+
23
+ ### From npm (for n8n users)
24
+
25
+ Follow the n8n community node installation guide:
26
+
27
+ - https://docs.n8n.io/integrations/community-nodes/installation/
28
+
29
+ Package name:
30
+
31
+ ```bash
32
+ n8n-nodes-team-dynamix
33
+ ```
34
+
35
+ ### For local development
36
+
37
+ ```bash
38
+ npm install
39
+ ```
40
+
41
+ ## Local Development
42
+
43
+ Start n8n with this node loaded and hot-reloaded:
44
+
45
+ ```bash
46
+ npm run dev
47
+ ```
48
+
49
+ Useful commands:
50
+
51
+ ```bash
52
+ npm run lint
53
+ npm run lint:fix
54
+ npm run build
55
+ ```
56
+
57
+ ## Credentials
58
+
59
+ Credential type: `TeamDynamix API` (`teamDynamixApi`)
60
+
61
+ Supported auth modes:
62
+
63
+ - User Login
64
+ - Admin Login
65
+ - Existing Token (Manual)
66
+
67
+ Configure your TeamDynamix base URL and whichever auth fields apply to your mode.
68
+
69
+ ## Operations
70
+
71
+ Resource: `Ticket`
72
+
73
+ - **Create**
74
+ - Mode: Guided Fields or Raw JSON
75
+ - Endpoint: `POST /tickets`
76
+ - **Get Many**
77
+ - Endpoint: `GET /tickets`
78
+ - Optional query params: `statusId`, `page`, `maxResults`
79
+ - **Update**
80
+ - Endpoint: `PUT /tickets/{ticketId}`
81
+ - **Delete**
82
+ - Endpoint: `DELETE /tickets/{ticketId}`
83
+ - **Add Feed**
84
+ - Endpoint: `POST /tickets/{ticketId}/feed`
85
+
86
+ All requests are made against your configured credential `baseUrl`.
87
+
88
+ ## Compatibility
89
+
90
+ - Node.js 22+
91
+ - Built with `@n8n/node-cli`
92
+
93
+ ## Contributing
94
+
95
+ We welcome contributions! Before contributing, please see:
96
+
97
+ - **[CONTRIBUTING.md](./CONTRIBUTING.md)** - Development workflow, branch strategy, and testing guidelines
98
+ - **[N8N_COMMUNITY_NODE_REQUIREMENTS.md](./N8N_COMMUNITY_NODE_REQUIREMENTS.md)** - N8N standards, publishing requirements, and submission process
99
+
100
+ ### Quick Setup for Development
101
+
102
+ ```bash
103
+ npm install # Install dependencies
104
+ npm run dev # Start with hot reload
105
+ npm run lint # Check code quality
106
+ npm run build # Build distribution
107
+ ```
108
+
109
+ ## Publishing
110
+
111
+ This package is automatically published to npm on every push to the `main` or `master` branch via Azure Pipelines CI/CD.
112
+
113
+ **Setup required:** First-time setup needs Azure DevOps npm service connection configuration. See [AZURE_DEVOPS_SETUP.md](./AZURE_DEVOPS_SETUP.md) for complete step-by-step instructions.
114
+
115
+ **Important:** All n8n community nodes must follow [publishing requirements](./N8N_COMMUNITY_NODE_REQUIREMENTS.md#publishing-requirements), including:
116
+
117
+ - ✅ Automatic linting and building on all commits
118
+ - ✅ Publishing to npm registry with proper authentication
119
+ - ⚠️ GitHub Actions with provenance statement requirement (May 1st, 2026+)
120
+
121
+ See [N8N_COMMUNITY_NODE_REQUIREMENTS.md](./N8N_COMMUNITY_NODE_REQUIREMENTS.md) for full publishing standards.
122
+
123
+ ## Resources
124
+
125
+ - **N8N Documentation:** https://docs.n8n.io/integrations/creating-nodes/
126
+ - **N8N Community Nodes:** https://docs.n8n.io/integrations/community-nodes/
127
+ - **N8N Creator Portal (Submission):** https://creators.n8n.io/nodes
128
+ - **TeamDynamix API Docs:** https://solutions.teamdynamix.com/TDWebApi/
129
+ - **NPM Package:** https://www.npmjs.com/package/n8n-nodes-team-dynamix
130
+
131
+ ## License
132
+
133
+ MIT
@@ -0,0 +1,13 @@
1
+ import { IAuthenticateGeneric, Icon, ICredentialDataDecryptedObject, ICredentialTestRequest, ICredentialType, IHttpRequestHelper, INodeProperties } from 'n8n-workflow';
2
+ export declare class TeamDynamixApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ icon: Icon;
7
+ properties: INodeProperties[];
8
+ authenticate: IAuthenticateGeneric;
9
+ preAuthentication(this: IHttpRequestHelper, credentials: ICredentialDataDecryptedObject): Promise<{
10
+ token: string;
11
+ }>;
12
+ test: ICredentialTestRequest;
13
+ }
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TeamDynamixApi = void 0;
4
+ class TeamDynamixApi {
5
+ constructor() {
6
+ this.name = 'teamDynamixApi';
7
+ this.displayName = 'TeamDynamix API';
8
+ this.documentationUrl = 'https://solutions.teamdynamix.com/TDWebApi/';
9
+ this.icon = {
10
+ light: 'file:../icons/TeamDynamix.svg',
11
+ dark: 'file:../icons/TeamDynamix.dark.svg',
12
+ };
13
+ this.properties = [
14
+ {
15
+ displayName: 'Bearer Token',
16
+ name: 'token',
17
+ type: 'hidden',
18
+ typeOptions: { expirable: true, password: true },
19
+ default: '',
20
+ },
21
+ {
22
+ displayName: 'Base URL',
23
+ name: 'baseUrl',
24
+ type: 'string',
25
+ default: 'https://solutions.teamdynamix.com/TDWebApi/api',
26
+ required: true,
27
+ },
28
+ {
29
+ displayName: 'Auth Method',
30
+ name: 'authMethod',
31
+ type: 'options',
32
+ options: [
33
+ { name: 'User Login', value: 'login' },
34
+ { name: 'Admin Login', value: 'loginadmin' },
35
+ ],
36
+ default: 'login',
37
+ required: true,
38
+ },
39
+ {
40
+ displayName: 'Username',
41
+ name: 'username',
42
+ type: 'string',
43
+ default: '',
44
+ displayOptions: { show: { authMethod: ['login'] } },
45
+ },
46
+ {
47
+ displayName: 'Password',
48
+ name: 'password',
49
+ type: 'string',
50
+ default: '',
51
+ displayOptions: { show: { authMethod: ['login'] } },
52
+ typeOptions: { password: true },
53
+ },
54
+ {
55
+ displayName: 'Business Entity ID (BEID)',
56
+ name: 'beid',
57
+ type: 'string',
58
+ default: '',
59
+ displayOptions: { show: { authMethod: ['loginadmin'] } },
60
+ },
61
+ {
62
+ displayName: 'Web Services Key',
63
+ name: 'wsKey',
64
+ type: 'string',
65
+ typeOptions: { password: true },
66
+ default: '',
67
+ displayOptions: { show: { authMethod: ['loginadmin'] } },
68
+ },
69
+ ];
70
+ this.authenticate = {
71
+ type: 'generic',
72
+ properties: {
73
+ headers: {
74
+ Authorization: '=Bearer {{$credentials?.token}}',
75
+ },
76
+ },
77
+ };
78
+ this.test = {
79
+ request: {
80
+ method: 'GET',
81
+ url: '={{ $credentials.baseUrl.replace(/\\/+$/, "") }}/auth/getuser',
82
+ },
83
+ };
84
+ }
85
+ async preAuthentication(credentials) {
86
+ var _a, _b, _c, _d, _e;
87
+ const base = credentials.baseUrl.replace(/\/+$/, '');
88
+ const authMethod = String((_a = credentials.authMethod) !== null && _a !== void 0 ? _a : 'login');
89
+ const authPath = authMethod === 'loginadmin' ? '/auth/loginadmin' : '/auth';
90
+ let payload;
91
+ if (authMethod === 'loginadmin') {
92
+ const beid = String((_b = credentials.beid) !== null && _b !== void 0 ? _b : '').trim();
93
+ const wsKey = String((_c = credentials.wsKey) !== null && _c !== void 0 ? _c : '').trim();
94
+ if (!beid || !wsKey) {
95
+ throw new Error('TeamDynamix admin auth requires both BEID and Web Services Key.');
96
+ }
97
+ payload = {
98
+ BEID: beid,
99
+ WebServicesKey: wsKey,
100
+ };
101
+ }
102
+ else {
103
+ const username = String((_d = credentials.username) !== null && _d !== void 0 ? _d : '').trim();
104
+ const password = String((_e = credentials.password) !== null && _e !== void 0 ? _e : '');
105
+ if (!username || !password) {
106
+ throw new Error('TeamDynamix user auth requires both Username and Password.');
107
+ }
108
+ payload = {
109
+ username,
110
+ password,
111
+ };
112
+ }
113
+ const response = await this.helpers.httpRequest({
114
+ method: 'POST',
115
+ url: `${base}${authPath}`,
116
+ body: payload,
117
+ });
118
+ const rawBody = response;
119
+ const token = typeof rawBody === 'string' ? rawBody.trim() : String(rawBody !== null && rawBody !== void 0 ? rawBody : '');
120
+ if (!token) {
121
+ throw new Error('TeamDynamix auth failed: token not found in response body.');
122
+ }
123
+ credentials.token = token;
124
+ return { token };
125
+ }
126
+ }
127
+ exports.TeamDynamixApi = TeamDynamixApi;
128
+ //# sourceMappingURL=TeamDynamixApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TeamDynamixApi.credentials.js","sourceRoot":"","sources":["../../credentials/TeamDynamixApi.credentials.ts"],"names":[],"mappings":";;;AAUA,MAAa,cAAc;IAA3B;QACC,SAAI,GAAG,gBAAgB,CAAC;QACxB,gBAAW,GAAG,iBAAiB,CAAC;QAChC,qBAAgB,GAAG,6CAA6C,CAAC;QACjE,SAAI,GAAS;YACZ,KAAK,EAAE,+BAA+B;YACtC,IAAI,EAAE,oCAAoC;SAC1C,CAAC;QACF,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAChD,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,gDAAgD;gBACzD,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,aAAa;gBAC1B,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE;oBACR,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE;oBACtC,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,YAAY,EAAE;iBAC5C;gBACD,OAAO,EAAE,OAAO;gBAChB,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,CAAC,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OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAC,CAAC;QACnF,IAAI,CAAC,KAAK,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;QAC/E,CAAC;QAGD,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC;QAC1B,OAAO,EAAE,KAAK,EAAE,CAAC;IAClB,CAAC;CAQD;AAnID,wCAmIC"}
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg width="100%" height="100%" viewBox="0 0 410 407" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
4
+ <g id="Layer_1-2" transform="matrix(1,0,0,1,-222.49,129.56)">
5
+ <g transform="matrix(2.759555,0,0,2.759555,222.531733,-129.56)">
6
+ <g>
7
+ <path d="M2.68,30.88C1.87,33.15 1.44,35.49 1.44,37.88C1.44,56.31 26.71,71.66 60.18,75.05C64.71,75.51 69.38,75.75 74.17,75.75C78.96,75.75 83.64,75.51 88.17,75.05C101.95,105.73 101.29,135.27 85.33,144.48C83.33,145.63 81.18,146.42 78.9,146.86C77.29,147.13 75.71,147.27 74.18,147.28C72.64,147.28 71.07,147.13 69.46,146.86C52.22,143.96 31.17,126.4 16.18,100.44C1.12,74.37 -3.55,47.24 2.68,30.88Z" style="fill:url(#_Linear1);fill-rule:nonzero;"/>
8
+ <path d="M74.17,50.8C93.85,23.51 119.78,9.3 135.74,18.51C137.45,19.5 138.98,20.72 140.34,22.15C140.4,22.22 140.64,22.5 140.7,22.57C140.81,22.7 140.91,22.82 141.02,22.95C141.02,22.96 141.04,22.97 141.05,22.99C141.13,23.09 141.2,23.18 141.28,23.28C141.43,23.47 141.58,23.65 141.72,23.84C141.81,23.95 141.89,24.06 141.97,24.18C142.02,24.25 142.07,24.32 142.12,24.38C142.17,24.45 142.37,24.73 142.42,24.8C142.47,24.87 142.52,24.94 142.56,25.01C142.62,25.09 142.67,25.18 142.73,25.26C142.77,25.32 142.81,25.37 142.84,25.43C142.92,25.55 143,25.67 143.08,25.79C143.16,25.91 143.23,26.02 143.3,26.14C143.41,26.31 143.52,26.49 143.62,26.66C143.73,26.85 143.84,27.03 143.95,27.22C144.01,27.33 144.08,27.45 144.14,27.56C144.17,27.62 144.21,27.68 144.24,27.74C144.3,27.85 144.35,27.95 144.41,28.06C144.46,28.16 144.52,28.27 144.57,28.37C144.61,28.44 144.64,28.51 144.68,28.58C144.72,28.65 144.75,28.72 144.78,28.8L144.78,28.81C144.83,28.91 144.87,29.01 144.92,29.1C144.99,29.25 145.06,29.4 145.12,29.56C152.14,45.76 147.63,73.66 132.17,100.44C117.18,126.4 96.13,143.97 78.89,146.86C81.17,146.42 83.32,145.63 85.32,144.48C101.27,135.27 101.94,105.73 88.16,75.05C86.29,70.89 84.16,66.71 81.76,62.56C79.37,58.42 76.82,54.49 74.17,50.8Z" style="fill:url(#_Linear2);fill-rule:nonzero;"/>
9
+ <path d="M1.44,37.87C1.44,35.48 1.86,33.14 2.68,30.87C3.12,29.72 3.61,28.62 4.16,27.58C5.12,25.81 6.32,24.09 7.74,22.43C19.09,9.21 44.56,0 74.17,0C103.78,0 128.88,9.08 140.35,22.15C138.99,20.72 137.46,19.5 135.75,18.51C119.79,9.3 93.86,23.5 74.18,50.8C71.52,54.49 68.98,58.41 66.59,62.56C64.19,66.71 62.06,70.89 60.19,75.05C26.71,71.65 1.44,56.3 1.44,37.87Z" style="fill:url(#_Linear3);fill-rule:nonzero;"/>
10
+ </g>
11
+ </g>
12
+ </g>
13
+ <defs>
14
+ <linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(85.69,66.64,-66.64,85.69,6.44,58.15)"><stop offset="0" style="stop-color:rgb(69,237,233);stop-opacity:1"/><stop offset="0.3" style="stop-color:rgb(69,237,233);stop-opacity:1"/><stop offset="0.9" style="stop-color:rgb(38,25,102);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(38,25,102);stop-opacity:1"/></linearGradient>
15
+ <linearGradient id="_Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(2558.196783,-15736.762536,15736.762536,2558.196783,6579.06585,17941.375717)"><stop offset="0" style="stop-color:rgb(69,237,233);stop-opacity:1"/><stop offset="0.3" style="stop-color:rgb(69,237,233);stop-opacity:1"/><stop offset="0.9" style="stop-color:rgb(38,25,102);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(38,25,102);stop-opacity:1"/></linearGradient>
16
+ <linearGradient id="_Linear3" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-15043.953,2701.0495,-2701.0495,-15043.953,17095.7046,1157.271)"><stop offset="0" style="stop-color:rgb(69,237,233);stop-opacity:1"/><stop offset="0.3" style="stop-color:rgb(69,237,233);stop-opacity:1"/><stop offset="0.9" style="stop-color:rgb(38,25,102);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(38,25,102);stop-opacity:1"/></linearGradient>
17
+ </defs>
18
+ </svg>
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg width="100%" height="100%" viewBox="0 0 410 407" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
4
+ <g id="Layer_1-2" transform="matrix(1,0,0,1,-222.49,129.56)">
5
+ <g transform="matrix(2.759555,0,0,2.759555,222.531733,-129.56)">
6
+ <g>
7
+ <path d="M2.68,30.88C1.87,33.15 1.44,35.49 1.44,37.88C1.44,56.31 26.71,71.66 60.18,75.05C64.71,75.51 69.38,75.75 74.17,75.75C78.96,75.75 83.64,75.51 88.17,75.05C101.95,105.73 101.29,135.27 85.33,144.48C83.33,145.63 81.18,146.42 78.9,146.86C77.29,147.13 75.71,147.27 74.18,147.28C72.64,147.28 71.07,147.13 69.46,146.86C52.22,143.96 31.17,126.4 16.18,100.44C1.12,74.37 -3.55,47.24 2.68,30.88Z" style="fill:url(#_Linear1);fill-rule:nonzero;"/>
8
+ <path d="M74.17,50.8C93.85,23.51 119.78,9.3 135.74,18.51C137.45,19.5 138.98,20.72 140.34,22.15C140.4,22.22 140.64,22.5 140.7,22.57C140.81,22.7 140.91,22.82 141.02,22.95C141.02,22.96 141.04,22.97 141.05,22.99C141.13,23.09 141.2,23.18 141.28,23.28C141.43,23.47 141.58,23.65 141.72,23.84C141.81,23.95 141.89,24.06 141.97,24.18C142.02,24.25 142.07,24.32 142.12,24.38C142.17,24.45 142.37,24.73 142.42,24.8C142.47,24.87 142.52,24.94 142.56,25.01C142.62,25.09 142.67,25.18 142.73,25.26C142.77,25.32 142.81,25.37 142.84,25.43C142.92,25.55 143,25.67 143.08,25.79C143.16,25.91 143.23,26.02 143.3,26.14C143.41,26.31 143.52,26.49 143.62,26.66C143.73,26.85 143.84,27.03 143.95,27.22C144.01,27.33 144.08,27.45 144.14,27.56C144.17,27.62 144.21,27.68 144.24,27.74C144.3,27.85 144.35,27.95 144.41,28.06C144.46,28.16 144.52,28.27 144.57,28.37C144.61,28.44 144.64,28.51 144.68,28.58C144.72,28.65 144.75,28.72 144.78,28.8L144.78,28.81C144.83,28.91 144.87,29.01 144.92,29.1C144.99,29.25 145.06,29.4 145.12,29.56C152.14,45.76 147.63,73.66 132.17,100.44C117.18,126.4 96.13,143.97 78.89,146.86C81.17,146.42 83.32,145.63 85.32,144.48C101.27,135.27 101.94,105.73 88.16,75.05C86.29,70.89 84.16,66.71 81.76,62.56C79.37,58.42 76.82,54.49 74.17,50.8Z" style="fill:url(#_Linear2);fill-rule:nonzero;"/>
9
+ <path d="M1.44,37.87C1.44,35.48 1.86,33.14 2.68,30.87C3.12,29.72 3.61,28.62 4.16,27.58C5.12,25.81 6.32,24.09 7.74,22.43C19.09,9.21 44.56,0 74.17,0C103.78,0 128.88,9.08 140.35,22.15C138.99,20.72 137.46,19.5 135.75,18.51C119.79,9.3 93.86,23.5 74.18,50.8C71.52,54.49 68.98,58.41 66.59,62.56C64.19,66.71 62.06,70.89 60.19,75.05C26.71,71.65 1.44,56.3 1.44,37.87Z" style="fill:url(#_Linear3);fill-rule:nonzero;"/>
10
+ </g>
11
+ </g>
12
+ </g>
13
+ <defs>
14
+ <linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(85.69,66.64,-66.64,85.69,6.44,58.15)"><stop offset="0" style="stop-color:rgb(69,237,233);stop-opacity:1"/><stop offset="0.3" style="stop-color:rgb(69,237,233);stop-opacity:1"/><stop offset="0.9" style="stop-color:rgb(38,25,102);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(38,25,102);stop-opacity:1"/></linearGradient>
15
+ <linearGradient id="_Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(2558.196783,-15736.762536,15736.762536,2558.196783,6579.06585,17941.375717)"><stop offset="0" style="stop-color:rgb(69,237,233);stop-opacity:1"/><stop offset="0.3" style="stop-color:rgb(69,237,233);stop-opacity:1"/><stop offset="0.9" style="stop-color:rgb(38,25,102);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(38,25,102);stop-opacity:1"/></linearGradient>
16
+ <linearGradient id="_Linear3" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-15043.953,2701.0495,-2701.0495,-15043.953,17095.7046,1157.271)"><stop offset="0" style="stop-color:rgb(69,237,233);stop-opacity:1"/><stop offset="0.3" style="stop-color:rgb(69,237,233);stop-opacity:1"/><stop offset="0.9" style="stop-color:rgb(38,25,102);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(38,25,102);stop-opacity:1"/></linearGradient>
17
+ </defs>
18
+ </svg>
@@ -0,0 +1,2 @@
1
+ import { IExecuteFunctions, INodeExecutionData } from 'n8n-workflow';
2
+ export declare function executeKbArticleOperation(this: IExecuteFunctions, itemIndex: number, baseUrl: string): Promise<INodeExecutionData[]>;
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.executeKbArticleOperation = executeKbArticleOperation;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ function parseJsonObject(value, fieldName, itemIndex) {
6
+ let body;
7
+ if (typeof value === 'string') {
8
+ try {
9
+ body = JSON.parse(value);
10
+ }
11
+ catch {
12
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `${fieldName} must be valid JSON`, {
13
+ itemIndex,
14
+ });
15
+ }
16
+ }
17
+ else {
18
+ body = value;
19
+ }
20
+ if (Array.isArray(body) || typeof body !== 'object' || body === null) {
21
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `${fieldName} must be a JSON object`, {
22
+ itemIndex,
23
+ });
24
+ }
25
+ return body;
26
+ }
27
+ async function executeCreate(itemIndex, kbArticlesBaseUrl) {
28
+ const kbArticleDataRaw = this.getNodeParameter('kbArticleData', itemIndex);
29
+ const body = parseJsonObject.call(this, kbArticleDataRaw, 'KB Article Data', itemIndex);
30
+ const response = await this.helpers.httpRequestWithAuthentication.call(this, 'teamDynamixApi', {
31
+ method: 'POST',
32
+ url: kbArticlesBaseUrl,
33
+ body,
34
+ json: true,
35
+ });
36
+ return [
37
+ {
38
+ json: response,
39
+ pairedItem: { item: itemIndex },
40
+ },
41
+ ];
42
+ }
43
+ async function executeGetAll(itemIndex, kbArticlesBaseUrl) {
44
+ const response = await this.helpers.httpRequestWithAuthentication.call(this, 'teamDynamixApi', {
45
+ method: 'GET',
46
+ url: kbArticlesBaseUrl,
47
+ json: true,
48
+ });
49
+ const kbArticles = Array.isArray(response) ? response : [response];
50
+ return kbArticles.map((article) => ({
51
+ json: article,
52
+ pairedItem: { item: itemIndex },
53
+ }));
54
+ }
55
+ async function executeGet(itemIndex, kbArticlesBaseUrl, kbArticleId) {
56
+ const response = await this.helpers.httpRequestWithAuthentication.call(this, 'teamDynamixApi', {
57
+ method: 'GET',
58
+ url: `${kbArticlesBaseUrl}/${kbArticleId}`,
59
+ json: true,
60
+ });
61
+ return [
62
+ {
63
+ json: response,
64
+ pairedItem: { item: itemIndex },
65
+ },
66
+ ];
67
+ }
68
+ async function executeUpdate(itemIndex, kbArticlesBaseUrl, kbArticleId) {
69
+ const kbArticleDataRaw = this.getNodeParameter('kbArticleData', itemIndex);
70
+ const body = parseJsonObject.call(this, kbArticleDataRaw, 'KB Article Data', itemIndex);
71
+ const response = await this.helpers.httpRequestWithAuthentication.call(this, 'teamDynamixApi', {
72
+ method: 'PUT',
73
+ url: `${kbArticlesBaseUrl}/${kbArticleId}`,
74
+ body,
75
+ json: true,
76
+ });
77
+ return [
78
+ {
79
+ json: response,
80
+ pairedItem: { item: itemIndex },
81
+ },
82
+ ];
83
+ }
84
+ async function executeDelete(itemIndex, kbArticlesBaseUrl, kbArticleId) {
85
+ await this.helpers.httpRequestWithAuthentication.call(this, 'teamDynamixApi', {
86
+ method: 'DELETE',
87
+ url: `${kbArticlesBaseUrl}/${kbArticleId}`,
88
+ json: true,
89
+ });
90
+ return [
91
+ {
92
+ json: {
93
+ kbArticleId,
94
+ deleted: true,
95
+ },
96
+ pairedItem: { item: itemIndex },
97
+ },
98
+ ];
99
+ }
100
+ async function executeKbArticleOperation(itemIndex, baseUrl) {
101
+ const resource = this.getNodeParameter('resource', itemIndex);
102
+ const operation = this.getNodeParameter('operation', itemIndex);
103
+ if (resource !== 'kbArticle') {
104
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported combination: ${resource}.${operation}`, {
105
+ itemIndex,
106
+ });
107
+ }
108
+ const kbArticlesBaseUrl = `${baseUrl}/knowledgebase/articles`;
109
+ if (operation === 'create') {
110
+ return executeCreate.call(this, itemIndex, kbArticlesBaseUrl);
111
+ }
112
+ if (operation === 'getAll') {
113
+ return executeGetAll.call(this, itemIndex, kbArticlesBaseUrl);
114
+ }
115
+ const kbArticleId = this.getNodeParameter('kbArticleId', itemIndex);
116
+ if (!kbArticleId || kbArticleId <= 0) {
117
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'KB Article ID must be greater than 0', {
118
+ itemIndex,
119
+ });
120
+ }
121
+ if (operation === 'get') {
122
+ return executeGet.call(this, itemIndex, kbArticlesBaseUrl, kbArticleId);
123
+ }
124
+ if (operation === 'update') {
125
+ return executeUpdate.call(this, itemIndex, kbArticlesBaseUrl, kbArticleId);
126
+ }
127
+ if (operation === 'delete') {
128
+ return executeDelete.call(this, itemIndex, kbArticlesBaseUrl, kbArticleId);
129
+ }
130
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported combination: ${resource}.${operation}`, {
131
+ itemIndex,
132
+ });
133
+ }
134
+ //# sourceMappingURL=KbArticleOperations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KbArticleOperations.js","sourceRoot":"","sources":["../../../nodes/TeamDynamix/KbArticleOperations.ts"],"names":[],"mappings":";;AAmJA,8DAsDC;AAzMD,+CAKsB;AAEtB,SAAS,eAAe,CAEvB,KAA2B,EAC3B,SAAiB,EACjB,SAAiB;IAEjB,IAAI,IAAiB,CAAC;IACtB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,IAAI,CAAC;YACJ,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CA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AAI,SAAS,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,iBAAiB,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,aAAa,EAAE,SAAS,CAAW,CAAC;IAC9E,IAAI,CAAC,WAAW,IAAI,WAAW,IAAI,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,sCAAsC,EAAE;YACpF,SAAS;SACT,CAAC,CAAC;IACJ,CAAC;IAED,IAAI,SAAS,KAAK,KAAK,EAAE,CAAC;QACzB,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,iBAAiB,EAAE,WAAW,CAAC,CAAC;IACzE,CAAC;IAED,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,iBAAiB,EAAE,WAAW,CAAC,CAAC;IAC5E,CAAC;IAED,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,iBAAiB,EAAE,WAAW,CAAC,CAAC;IAC5E,CAAC;IAED,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,4BAA4B,QAAQ,IAAI,SAAS,EAAE,EACnD;QACC,SAAS;KACT,CACD,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class TeamDynamix implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }