n8n-nodes-craft-daily-notes 1.0.24 → 1.0.27

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.
Files changed (80) hide show
  1. package/README.md +223 -64
  2. package/dist/credentials/CraftDocumentsApi.credentials.d.ts +9 -0
  3. package/dist/credentials/CraftDocumentsApi.credentials.js +31 -0
  4. package/dist/credentials/CraftDocumentsApi.credentials.js.map +1 -0
  5. package/dist/nodes/CraftDailyNotes/resources/collection/addItems.js +33 -7
  6. package/dist/nodes/CraftDailyNotes/resources/collection/addItems.js.map +1 -1
  7. package/dist/nodes/CraftDailyNotes/resources/collection/deleteItems.js +1 -1
  8. package/dist/nodes/CraftDailyNotes/resources/collection/deleteItems.js.map +1 -1
  9. package/dist/nodes/CraftDailyNotes/resources/collection/updateItems.js +40 -7
  10. package/dist/nodes/CraftDailyNotes/resources/collection/updateItems.js.map +1 -1
  11. package/dist/nodes/CraftDocuments/CraftDocuments.node.d.ts +12 -0
  12. package/dist/nodes/CraftDocuments/CraftDocuments.node.js +83 -0
  13. package/dist/nodes/CraftDocuments/CraftDocuments.node.js.map +1 -0
  14. package/dist/nodes/CraftDocuments/CraftDocuments.node.json +22 -0
  15. package/dist/nodes/CraftDocuments/loadOptions/getCollections.d.ts +2 -0
  16. package/dist/nodes/CraftDocuments/loadOptions/getCollections.js +18 -0
  17. package/dist/nodes/CraftDocuments/loadOptions/getCollections.js.map +1 -0
  18. package/dist/nodes/CraftDocuments/loadOptions/getDocuments.d.ts +2 -0
  19. package/dist/nodes/CraftDocuments/loadOptions/getDocuments.js +18 -0
  20. package/dist/nodes/CraftDocuments/loadOptions/getDocuments.js.map +1 -0
  21. package/dist/nodes/CraftDocuments/resources/block/delete.d.ts +2 -0
  22. package/dist/nodes/CraftDocuments/resources/block/delete.js +24 -0
  23. package/dist/nodes/CraftDocuments/resources/block/delete.js.map +1 -0
  24. package/dist/nodes/CraftDocuments/resources/block/get.d.ts +2 -0
  25. package/dist/nodes/CraftDocuments/resources/block/get.js +91 -0
  26. package/dist/nodes/CraftDocuments/resources/block/get.js.map +1 -0
  27. package/dist/nodes/CraftDocuments/resources/block/index.d.ts +2 -0
  28. package/dist/nodes/CraftDocuments/resources/block/index.js +104 -0
  29. package/dist/nodes/CraftDocuments/resources/block/index.js.map +1 -0
  30. package/dist/nodes/CraftDocuments/resources/block/insert.d.ts +3 -0
  31. package/dist/nodes/CraftDocuments/resources/block/insert.js +117 -0
  32. package/dist/nodes/CraftDocuments/resources/block/insert.js.map +1 -0
  33. package/dist/nodes/CraftDocuments/resources/block/move.d.ts +2 -0
  34. package/dist/nodes/CraftDocuments/resources/block/move.js +81 -0
  35. package/dist/nodes/CraftDocuments/resources/block/move.js.map +1 -0
  36. package/dist/nodes/CraftDocuments/resources/block/search.d.ts +2 -0
  37. package/dist/nodes/CraftDocuments/resources/block/search.js +96 -0
  38. package/dist/nodes/CraftDocuments/resources/block/search.js.map +1 -0
  39. package/dist/nodes/CraftDocuments/resources/block/update.d.ts +2 -0
  40. package/dist/nodes/CraftDocuments/resources/block/update.js +85 -0
  41. package/dist/nodes/CraftDocuments/resources/block/update.js.map +1 -0
  42. package/dist/nodes/CraftDocuments/resources/collection/addItems.d.ts +2 -0
  43. package/dist/nodes/CraftDocuments/resources/collection/addItems.js +60 -0
  44. package/dist/nodes/CraftDocuments/resources/collection/addItems.js.map +1 -0
  45. package/dist/nodes/CraftDocuments/resources/collection/deleteItems.d.ts +2 -0
  46. package/dist/nodes/CraftDocuments/resources/collection/deleteItems.js +36 -0
  47. package/dist/nodes/CraftDocuments/resources/collection/deleteItems.js.map +1 -0
  48. package/dist/nodes/CraftDocuments/resources/collection/getItems.d.ts +2 -0
  49. package/dist/nodes/CraftDocuments/resources/collection/getItems.js +37 -0
  50. package/dist/nodes/CraftDocuments/resources/collection/getItems.js.map +1 -0
  51. package/dist/nodes/CraftDocuments/resources/collection/getSchema.d.ts +2 -0
  52. package/dist/nodes/CraftDocuments/resources/collection/getSchema.js +45 -0
  53. package/dist/nodes/CraftDocuments/resources/collection/getSchema.js.map +1 -0
  54. package/dist/nodes/CraftDocuments/resources/collection/index.d.ts +2 -0
  55. package/dist/nodes/CraftDocuments/resources/collection/index.js +101 -0
  56. package/dist/nodes/CraftDocuments/resources/collection/index.js.map +1 -0
  57. package/dist/nodes/CraftDocuments/resources/collection/list.d.ts +2 -0
  58. package/dist/nodes/CraftDocuments/resources/collection/list.js +60 -0
  59. package/dist/nodes/CraftDocuments/resources/collection/list.js.map +1 -0
  60. package/dist/nodes/CraftDocuments/resources/collection/updateItems.d.ts +2 -0
  61. package/dist/nodes/CraftDocuments/resources/collection/updateItems.js +67 -0
  62. package/dist/nodes/CraftDocuments/resources/collection/updateItems.js.map +1 -0
  63. package/dist/nodes/CraftDocuments/resources/document/index.d.ts +2 -0
  64. package/dist/nodes/CraftDocuments/resources/document/index.js +31 -0
  65. package/dist/nodes/CraftDocuments/resources/document/index.js.map +1 -0
  66. package/dist/nodes/CraftDocuments/resources/document/list.d.ts +2 -0
  67. package/dist/nodes/CraftDocuments/resources/document/list.js +15 -0
  68. package/dist/nodes/CraftDocuments/resources/document/list.js.map +1 -0
  69. package/dist/nodes/CraftDocuments/resources/search/index.d.ts +2 -0
  70. package/dist/nodes/CraftDocuments/resources/search/index.js +110 -0
  71. package/dist/nodes/CraftDocuments/resources/search/index.js.map +1 -0
  72. package/dist/nodes/CraftDocuments/shared/transport.d.ts +2 -0
  73. package/dist/nodes/CraftDocuments/shared/transport.js +20 -0
  74. package/dist/nodes/CraftDocuments/shared/transport.js.map +1 -0
  75. package/dist/package.json +11 -6
  76. package/dist/tsconfig.tsbuildinfo +1 -1
  77. package/package.json +11 -6
  78. package/dist/nodes/CraftDailyNotes/shared/blockBuilder.d.ts +0 -18
  79. package/dist/nodes/CraftDailyNotes/shared/blockBuilder.js +0 -191
  80. package/dist/nodes/CraftDailyNotes/shared/blockBuilder.js.map +0 -1
