Skip to content

Commit 2b04ff4

Browse files
authored
Merge pull request #5 from conciso:bug/CCE-2765-confluence-node-erzeugt-einen-fehler-bei-der-insta
Refactor README and templates, update node configurations, and enhance TypeScript settings
2 parents 14593f5 + 6e9f0db commit 2b04ff4

File tree

12 files changed

+84
-180
lines changed

12 files changed

+84
-180
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = {
1818
extraFileExtensions: ['.json'],
1919
},
2020

21-
ignorePatterns: ['.eslintrc.js', '**/*.js', '**/node_modules/**', '**/dist/**'],
21+
ignorePatterns: ['.eslintrc.js', '**/*.js', '**/node_modules/**', '**/dist/**', '**/archive/**'],
2222

2323
overrides: [
2424
{

README.md

Lines changed: 4 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ A powerful n8n Community Node for seamless integration with Confluence Cloud RES
1414
- **Built-in Error Handling**: Comprehensive error messages with actionable solutions
1515
- **OpenAPI-Generated**: Automatically generated from official Confluence API specifications
1616

17-
### 🎯 **Confluence Cloud Trigger**
18-
- **Real-time Content Monitoring**: Poll for new or updated content
19-
- **Flexible Filtering**: Filter by spaces, labels, authors, and content types
20-
- **Template-based Configuration**: Easy setup with pre-configured templates
21-
- **Custom CQL Support**: Advanced users can write custom Confluence Query Language expressions
22-
- **Smart Time Handling**: Configurable lookback periods for initial runs
23-
2417
### 🛡️ **Quality Assurance**
2518
- **Deprecated API Detection**: Build fails if deprecated APIs are detected
2619
- **Missing Route Validation**: Automatic validation of API route configurations
@@ -124,38 +117,6 @@ Create a **Confluence Cloud API** credential with:
124117

125118

126119

127-
## 🎯 Trigger Configuration
128-
129-
### Template Options
130-
131-
| Template | Description | CQL Generated |
132-
|----------|-------------|---------------|
133-
| **New Pages** | Monitor newly created pages | `type = page AND created >= now("-1h")` |
134-
| **Updated Pages** | Monitor modified pages | `type = page AND lastModified >= now("-1h")` |
135-
| **New or Updated Pages** | Monitor all page changes | `type = page AND (created >= now("-1h") OR lastModified >= now("-1h"))` |
136-
137-
138-
### Filter Options
139-
140-
| Filter | Type | Description | Example |
141-
|--------|------|-------------|---------|
142-
| **Space Keys** | String | Comma-separated space keys | `DOCS, TEAM, HELP` |
143-
| **Labels** | String | Comma-separated labels | `urgent, review, draft` |
144-
| **Author** | String | Confluence Account ID | `99:27935d01-XXXX-XXXX-XXXX-a9b8d3b2ae2e` |
145-
| **Initial Lookback** | Select | How far back to look initially | `1h, 6h, 12h, 1d, 3d, 1w, 2w, 1month` |
146-
147-
### Advanced: Custom CQL
148-
149-
For power users, write custom Confluence Query Language expressions:
150-
151-
```cql
152-
space in ("DOCS", "TEAM") AND
153-
type = page AND
154-
(label = "urgent" OR label = "review") AND
155-
creator = "99:27935d01-XXXX-XXXX-XXXX-a9b8d3b2ae2e" AND
156-
created >= now("-1w")
157-
```
158-
159120
## 💡 Usage Examples
160121

161122
### Example 1: Create a New Page
@@ -176,19 +137,7 @@ created >= now("-1w")
176137
}
177138
```
178139

179-
### Example 2: Monitor New Pages in Specific Spaces
180-
181-
```javascript
182-
// Trigger Configuration
183-
{
184-
"queryType": "template",
185-
"template": "new_pages",
186-
"spaceKeys": "DOCS, ENGINEERING",
187-
"initialLookback": "1d"
188-
}
189-
```
190-
191-
### Example 3: List All Spaces
140+
### Example 2: List All Spaces
192141

193142
```javascript
194143
// Simple space listing
@@ -219,11 +168,8 @@ npm install
219168
# Build the project
220169
npm run build
221170

222-
# Run tests
223-
npm test
224-
225-
# Format code
226-
npm run format
171+
# Build and run in dev mode
172+
npm run dev # then open browser with http://localhost:5678
227173
```
228174

229175
### Architecture
@@ -257,7 +203,7 @@ Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md)
257203
"legacy": false
258204
}
259205
```
260-
3. Run `npm run build` to generate operations
206+
3. Run `npm run dev` to generate operations
261207
4. Test your changes
262208

263209
## 📋 API Compatibility
@@ -266,8 +212,6 @@ Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md)
266212
|---------------------|----------------|-------|
267213
| **REST API v2** | ✅ Full Support | Primary API version |
268214
| **REST API v1** | 🟡 Legacy Support | For operations not yet in V2 |
269-
| **Content API** | ✅ Supported | Via V2 endpoints |
270-
| **Space API** | ✅ Supported | Both V1 and V2 |
271215

