@izzai/n8n-nodes-izzone 0.0.17
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 +1 -0
- package/README.md +32 -0
- package/dist/constants/behaviour.d.ts +15 -0
- package/dist/constants/behaviour.js +54 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.js +18 -0
- package/dist/constants/url.d.ts +1 -0
- package/dist/constants/url.js +4 -0
- package/dist/credentials/IzzOne.credentials.d.ts +8 -0
- package/dist/credentials/IzzOne.credentials.js +39 -0
- package/dist/credentials/izz-one.png +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +1 -0
- package/dist/nodes/IzzOne.node.d.ts +13 -0
- package/dist/nodes/IzzOne.node.js +194 -0
- package/dist/nodes/IzzOne.node.json +12 -0
- package/dist/nodes/izz-one.png +0 -0
- package/dist/utils/generic.d.ts +6 -0
- package/dist/utils/generic.js +9 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +18 -0
- package/dist/utils/methods.d.ts +13 -0
- package/dist/utils/methods.js +70 -0
- package/package.json +85 -0
package/LICENSE.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
United Innovations GmbH
|
package/README.md
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# izz.ONE n8n Nodes
|
2
|
+
|
3
|
+
This application provides custom nodes for n8n, a popular workflow automation tool. The nodes are designed to integrate with izz.ONE services, allowing users to automate tasks and workflows that involve izz.ONE functionalities.
|
4
|
+
|
5
|
+
## Development Setup
|
6
|
+
|
7
|
+
To set up the development environment for the izz.ONE n8n nodes, follow these steps:
|
8
|
+
|
9
|
+
1. **Clone the Repository**: Clone the repository to your local machine using Git.
|
10
|
+
```bash
|
11
|
+
git clone https://github.com/@izzai/n8n-izzone.git
|
12
|
+
cd n8n-izzone
|
13
|
+
```
|
14
|
+
2. **Install Dependencies**: Use npm or yarn to install the required dependencies.
|
15
|
+
```bash
|
16
|
+
npm install
|
17
|
+
# or
|
18
|
+
yarn install
|
19
|
+
```
|
20
|
+
3. **Build the Project**: Build the project to compile TypeScript files and prepare the application for development.
|
21
|
+
```bash
|
22
|
+
npm run build
|
23
|
+
# or
|
24
|
+
yarn build
|
25
|
+
```
|
26
|
+
4. **Link the Project**: To use the nodes in a local n8n instance, you can link the project.
|
27
|
+
```bash
|
28
|
+
npm link
|
29
|
+
# or
|
30
|
+
yarn link
|
31
|
+
```
|
32
|
+
5. Follow the instructions [here](https://docs.n8n.io/integrations/creating-nodes/test/run-node-locally/) to run the node locally.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
export declare enum LlmBehaviorEnum {
|
2
|
+
CONVERSATIONAL = "conversational",
|
3
|
+
EXPLAINING = "explaining",
|
4
|
+
CREATIVE = "creative",
|
5
|
+
FORMAL = "formal",
|
6
|
+
INFORMAL = "informal",
|
7
|
+
TECHNICAL = "technical",
|
8
|
+
FRIENDLY = "friendly",
|
9
|
+
PROFESSIONAL = "professional",
|
10
|
+
HUMOROUS = "humorous"
|
11
|
+
}
|
12
|
+
export declare const LlmBehavior: {
|
13
|
+
name: string;
|
14
|
+
value: LlmBehaviorEnum;
|
15
|
+
}[];
|
@@ -0,0 +1,54 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.LlmBehavior = exports.LlmBehaviorEnum = void 0;
|
4
|
+
// Copy from apps/nexus-api/src/customTypes/chat.ts
|
5
|
+
var LlmBehaviorEnum;
|
6
|
+
(function (LlmBehaviorEnum) {
|
7
|
+
LlmBehaviorEnum["CONVERSATIONAL"] = "conversational";
|
8
|
+
LlmBehaviorEnum["EXPLAINING"] = "explaining";
|
9
|
+
LlmBehaviorEnum["CREATIVE"] = "creative";
|
10
|
+
LlmBehaviorEnum["FORMAL"] = "formal";
|
11
|
+
LlmBehaviorEnum["INFORMAL"] = "informal";
|
12
|
+
LlmBehaviorEnum["TECHNICAL"] = "technical";
|
13
|
+
LlmBehaviorEnum["FRIENDLY"] = "friendly";
|
14
|
+
LlmBehaviorEnum["PROFESSIONAL"] = "professional";
|
15
|
+
LlmBehaviorEnum["HUMOROUS"] = "humorous";
|
16
|
+
})(LlmBehaviorEnum || (exports.LlmBehaviorEnum = LlmBehaviorEnum = {}));
|
17
|
+
exports.LlmBehavior = [
|
18
|
+
{
|
19
|
+
name: 'Conversational',
|
20
|
+
value: LlmBehaviorEnum.CONVERSATIONAL,
|
21
|
+
},
|
22
|
+
{
|
23
|
+
name: 'Explaining',
|
24
|
+
value: LlmBehaviorEnum.EXPLAINING,
|
25
|
+
},
|
26
|
+
{
|
27
|
+
name: 'Creative',
|
28
|
+
value: LlmBehaviorEnum.CREATIVE,
|
29
|
+
},
|
30
|
+
{
|
31
|
+
name: 'Formal',
|
32
|
+
value: LlmBehaviorEnum.FORMAL,
|
33
|
+
},
|
34
|
+
{
|
35
|
+
name: 'Informal',
|
36
|
+
value: LlmBehaviorEnum.INFORMAL,
|
37
|
+
},
|
38
|
+
{
|
39
|
+
name: 'Technical',
|
40
|
+
value: LlmBehaviorEnum.TECHNICAL,
|
41
|
+
},
|
42
|
+
{
|
43
|
+
name: 'Friendly',
|
44
|
+
value: LlmBehaviorEnum.FRIENDLY,
|
45
|
+
},
|
46
|
+
{
|
47
|
+
name: 'Professional',
|
48
|
+
value: LlmBehaviorEnum.PROFESSIONAL,
|
49
|
+
},
|
50
|
+
{
|
51
|
+
name: 'Humorous',
|
52
|
+
value: LlmBehaviorEnum.HUMOROUS,
|
53
|
+
},
|
54
|
+
];
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./behaviour"), exports);
|
18
|
+
__exportStar(require("./url"), exports);
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const BASE_URL = "https://api.nexus.izz.ai";
|
@@ -0,0 +1,39 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.IzzOne = void 0;
|
4
|
+
class IzzOne {
|
5
|
+
name = 'IzzOneApi';
|
6
|
+
displayName = 'izz.ONE API';
|
7
|
+
icon = 'file:izz-one.png';
|
8
|
+
documentationUrl = 'https://api.nexus.izz.ai/docs'; // TODO: Update URL later
|
9
|
+
properties = [
|
10
|
+
{
|
11
|
+
displayName: 'Email ID',
|
12
|
+
name: 'emailId',
|
13
|
+
type: 'string',
|
14
|
+
required: true,
|
15
|
+
default: '',
|
16
|
+
placeholder: 'Enter your email ID',
|
17
|
+
description: 'The email ID associated with your izz.ONE account',
|
18
|
+
},
|
19
|
+
{
|
20
|
+
displayName: 'API Key',
|
21
|
+
name: 'apiKey',
|
22
|
+
type: 'string',
|
23
|
+
typeOptions: { password: true },
|
24
|
+
default: '',
|
25
|
+
placeholder: 'Enter your API key',
|
26
|
+
description: 'The API key for authenticating with izz.ONE',
|
27
|
+
},
|
28
|
+
{
|
29
|
+
displayName: 'Instance ID',
|
30
|
+
name: 'instanceId',
|
31
|
+
type: 'string',
|
32
|
+
required: true,
|
33
|
+
default: '',
|
34
|
+
placeholder: 'Enter your instance ID',
|
35
|
+
description: 'The unique identifier for your izz.ONE instance',
|
36
|
+
},
|
37
|
+
];
|
38
|
+
}
|
39
|
+
exports.IzzOne = IzzOne;
|
Binary file
|
package/dist/index.d.ts
ADDED
File without changes
|
package/dist/index.js
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { type IExecuteFunctions, type INodeExecutionData, type INodeType, type INodeTypeDescription, type NodeExecutionWithMetadata } from 'n8n-workflow';
|
2
|
+
import { getAgents, getDatasources, getLlms } from '../utils';
|
3
|
+
export declare class IzzOne implements INodeType {
|
4
|
+
description: INodeTypeDescription;
|
5
|
+
methods: {
|
6
|
+
loadOptions: {
|
7
|
+
getAgents: typeof getAgents;
|
8
|
+
getDatasources: typeof getDatasources;
|
9
|
+
getLlms: typeof getLlms;
|
10
|
+
};
|
11
|
+
};
|
12
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][] | NodeExecutionWithMetadata[][]>;
|
13
|
+
}
|
@@ -0,0 +1,194 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.IzzOne = void 0;
|
4
|
+
const constants_1 = require("../constants");
|
5
|
+
const utils_1 = require("../utils");
|
6
|
+
class IzzOne {
|
7
|
+
description = {
|
8
|
+
displayName: 'izz.ONE',
|
9
|
+
name: 'izzOne',
|
10
|
+
icon: 'file:izz-one.png',
|
11
|
+
group: ['input'],
|
12
|
+
version: 1,
|
13
|
+
description: 'Fetch data from izz.ONE',
|
14
|
+
defaults: {
|
15
|
+
name: 'izz.ONE',
|
16
|
+
color: '#FF08FF', // TODO: Change color to match izz.ONE branding
|
17
|
+
},
|
18
|
+
inputs: ["main" /* NodeConnectionType.Main */],
|
19
|
+
outputs: ["main" /* NodeConnectionType.Main */],
|
20
|
+
credentials: [
|
21
|
+
{
|
22
|
+
name: 'IzzOneApi',
|
23
|
+
required: true,
|
24
|
+
},
|
25
|
+
],
|
26
|
+
properties: [
|
27
|
+
{
|
28
|
+
displayName: 'Operation',
|
29
|
+
name: 'operation',
|
30
|
+
type: 'options',
|
31
|
+
options: [
|
32
|
+
{
|
33
|
+
name: 'Send a message',
|
34
|
+
value: 'sendMessage',
|
35
|
+
description: 'Send a message to a izz.ONE as chat',
|
36
|
+
},
|
37
|
+
{
|
38
|
+
name: 'Continue a chat',
|
39
|
+
value: 'continueChat',
|
40
|
+
description: 'Continue an existing chat with a message',
|
41
|
+
},
|
42
|
+
],
|
43
|
+
default: 'sendMessage',
|
44
|
+
description: 'The operation to perform',
|
45
|
+
},
|
46
|
+
{
|
47
|
+
displayName: 'Chat ID',
|
48
|
+
name: 'id',
|
49
|
+
type: 'string',
|
50
|
+
required: true,
|
51
|
+
default: '',
|
52
|
+
displayOptions: {
|
53
|
+
show: {
|
54
|
+
operation: ['continueChat'],
|
55
|
+
},
|
56
|
+
},
|
57
|
+
placeholder: 'Enter the chat ID (optional)',
|
58
|
+
description: 'The unique identifier for the chat. If not provided, a new chat will be created.',
|
59
|
+
},
|
60
|
+
{
|
61
|
+
displayName: 'Message',
|
62
|
+
name: 'msg',
|
63
|
+
type: 'string',
|
64
|
+
required: true,
|
65
|
+
default: '',
|
66
|
+
placeholder: 'Enter your message',
|
67
|
+
},
|
68
|
+
{
|
69
|
+
displayName: 'Datasources',
|
70
|
+
name: 'datasources',
|
71
|
+
type: 'multiOptions',
|
72
|
+
options: [],
|
73
|
+
required: false,
|
74
|
+
typeOptions: {
|
75
|
+
loadOptionsMethod: 'getDatasources',
|
76
|
+
},
|
77
|
+
default: ['auto'],
|
78
|
+
description: 'Select a datasource to use for the chat. If not selected, automatic datasource selection will be made. Mixing automatic with other datasources will defaults to automatic.',
|
79
|
+
},
|
80
|
+
{
|
81
|
+
displayName: 'Agent',
|
82
|
+
name: 'agent',
|
83
|
+
type: 'options',
|
84
|
+
options: [],
|
85
|
+
required: false,
|
86
|
+
typeOptions: {
|
87
|
+
loadOptionsMethod: 'getAgents',
|
88
|
+
},
|
89
|
+
default: '',
|
90
|
+
description: 'Select an agent to use for the chat. If not selected, no agent will be used.',
|
91
|
+
},
|
92
|
+
{
|
93
|
+
displayName: 'LLM Model',
|
94
|
+
name: 'llm',
|
95
|
+
type: 'options',
|
96
|
+
options: [],
|
97
|
+
required: false,
|
98
|
+
typeOptions: {
|
99
|
+
loadOptionsMethod: 'getLlms',
|
100
|
+
},
|
101
|
+
default: '',
|
102
|
+
description: 'Select a specific LLM model to use for the chat. If not selected, automatic model selection will be made.',
|
103
|
+
},
|
104
|
+
{
|
105
|
+
displayName: 'System Message',
|
106
|
+
name: 'systemMessage',
|
107
|
+
type: 'string',
|
108
|
+
required: false,
|
109
|
+
default: '',
|
110
|
+
placeholder: 'Enter a custom system message (optional)',
|
111
|
+
},
|
112
|
+
{
|
113
|
+
displayName: 'LLM Behavior',
|
114
|
+
name: 'behavior',
|
115
|
+
type: 'multiOptions',
|
116
|
+
default: [
|
117
|
+
constants_1.LlmBehaviorEnum.CONVERSATIONAL,
|
118
|
+
constants_1.LlmBehaviorEnum.FRIENDLY,
|
119
|
+
constants_1.LlmBehaviorEnum.INFORMAL,
|
120
|
+
constants_1.LlmBehaviorEnum.CREATIVE,
|
121
|
+
],
|
122
|
+
options: constants_1.LlmBehavior,
|
123
|
+
},
|
124
|
+
{
|
125
|
+
displayName: 'Tags',
|
126
|
+
name: 'tags',
|
127
|
+
type: 'string',
|
128
|
+
required: false,
|
129
|
+
default: '',
|
130
|
+
placeholder: 'Enter tags (comma-separated)',
|
131
|
+
description: 'Optional tags to categorize the message. Enter tags as a comma-separated list.',
|
132
|
+
},
|
133
|
+
{
|
134
|
+
// ! Might not work in local n8n
|
135
|
+
displayName: 'Streaming',
|
136
|
+
name: 'streaming',
|
137
|
+
type: 'boolean',
|
138
|
+
default: false,
|
139
|
+
description: 'If enabled, the response will be streamed back in real-time. Otherwise, the full response will be returned at once.',
|
140
|
+
},
|
141
|
+
],
|
142
|
+
};
|
143
|
+
methods = {
|
144
|
+
loadOptions: {
|
145
|
+
getAgents: utils_1.getAgents,
|
146
|
+
getDatasources: utils_1.getDatasources,
|
147
|
+
getLlms: utils_1.getLlms,
|
148
|
+
},
|
149
|
+
};
|
150
|
+
async execute() {
|
151
|
+
let responseData;
|
152
|
+
const operation = this.getNodeParameter('operation', 0);
|
153
|
+
const credentials = await this.getCredentials('IzzOneApi');
|
154
|
+
if (['sendMessage', 'continueChat'].includes(operation)) {
|
155
|
+
const msg = this.getNodeParameter('msg', 0);
|
156
|
+
const id = operation === 'continueChat'
|
157
|
+
? this.getNodeParameter('id', 0)
|
158
|
+
: undefined;
|
159
|
+
const datasources = this.getNodeParameter('datasources', 0);
|
160
|
+
const agent = this.getNodeParameter('agent', 0);
|
161
|
+
const llm = this.getNodeParameter('llm', 0);
|
162
|
+
const systemMessage = this.getNodeParameter('systemMessage', 0);
|
163
|
+
const behavior = this.getNodeParameter('behavior', 0);
|
164
|
+
const tags = this.getNodeParameter('tags', 0)
|
165
|
+
.split(',')
|
166
|
+
.map((v) => v.trim())
|
167
|
+
.filter(Boolean);
|
168
|
+
const streaming = this.getNodeParameter('streaming', 0);
|
169
|
+
const requestBody = {
|
170
|
+
msg,
|
171
|
+
...(id && { id: id.trim() }),
|
172
|
+
...(datasources && { datasources }),
|
173
|
+
...(agent && { agent }),
|
174
|
+
...(llm && { llm }),
|
175
|
+
...(systemMessage && { systemMessage: systemMessage.trim() }),
|
176
|
+
behavior,
|
177
|
+
tags,
|
178
|
+
};
|
179
|
+
const requestOptions = {
|
180
|
+
headers: (0, utils_1.getHeaders)(credentials),
|
181
|
+
method: 'POST',
|
182
|
+
body: requestBody,
|
183
|
+
url: new URL(
|
184
|
+
// /v1/chat or /v1/chat/stream
|
185
|
+
['/v1/chat', streaming && 'stream'].filter(Boolean).join('/'), constants_1.BASE_URL).href,
|
186
|
+
json: true,
|
187
|
+
};
|
188
|
+
responseData = await this.helpers.httpRequest(requestOptions);
|
189
|
+
}
|
190
|
+
// Map data to n8n data
|
191
|
+
return [this.helpers.returnJsonArray(responseData)];
|
192
|
+
}
|
193
|
+
}
|
194
|
+
exports.IzzOne = IzzOne;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
{
|
2
|
+
"node": "n8n-nodes-base.IzzOne",
|
3
|
+
"nodeVersion": "1.0",
|
4
|
+
"codexVersion": "1.0",
|
5
|
+
"categories": ["Artificial Intelligence", "Data Processing"],
|
6
|
+
"resources": {
|
7
|
+
"primaryDocumentation": {
|
8
|
+
"title": "Izz.ONE Documentation",
|
9
|
+
"url": "https://api.nexus.izz.ai/docs"
|
10
|
+
}
|
11
|
+
}
|
12
|
+
}
|
Binary file
|
@@ -0,0 +1,9 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getHeaders = void 0;
|
4
|
+
const getHeaders = (credentials) => ({
|
5
|
+
Accept: 'application/json',
|
6
|
+
Authorization: `Basic ${Buffer.from(`${credentials.emailId}:${credentials.apiKey}`).toString('base64')}`,
|
7
|
+
'x-environment-id': credentials.instanceId,
|
8
|
+
});
|
9
|
+
exports.getHeaders = getHeaders;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
|
+
};
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
__exportStar(require("./generic"), exports);
|
18
|
+
__exportStar(require("./methods"), exports);
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import type { ILoadOptionsFunctions } from 'n8n-workflow';
|
2
|
+
export declare function getLlms(this: ILoadOptionsFunctions): Promise<{
|
3
|
+
name: string;
|
4
|
+
value: string;
|
5
|
+
}[]>;
|
6
|
+
export declare function getAgents(this: ILoadOptionsFunctions): Promise<{
|
7
|
+
name: string;
|
8
|
+
value: string;
|
9
|
+
}[]>;
|
10
|
+
export declare function getDatasources(this: ILoadOptionsFunctions): Promise<{
|
11
|
+
name: string;
|
12
|
+
value: string;
|
13
|
+
}[]>;
|
@@ -0,0 +1,70 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getLlms = getLlms;
|
4
|
+
exports.getAgents = getAgents;
|
5
|
+
exports.getDatasources = getDatasources;
|
6
|
+
const constants_1 = require("../constants");
|
7
|
+
const generic_1 = require("./generic");
|
8
|
+
async function getLlms() {
|
9
|
+
const credentials = await this.getCredentials('IzzOneApi');
|
10
|
+
const path = '/v1/model/available-models';
|
11
|
+
const url = new URL(path, constants_1.BASE_URL);
|
12
|
+
url.searchParams.append('limit', Number.MAX_SAFE_INTEGER.toString());
|
13
|
+
const response = await this.helpers.httpRequest({
|
14
|
+
method: 'GET',
|
15
|
+
url: url.toString(),
|
16
|
+
headers: (0, generic_1.getHeaders)(credentials),
|
17
|
+
json: true,
|
18
|
+
});
|
19
|
+
const data = response.map((data) => ({
|
20
|
+
name: data.label + ` (${data.provider})`,
|
21
|
+
value: data.model,
|
22
|
+
}));
|
23
|
+
data.unshift({
|
24
|
+
name: 'Automatic',
|
25
|
+
value: '',
|
26
|
+
});
|
27
|
+
return data;
|
28
|
+
}
|
29
|
+
async function getAgents() {
|
30
|
+
const credentials = await this.getCredentials('IzzOneApi');
|
31
|
+
const path = '/v1/agent';
|
32
|
+
const url = new URL(path, constants_1.BASE_URL);
|
33
|
+
url.searchParams.append('limit', Number.MAX_SAFE_INTEGER.toString());
|
34
|
+
const response = await this.helpers.httpRequest({
|
35
|
+
method: 'GET',
|
36
|
+
url: url.toString(),
|
37
|
+
headers: (0, generic_1.getHeaders)(credentials),
|
38
|
+
json: true,
|
39
|
+
});
|
40
|
+
const data = response.data.map((data) => ({
|
41
|
+
name: data.name,
|
42
|
+
value: data._id,
|
43
|
+
}));
|
44
|
+
data.unshift({
|
45
|
+
name: 'No Agent',
|
46
|
+
value: '',
|
47
|
+
});
|
48
|
+
return data;
|
49
|
+
}
|
50
|
+
async function getDatasources() {
|
51
|
+
const credentials = await this.getCredentials('IzzOneApi');
|
52
|
+
const path = '/v1/datasource';
|
53
|
+
const url = new URL(path, constants_1.BASE_URL);
|
54
|
+
url.searchParams.append('limit', Number.MAX_SAFE_INTEGER.toString());
|
55
|
+
const response = await this.helpers.httpRequest({
|
56
|
+
method: 'GET',
|
57
|
+
url: url.toString(),
|
58
|
+
headers: (0, generic_1.getHeaders)(credentials),
|
59
|
+
json: true,
|
60
|
+
});
|
61
|
+
const data = response.data.map((data) => ({
|
62
|
+
name: data.displayName + ` (${data.type})`,
|
63
|
+
value: data._id,
|
64
|
+
}));
|
65
|
+
data.unshift({
|
66
|
+
name: 'Automatic',
|
67
|
+
value: 'auto',
|
68
|
+
});
|
69
|
+
return data;
|
70
|
+
}
|
package/package.json
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
{
|
2
|
+
"name": "@izzai/n8n-nodes-izzone",
|
3
|
+
"version": "0.0.17",
|
4
|
+
"description": "n8n custom node for izz.ONE",
|
5
|
+
"main": "dist/index.js",
|
6
|
+
"types": "dist/index.d.ts",
|
7
|
+
"type": "commonjs",
|
8
|
+
"homepage": "https://www.izz.ai/",
|
9
|
+
"repository": {
|
10
|
+
"type": "git",
|
11
|
+
"url": "https://github.com/@izzai/n8n-izzone.git"
|
12
|
+
},
|
13
|
+
"scripts": {
|
14
|
+
"lint": "eslint src",
|
15
|
+
"build": "run-s \"pre:build\" \"create:build\" \"post:build\"",
|
16
|
+
"fix": "run-p \"lint:prettier --write\" \"lint:eslint --fix\" \"typecheck\"",
|
17
|
+
"lint:prettier": "prettier \"**/*.{js,jsx,ts,tsx,css,scss,json,md,yml,html}\"",
|
18
|
+
"lint:eslint": "eslint \"**/*.{ts,tsx}\"",
|
19
|
+
"lint:all": "run-p \"lint:prettier --check\" \"lint:eslint\" \"typecheck\"",
|
20
|
+
"typecheck": "tsc --noEmit --project ./tsconfig.json",
|
21
|
+
"pre:build": "tsx buildScripts/preBuild.ts",
|
22
|
+
"post:build": "tsx buildScripts/postBuild.ts",
|
23
|
+
"create:build": "tsc"
|
24
|
+
},
|
25
|
+
"n8n": {
|
26
|
+
"n8nNodesApiVersion": 1,
|
27
|
+
"credentials": [
|
28
|
+
"dist/credentials/IzzOne.credentials.js"
|
29
|
+
],
|
30
|
+
"nodes": [
|
31
|
+
"dist/nodes/IzzOne.node.js"
|
32
|
+
]
|
33
|
+
},
|
34
|
+
"keywords": [
|
35
|
+
"one",
|
36
|
+
"izz",
|
37
|
+
"izz one",
|
38
|
+
"nexus",
|
39
|
+
"n8n",
|
40
|
+
"node",
|
41
|
+
"custom node",
|
42
|
+
"n8n izz one",
|
43
|
+
"izz.ONE"
|
44
|
+
],
|
45
|
+
"engines": {
|
46
|
+
"node": ">=22"
|
47
|
+
},
|
48
|
+
"author": {
|
49
|
+
"name": "Adarsh Mohan",
|
50
|
+
"email": "adarsh@izz.ai"
|
51
|
+
},
|
52
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
53
|
+
"files": [
|
54
|
+
"dist",
|
55
|
+
"LICENSE.md"
|
56
|
+
],
|
57
|
+
"dependencies": {
|
58
|
+
"n8n-workflow": "1.82.0"
|
59
|
+
},
|
60
|
+
"devDependencies": {
|
61
|
+
"@eslint/js": "*",
|
62
|
+
"@izzai/nexus-api": "workspace:*",
|
63
|
+
"@izzai/tsconfig": "workspace:*",
|
64
|
+
"@tsconfig/node22": "^22.0.0",
|
65
|
+
"@types/eslint": "*",
|
66
|
+
"@types/node": "^*",
|
67
|
+
"@types/prettier": "*",
|
68
|
+
"@typescript-eslint/eslint-plugin": "*",
|
69
|
+
"@typescript-eslint/parser": "*",
|
70
|
+
"eslint": "*",
|
71
|
+
"eslint-config-prettier": "*",
|
72
|
+
"eslint-plugin-import": "*",
|
73
|
+
"eslint-plugin-prettier": "*",
|
74
|
+
"eslint-plugin-simple-import-sort": "*",
|
75
|
+
"eslint-plugin-unused-imports": "*",
|
76
|
+
"npm-run-all": "*",
|
77
|
+
"prettier": "*",
|
78
|
+
"tsconfig": "*",
|
79
|
+
"typescript": "*",
|
80
|
+
"typescript-eslint": "*"
|
81
|
+
},
|
82
|
+
"peerDependencies": {
|
83
|
+
"n8n-workflow": "*"
|
84
|
+
}
|
85
|
+
}
|