package/README.md CHANGED
@@ -1,20 +1,104 @@
1
- # n8n-nodes-craft-daily-notes
2
-
3
- n8n community node for **[Craft Daily Notes API](https://www.craft.do/s/hLrMZpKFfYRWPT)** — manage blocks, tasks, collections, and search across your Craft daily notes.
4
-
5
- [![npm version](https://img.shields.io/npm/v/n8n-nodes-craft-daily-notes?style=flat-square&color=blue)](https://www.npmjs.com/package/n8n-nodes-craft-daily-notes)
6
- [![n8n](https://img.shields.io/badge/n8n-Community%20Node-FF6D5A?style=flat-square&logo=n8n&logoColor=white)](https://docs.n8n.io/integrations/community-nodes/)
7
- [![License](https://img.shields.io/badge/License-MIT-green?style=flat-square)](LICENSE.md)
8
- [![Node.js](https://img.shields.io/badge/Node.js-%3E%3D18.0.0-brightgreen?style=flat-square&logo=node.js&logoColor=white)](https://nodejs.org/)
9
-
10
- ## Installation
1
+ <h1 align="center">📝 n8n-nodes-craft 📝</h1>
2
+ <h3 align="center">Automate your Craft docs. Stop manual copy-pasting.</h3>
3
+
4
+ <p align="center">
5
+ <strong>
6
+ <em>The ultimate n8n community nodes for Craft. Manage daily notes, documents, blocks, tasks, and collections — all from your workflows.</em>
7
+ </strong>
8
+ </p>
9
+
10
+ <p align="center">
11
+ <a href="https://www.npmjs.com/package/n8n-nodes-craft-daily-notes"><img alt="npm" src="https://img.shields.io/npm/v/n8n-nodes-craft-daily-notes.svg?style=flat-square&color=4D87E6"></a>
12
+ <a href="#"><img alt="node" src="https://img.shields.io/badge/node-%3E%3D20.15.0-4D87E6.svg?style=flat-square"></a>
13
+ &nbsp;&nbsp;•&nbsp;&nbsp;
14
+ <a href="LICENSE.md"><img alt="license" src="https://img.shields.io/badge/License-MIT-F9A825.svg?style=flat-square"></a>
15
+ <a href="https://docs.n8n.io/integrations/community-nodes/"><img alt="n8n" src="https://img.shields.io/badge/n8n-Community%20Node-FF6D5A.svg?style=flat-square"></a>
16
+ </p>
17
+
18
+ <p align="center">
19
+ <img alt="daily notes" src="https://img.shields.io/badge/📅_Daily_Notes-blocks,_tasks,_search-2ED573.svg?style=for-the-badge">
20
+ <img alt="documents" src="https://img.shields.io/badge/📄_Documents-multi--doc_management-2ED573.svg?style=for-the-badge">
21
+ </p>
22
+
23
+ <div align="center">
24
+
25
+ ### 🧭 Quick Navigation
26
+
27
+ [**⚡ Install**](#-installation) •
28
+ [**🔑 Setup**](#-setup) •
29
+ [**✨ Features**](#-features) •
30
+ [**🎮 Examples**](#-examples) •
31
+ [**🛠️ Development**](#️-development)
32
+
33
+ </div>
34
+
35
+ ---
36
+
37
+ **Two powerful nodes in one package.** Whether you're automating daily journaling, syncing tasks to external systems, or building AI-powered document workflows — this package has you covered.
38
+
39
+ <div align="center">
40
+ <table>
41
+ <tr>
42
+ <td align="center">
43
+ <h3>📅</h3>
44
+ <b>Craft Daily Notes</b><br/>
45
+ <sub>Blocks, tasks, collections, search</sub>
46
+ </td>
47
+ <td align="center">
48
+ <h3>📄</h3>
49
+ <b>Craft Documents</b><br/>
50
+ <sub>Multi-document management</sub>
51
+ </td>
52
+ <td align="center">
53
+ <h3>🤖</h3>
54
+ <b>AI Agent Ready</b><br/>
55
+ <sub>Works with n8n AI tools</sub>
56
+ </td>
57
+ </tr>
58
+ </table>
59
+ </div>
60
+
61
+ ---
62
+
63
+ ## 💥 Why This Exists
64
+
65
+ Craft is beautiful for writing. But getting data in and out? Pain. This package fixes that.
66
+
67
+ <table align="center">
68
+ <tr>
69
+ <td align="center"><b>❌ Without This Node</b></td>
70
+ <td align="center"><b>✅ With This Node</b></td>
71
+ </tr>
72
+ <tr>
73
+ <td>
74
+ <ol>
75
+ <li>Open Craft. Copy block IDs manually.</li>
76
+ <li>Write custom API scripts.</li>
77
+ <li>Debug authentication issues.</li>
78
+ <li>Pray your automation works.</li>
79
+ </ol>
80
+ </td>
81
+ <td>
82
+ <ol>
83
+ <li>Install the node.</li>
84
+ <li>Paste your Connect URL.</li>
85
+ <li>Build workflows visually.</li>
86
+ <li>Ship it. ☕</li>
87
+ </ol>
88
+ </td>
89
+ </tr>
90
+ </table>
91
+
92
+ ---
93
+
94
+ ## 🚀 Installation
11
95
 
12
96
  ### Community Nodes (Recommended)
13
97
 
14
- 1. Go to **Settings > Community Nodes** in n8n
15
- 2. Select **Install**
98
+ 1. Go to **Settings Community Nodes** in n8n
99
+ 2. Click **Install**
16
100
  3. Enter `n8n-nodes-craft-daily-notes`
17
- 4. Select **Install**
101
+ 4. Click **Install**
18
102
 
19
103
  ### Manual Installation
20
104
 
@@ -23,83 +107,158 @@ cd ~/.n8n/nodes
23
107
  npm install n8n-nodes-craft-daily-notes
24
108
  ```
25
109
 
26
- ## Setup
110
+ ---
111
+
112
+ ## 🔑 Setup
113
+
114
+ <table>
115
+ <tr>
116
+ <td width="50%">
117
+
118
+ ### Daily Notes API
119
+
120
+ 1. In Craft: **Settings → Connect → Daily Notes & Tasks**
121
+ 2. Copy your Connect API URL
122
+ 3. In n8n: Create **Craft Daily Notes API** credentials
123
+ 4. Paste the URL
124
+
125
+ </td>
126
+ <td width="50%">
127
+
128
+ ### Documents API
129
+
130
+ 1. In Craft: **Settings → Connect → Your Connection**
131
+ 2. Copy your Connect API URL
132
+ 3. In n8n: Create **Craft Documents API** credentials
133
+ 4. Paste the URL
27
134
 
28
- 1. In Craft, go to **Settings → Connect → Daily Notes & Tasks**
29
- 2. Copy your **Connect API URL** (looks like `https://connect.craft.do/links/YOUR_ID/api/v1`)
30
- 3. In n8n, create new credentials for **Craft Daily Notes API**
31
- 4. Paste your API URL
135
+ </td>
136
+ </tr>
137
+ </table>
32
138
 
33
- > **Note**: The API URL itself acts as your authentication token. Keep it secure and do not share it publicly.
139
+ > **🔐 Security Note:** The API URL contains your auth token. Keep it private.
34
140
 
35
- ## Features
141
+ ---
142
+
143
+ ## ✨ Features
144
+
145
+ <div align="center">
146
+
147
+ ### Craft Daily Notes
36
148
 
37
149
  | Resource | Operations |
38
- |----------|------------|
39
- | **Block** | Get, Insert, Update, Delete, Move, Search in Document |
40
- | **Task** | Get, Add, Update, Delete |
41
- | **Collection** | List, Get Schema, Get Items, Add Items, Update Items, Delete Items |
42
- | **Search** | Search Across Daily Notes |
150
+ |:--------:|:-----------|
151
+ | **📦 Block** | Get, Insert, Update, Delete, Move, Search |
152
+ | **✅ Task** | Get, Add, Update, Delete |
153
+ | **🗂️ Collection** | List, Get Schema, Get/Add/Update/Delete Items |
154
+ | **🔍 Search** | Search Across All Daily Notes |
43
155
 
44
- ### Smart Block Builder
156
+ ### Craft Documents
157
+
158
+ | Resource | Operations |
159
+ |:--------:|:-----------|
160
+ | **📄 Document** | List All Documents |
161
+ | **📦 Block** | Get, Insert, Update, Delete, Move, Search |
162
+ | **🗂️ Collection** | List, Get Schema, Get/Add/Update/Delete Items |
163
+ | **🔍 Search** | Search Across All Documents |
45
164
 
46
- Paste large markdown content — the node automatically splits it into optimal blocks while preserving headers and structure. Configurable options include:
165
+ </div>
47
166
 
48
- - **Max Block Size**: Control maximum characters per block (1000-10000)
49
- - **Preserve Headers**: Keep markdown headers as separate styled blocks
50
- - **Split on Paragraphs**: Intelligent paragraph-aware splitting
167
+ ### 🎯 Key Capabilities
51
168
 
52
- ### Relative Dates
169
+ - **📅 Relative Dates** — Use `today`, `tomorrow`, `yesterday` or `YYYY-MM-DD`
170
+ - **🤖 AI Agent Support** — Works as a tool in AI-powered workflows
171
+ - **📋 Smart Dropdowns** — Collections load dynamically from your data
172
+ - **⚡ Declarative Routing** — Clean, maintainable node architecture
53
173
 
54
- Use `today`, `tomorrow`, `yesterday`, or ISO format (`YYYY-MM-DD`) throughout all date fields.
174
+ ---
175
+
176
+ ## 🎮 Examples
177
+
178
+ ### Get Today's Daily Note
179
+
180
+ ```
181
+ Node: Craft Daily Notes
182
+ Resource: Block → Get
183
+ Date: today
184
+ ```
55
185
 
56
- ### AI Agent Support
186
+ ### Add Task to Inbox
57
187
 
58
- This node is compatible with n8n AI agents (`usableAsTool: true`), allowing it to be used as a tool in AI-powered workflows.
188
+ ```
189
+ Node: Craft Daily Notes
190
+ Resource: Task → Add
191
+ Content: "Review pull requests"
192
+ Location: Inbox
193
+ ```
59
194
 
60
- ## Examples
195
+ ### Insert Content into Document
61
196
 
62
- ### Get Today's Blocks
63
- - Resource: **Block**
64
- - Operation: **Get**
65
- - Date: `today`
197
+ ```
198
+ Node: Craft Documents
199
+ Resource: Block → Insert
200
+ Document ID: (select from dropdown)
201
+ Content: "## Meeting Notes\n\n- Point 1\n- Point 2"
202
+ ```
66
203
 
67
- ### Add a Task to Inbox
68
- - Resource: **Task**
69
- - Operation: **Add**
70
- - Task Content: `Review pull requests`
71
- - Location Type: **Inbox**
204
+ ### Search Across Everything
72
205
 
73
- ### Search Across Notes
74
- - Resource: **Search**
75
- - Operation: **Search Across Daily Notes**
76
- - Search Terms: `project alpha`
206
+ ```
207
+ Node: Craft Daily Notes
208
+ Resource: Search → Search Across Daily Notes
209
+ Terms: "project alpha"
210
+ ```
77
211
 
78
- ### Insert Smart Blocks
79
- - Resource: **Block**
80
- - Operation: **Insert**
81
- - Content Mode: **Markdown Text**
82
- - Paste your long-form content and let the node handle optimal splitting
212
+ ---
83
213
 
84
- ## Development
214
+ ## 🛠️ Development
85
215
 
86
216
  ```bash
217
+ # Install dependencies
87
218
  npm install
88
- npm run dev # Start n8n with hot reload
89
- npm run build # Compile TypeScript
90
- npm run lint # Check code quality
219
+
220
+ # Development mode (hot reload)
221
+ npm run dev
222
+
223
+ # Build for production
224
+ npm run build
225
+
226
+ # Lint code
227
+ npm run lint
91
228
  ```
92
229
 
93
- ## Resources
230
+ ### Project Structure
94
231
 
95
- - [Craft Daily Notes API Documentation](https://www.craft.do/s/hLrMZpKFfYRWPT)
96
- - [n8n Community Nodes Documentation](https://docs.n8n.io/integrations/community-nodes/)
232
+ ```
233
+ ├── credentials/ # API credential definitions
234
+ ├── nodes/
235
+ │ ├── CraftDailyNotes/ # Daily Notes node
236
+ │ └── CraftDocuments/ # Documents node
237
+ ├── icons/ # Node icons (light/dark)
238
+ └── dist/ # Compiled output
239
+ ```
240
+
241
+ ---
242
+
243
+ ## 📚 Resources
244
+
245
+ - [Craft Connect Documentation](https://www.craft.do/s/hLrMZpKFfYRWPT)
246
+ - [n8n Community Nodes Guide](https://docs.n8n.io/integrations/community-nodes/)
97
247
  - [Changelog](CHANGELOG.md)
98
248
 
99
- ## Author
249
+ ---
250
+
251
+ <div align="center">
252
+
253
+ ## 👤 Author
254
+
255
+ **Yigit Konur**
256
+
257
+ [![GitHub](https://img.shields.io/badge/GitHub-yigitkonur-181717?style=flat-square&logo=github)](https://github.com/yigitkonur)
258
+ [![Email](https://img.shields.io/badge/Email-yigit@konur.dev-EA4335?style=flat-square&logo=gmail&logoColor=white)](mailto:yigit@konur.dev)
100
259
 
101
- **Yigit Konur** — [GitHub](https://github.com/yigitkonur) • [Email](mailto:yigit@konur.dev)
260
+ ---
102
261
 
103
- ## License
262
+ **[MIT License](LICENSE.md)** — Built with 🔥 for the Craft + n8n community.
104
263
 
105
- [MIT](LICENSE.md)
264
+ </div>
@@ -0,0 +1,9 @@
1
+ import type { Icon, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class CraftDocumentsApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ icon: Icon;
6
+ documentationUrl: string;
7
+ properties: INodeProperties[];
8
+ test: ICredentialTestRequest;
9
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CraftDocumentsApi = void 0;
4
+ class CraftDocumentsApi {
5
+ constructor() {
6
+ this.name = 'craftDocumentsApi';
7
+ this.displayName = 'Craft Documents API';
8
+ this.icon = { light: 'file:../icons/craft.svg', dark: 'file:../icons/craft.dark.svg' };
9
+ this.documentationUrl = 'https://www.craft.do/s/hLrMZpKFfYRWPT';
10
+ this.properties = [
11
+ {
12
+ displayName: 'API URL',
13
+ name: 'apiUrl',
14
+ type: 'string',
15
+ default: '',
16
+ required: true,
17
+ placeholder: 'https://connect.craft.do/links/YOUR_ID/api/v1',
18
+ description: 'Your Connect API URL from Craft. Go to Settings → Connect → Collections & Docs to get this URL.',
19
+ },
20
+ ];
21
+ this.test = {
22
+ request: {
23
+ baseURL: '={{$credentials.apiUrl}}',
24
+ url: '/documents',
25
+ method: 'GET',
26
+ },
27
+ };
28
+ }
29
+ }
30
+ exports.CraftDocumentsApi = CraftDocumentsApi;
31
+ //# sourceMappingURL=CraftDocumentsApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CraftDocumentsApi.credentials.js","sourceRoot":"","sources":["../../credentials/CraftDocumentsApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,iBAAiB;IAA9B;QACC,SAAI,GAAG,mBAAmB,CAAC;QAE3B,gBAAW,GAAG,qBAAqB,CAAC;QAEpC,SAAI,GAAS,EAAE,KAAK,EAAE,yBAAyB,EAAE,IAAI,EAAE,8BAA8B,EAAE,CAAC;QAExF,qBAAgB,GAAG,uCAAuC,CAAC;QAE3D,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,+CAA+C;gBAC5D,WAAW,EACV,iGAAiG;aAClG;SACD,CAAC;QAOF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,0BAA0B;gBACnC,GAAG,EAAE,YAAY;gBACjB,MAAM,EAAE,KAAK;aACb;SACD,CAAC;IACH,CAAC;CAAA;AAlCD,8CAkCC"}
@@ -16,17 +16,43 @@ exports.collectionAddItemsDescription = [
16
16
  displayOptions: { show: showOnlyForCollectionAddItems },
17
17
  },
18
18
  {
19
- displayName: 'Items (JSON)',
20
- name: 'itemsJson',
21
- type: 'json',
22
- default: '{"items": [{"title": "New Item", "properties": {}}]}',
23
- required: true,
24
- description: 'Items to add in JSON format. Use "Get Schema" operation first to understand the required structure. Each item needs at least a "title" field.',
19
+ displayName: 'Items',
20
+ name: 'items',
21
+ type: 'fixedCollection',
22
+ typeOptions: {
23
+ multipleValues: true,
24
+ },
25
+ default: {},
26
+ placeholder: 'Add Item',
25
27
  displayOptions: { show: showOnlyForCollectionAddItems },
28
+ options: [
29
+ {
30
+ name: 'itemValues',
31
+ displayName: 'Item',
32
+ values: [
33
+ {
34
+ displayName: 'Title',
35
+ name: 'title',
36
+ type: 'string',
37
+ default: '',
38
+ required: true,
39
+ description: 'The title for the new item',
40
+ },
41
+ {
42
+ displayName: 'Properties (JSON)',
43
+ name: 'properties',
44
+ type: 'json',
45
+ default: '{}',
46
+ description: 'Additional properties for the item as JSON object. Use "Get Schema" to see available fields.',
47
+ },
48
+ ],
49
+ },
50
+ ],
26
51
  routing: {
27
52
  send: {
28
53
  type: 'body',
29
- value: '={{ JSON.parse($value) }}',
54
+ property: 'items',
55
+ value: '={{ $value.itemValues ? $value.itemValues.map(item => ({ title: item.title, properties: typeof item.properties === "string" ? JSON.parse(item.properties || "{}") : (item.properties || {}) })) : [] }}',
30
56
  },
31
57
  },
32
58
  },
@@ -1 +1 @@
1
- {"version":3,"file":"addItems.js","sourceRoot":"","sources":["../../../../../nodes/CraftDailyNotes/resources/collection/addItems.ts"],"names":[],"mappings":";;;AAMA,MAAM,6BAA6B,GAAG,EAAE,SAAS,EAAE,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC;AAE/E,QAAA,6BAA6B,GAAsB;IAE/D;QACC,WAAW,EAAE,uBAAuB;QACpC,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;YACZ,iBAAiB,EAAE,gBAAgB;SACnC;QACD,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,4JAA4J;QACzK,cAAc,EAAE,EAAE,IAAI,EAAE,6BAA6B,EAAE;KACvD;IAGD;QACC,WAAW,EAAE,cAAc;QAC3B,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,sDAAsD;QAC/D,QAAQ,EAAE,IAAI;QACd,WAAW,EACV,+IAA+I;QAChJ,cAAc,EAAE,EAAE,IAAI,EAAE,6BAA6B,EAAE;QACvD,OAAO,EAAE;YACR,IAAI,EAAE;gBACL,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,2BAA2B;aAClC;SACD;KACD;CACD,CAAC"}
1
+ {"version":3,"file":"addItems.js","sourceRoot":"","sources":["../../../../../nodes/CraftDailyNotes/resources/collection/addItems.ts"],"names":[],"mappings":";;;AAMA,MAAM,6BAA6B,GAAG,EAAE,SAAS,EAAE,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC;AAE/E,QAAA,6BAA6B,GAAsB;IAE/D;QACC,WAAW,EAAE,uBAAuB;QACpC,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;YACZ,iBAAiB,EAAE,gBAAgB;SACnC;QACD,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,4JAA4J;QACzK,cAAc,EAAE,EAAE,IAAI,EAAE,6BAA6B,EAAE;KACvD;IAGD;QACC,WAAW,EAAE,OAAO;QACpB,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE;YACZ,cAAc,EAAE,IAAI;SACpB;QACD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,UAAU;QACvB,cAAc,EAAE,EAAE,IAAI,EAAE,6BAA6B,EAAE;QACvD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,YAAY;gBAClB,WAAW,EAAE,MAAM;gBACnB,MAAM,EAAE;oBACP;wBACC,WAAW,EAAE,OAAO;wBACpB,IAAI,EAAE,OAAO;wBACb,IAAI,EAAE,QAAQ;wBACd,OAAO,EAAE,EAAE;wBACX,QAAQ,EAAE,IAAI;wBACd,WAAW,EAAE,4BAA4B;qBACzC;oBACD;wBACC,WAAW,EAAE,mBAAmB;wBAChC,IAAI,EAAE,YAAY;wBAClB,IAAI,EAAE,MAAM;wBACZ,OAAO,EAAE,IAAI;wBACb,WAAW,EAAE,8FAA8F;qBAC3G;iBACD;aACD;SACD;QACD,OAAO,EAAE;YACR,IAAI,EAAE;gBACL,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,OAAO;gBACjB,KAAK,EACJ,yMAAyM;aAC1M;SACD;KACD;CACD,CAAC"}
@@ -17,7 +17,7 @@ exports.collectionDeleteItemsDescription = [
17
17
  },
18
18
  {
19
19
  displayName: 'Item IDs',
20
- name: 'itemIds',
20
+ name: 'idsToDelete',
21
21
  type: 'string',
22
22
  default: '',
23
23
  required: true,
@@ -1 +1 @@
1
- {"version":3,"file":"deleteItems.js","sourceRoot":"","sources":["../../../../../nodes/CraftDailyNotes/resources/collection/deleteItems.ts"],"names":[],"mappings":";;;AAMA,MAAM,gCAAgC,GAAG,EAAE,SAAS,EAAE,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC;AAErF,QAAA,gCAAgC,GAAsB;IAElE;QACC,WAAW,EAAE,uBAAuB;QACpC,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;YACZ,iBAAiB,EAAE,gBAAgB;SACnC;QACD,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,4JAA4J;QACzK,cAAc,EAAE,EAAE,IAAI,EAAE,gCAAgC,EAAE;KAC1D;IAGD;QACC,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,iCAAiC;QAC9C,WAAW,EACV,iHAAiH;QAClH,cAAc,EAAE,EAAE,IAAI,EAAE,gCAAgC,EAAE;QAC1D,OAAO,EAAE;YACR,IAAI,EAAE;gBACL,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,aAAa;gBACvB,KAAK,EACJ,6FAA6F;aAC9F;SACD;KACD;CACD,CAAC"}
1
+ {"version":3,"file":"deleteItems.js","sourceRoot":"","sources":["../../../../../nodes/CraftDailyNotes/resources/collection/deleteItems.ts"],"names":[],"mappings":";;;AAMA,MAAM,gCAAgC,GAAG,EAAE,SAAS,EAAE,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC;AAErF,QAAA,gCAAgC,GAAsB;IAElE;QACC,WAAW,EAAE,uBAAuB;QACpC,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;YACZ,iBAAiB,EAAE,gBAAgB;SACnC;QACD,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,4JAA4J;QACzK,cAAc,EAAE,EAAE,IAAI,EAAE,gCAAgC,EAAE;KAC1D;IAGD;QACC,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,iCAAiC;QAC9C,WAAW,EACV,iHAAiH;QAClH,cAAc,EAAE,EAAE,IAAI,EAAE,gCAAgC,EAAE;QAC1D,OAAO,EAAE;YACR,IAAI,EAAE;gBACL,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,aAAa;gBACvB,KAAK,EACJ,6FAA6F;aAC9F;SACD;KACD;CACD,CAAC"}
@@ -16,17 +16,50 @@ exports.collectionUpdateItemsDescription = [
16
16
  displayOptions: { show: showOnlyForCollectionUpdateItems },
17
17
  },
18
18
  {
19
- displayName: 'Items to Update (JSON)',
20
- name: 'itemsToUpdateJson',
21
- type: 'json',
22
- default: '{"itemsToUpdate": [{"id": "item-id", "title": "Updated Title", "properties": {}}]}',
23
- required: true,
24
- description: 'Items to update in JSON format. Each item must include an "ID" field. Only provided fields will be updated (partial updates supported).',
19
+ displayName: 'Items to Update',
20
+ name: 'itemsToUpdate',
21
+ type: 'fixedCollection',
22
+ typeOptions: {
23
+ multipleValues: true,
24
+ },
25
+ default: {},
26
+ placeholder: 'Add Item',
25
27
  displayOptions: { show: showOnlyForCollectionUpdateItems },
28
+ options: [
29
+ {
30
+ name: 'itemValues',
31
+ displayName: 'Item',
32
+ values: [
33
+ {
34
+ displayName: 'Item ID',
35
+ name: 'id',
36
+ type: 'string',
37
+ default: '',
38
+ required: true,
39
+ description: 'The ID of the item to update',
40
+ },
41
+ {
42
+ displayName: 'Title',
43
+ name: 'title',
44
+ type: 'string',
45
+ default: '',
46
+ description: 'New title for the item (leave empty to keep current)',
47
+ },
48
+ {
49
+ displayName: 'Properties (JSON)',
50
+ name: 'properties',
51
+ type: 'json',
52
+ default: '{}',
53
+ description: 'Updated properties for the item as JSON object',
54
+ },
55
+ ],
56
+ },
57
+ ],
26
58
  routing: {
27
59
  send: {
28
60
  type: 'body',
29
- value: '={{ JSON.parse($value) }}',
61
+ property: 'itemsToUpdate',
62
+ value: '={{ $value.itemValues ? $value.itemValues.map(item => { const obj = { id: item.id }; if (item.title) obj.title = item.title; obj.properties = typeof item.properties === "string" ? JSON.parse(item.properties || "{}") : (item.properties || {}); return obj; }) : [] }}',
30
63
  },
31
64
  },
32
65
  },
@@ -1 +1 @@
1
- {"version":3,"file":"updateItems.js","sourceRoot":"","sources":["../../../../../nodes/CraftDailyNotes/resources/collection/updateItems.ts"],"names":[],"mappings":";;;AAMA,MAAM,gCAAgC,GAAG,EAAE,SAAS,EAAE,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC;AAErF,QAAA,gCAAgC,GAAsB;IAElE;QACC,WAAW,EAAE,uBAAuB;QACpC,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;YACZ,iBAAiB,EAAE,gBAAgB;SACnC;QACD,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,4JAA4J;QACzK,cAAc,EAAE,EAAE,IAAI,EAAE,gCAAgC,EAAE;KAC1D;IAGD;QACC,WAAW,EAAE,wBAAwB;QACrC,IAAI,EAAE,mBAAmB;QACzB,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,oFAAoF;QAC7F,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,yIAAyI;QACtJ,cAAc,EAAE,EAAE,IAAI,EAAE,gCAAgC,EAAE;QAC1D,OAAO,EAAE;YACR,IAAI,EAAE;gBACL,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,2BAA2B;aAClC;SACD;KACD;CACD,CAAC"}
1
+ {"version":3,"file":"updateItems.js","sourceRoot":"","sources":["../../../../../nodes/CraftDailyNotes/resources/collection/updateItems.ts"],"names":[],"mappings":";;;AAMA,MAAM,gCAAgC,GAAG,EAAE,SAAS,EAAE,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC;AAErF,QAAA,gCAAgC,GAAsB;IAElE;QACC,WAAW,EAAE,uBAAuB;QACpC,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;YACZ,iBAAiB,EAAE,gBAAgB;SACnC;QACD,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,4JAA4J;QACzK,cAAc,EAAE,EAAE,IAAI,EAAE,gCAAgC,EAAE;KAC1D;IAGD;QACC,WAAW,EAAE,iBAAiB;QAC9B,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE;YACZ,cAAc,EAAE,IAAI;SACpB;QACD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,UAAU;QACvB,cAAc,EAAE,EAAE,IAAI,EAAE,gCAAgC,EAAE;QAC1D,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,YAAY;gBAClB,WAAW,EAAE,MAAM;gBACnB,MAAM,EAAE;oBACP;wBACC,WAAW,EAAE,SAAS;wBACtB,IAAI,EAAE,IAAI;wBACV,IAAI,EAAE,QAAQ;wBACd,OAAO,EAAE,EAAE;wBACX,QAAQ,EAAE,IAAI;wBACd,WAAW,EAAE,8BAA8B;qBAC3C;oBACD;wBACC,WAAW,EAAE,OAAO;wBACpB,IAAI,EAAE,OAAO;wBACb,IAAI,EAAE,QAAQ;wBACd,OAAO,EAAE,EAAE;wBACX,WAAW,EAAE,sDAAsD;qBACnE;oBACD;wBACC,WAAW,EAAE,mBAAmB;wBAChC,IAAI,EAAE,YAAY;wBAClB,IAAI,EAAE,MAAM;wBACZ,OAAO,EAAE,IAAI;wBACb,WAAW,EAAE,gDAAgD;qBAC7D;iBACD;aACD;SACD;QACD,OAAO,EAAE;YACR,IAAI,EAAE;gBACL,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,eAAe;gBACzB,KAAK,EACJ,2QAA2Q;aAC5Q;SACD;KACD;CACD,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ import { getDocuments } from './loadOptions/getDocuments';
3
+ import { getCollections } from './loadOptions/getCollections';
4
+ export declare class CraftDocuments implements INodeType {
5
+ description: INodeTypeDescription;
6
+ methods: {
7
+ loadOptions: {
8
+ getDocuments: typeof getDocuments;
9
+ getCollections: typeof getCollections;
10
+ };
11
+ };
12
+ }
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CraftDocuments = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const document_1 = require("./resources/document");
6
+ const block_1 = require("./resources/block");
7
+ const collection_1 = require("./resources/collection");
8
+ const search_1 = require("./resources/search");
9
+ const getDocuments_1 = require("./loadOptions/getDocuments");
10
+ const getCollections_1 = require("./loadOptions/getCollections");
11
+ class CraftDocuments {
12
+ constructor() {
13
+ this.description = {
14
+ displayName: 'Craft Documents',
15
+ name: 'craftDocuments',
16
+ icon: { light: 'file:../../icons/craft.svg', dark: 'file:../../icons/craft.dark.svg' },
17
+ group: ['transform'],
18
+ version: 1,
19
+ subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
20
+ description: 'Interact with Craft Multi-Document API - manage documents, blocks, collections, and search',
21
+ defaults: { name: 'Craft Documents' },
22
+ usableAsTool: true,
23
+ inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
24
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
25
+ credentials: [
26
+ {
27
+ name: 'craftDocumentsApi',
28
+ required: true,
29
+ },
30
+ ],
31
+ requestDefaults: {
32
+ baseURL: '={{$credentials.apiUrl}}',
33
+ headers: {
34
+ Accept: 'application/json',
35
+ 'Content-Type': 'application/json',
36
+ },
37
+ },
38
+ properties: [
39
+ {
40
+ displayName: 'Resource',
41
+ name: 'resource',
42
+ type: 'options',
43
+ noDataExpression: true,
44
+ options: [
45
+ {
46
+ name: 'Document',
47
+ value: 'document',
48
+ description: 'List and manage documents',
49
+ },
50
+ {
51
+ name: 'Block',
52
+ value: 'block',
53
+ description: 'Manage content blocks in documents',
54
+ },
55
+ {
56
+ name: 'Collection',
57
+ value: 'collection',
58
+ description: 'Manage collections (database-like structures)',
59
+ },
60
+ {
61
+ name: 'Search',
62
+ value: 'search',
63
+ description: 'Search across documents',
64
+ },
65
+ ],
66
+ default: 'document',
67
+ },
68
+ ...document_1.documentDescription,
69
+ ...block_1.blockDescription,
70
+ ...collection_1.collectionDescription,
71
+ ...search_1.searchDescription,
72
+ ],
73
+ };
74
+ this.methods = {
75
+ loadOptions: {
76
+ getDocuments: getDocuments_1.getDocuments,
77
+ getCollections: getCollections_1.getCollections,
78
+ },
79
+ };
80
+ }
81
+ }
82
+ exports.CraftDocuments = CraftDocuments;
83
+ //# sourceMappingURL=CraftDocuments.node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CraftDocuments.node.js","sourceRoot":"","sources":["../../../nodes/CraftDocuments/CraftDocuments.node.ts"],"names":[],"mappings":";;;AAYA,+CAAmD;AAGnD,mDAA2D;AAC3D,6CAAqD;AACrD,uDAA+D;AAC/D,+CAAuD;AAGvD,6DAA0D;AAC1D,iEAA8D;AAE9D,MAAa,cAAc;IAA3B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,iBAAiB;YAC9B,IAAI,EAAE,gBAAgB;YACtB,IAAI,EAAE,EAAE,KAAK,EAAE,4BAA4B,EAAE,IAAI,EAAE,iCAAiC,EAAE;YACtF,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,4FAA4F;YACzG,QAAQ,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE;YACrC,YAAY,EAAE,IAAI;YAClB,MAAM,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAClC,OAAO,EAAE,CAAC,kCAAmB,CAAC,IAAI,CAAC;YAEnC,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,mBAAmB;oBACzB,QAAQ,EAAE,IAAI;iBACd;aACD;YAGD,eAAe,EAAE;gBAChB,OAAO,EAAE,0BAA0B;gBACnC,OAAO,EAAE;oBACR,MAAM,EAAE,kBAAkB;oBAC1B,cAAc,EAAE,kBAAkB;iBAClC;aACD;YAED,UAAU,EAAE;gBAEX;oBACC,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR;4BACC,IAAI,EAAE,UAAU;4BAChB,KAAK,EAAE,UAAU;4BACjB,WAAW,EAAE,2BAA2B;yBACxC;wBACD;4BACC,IAAI,EAAE,OAAO;4BACb,KAAK,EAAE,OAAO;4BACd,WAAW,EAAE,oCAAoC;yBACjD;wBACD;4BACC,IAAI,EAAE,YAAY;4BAClB,KAAK,EAAE,YAAY;4BACnB,WAAW,EAAE,+CAA+C;yBAC5D;wBACD;4BACC,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,QAAQ;4BACf,WAAW,EAAE,yBAAyB;yBACtC;qBACD;oBACD,OAAO,EAAE,UAAU;iBACnB;gBAGD,GAAG,8BAAmB;gBACtB,GAAG,wBAAgB;gBACnB,GAAG,kCAAqB;gBACxB,GAAG,0BAAiB;aACpB;SACD,CAAC;QAGF,YAAO,GAAG;YACT,WAAW,EAAE;gBACZ,YAAY,EAAZ,2BAAY;gBACZ,cAAc,EAAd,+BAAc;aACd;SACD,CAAC;IACH,CAAC;CAAA;AA7ED,wCA6EC"}
@@ -0,0 +1,22 @@
1
+ {
2
+ "node": "n8n-nodes-craft-daily-notes.craftDocuments",
3
+ "nodeVersion": "1.0",
4
+ "codexVersion": "1.0",
5
+ "categories": ["Productivity"],
6
+ "resources": {
7
+ "credentialDocumentation": [
8
+ {
9
+ "url": "https://www.craft.do/s/hLrMZpKFfYRWPT"
10
+ }
11
+ ],
12
+ "primaryDocumentation": [
13
+ {
14
+ "url": "https://www.craft.do/s/hLrMZpKFfYRWPT"
15
+ }
16
+ ]
17
+ },
18
+ "alias": ["craft", "documents", "collections", "notes", "knowledge base"],
19
+ "subcategories": {
20
+ "Productivity": ["Notes & Documents"]
21
+ }
22
+ }
@@ -0,0 +1,2 @@
1
+ import type { ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
2
+ export declare function getCollections(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;