@aiteza/n8n-nodes-aiteza 0.1.1
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 +22 -0
- package/README.md +80 -0
- package/dist/credentials/AitezaOAuth2Api.credentials.d.ts +17 -0
- package/dist/credentials/AitezaOAuth2Api.credentials.js +83 -0
- package/dist/credentials/aiteza.svg +13 -0
- package/dist/nodes/Aiteza/Aiteza.node.d.ts +19 -0
- package/dist/nodes/Aiteza/Aiteza.node.js +1244 -0
- package/dist/nodes/Aiteza/GenericFunctions.d.ts +17 -0
- package/dist/nodes/Aiteza/GenericFunctions.js +180 -0
- package/dist/nodes/Aiteza/aiteza.svg +13 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 AITEZA
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# n8n-nodes-aiteza
|
|
2
|
+
|
|
3
|
+
A community node for [n8n](https://n8n.io) that integrates with the [AITEZA](https://aiteza.com) REST API.
|
|
4
|
+
|
|
5
|
+
This node lets you work with AITEZA Datarooms, Files, Web Sources, Search, Chat, Models, and Workflows directly from your n8n workflows. Authentication is handled via OAuth2 (Keycloak Authorization Code flow).
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
### Community Nodes (recommended)
|
|
10
|
+
|
|
11
|
+
1. Open your n8n instance.
|
|
12
|
+
2. Go to **Settings > Community Nodes**.
|
|
13
|
+
3. Select **Install**.
|
|
14
|
+
4. Enter `@aiteza/n8n-nodes-aiteza` and confirm.
|
|
15
|
+
|
|
16
|
+
For more details, see the [n8n docs on community nodes](https://docs.n8n.io/integrations/community-nodes/installation/).
|
|
17
|
+
|
|
18
|
+
### Environment Variables (n8n v2.21.0+)
|
|
19
|
+
|
|
20
|
+
If you manage your n8n instance through a deployment pipeline, you can install community packages via environment variables:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
export N8N_COMMUNITY_PACKAGES_MANAGED_BY_ENV=true
|
|
24
|
+
export N8N_COMMUNITY_PACKAGES='[{"name":"@aiteza/n8n-nodes-aiteza","version":"0.1.0"}]'
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Restart n8n after setting these. For the full reference, see the [n8n environment variable docs](https://docs.n8n.io/hosting/configuration/environment-variables/).
|
|
28
|
+
|
|
29
|
+
### Manual npm Install (Docker)
|
|
30
|
+
|
|
31
|
+
If you run n8n in Docker (e.g. in queue mode or for private packages), install directly inside the container:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
docker exec -it n8n sh
|
|
35
|
+
mkdir -p ~/.n8n/nodes && cd ~/.n8n/nodes
|
|
36
|
+
npm i @aiteza/n8n-nodes-aiteza
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Then restart the container:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
docker restart n8n
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Credentials
|
|
46
|
+
|
|
47
|
+
This node authenticates through Keycloak's OAuth2 Authorization Code flow. When you add AITEZA credentials in n8n, a **Connect** button opens the Keycloak login page. After you sign in, n8n stores and automatically refreshes your tokens.
|
|
48
|
+
|
|
49
|
+
### Configuration
|
|
50
|
+
|
|
51
|
+
| Field | Description | Default |
|
|
52
|
+
| ------------- | ----------------------------------------------------------- | ------- |
|
|
53
|
+
| Base URL | Your AITEZA backend URL, e.g. `https://aiteza.example.com` | *none* |
|
|
54
|
+
| Realm | Keycloak realm name | `kai` |
|
|
55
|
+
| Client ID | OAuth2 client ID (provided by n8n's OAuth2 base) | *none* |
|
|
56
|
+
| Client Secret | OAuth2 client secret (provided by n8n's OAuth2 base) | *none* |
|
|
57
|
+
|
|
58
|
+
### Keycloak Client Setup
|
|
59
|
+
|
|
60
|
+
Your Keycloak client (e.g. `n8n`) needs to be configured for the Authorization Code flow:
|
|
61
|
+
|
|
62
|
+
- **Valid Redirect URIs**: add your n8n callback URL, typically `https://<your-n8n>/rest/oauth2-credential/callback`
|
|
63
|
+
- **Access Type**: `confidential` (when using a client secret) or `public`
|
|
64
|
+
- **Standard Flow Enabled**: `ON`
|
|
65
|
+
|
|
66
|
+
## Supported Resources
|
|
67
|
+
|
|
68
|
+
| Resource | Operations |
|
|
69
|
+
| ---------- | ------------------------------------------------------------ |
|
|
70
|
+
| Dataroom | Get, Get Many, Search, Create, Delete |
|
|
71
|
+
| File | Get, Get Many, Get Status, Delete, Upload, Upload Standalone |
|
|
72
|
+
| Web Source | Get Many, Add, Delete |
|
|
73
|
+
| Search | Hybrid Search |
|
|
74
|
+
| Chat | Create, Get, Get Messages, Delete, Ask (Ephemeral), Generate |
|
|
75
|
+
| Model | Get Many |
|
|
76
|
+
| Workflow | Get, Get Many |
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class AitezaOAuth2Api implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
icon: {
|
|
7
|
+
readonly light: "file:aiteza.svg";
|
|
8
|
+
readonly dark: "file:aiteza.svg";
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Extending oAuth2Api gives us n8n's built-in OAuth2 Authorization Code flow.
|
|
12
|
+
* The user will see a "Connect" button that opens Keycloak's login page.
|
|
13
|
+
*/
|
|
14
|
+
extends: string[];
|
|
15
|
+
properties: INodeProperties[];
|
|
16
|
+
test: ICredentialTestRequest;
|
|
17
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AitezaOAuth2Api = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Hardcoded Keycloak auth base URL – not user-configurable.
|
|
6
|
+
*/
|
|
7
|
+
const KEYCLOAK_BASE_URL = 'https://auth.weyer-data-engineering.com';
|
|
8
|
+
class AitezaOAuth2Api {
|
|
9
|
+
name = 'aitezaOAuth2Api';
|
|
10
|
+
displayName = 'AITEZA OAuth2 API';
|
|
11
|
+
documentationUrl = 'https://docs.aiteza.com';
|
|
12
|
+
icon = { light: 'file:aiteza.svg', dark: 'file:aiteza.svg' };
|
|
13
|
+
/**
|
|
14
|
+
* Extending oAuth2Api gives us n8n's built-in OAuth2 Authorization Code flow.
|
|
15
|
+
* The user will see a "Connect" button that opens Keycloak's login page.
|
|
16
|
+
*/
|
|
17
|
+
extends = ['oAuth2Api'];
|
|
18
|
+
properties = [
|
|
19
|
+
// --- User-visible fields ---
|
|
20
|
+
{
|
|
21
|
+
displayName: 'Base URL',
|
|
22
|
+
name: 'baseUrl',
|
|
23
|
+
type: 'string',
|
|
24
|
+
default: '',
|
|
25
|
+
placeholder: 'https://aiteza.example.com',
|
|
26
|
+
description: 'AITEZA Backend URL (without trailing slash)',
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Realm',
|
|
31
|
+
name: 'realm',
|
|
32
|
+
type: 'string',
|
|
33
|
+
default: 'kai',
|
|
34
|
+
description: 'Keycloak Realm name',
|
|
35
|
+
required: true,
|
|
36
|
+
},
|
|
37
|
+
// --- OAuth2 fields (pre-configured, hidden from user) ---
|
|
38
|
+
{
|
|
39
|
+
displayName: 'Grant Type',
|
|
40
|
+
name: 'grantType',
|
|
41
|
+
type: 'hidden',
|
|
42
|
+
default: 'authorizationCode',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
displayName: 'Authorization URL',
|
|
46
|
+
name: 'authUrl',
|
|
47
|
+
type: 'hidden',
|
|
48
|
+
default: `=${KEYCLOAK_BASE_URL}/realms/{{$self.realm}}/protocol/openid-connect/auth`,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
displayName: 'Access Token URL',
|
|
52
|
+
name: 'accessTokenUrl',
|
|
53
|
+
type: 'hidden',
|
|
54
|
+
default: `=${KEYCLOAK_BASE_URL}/realms/{{$self.realm}}/protocol/openid-connect/token`,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
displayName: 'Scope',
|
|
58
|
+
name: 'scope',
|
|
59
|
+
type: 'hidden',
|
|
60
|
+
default: 'openid profile email',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
displayName: 'Auth URI Query Parameters',
|
|
64
|
+
name: 'authQueryParameters',
|
|
65
|
+
type: 'hidden',
|
|
66
|
+
default: '',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
displayName: 'Authentication',
|
|
70
|
+
name: 'authentication',
|
|
71
|
+
type: 'hidden',
|
|
72
|
+
default: 'body',
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
test = {
|
|
76
|
+
request: {
|
|
77
|
+
baseURL: '={{$credentials.baseUrl}}',
|
|
78
|
+
url: '/api/models',
|
|
79
|
+
method: 'GET',
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
exports.AitezaOAuth2Api = AitezaOAuth2Api;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg id="Ebene_2" data-name="Ebene 2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 114.46 100.31">
|
|
3
|
+
<defs>
|
|
4
|
+
<style>
|
|
5
|
+
.cls-1 {
|
|
6
|
+
fill: #0769b3;
|
|
7
|
+
}
|
|
8
|
+
</style>
|
|
9
|
+
</defs>
|
|
10
|
+
<g id="Ebene_1-2" data-name="Ebene 1">
|
|
11
|
+
<path class="cls-1" d="M113.88,52.37l-16.51,28.61h-16.2c-1.19,0-2.34-.49-3.17-1.34l-9.48-9.73c.45-1.28.71-2.64.71-4.06,0-6.62-5.37-11.98-11.98-11.98s-11.98,5.37-11.98,11.98,5.37,11.99,11.98,11.99c1.65,0,3.22-.33,4.65-.93l12.04,12.37c.83.85,1.98,1.33,3.17,1.33h14.71l-4.34,7.51c-.8,1.36-2.25,2.21-3.83,2.21H30.82c-1.58,0-3.03-.85-3.83-2.21L.59,52.37c-.78-1.36-.78-3.06,0-4.42l16.17-28h15.99c1.19,0,2.34.48,3.17,1.34l10.07,10.34c-.45,1.26-.71,2.63-.71,4.05,0,6.62,5.37,11.98,11.99,11.98s11.98-5.37,11.98-11.98-5.37-11.99-11.98-11.99c-1.65,0-3.23.33-4.66.93l-12.65-12.97c-.82-.86-1.97-1.34-3.16-1.34h-14.51l4.68-8.1c.8-1.36,2.25-2.21,3.83-2.21h52.82c1.58,0,3.03.85,3.83,2.21l26.41,45.74c.78,1.36.78,3.06,0,4.42Z"/>
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
import { loadDatarooms, loadDataroomsOptional, loadModels, loadChats, loadFilesInDataroom, loadImagesInDataroom, loadWebSourcesInDataroom, loadStandaloneFiles, loadStandaloneImages } from './GenericFunctions';
|
|
3
|
+
export declare class Aiteza implements INodeType {
|
|
4
|
+
description: INodeTypeDescription;
|
|
5
|
+
methods: {
|
|
6
|
+
loadOptions: {
|
|
7
|
+
getDatarooms: typeof loadDatarooms;
|
|
8
|
+
getDataroomsOptional: typeof loadDataroomsOptional;
|
|
9
|
+
getModels: typeof loadModels;
|
|
10
|
+
getChats: typeof loadChats;
|
|
11
|
+
getFilesInDataroom: typeof loadFilesInDataroom;
|
|
12
|
+
getImagesInDataroom: typeof loadImagesInDataroom;
|
|
13
|
+
getWebSourcesInDataroom: typeof loadWebSourcesInDataroom;
|
|
14
|
+
getStandaloneFiles: typeof loadStandaloneFiles;
|
|
15
|
+
getStandaloneImages: typeof loadStandaloneImages;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
19
|
+
}
|