n8n-nodes-craft-daily-notes 1.0.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.
- package/LICENSE.md +19 -0
- package/README.md +105 -0
- package/dist/credentials/CraftDailyNotesApi.credentials.d.ts +9 -0
- package/dist/credentials/CraftDailyNotesApi.credentials.js +34 -0
- package/dist/credentials/CraftDailyNotesApi.credentials.js.map +1 -0
- package/dist/icons/craft.dark.svg +19 -0
- package/dist/icons/craft.svg +30 -0
- package/dist/nodes/CraftDailyNotes/CraftDailyNotes.node.d.ts +11 -0
- package/dist/nodes/CraftDailyNotes/CraftDailyNotes.node.js +143 -0
- package/dist/nodes/CraftDailyNotes/CraftDailyNotes.node.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/CraftDailyNotes.node.json +22 -0
- package/dist/nodes/CraftDailyNotes/listSearch/getCollections.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/listSearch/getCollections.js +14 -0
- package/dist/nodes/CraftDailyNotes/listSearch/getCollections.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/resources/block/delete.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/resources/block/delete.js +24 -0
- package/dist/nodes/CraftDailyNotes/resources/block/delete.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/resources/block/get.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/resources/block/get.js +127 -0
- package/dist/nodes/CraftDailyNotes/resources/block/get.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/resources/block/index.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/resources/block/index.js +95 -0
- package/dist/nodes/CraftDailyNotes/resources/block/index.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/resources/block/insert.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/resources/block/insert.js +154 -0
- package/dist/nodes/CraftDailyNotes/resources/block/insert.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/resources/block/move.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/resources/block/move.js +80 -0
- package/dist/nodes/CraftDailyNotes/resources/block/move.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/resources/block/search.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/resources/block/search.js +96 -0
- package/dist/nodes/CraftDailyNotes/resources/block/search.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/resources/block/update.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/resources/block/update.js +82 -0
- package/dist/nodes/CraftDailyNotes/resources/block/update.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/addItems.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/addItems.js +34 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/addItems.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/deleteItems.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/deleteItems.js +36 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/deleteItems.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/getItems.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/getItems.js +37 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/getItems.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/getSchema.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/getSchema.js +45 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/getSchema.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/index.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/index.js +101 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/index.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/list.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/list.js +57 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/list.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/updateItems.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/updateItems.js +34 -0
- package/dist/nodes/CraftDailyNotes/resources/collection/updateItems.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/resources/search/index.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/resources/search/index.js +107 -0
- package/dist/nodes/CraftDailyNotes/resources/search/index.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/resources/task/add.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/resources/task/add.js +85 -0
- package/dist/nodes/CraftDailyNotes/resources/task/add.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/resources/task/delete.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/resources/task/delete.js +24 -0
- package/dist/nodes/CraftDailyNotes/resources/task/delete.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/resources/task/get.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/resources/task/get.js +44 -0
- package/dist/nodes/CraftDailyNotes/resources/task/get.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/resources/task/index.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/resources/task/index.js +73 -0
- package/dist/nodes/CraftDailyNotes/resources/task/index.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/resources/task/update.d.ts +2 -0
- package/dist/nodes/CraftDailyNotes/resources/task/update.js +87 -0
- package/dist/nodes/CraftDailyNotes/resources/task/update.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/shared/blockBuilder.d.ts +13 -0
- package/dist/nodes/CraftDailyNotes/shared/blockBuilder.js +121 -0
- package/dist/nodes/CraftDailyNotes/shared/blockBuilder.js.map +1 -0
- package/dist/nodes/CraftDailyNotes/shared/transport.d.ts +3 -0
- package/dist/nodes/CraftDailyNotes/shared/transport.js +50 -0
- package/dist/nodes/CraftDailyNotes/shared/transport.js.map +1 -0
- package/dist/package.json +64 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +64 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright 2025 Yigit Konur
|
|
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,105 @@
|
|
|
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
|
+
[](https://www.npmjs.com/package/n8n-nodes-craft-daily-notes)
|
|
6
|
+
[](https://docs.n8n.io/integrations/community-nodes/)
|
|
7
|
+
[](LICENSE.md)
|
|
8
|
+
[](https://nodejs.org/)
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
### Community Nodes (Recommended)
|
|
13
|
+
|
|
14
|
+
1. Go to **Settings > Community Nodes** in n8n
|
|
15
|
+
2. Select **Install**
|
|
16
|
+
3. Enter `n8n-nodes-craft-daily-notes`
|
|
17
|
+
4. Select **Install**
|
|
18
|
+
|
|
19
|
+
### Manual Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
cd ~/.n8n/nodes
|
|
23
|
+
npm install n8n-nodes-craft-daily-notes
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Setup
|
|
27
|
+
|
|
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
|
|
32
|
+
|
|
33
|
+
> **Note**: The API URL itself acts as your authentication token. Keep it secure and do not share it publicly.
|
|
34
|
+
|
|
35
|
+
## Features
|
|
36
|
+
|
|
37
|
+
| 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 |
|
|
43
|
+
|
|
44
|
+
### Smart Block Builder
|
|
45
|
+
|
|
46
|
+
Paste large markdown content — the node automatically splits it into optimal blocks while preserving headers and structure. Configurable options include:
|
|
47
|
+
|
|
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
|
|
51
|
+
|
|
52
|
+
### Relative Dates
|
|
53
|
+
|
|
54
|
+
Use `today`, `tomorrow`, `yesterday`, or ISO format (`YYYY-MM-DD`) throughout all date fields.
|
|
55
|
+
|
|
56
|
+
### AI Agent Support
|
|
57
|
+
|
|
58
|
+
This node is compatible with n8n AI agents (`usableAsTool: true`), allowing it to be used as a tool in AI-powered workflows.
|
|
59
|
+
|
|
60
|
+
## Examples
|
|
61
|
+
|
|
62
|
+
### Get Today's Blocks
|
|
63
|
+
- Resource: **Block**
|
|
64
|
+
- Operation: **Get**
|
|
65
|
+
- Date: `today`
|
|
66
|
+
|
|
67
|
+
### Add a Task to Inbox
|
|
68
|
+
- Resource: **Task**
|
|
69
|
+
- Operation: **Add**
|
|
70
|
+
- Task Content: `Review pull requests`
|
|
71
|
+
- Location Type: **Inbox**
|
|
72
|
+
|
|
73
|
+
### Search Across Notes
|
|
74
|
+
- Resource: **Search**
|
|
75
|
+
- Operation: **Search Across Daily Notes**
|
|
76
|
+
- Search Terms: `project alpha`
|
|
77
|
+
|
|
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
|
|
83
|
+
|
|
84
|
+
## Development
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npm install
|
|
88
|
+
npm run dev # Start n8n with hot reload
|
|
89
|
+
npm run build # Compile TypeScript
|
|
90
|
+
npm run lint # Check code quality
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Resources
|
|
94
|
+
|
|
95
|
+
- [Craft Daily Notes API Documentation](https://www.craft.do/s/hLrMZpKFfYRWPT)
|
|
96
|
+
- [n8n Community Nodes Documentation](https://docs.n8n.io/integrations/community-nodes/)
|
|
97
|
+
- [Changelog](CHANGELOG.md)
|
|
98
|
+
|
|
99
|
+
## Author
|
|
100
|
+
|
|
101
|
+
**Yigit Konur** — [GitHub](https://github.com/yigitkonur) • [Email](mailto:yigit@konur.dev)
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
[MIT](LICENSE.md)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Icon, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class CraftDailyNotesApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
icon: Icon;
|
|
6
|
+
documentationUrl: string;
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
test: ICredentialTestRequest;
|
|
9
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CraftDailyNotesApi = void 0;
|
|
4
|
+
class CraftDailyNotesApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'craftDailyNotesApi';
|
|
7
|
+
this.displayName = 'Craft Daily Notes 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 → Daily Notes & Tasks to get this URL.',
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
this.test = {
|
|
22
|
+
request: {
|
|
23
|
+
baseURL: '={{$credentials.apiUrl}}',
|
|
24
|
+
url: '/blocks',
|
|
25
|
+
method: 'GET',
|
|
26
|
+
qs: {
|
|
27
|
+
date: 'today',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.CraftDailyNotesApi = CraftDailyNotesApi;
|
|
34
|
+
//# sourceMappingURL=CraftDailyNotesApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CraftDailyNotesApi.credentials.js","sourceRoot":"","sources":["../../credentials/CraftDailyNotesApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,kBAAkB;IAA/B;QACC,SAAI,GAAG,oBAAoB,CAAC;QAE5B,gBAAW,GAAG,uBAAuB,CAAC;QAEtC,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,kGAAkG;aACnG;SACD,CAAC;QAKF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,0BAA0B;gBACnC,GAAG,EAAE,SAAS;gBACd,MAAM,EAAE,KAAK;gBACb,EAAE,EAAE;oBACH,IAAI,EAAE,OAAO;iBACb;aACD;SACD,CAAC;IACH,CAAC;CAAA;AAnCD,gDAmCC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 110.89 110.89">
|
|
3
|
+
<defs>
|
|
4
|
+
<style>
|
|
5
|
+
.cls-1 {
|
|
6
|
+
fill: #fff;
|
|
7
|
+
fill-rule: evenodd;
|
|
8
|
+
}
|
|
9
|
+
</style>
|
|
10
|
+
</defs>
|
|
11
|
+
<g id="craft_logopack">
|
|
12
|
+
<g id="craft_icon_white">
|
|
13
|
+
<path class="cls-1" d="m59.88,107.62c0,1.81,1.46,3.27,3.27,3.27h44.56c1.81,0,3.28-1.47,3.17-3.27-1.62-25.93-21.8-46.3-47.73-47.92-1.8-.11-3.27,1.36-3.27,3.17v44.75Z"/>
|
|
14
|
+
<path class="cls-1" d="m51.38,62.97c0-1.81-1.46-3.27-3.27-3.27H3.17c-1.81,0-3.28,1.47-3.17,3.27,1.62,25.93,22.18,46.3,48.11,47.92,1.8.11,3.27-1.36,3.27-3.17v-44.75Z"/>
|
|
15
|
+
<path class="cls-1" d="m51.38,47.92c0,1.81-1.46,3.27-3.27,3.27H3.17c-1.81,0-3.28-1.47-3.17-3.27C1.63,21.99,22.18,1.63,48.11,0c1.8-.11,3.27,1.36,3.27,3.17v44.75Z"/>
|
|
16
|
+
<path class="cls-1" d="m59.88,3.27c0-1.81,1.46-3.27,3.27-3.27h44.56c1.81,0,3.28,1.47,3.17,3.27-1.62,25.93-21.8,46.3-47.73,47.92-1.8.11-3.27-1.36-3.27-3.17V3.27Z"/>
|
|
17
|
+
</g>
|
|
18
|
+
</g>
|
|
19
|
+
</svg>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg id="Layer_2" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 110.89 110.89">
|
|
3
|
+
<defs>
|
|
4
|
+
<style>
|
|
5
|
+
.cls-1 {
|
|
6
|
+
fill: #254078;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.cls-1, .cls-2, .cls-3 {
|
|
10
|
+
fill-rule: evenodd;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.cls-2 {
|
|
14
|
+
fill: #ff62fd;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.cls-3 {
|
|
18
|
+
fill: #0078ff;
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
21
|
+
</defs>
|
|
22
|
+
<g id="craft_logopack">
|
|
23
|
+
<g id="craft_icon_colour_regular">
|
|
24
|
+
<path class="cls-1" d="m59.05,107.6c0,1.82,1.47,3.29,3.29,3.29h45.36c1.82,0,3.3-1.48,3.18-3.29-1.63-26.06-22.48-46.92-48.54-48.54-1.81-.11-3.29,1.37-3.29,3.18v45.36Z"/>
|
|
25
|
+
<path class="cls-1" d="m51.84,62.34c0-1.82-1.47-3.29-3.29-3.29H3.19c-1.82,0-3.3,1.48-3.18,3.29,1.63,26.06,22.48,46.92,48.54,48.54,1.81.11,3.29-1.37,3.29-3.18v-45.36Z"/>
|
|
26
|
+
<path class="cls-2" d="m51.84,48.55c0,1.82-1.47,3.29-3.29,3.29H3.19c-1.82,0-3.3-1.48-3.18-3.29C1.63,22.49,22.49,1.63,48.55,0c1.81-.11,3.29,1.37,3.29,3.18v45.36Z"/>
|
|
27
|
+
<path class="cls-3" d="m59.05,3.29c0-1.82,1.47-3.29,3.29-3.29h45.36c1.82,0,3.3,1.48,3.18,3.29-1.63,26.06-22.48,46.92-48.54,48.54-1.81.11-3.29-1.37-3.29-3.18V3.29Z"/>
|
|
28
|
+
</g>
|
|
29
|
+
</g>
|
|
30
|
+
</svg>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
import { getCollections } from './listSearch/getCollections';
|
|
3
|
+
export declare class CraftDailyNotes implements INodeType {
|
|
4
|
+
description: INodeTypeDescription;
|
|
5
|
+
methods: {
|
|
6
|
+
loadOptions: {
|
|
7
|
+
getCollections: typeof getCollections;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CraftDailyNotes = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const block_1 = require("./resources/block");
|
|
6
|
+
const task_1 = require("./resources/task");
|
|
7
|
+
const collection_1 = require("./resources/collection");
|
|
8
|
+
const search_1 = require("./resources/search");
|
|
9
|
+
const getCollections_1 = require("./listSearch/getCollections");
|
|
10
|
+
const transport_1 = require("./shared/transport");
|
|
11
|
+
const blockBuilder_1 = require("./shared/blockBuilder");
|
|
12
|
+
class CraftDailyNotes {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.description = {
|
|
15
|
+
displayName: 'Craft Daily Notes',
|
|
16
|
+
name: 'craftDailyNotes',
|
|
17
|
+
icon: { light: 'file:../../icons/craft.svg', dark: 'file:../../icons/craft.dark.svg' },
|
|
18
|
+
group: ['transform'],
|
|
19
|
+
version: 1,
|
|
20
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
21
|
+
description: 'Interact with Craft Daily Notes API - manage blocks, tasks, collections, and search',
|
|
22
|
+
defaults: { name: 'Craft Daily Notes' },
|
|
23
|
+
usableAsTool: true,
|
|
24
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
25
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
26
|
+
credentials: [
|
|
27
|
+
{
|
|
28
|
+
name: 'craftDailyNotesApi',
|
|
29
|
+
required: true,
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
requestDefaults: {
|
|
33
|
+
baseURL: '={{$credentials.apiUrl}}',
|
|
34
|
+
headers: {
|
|
35
|
+
Accept: 'application/json',
|
|
36
|
+
'Content-Type': 'application/json',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
properties: [
|
|
40
|
+
{
|
|
41
|
+
displayName: 'Resource',
|
|
42
|
+
name: 'resource',
|
|
43
|
+
type: 'options',
|
|
44
|
+
noDataExpression: true,
|
|
45
|
+
options: [
|
|
46
|
+
{
|
|
47
|
+
name: 'Block',
|
|
48
|
+
value: 'block',
|
|
49
|
+
description: 'Manage content blocks in daily notes',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'Task',
|
|
53
|
+
value: 'task',
|
|
54
|
+
description: 'Manage tasks across daily notes',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'Collection',
|
|
58
|
+
value: 'collection',
|
|
59
|
+
description: 'Manage collections (database-like structures)',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'Search',
|
|
63
|
+
value: 'search',
|
|
64
|
+
description: 'Search across daily notes',
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
default: 'block',
|
|
68
|
+
},
|
|
69
|
+
...block_1.blockDescription,
|
|
70
|
+
...task_1.taskDescription,
|
|
71
|
+
...collection_1.collectionDescription,
|
|
72
|
+
...search_1.searchDescription,
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
this.methods = {
|
|
76
|
+
loadOptions: {
|
|
77
|
+
getCollections: getCollections_1.getCollections,
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
async execute() {
|
|
82
|
+
const items = this.getInputData();
|
|
83
|
+
const returnData = [];
|
|
84
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
85
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
86
|
+
if (resource === 'block' && operation === 'insert') {
|
|
87
|
+
for (let i = 0; i < items.length; i++) {
|
|
88
|
+
try {
|
|
89
|
+
const contentMode = this.getNodeParameter('contentMode', i);
|
|
90
|
+
let blocks;
|
|
91
|
+
if (contentMode === 'markdown') {
|
|
92
|
+
const markdownContent = this.getNodeParameter('markdownContent', i);
|
|
93
|
+
const processingOptions = this.getNodeParameter('blockProcessingOptions', i, {});
|
|
94
|
+
const builtBlocks = (0, blockBuilder_1.buildBlocksFromMarkdown)(markdownContent, {
|
|
95
|
+
maxBlockSize: processingOptions.maxBlockSize || 5000,
|
|
96
|
+
preserveHeaders: processingOptions.preserveHeaders !== false,
|
|
97
|
+
splitOnParagraphs: processingOptions.splitOnParagraphs !== false,
|
|
98
|
+
});
|
|
99
|
+
blocks = builtBlocks;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
const blocksJson = this.getNodeParameter('blocksJson', i);
|
|
103
|
+
blocks = (0, blockBuilder_1.parseBlockArray)(blocksJson);
|
|
104
|
+
}
|
|
105
|
+
const positionParam = this.getNodeParameter('position', i, {});
|
|
106
|
+
const positionValues = positionParam.positionValues || {};
|
|
107
|
+
const position = {
|
|
108
|
+
position: positionValues.position || 'end',
|
|
109
|
+
date: positionValues.date || 'today',
|
|
110
|
+
};
|
|
111
|
+
if (['before', 'after'].includes(position.position) &&
|
|
112
|
+
positionValues.referenceBlockId) {
|
|
113
|
+
position.referenceBlockId = positionValues.referenceBlockId;
|
|
114
|
+
}
|
|
115
|
+
const response = await transport_1.craftApiRequest.call(this, 'POST', '/blocks', {
|
|
116
|
+
blocks,
|
|
117
|
+
position,
|
|
118
|
+
});
|
|
119
|
+
returnData.push({
|
|
120
|
+
json: response,
|
|
121
|
+
pairedItem: { item: i },
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
if (this.continueOnFail()) {
|
|
126
|
+
returnData.push({
|
|
127
|
+
json: {
|
|
128
|
+
error: error instanceof Error ? error.message : 'Unknown error',
|
|
129
|
+
},
|
|
130
|
+
pairedItem: { item: i },
|
|
131
|
+
});
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error instanceof Error ? error : new Error('Unknown error'), { itemIndex: i });
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return [returnData];
|
|
138
|
+
}
|
|
139
|
+
return [[]];
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
exports.CraftDailyNotes = CraftDailyNotes;
|
|
143
|
+
//# sourceMappingURL=CraftDailyNotes.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CraftDailyNotes.node.js","sourceRoot":"","sources":["../../../nodes/CraftDailyNotes/CraftDailyN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AC;wBAC3B,UAAU,CAAC,IAAI,CAAC;4BACf,IAAI,EAAE;gCACL,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;6BAC/D;4BACD,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;yBACvB,CAAC,CAAC;wBACH,SAAS;oBACV,CAAC;oBACD,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,eAAe,CAAC,EAC3D,EAAE,SAAS,EAAE,CAAC,EAAE,CAChB,CAAC;gBACH,CAAC;YACF,CAAC;YAED,OAAO,CAAC,UAAU,CAAC,CAAC;QACrB,CAAC;QAGD,OAAO,CAAC,EAAE,CAAC,CAAC;IACb,CAAC;CACD;AAzKD,0CAyKC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-craft-daily-notes.craftDailyNotes",
|
|
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", "daily notes", "notion", "notes", "tasks", "productivity"],
|
|
19
|
+
"subcategories": {
|
|
20
|
+
"Productivity": ["Note Taking"]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCollections = getCollections;
|
|
4
|
+
const transport_1 = require("../shared/transport");
|
|
5
|
+
async function getCollections() {
|
|
6
|
+
const response = await transport_1.craftApiRequest.call(this, 'GET', '/collections');
|
|
7
|
+
const data = response;
|
|
8
|
+
const collections = data.items || [];
|
|
9
|
+
return collections.map((collection) => ({
|
|
10
|
+
name: `${collection.name} (${collection.dailyNoteDate})`,
|
|
11
|
+
value: collection.id,
|
|
12
|
+
}));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=getCollections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCollections.js","sourceRoot":"","sources":["../../../../nodes/CraftDailyNotes/listSearch/getCollections.ts"],"names":[],"mappings":";;AAmBA,wCAaC;AA1BD,mDAAsD;AAa/C,KAAK,UAAU,cAAc;IAGnC,MAAM,QAAQ,GAAG,MAAM,2BAAe,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IAEzE,MAAM,IAAI,GAAG,QAA+C,CAAC;IAC7D,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;IAGrC,OAAO,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACvC,IAAI,EAAE,GAAG,UAAU,CAAC,IAAI,KAAK,UAAU,CAAC,aAAa,GAAG;QACxD,KAAK,EAAE,UAAU,CAAC,EAAE;KACpB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.blockDeleteDescription = void 0;
|
|
4
|
+
const showOnlyForBlockDelete = { operation: ['delete'], resource: ['block'] };
|
|
5
|
+
exports.blockDeleteDescription = [
|
|
6
|
+
{
|
|
7
|
+
displayName: 'Block IDs',
|
|
8
|
+
name: 'blockIds',
|
|
9
|
+
type: 'string',
|
|
10
|
+
default: '',
|
|
11
|
+
required: true,
|
|
12
|
+
placeholder: 'ID1, ID2, ID3 or ["ID1", "ID2"]',
|
|
13
|
+
description: 'Block IDs to delete. Provide as comma-separated values or JSON array.',
|
|
14
|
+
displayOptions: { show: showOnlyForBlockDelete },
|
|
15
|
+
routing: {
|
|
16
|
+
send: {
|
|
17
|
+
type: 'body',
|
|
18
|
+
property: 'blockIds',
|
|
19
|
+
value: '={{ $value.startsWith("[") ? JSON.parse($value) : $value.split(",").map(id => id.trim()) }}',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../../nodes/CraftDailyNotes/resources/block/delete.ts"],"names":[],"mappings":";;;AAMA,MAAM,sBAAsB,GAAG,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;AAEjE,QAAA,sBAAsB,GAAsB;IAExD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,iCAAiC;QAC9C,WAAW,EACV,uEAAuE;QACxE,cAAc,EAAE,EAAE,IAAI,EAAE,sBAAsB,EAAE;QAChD,OAAO,EAAE;YACR,IAAI,EAAE;gBACL,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,UAAU;gBACpB,KAAK,EACJ,6FAA6F;aAC9F;SACD;KACD;CACD,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.blockGetDescription = void 0;
|
|
4
|
+
const showOnlyForBlockGet = { operation: ['get'], resource: ['block'] };
|
|
5
|
+
exports.blockGetDescription = [
|
|
6
|
+
{
|
|
7
|
+
displayName: 'Fetch By',
|
|
8
|
+
name: 'fetchBy',
|
|
9
|
+
type: 'options',
|
|
10
|
+
options: [
|
|
11
|
+
{ name: 'Date', value: 'date', description: 'Fetch blocks from a specific date' },
|
|
12
|
+
{ name: 'Block ID', value: 'blockId', description: 'Fetch a specific block by its ID' },
|
|
13
|
+
],
|
|
14
|
+
default: 'date',
|
|
15
|
+
displayOptions: { show: showOnlyForBlockGet },
|
|
16
|
+
description: 'How to identify which blocks to fetch',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
displayName: 'Date',
|
|
20
|
+
name: 'date',
|
|
21
|
+
type: 'string',
|
|
22
|
+
default: 'today',
|
|
23
|
+
placeholder: 'today, tomorrow, yesterday, or YYYY-MM-DD',
|
|
24
|
+
description: 'The date for the daily note. Accepts relative dates (today, tomorrow, yesterday) or ISO format.',
|
|
25
|
+
displayOptions: {
|
|
26
|
+
show: {
|
|
27
|
+
...showOnlyForBlockGet,
|
|
28
|
+
fetchBy: ['date'],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
routing: {
|
|
32
|
+
send: {
|
|
33
|
+
type: 'query',
|
|
34
|
+
property: 'date',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
displayName: 'Block ID',
|
|
40
|
+
name: 'blockId',
|
|
41
|
+
type: 'string',
|
|
42
|
+
default: '',
|
|
43
|
+
placeholder: 'E21E3640-FBD2-4887-BD1B-B1FFE1781168',
|
|
44
|
+
description: 'The UUID of the specific block to fetch',
|
|
45
|
+
displayOptions: {
|
|
46
|
+
show: {
|
|
47
|
+
...showOnlyForBlockGet,
|
|
48
|
+
fetchBy: ['blockId'],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
routing: {
|
|
52
|
+
send: {
|
|
53
|
+
type: 'query',
|
|
54
|
+
property: 'id',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
displayName: 'Max Depth',
|
|
60
|
+
name: 'maxDepth',
|
|
61
|
+
type: 'number',
|
|
62
|
+
typeOptions: {
|
|
63
|
+
minValue: -1,
|
|
64
|
+
maxValue: 10,
|
|
65
|
+
},
|
|
66
|
+
default: -1,
|
|
67
|
+
description: 'Maximum depth of nested content to fetch. -1 for all descendants, 0 for only the block itself.',
|
|
68
|
+
displayOptions: { show: showOnlyForBlockGet },
|
|
69
|
+
routing: {
|
|
70
|
+
send: {
|
|
71
|
+
type: 'query',
|
|
72
|
+
property: 'maxDepth',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
displayName: 'Response Format',
|
|
78
|
+
name: 'responseFormat',
|
|
79
|
+
type: 'options',
|
|
80
|
+
options: [
|
|
81
|
+
{
|
|
82
|
+
name: 'JSON (Structured)',
|
|
83
|
+
value: 'json',
|
|
84
|
+
description: 'Returns structured block data with IDs and properties',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: 'Markdown (Text)',
|
|
88
|
+
value: 'markdown',
|
|
89
|
+
description: 'Returns rendered markdown content',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
default: 'json',
|
|
93
|
+
description: 'Format of the response',
|
|
94
|
+
displayOptions: { show: showOnlyForBlockGet },
|
|
95
|
+
routing: {
|
|
96
|
+
request: {
|
|
97
|
+
headers: {
|
|
98
|
+
Accept: '={{ $value === "markdown" ? "text/markdown" : "application/json" }}',
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
displayName: 'Additional Options',
|
|
105
|
+
name: 'additionalOptions',
|
|
106
|
+
type: 'collection',
|
|
107
|
+
placeholder: 'Add Option',
|
|
108
|
+
default: {},
|
|
109
|
+
displayOptions: { show: showOnlyForBlockGet },
|
|
110
|
+
options: [
|
|
111
|
+
{
|
|
112
|
+
displayName: 'Fetch Metadata',
|
|
113
|
+
name: 'fetchMetadata',
|
|
114
|
+
type: 'boolean',
|
|
115
|
+
default: false,
|
|
116
|
+
description: 'Whether to include metadata (comments, timestamps, authors) for the blocks',
|
|
117
|
+
routing: {
|
|
118
|
+
send: {
|
|
119
|
+
type: 'query',
|
|
120
|
+
property: 'fetchMetadata',
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../../nodes/CraftDailyNotes/resources/block/get.ts"],"names":[],"mappings":";;;AAMA,MAAM,mBAAmB,GAAG,EAAE,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;AAE3D,QAAA,mBAAmB,GAAsB;IAErD;QACC,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,SAAS;QACf,OAAO,EAAE;YACR,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,mCAAmC,EAAE;YACjF,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,kCAAkC,EAAE;SACvF;QACD,OAAO,EAAE,MAAM;QACf,cAAc,EAAE,EAAE,IAAI,EAAE,mBAAmB,EAAE;QAC7C,WAAW,EAAE,uCAAuC;KACpD;IAGD;QACC,WAAW,EAAE,MAAM;QACnB,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,2CAA2C;QACxD,WAAW,EACV,iGAAiG;QAClG,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,GAAG,mBAAmB;gBACtB,OAAO,EAA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