272216
## 🐛 Troubleshooting
273217

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"node": "n8n-nodes-base.ConfluenceCloudTrigger",
3+
"nodeVersion": "1.0",
4+
"codexVersion": "1.0",
5+
"categories": ["Development", "Productivity"],
6+
"credentials": [
7+
{
8+
"name": "confluenceCloudApi",
9+
"displayName": "Confluence Cloud API"
10+
}
11+
]
12+
}
File renamed without changes.

gulpfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function copyIcons() {
104104

105105
// ESLint (for credentials and nodes)
106106
function lint(done) {
107-
const eslint = spawn('npx', ['eslint', '--fix', 'credentials/**/*.ts', 'nodes/**/*.ts'], { stdio: 'inherit' });
107+
const eslint = spawn('npx', ['eslint', '--fix', 'credentials/**/*.ts', '--ignore-pattern', '!nodes/**/*.ts'], { stdio: 'inherit' });
108108
eslint.on('close', (code) => {
109109
if (code === 0) {
110110
console.log('✅ ESLint passed');

index.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
module.exports = {
2-
...require('./dist/nodes/ConfluenceCloud/ConfluenceCloud.node.js'),
3-
...require('./dist/credentials/ConfluenceCloudApi.credentials.js'),
4-
};

nodes/ConfluenceCloud/ConfluenceCloud.node.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
2-
"node": "dist/nodes/ConfluenceCloud/ConfluenceCloud.node.js",
2+
"node": "n8n-nodes-base.ConfluenceCloud",
3+
"nodeVersion": "1.0",
4+
"codexVersion": "1.0",
5+
"categories": ["Development", "Productivity"],
36
"credentials": [
47
{
58
"name": "confluenceCloudApi",

nodes/ConfluenceCloud/ConfluenceCloudTrigger.node.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
2-
"name": "n8n-nodes-confluence-cloud",
3-
"version": "1.2.5",
2+
"name": "@conciso/n8n-nodes-confluence-cloud",
3+
"version": "1.2.14",
44
"description": "n8n node for Confluence Cloud REST API integration",
5+
"publishConfig": {
6+
"access": "public"
7+
},
58
"keywords": [
69
"n8n-community-node-package",
710
"confluence",
@@ -38,17 +41,15 @@
3841
"release:major": "gulp releaseMajor"
3942
},
4043
"files": [
41-
"dist",
42-
"index.js"
44+
"dist"
4345
],
4446
"n8n": {
4547
"n8nNodesApiVersion": 1,
4648
"credentials": [
4749
"dist/credentials/ConfluenceCloudApi.credentials.js"
4850
],
4951
"nodes": [
50-
"dist/nodes/ConfluenceCloud/ConfluenceCloud.node.js",
51-
"dist/nodes/ConfluenceCloud/ConfluenceCloudTrigger.node.js"
52+
"dist/nodes/ConfluenceCloud/ConfluenceCloud.node.js"
5253
]
5354
},
5455
"devDependencies": {

scripts/openapi-generator.js

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -271,38 +271,39 @@ export const mainProperties = [
271271
const nodeCode = `"use strict";
272272
Object.defineProperty(exports, "__esModule", { value: true });
273273
exports.ConfluenceCloud = void 0;
274-
const n8n_workflow_1 = require("n8n-workflow");
275274
276275
class ConfluenceCloud {
277-
description = {
278-
displayName: 'Confluence Cloud',
279-
name: 'confluenceCloud',
280-
icon: 'file:confluence.svg',
281-
group: ['output'],
282-
version: 1,
283-
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
284-
description: 'Zugriff auf die Confluence Cloud REST API - Auto-generated from OpenAPI',
285-
defaults: {
286-
name: 'Confluence Cloud',
287-
},
288-
inputs: [n8n_workflow_1.NodeConnectionType.Main],
289-
outputs: [n8n_workflow_1.NodeConnectionType.Main],
290-
usableAsTool: true,
291-
credentials: [
292-
{
293-
name: 'confluenceCloudApi',
294-
required: true,
276+
constructor() {
277+
this.description = {
278+
displayName: 'Confluence Cloud',
279+
name: 'confluenceCloud',
280+
icon: 'file:confluence.svg',
281+
group: ['output'],
282+
version: 1,
283+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
284+
description: 'Access to the Confluence Cloud REST API - Auto-generated from OpenAPI',
285+
defaults: {
286+
name: 'Confluence Cloud',
295287
},
296-
],
297-
requestDefaults: {
298-
baseURL: '={{$credentials.domain}}',
299-
headers: {
300-
Accept: 'application/json',
301-
'Content-Type': 'application/json',
288+
inputs: ["main"],
289+
outputs: ["main"],
290+
usableAsTool: true,
291+
credentials: [
292+
{
293+
name: 'confluenceCloudApi',
294+
required: true,
295+
},
296+
],
297+
requestDefaults: {
298+
baseURL: '={{$credentials.domain}}',
299+
headers: {
300+
Accept: 'application/json',
301+
'Content-Type': 'application/json',
302+
},
302303
},
303-
},
304-
properties: ${JSON.stringify(allProperties, null, 8)},
305-
};
304+
properties: ${JSON.stringify(allProperties, null, 8)},
305+
};
306+
}
306307
}
307308
exports.ConfluenceCloud = ConfluenceCloud;`;
308309

0 commit comments

Comments
 (0)