n8n-nodes-innotes 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.
Files changed (31) hide show
  1. package/README.md +305 -0
  2. package/dist/credentials/InNotesApi.credentials.js +108 -0
  3. package/dist/credentials/InNotesApi.credentials.js.map +1 -0
  4. package/dist/credentials/InNotesApi.credentials.ts +111 -0
  5. package/dist/credentials/Logo_128.png +0 -0
  6. package/dist/descriptions/ContactDescription.js +291 -0
  7. package/dist/descriptions/ContactDescription.js.map +1 -0
  8. package/dist/descriptions/JobDescription.js +413 -0
  9. package/dist/descriptions/JobDescription.js.map +1 -0
  10. package/dist/descriptions/NoteDescription.js +130 -0
  11. package/dist/descriptions/NoteDescription.js.map +1 -0
  12. package/dist/descriptions/StatusDescription.js +78 -0
  13. package/dist/descriptions/StatusDescription.js.map +1 -0
  14. package/dist/descriptions/TagDescription.js +34 -0
  15. package/dist/descriptions/TagDescription.js.map +1 -0
  16. package/dist/descriptions/UserDescription.js +40 -0
  17. package/dist/descriptions/UserDescription.js.map +1 -0
  18. package/dist/icons/Logo_128.png +0 -0
  19. package/dist/nodes/InNotes/InNotes.node.js +679 -0
  20. package/dist/nodes/InNotes/InNotes.node.js.map +1 -0
  21. package/dist/nodes/InNotes/Logo_128.png +0 -0
  22. package/dist/package.json +70 -0
  23. package/dist/test/InNotes.node.test.js +144 -0
  24. package/dist/test/InNotes.node.test.js.map +1 -0
  25. package/dist/test/setup.js +38 -0
  26. package/dist/test/setup.js.map +1 -0
  27. package/dist/types/InNotesTypes.js +8 -0
  28. package/dist/types/InNotesTypes.js.map +1 -0
  29. package/dist/utils/helpers.js +172 -0
  30. package/dist/utils/helpers.js.map +1 -0
  31. package/package.json +70 -0
package/README.md ADDED
@@ -0,0 +1,305 @@
1
+ # InNotes N8N Node
2
+
3
+ An N8N custom node that enables seamless integration with the InNotes LinkedIn CRM application. This node allows you to automate workflows involving contacts, notes, jobs, statuses, tags, and user management within the InNotes platform.
4
+
5
+ ## Features
6
+
7
+ - **Complete CRUD Operations**: Create, read, update, and delete operations for all InNotes resources
8
+ - **LinkedIn CRM Integration**: Specifically designed for LinkedIn-based contact management
9
+ - **Comprehensive Resource Support**:
10
+ - Contacts (LinkedIn profiles, emails, phone numbers)
11
+ - Notes (conversation logs, meeting notes, follow-ups)
12
+ - Jobs (job applications, opportunities, tracking)
13
+ - Statuses (contact status management)
14
+ - Tags (categorization and organization)
15
+ - Users (user account management)
16
+ - **Advanced Filtering**: Search and filter capabilities for efficient data retrieval
17
+ - **Pagination Support**: Handle large datasets with built-in pagination
18
+ - **Error Handling**: Robust error handling with meaningful error messages
19
+ - **Authentication**: Secure API authentication using username/password credentials
20
+
21
+ ## Installation
22
+
23
+ ### Prerequisites
24
+
25
+ - N8N instance (self-hosted or cloud)
26
+ - Node.js 18+ and yarn package manager
27
+ - Access to InNotes API credentials
28
+
29
+ ### Building the Node
30
+
31
+ 1. Clone or download this node package to your local machine
32
+ 2. Install dependencies:
33
+ ```bash
34
+ yarn install
35
+ ```
36
+
37
+ 3. Build the node:
38
+ ```bash
39
+ yarn build
40
+ ```
41
+
42
+ 4. Link the node to your N8N installation:
43
+ ```bash
44
+ # For local N8N development
45
+ yarn link
46
+ cd /path/to/your/n8n
47
+ yarn link n8n-nodes-innotes
48
+
49
+ # Or copy the dist folder to your N8N custom nodes directory
50
+ cp -r dist/* ~/.n8n/custom/
51
+ ```
52
+
53
+ ### Development
54
+
55
+ For development and testing:
56
+
57
+ ```bash
58
+ # Install dependencies
59
+ yarn install
60
+
61
+ # Run linting
62
+ yarn lint
63
+
64
+ # Run tests
65
+ yarn test
66
+
67
+ # Watch mode for development
68
+ yarn dev
69
+
70
+ # Build for production
71
+ yarn build
72
+ ```
73
+
74
+ ## Configuration
75
+
76
+ ### API Credentials
77
+
78
+ Before using the InNotes node, you need to configure your API credentials:
79
+
80
+ 1. In N8N, go to **Credentials** → **Create New**
81
+ 2. Search for **InNotes API** and select it
82
+ 3. Fill in the required fields:
83
+ - **Username**: Your InNotes account email
84
+ - **Password**: Your InNotes account password
85
+ - **Base URL**: Your InNotes instance URL (e.g., `https://app.innotes.com`)
86
+
87
+ ### Node Setup
88
+
89
+ 1. Add the **InNotes** node to your workflow
90
+ 2. Select your configured credentials
91
+ 3. Choose the **Resource** (Contact, Note, Job, Status, Tag, User)
92
+ 4. Select the desired **Operation** (Get, Create, Update, Delete, etc.)
93
+ 5. Configure the specific parameters for your operation
94
+
95
+ ## Usage Examples
96
+
97
+ ### Managing Contacts
98
+
99
+ #### Get All Contacts
100
+ - **Resource**: Contact
101
+ - **Operation**: Get All
102
+ - **Parameters**:
103
+ - Limit: Number of contacts to retrieve (default: 50)
104
+ - Return All: Whether to return all contacts or paginate
105
+
106
+ #### Create New Contact
107
+ - **Resource**: Contact
108
+ - **Operation**: Create
109
+ - **Required Fields**:
110
+ - Name: Contact's full name
111
+ - LinkedIn URL: LinkedIn profile URL
112
+ - **Optional Fields**:
113
+ - Email, Phone, Company, Position, etc.
114
+
115
+ #### Update Contact
116
+ - **Resource**: Contact
117
+ - **Operation**: Update
118
+ - **Required Fields**:
119
+ - Contact ID: ID of the contact to update
120
+ - **Update Fields**: Any contact fields you want to modify
121
+
122
+ #### Search Contacts
123
+ - **Resource**: Contact
124
+ - **Operation**: Search
125
+ - **Parameters**:
126
+ - Query: Search term (name, email, company)
127
+ - Filters: Additional filtering options
128
+
129
+ ### Managing Notes
130
+
131
+ #### Create Note
132
+ - **Resource**: Note
133
+ - **Operation**: Create
134
+ - **Required Fields**:
135
+ - Contact ID: ID of the associated contact
136
+ - Content: Note content (supports rich text)
137
+ - **Optional Fields**:
138
+ - Type: Note type (meeting, call, email, etc.)
139
+ - Tags: Associated tags
140
+
141
+ #### Get Notes for Contact
142
+ - **Resource**: Note
143
+ - **Operation**: Get All
144
+ - **Parameters**:
145
+ - Contact ID: Filter notes by contact
146
+ - Date Range: Filter by creation date
147
+
148
+ ### Managing Jobs
149
+
150
+ #### Track Job Application
151
+ - **Resource**: Job
152
+ - **Operation**: Create
153
+ - **Required Fields**:
154
+ - Title: Job title
155
+ - Company: Company name
156
+ - **Optional Fields**:
157
+ - Status, URL, Description, Salary Range, etc.
158
+
159
+ #### Update Job Status
160
+ - **Resource**: Job
161
+ - **Operation**: Update
162
+ - **Fields**:
163
+ - Job ID: ID of the job to update
164
+ - Status: New status (applied, interviewing, offer, etc.)
165
+
166
+ ### Managing Tags and Statuses
167
+
168
+ #### Create Custom Tags
169
+ - **Resource**: Tag
170
+ - **Operation**: Create
171
+ - **Fields**:
172
+ - Name: Tag name
173
+ - Color: Tag color (hex code)
174
+
175
+ #### Update Contact Status
176
+ - **Resource**: Status
177
+ - **Operation**: Create/Update
178
+ - **Fields**:
179
+ - Contact ID: Associated contact
180
+ - Status: Status value
181
+ - Type: Status type
182
+
183
+ ## Workflow Integration Examples
184
+
185
+ ### Automated LinkedIn Outreach
186
+ 1. **Trigger**: Webhook or schedule
187
+ 2. **InNotes Node**: Get contacts with specific tags
188
+ 3. **Filter**: Process only contacts without recent notes
189
+ 4. **InNotes Node**: Create follow-up notes
190
+ 5. **Email/LinkedIn Node**: Send personalized messages
191
+
192
+ ### Job Application Tracking
193
+ 1. **Trigger**: New job posting (webhook/RSS)
194
+ 2. **InNotes Node**: Create new job entry
195
+ 3. **InNotes Node**: Link to relevant contacts
196
+ 4. **InNotes Node**: Create application tracking note
197
+ 5. **Calendar Node**: Schedule follow-up reminders
198
+
199
+ ### Contact Enrichment
200
+ 1. **Trigger**: New contact created
201
+ 2. **External API**: Enrich contact data (company info, etc.)
202
+ 3. **InNotes Node**: Update contact with enriched data
203
+ 4. **InNotes Node**: Create initial contact note
204
+ 5. **InNotes Node**: Apply relevant tags
205
+
206
+ ## API Reference
207
+
208
+ ### Resources
209
+
210
+ | Resource | Operations | Description |
211
+ |----------|------------|-------------|
212
+ | Contact | Get All, Get, Create, Update, Delete, Search | LinkedIn contact management |
213
+ | Note | Get All, Get, Create, Update, Delete | Conversation and meeting notes |
214
+ | Job | Get All, Get, Create, Update, Delete | Job application tracking |
215
+ | Status | Get All, Get, Create, Update, Delete | Contact status management |
216
+ | Tag | Get All, Get, Create, Update, Delete | Categorization and organization |
217
+ | User | Get, Update | User account management |
218
+
219
+ ### Common Parameters
220
+
221
+ - **Limit**: Maximum number of items to return (pagination)
222
+ - **Return All**: Override limit and return all items
223
+ - **Sort By**: Field to sort results by
224
+ - **Sort Order**: Ascending or descending sort
225
+ - **Filters**: Resource-specific filtering options
226
+
227
+ ### Error Handling
228
+
229
+ The node provides comprehensive error handling:
230
+
231
+ - **Authentication Errors**: Invalid credentials or expired sessions
232
+ - **Validation Errors**: Missing required fields or invalid data
233
+ - **API Errors**: Server errors or rate limiting
234
+ - **Network Errors**: Connection issues or timeouts
235
+
236
+ All errors include detailed messages to help with troubleshooting.
237
+
238
+ ## Contributing
239
+
240
+ ### Development Setup
241
+
242
+ 1. Fork the repository
243
+ 2. Install dependencies: `yarn install`
244
+ 3. Make your changes
245
+ 4. Run tests: `yarn test`
246
+ 5. Run linting: `yarn lint`
247
+ 6. Build: `yarn build`
248
+ 7. Submit a pull request
249
+
250
+ ### Code Style
251
+
252
+ - Follow TypeScript best practices
253
+ - Use ESLint configuration provided
254
+ - Add JSDoc comments for public methods
255
+ - Include unit tests for new features
256
+ - Follow existing naming conventions
257
+
258
+ ### Testing
259
+
260
+ ```bash
261
+ # Run all tests
262
+ yarn test
263
+
264
+ # Run tests in watch mode
265
+ yarn test:watch
266
+
267
+ # Run tests with coverage
268
+ yarn test:coverage
269
+ ```
270
+
271
+ ## Support
272
+
273
+ ### Documentation
274
+ - [InNotes API Documentation](https://docs.innotes.com)
275
+ - [N8N Documentation](https://docs.n8n.io)
276
+
277
+ ### Issues
278
+ If you encounter any issues or have feature requests, please:
279
+ 1. Check existing issues in the repository
280
+ 2. Create a new issue with detailed description
281
+ 3. Include error messages and steps to reproduce
282
+
283
+ ### Community
284
+ - Join the N8N Community Discord
285
+ - Check the InNotes user community
286
+
287
+ ## License
288
+
289
+ This project is licensed under the MIT License - see the LICENSE file for details.
290
+
291
+ ## Changelog
292
+
293
+ ### Version 1.0.0
294
+ - Initial release
295
+ - Support for all InNotes resources (Contact, Note, Job, Status, Tag, User)
296
+ - Complete CRUD operations
297
+ - Search and filtering capabilities
298
+ - Pagination support
299
+ - Comprehensive error handling
300
+ - Full TypeScript support
301
+
302
+ ---
303
+
304
+ **Author**: marco
305
+ **Last Updated**: 2025-06-01
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ /**
3
+ * Author: Marco Visin
4
+ * Date: 2025-06-02
5
+ * Updated to support Bearer token authentication
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.InNotesApi = void 0;
9
+ class InNotesApi {
10
+ constructor() {
11
+ this.name = 'inNotesApi';
12
+ this.displayName = 'InNotes API';
13
+ this.documentationUrl = 'https://innotes.me';
14
+ this.icon = 'file:Logo_128.png';
15
+ this.properties = [
16
+ {
17
+ displayName: 'Base URL',
18
+ name: 'baseUrl',
19
+ type: 'string',
20
+ default: 'https://innotes.me',
21
+ description: 'The base URL of your InNotes instance',
22
+ required: true,
23
+ },
24
+ {
25
+ displayName: 'Authentication Method',
26
+ name: 'authMethod',
27
+ type: 'options',
28
+ options: [
29
+ {
30
+ name: 'Bearer Token',
31
+ value: 'token',
32
+ },
33
+ {
34
+ name: 'Username/Password (Legacy)',
35
+ value: 'credentials',
36
+ },
37
+ ],
38
+ default: 'token',
39
+ description: 'Choose your authentication method. Bearer token is recommended.',
40
+ },
41
+ {
42
+ displayName: 'Bearer Token',
43
+ name: 'token',
44
+ type: 'string',
45
+ typeOptions: {
46
+ password: true,
47
+ },
48
+ default: '',
49
+ description: 'Your InNotes API Bearer token. Generate one in your dashboard settings.',
50
+ required: true,
51
+ displayOptions: {
52
+ show: {
53
+ authMethod: ['token'],
54
+ },
55
+ },
56
+ },
57
+ {
58
+ displayName: 'Username',
59
+ name: 'username',
60
+ type: 'string',
61
+ default: '',
62
+ description: 'Your InNotes username',
63
+ required: true,
64
+ displayOptions: {
65
+ show: {
66
+ authMethod: ['credentials'],
67
+ },
68
+ },
69
+ },
70
+ {
71
+ displayName: 'Password',
72
+ name: 'password',
73
+ type: 'string',
74
+ typeOptions: {
75
+ password: true,
76
+ },
77
+ default: '',
78
+ description: 'Your InNotes password',
79
+ required: true,
80
+ displayOptions: {
81
+ show: {
82
+ authMethod: ['credentials'],
83
+ },
84
+ },
85
+ },
86
+ ];
87
+ this.authenticate = {
88
+ type: 'generic',
89
+ properties: {
90
+ headers: {
91
+ 'Authorization': '={{$credentials.authMethod === "token" ? "Bearer " + $credentials.token : undefined}}',
92
+ 'username': '={{$credentials.authMethod === "credentials" ? $credentials.username : undefined}}',
93
+ 'password': '={{$credentials.authMethod === "credentials" ? $credentials.password : undefined}}',
94
+ },
95
+ },
96
+ };
97
+ this.test = {
98
+ request: {
99
+ baseURL: '={{$credentials.baseUrl}}',
100
+ url: '/api/user',
101
+ method: 'GET',
102
+ },
103
+ };
104
+ }
105
+ }
106
+ exports.InNotesApi = InNotesApi;
107
+
108
+ //# sourceMappingURL=InNotesApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../credentials/InNotesApi.credentials.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAUH,MAAa,UAAU;IAAvB;QACC,SAAI,GAAG,YAAY,CAAC;QACpB,gBAAW,GAAG,aAAa,CAAC;QAC5B,qBAAgB,GAAG,oBAAoB,CAAC;QACxC,SAAI,GAAS,mBAAmB,CAAC;QACjC,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,oBAAoB;gBAC7B,WAAW,EAAE,uCAAuC;gBACpD,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,uBAAuB;gBACpC,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,cAAc;wBACpB,KAAK,EAAE,OAAO;qBACd;oBACD;wBACC,IAAI,EAAE,4BAA4B;wBAClC,KAAK,EAAE,aAAa;qBACpB;iBACD;gBACD,OAAO,EAAE,OAAO;gBAChB,WAAW,EAAE,iEAAiE;aAC9E;YACD;gBACC,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,yEAAyE;gBACtF,QAAQ,EAAE,IAAI;gBACd,cAAc,EAAE;oBACf,IAAI,EAAE;wBACL,UAAU,EAAE,CAAC,OAAO,CAAC;qBACrB;iBACD;aACD;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,uBAAuB;gBACpC,QAAQ,EAAE,IAAI;gBACd,cAAc,EAAE;oBACf,IAAI,EAAE;wBACL,UAAU,EAAE,CAAC,aAAa,CAAC;qBAC3B;iBACD;aACD;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;gBACD,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,uBAAuB;gBACpC,QAAQ,EAAE,IAAI;gBACd,cAAc,EAAE;oBACf,IAAI,EAAE;wBACL,UAAU,EAAE,CAAC,aAAa,CAAC;qBAC3B;iBACD;aACD;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,eAAe,EAAE,uFAAuF;oBACxG,UAAU,EAAE,oFAAoF;oBAChG,UAAU,EAAE,oFAAoF;iBAChG;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,2BAA2B;gBACpC,GAAG,EAAE,WAAW;gBAChB,MAAM,EAAE,KAAK;aACb;SACD,CAAC;IACH,CAAC;CAAA;AAhGD,gCAgGC","file":"InNotesApi.credentials.js","sourcesContent":["/**\n * Author: Marco Visin\n * Date: 2025-06-02\n * Updated to support Bearer token authentication\n */\n\nimport {\n\tIAuthenticateGeneric,\n\tICredentialTestRequest,\n\tICredentialType,\n\tINodeProperties,\n\tIcon,\n} from 'n8n-workflow';\n\nexport class InNotesApi implements ICredentialType {\n\tname = 'inNotesApi';\n\tdisplayName = 'InNotes API';\n\tdocumentationUrl = 'https://innotes.me';\n\ticon: Icon = 'file:Logo_128.png';\n\tproperties: INodeProperties[] = [\n\t\t{\n\t\t\tdisplayName: 'Base URL',\n\t\t\tname: 'baseUrl',\n\t\t\ttype: 'string',\n\t\t\tdefault: 'https://innotes.me',\n\t\t\tdescription: 'The base URL of your InNotes instance',\n\t\t\trequired: true,\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Authentication Method',\n\t\t\tname: 'authMethod',\n\t\t\ttype: 'options',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tname: 'Bearer Token',\n\t\t\t\t\tvalue: 'token',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Username/Password (Legacy)',\n\t\t\t\t\tvalue: 'credentials',\n\t\t\t\t},\n\t\t\t],\n\t\t\tdefault: 'token',\n\t\t\tdescription: 'Choose your authentication method. Bearer token is recommended.',\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Bearer Token',\n\t\t\tname: 'token',\n\t\t\ttype: 'string',\n\t\t\ttypeOptions: {\n\t\t\t\tpassword: true,\n\t\t\t},\n\t\t\tdefault: '',\n\t\t\tdescription: 'Your InNotes API Bearer token. Generate one in your dashboard settings.',\n\t\t\trequired: true,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tauthMethod: ['token'],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Username',\n\t\t\tname: 'username',\n\t\t\ttype: 'string',\n\t\t\tdefault: '',\n\t\t\tdescription: 'Your InNotes username',\n\t\t\trequired: true,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tauthMethod: ['credentials'],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdisplayName: 'Password',\n\t\t\tname: 'password',\n\t\t\ttype: 'string',\n\t\t\ttypeOptions: {\n\t\t\t\tpassword: true,\n\t\t\t},\n\t\t\tdefault: '',\n\t\t\tdescription: 'Your InNotes password',\n\t\t\trequired: true,\n\t\t\tdisplayOptions: {\n\t\t\t\tshow: {\n\t\t\t\t\tauthMethod: ['credentials'],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t];\n\n\tauthenticate: IAuthenticateGeneric = {\n\t\ttype: 'generic',\n\t\tproperties: {\n\t\t\theaders: {\n\t\t\t\t'Authorization': '={{$credentials.authMethod === \"token\" ? \"Bearer \" + $credentials.token : undefined}}',\n\t\t\t\t'username': '={{$credentials.authMethod === \"credentials\" ? $credentials.username : undefined}}',\n\t\t\t\t'password': '={{$credentials.authMethod === \"credentials\" ? $credentials.password : undefined}}',\n\t\t\t},\n\t\t},\n\t};\n\n\ttest: ICredentialTestRequest = {\n\t\trequest: {\n\t\t\tbaseURL: '={{$credentials.baseUrl}}',\n\t\t\turl: '/api/user',\n\t\t\tmethod: 'GET',\n\t\t},\n\t};\n}\n"]}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Author: Marco Visin
3
+ * Date: 2025-06-02
4
+ * Updated to support Bearer token authentication
5
+ */
6
+
7
+ import {
8
+ IAuthenticateGeneric,
9
+ ICredentialTestRequest,
10
+ ICredentialType,
11
+ INodeProperties,
12
+ Icon,
13
+ } from 'n8n-workflow';
14
+
15
+ export class InNotesApi implements ICredentialType {
16
+ name = 'inNotesApi';
17
+ displayName = 'InNotes API';
18
+ documentationUrl = 'https://innotes.me';
19
+ icon: Icon = 'file:Logo_128.png';
20
+ properties: INodeProperties[] = [
21
+ {
22
+ displayName: 'Base URL',
23
+ name: 'baseUrl',
24
+ type: 'string',
25
+ default: 'https://innotes.me',
26
+ description: 'The base URL of your InNotes instance',
27
+ required: true,
28
+ },
29
+ {
30
+ displayName: 'Authentication Method',
31
+ name: 'authMethod',
32
+ type: 'options',
33
+ options: [
34
+ {
35
+ name: 'Bearer Token',
36
+ value: 'token',
37
+ },
38
+ {
39
+ name: 'Username/Password (Legacy)',
40
+ value: 'credentials',
41
+ },
42
+ ],
43
+ default: 'token',
44
+ description: 'Choose your authentication method. Bearer token is recommended.',
45
+ },
46
+ {
47
+ displayName: 'Bearer Token',
48
+ name: 'token',
49
+ type: 'string',
50
+ typeOptions: {
51
+ password: true,
52
+ },
53
+ default: '',
54
+ description: 'Your InNotes API Bearer token. Generate one in your dashboard settings.',
55
+ required: true,
56
+ displayOptions: {
57
+ show: {
58
+ authMethod: ['token'],
59
+ },
60
+ },
61
+ },
62
+ {
63
+ displayName: 'Username',
64
+ name: 'username',
65
+ type: 'string',
66
+ default: '',
67
+ description: 'Your InNotes username',
68
+ required: true,
69
+ displayOptions: {
70
+ show: {
71
+ authMethod: ['credentials'],
72
+ },
73
+ },
74
+ },
75
+ {
76
+ displayName: 'Password',
77
+ name: 'password',
78
+ type: 'string',
79
+ typeOptions: {
80
+ password: true,
81
+ },
82
+ default: '',
83
+ description: 'Your InNotes password',
84
+ required: true,
85
+ displayOptions: {
86
+ show: {
87
+ authMethod: ['credentials'],
88
+ },
89
+ },
90
+ },
91
+ ];
92
+
93
+ authenticate: IAuthenticateGeneric = {
94
+ type: 'generic',
95
+ properties: {
96
+ headers: {
97
+ 'Authorization': '={{$credentials.authMethod === "token" ? "Bearer " + $credentials.token : undefined}}',
98
+ 'username': '={{$credentials.authMethod === "credentials" ? $credentials.username : undefined}}',
99
+ 'password': '={{$credentials.authMethod === "credentials" ? $credentials.password : undefined}}',
100
+ },
101
+ },
102
+ };
103
+
104
+ test: ICredentialTestRequest = {
105
+ request: {
106
+ baseURL: '={{$credentials.baseUrl}}',
107
+ url: '/api/user',
108
+ method: 'GET',
109
+ },
110
+ };
111
+ }
Binary file