@miridih-de/n8n-nodes-databricks 0.1.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.ko.md +152 -0
- package/README.md +145 -0
- package/dist/credentials/DatabricksApi.credentials.d.ts +10 -0
- package/dist/credentials/DatabricksApi.credentials.js +48 -0
- package/dist/credentials/DatabricksApi.credentials.js.map +1 -0
- package/dist/credentials/DatabricksOAuth2Api.credentials.d.ts +10 -0
- package/dist/credentials/DatabricksOAuth2Api.credentials.js +68 -0
- package/dist/credentials/DatabricksOAuth2Api.credentials.js.map +1 -0
- package/dist/credentials/databricks.svg +19 -0
- package/dist/icons/databricks.png +0 -0
- package/dist/icons/databricks.svg +19 -0
- package/dist/icons/github.dark.svg +3 -0
- package/dist/icons/github.svg +3 -0
- package/dist/nodes/Databricks/Databricks.node.d.ts +15 -0
- package/dist/nodes/Databricks/Databricks.node.js +131 -0
- package/dist/nodes/Databricks/Databricks.node.js.map +1 -0
- package/dist/nodes/Databricks/listSearch/getClusters.d.ts +2 -0
- package/dist/nodes/Databricks/listSearch/getClusters.js +24 -0
- package/dist/nodes/Databricks/listSearch/getClusters.js.map +1 -0
- package/dist/nodes/Databricks/listSearch/getJobs.d.ts +2 -0
- package/dist/nodes/Databricks/listSearch/getJobs.js +26 -0
- package/dist/nodes/Databricks/listSearch/getJobs.js.map +1 -0
- package/dist/nodes/Databricks/listSearch/getWarehouses.d.ts +2 -0
- package/dist/nodes/Databricks/listSearch/getWarehouses.js +23 -0
- package/dist/nodes/Databricks/listSearch/getWarehouses.js.map +1 -0
- package/dist/nodes/Databricks/resources/sql/execute.d.ts +2 -0
- package/dist/nodes/Databricks/resources/sql/execute.js +169 -0
- package/dist/nodes/Databricks/resources/sql/execute.js.map +1 -0
- package/dist/nodes/Databricks/resources/sql/index.d.ts +2 -0
- package/dist/nodes/Databricks/resources/sql/index.js +213 -0
- package/dist/nodes/Databricks/resources/sql/index.js.map +1 -0
- package/dist/nodes/Databricks/resources/workflow/index.d.ts +2 -0
- package/dist/nodes/Databricks/resources/workflow/index.js +121 -0
- package/dist/nodes/Databricks/resources/workflow/index.js.map +1 -0
- package/dist/nodes/Databricks/resources/workflow/runNow.d.ts +2 -0
- package/dist/nodes/Databricks/resources/workflow/runNow.js +90 -0
- package/dist/nodes/Databricks/resources/workflow/runNow.js.map +1 -0
- package/dist/nodes/Databricks/shared/polling.d.ts +16 -0
- package/dist/nodes/Databricks/shared/polling.js +38 -0
- package/dist/nodes/Databricks/shared/polling.js.map +1 -0
- package/dist/nodes/Databricks/shared/transport.d.ts +2 -0
- package/dist/nodes/Databricks/shared/transport.js +45 -0
- package/dist/nodes/Databricks/shared/transport.js.map +1 -0
- package/dist/nodes/Databricks/shared/utils.d.ts +37 -0
- package/dist/nodes/Databricks/shared/utils.js +106 -0
- package/dist/nodes/Databricks/shared/utils.js.map +1 -0
- package/dist/package.json +52 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +51 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright 2022 n8n
|
|
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.ko.md
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# n8n-nodes-databricks
|
|
2
|
+
|
|
3
|
+
[English](README.md)
|
|
4
|
+
|
|
5
|
+
Databricks에서 SQL 쿼리 실행 및 Job 트리거를 위한 n8n 커뮤니티 노드입니다.
|
|
6
|
+
|
|
7
|
+
## 기능
|
|
8
|
+
|
|
9
|
+
- **SQL 실행**: Databricks SQL Warehouse 또는 All-Purpose Cluster에서 SQL 쿼리 실행
|
|
10
|
+
- **대용량 결과 지원**: EXTERNAL_LINKS 방식으로 최대 100GB 데이터 처리 (SQL Warehouse 전용)
|
|
11
|
+
- **Workflow 트리거**: 파라미터와 함께 Databricks Job 실행
|
|
12
|
+
- **유연한 출력 형식**: Individual Rows 또는 DataFrame 형식 선택 가능
|
|
13
|
+
- **Resource Locator**: 드롭다운으로 Warehouse, Cluster, Job 쉽게 선택
|
|
14
|
+
- **다중 인증 방식**: OAuth2 및 Personal Access Token 지원
|
|
15
|
+
|
|
16
|
+
## 설치
|
|
17
|
+
|
|
18
|
+
### Community Nodes (권장)
|
|
19
|
+
|
|
20
|
+
1. **Settings > Community Nodes** 이동
|
|
21
|
+
2. **Install** 선택
|
|
22
|
+
3. `n8n-nodes-databricks-custom` 입력
|
|
23
|
+
4. **Install** 선택
|
|
24
|
+
|
|
25
|
+
### 수동 설치
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install n8n-nodes-databricks-custom
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 인증 설정
|
|
32
|
+
|
|
33
|
+
두 가지 인증 방식을 지원합니다:
|
|
34
|
+
|
|
35
|
+
### OAuth2 (권장)
|
|
36
|
+
|
|
37
|
+
Databricks와의 보안 인증을 위해 OAuth2 자격 증명을 구성합니다.
|
|
38
|
+
|
|
39
|
+
### Personal Access Token
|
|
40
|
+
|
|
41
|
+
| 필드 | 설명 |
|
|
42
|
+
| ------------------------- | -------------------------------------------------------------------- |
|
|
43
|
+
| **Workspace URL** | Databricks workspace URL (예: `https://xxx.cloud.databricks.com`) |
|
|
44
|
+
| **Personal Access Token** | Databricks User Settings > Developer > Access tokens에서 생성한 토큰 |
|
|
45
|
+
|
|
46
|
+
## 작업(Operations)
|
|
47
|
+
|
|
48
|
+
### SQL Resource
|
|
49
|
+
|
|
50
|
+
#### Execute SQL
|
|
51
|
+
|
|
52
|
+
Databricks에서 SQL 쿼리를 실행합니다.
|
|
53
|
+
|
|
54
|
+
**파라미터:**
|
|
55
|
+
|
|
56
|
+
| 파라미터 | 설명 |
|
|
57
|
+
| ----------------------- | ---------------------------------------------------------------------------- |
|
|
58
|
+
| Execution Mode | `SQL Warehouse` 또는 `Shared Cluster` |
|
|
59
|
+
| SQL Warehouse / Cluster | 드롭다운에서 선택하거나 ID 직접 입력 |
|
|
60
|
+
| SQL Statement | 실행할 SQL 쿼리 |
|
|
61
|
+
| Output Format | `Individual Rows` (n8n 표준) 또는 `DataFrame` (rows 배열을 포함한 단일 객체) |
|
|
62
|
+
| Timeout | 최대 대기 시간 (초, 기본값: 300) |
|
|
63
|
+
| Large Result Support | 25MB 이상 대용량 결과 처리 시 활성화 (SQL Warehouse 전용, 최대 100GB) |
|
|
64
|
+
|
|
65
|
+
> **참고**: Shared Cluster 모드는 Command API 1.2 제한으로 인해 약 1000행까지만 반환됩니다. 대용량 데이터가 필요하면 SQL Warehouse + Large Result Support를 사용하세요.
|
|
66
|
+
|
|
67
|
+
**Output Format 예시:**
|
|
68
|
+
|
|
69
|
+
_Individual Rows:_
|
|
70
|
+
|
|
71
|
+
```json
|
|
72
|
+
[
|
|
73
|
+
{ "id": 1, "name": "Alice" },
|
|
74
|
+
{ "id": 2, "name": "Bob" }
|
|
75
|
+
]
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
_DataFrame:_
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"rows": [
|
|
83
|
+
{ "id": 1, "name": "Alice" },
|
|
84
|
+
{ "id": 2, "name": "Bob" }
|
|
85
|
+
],
|
|
86
|
+
"rowCount": 2
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Workflow Resource
|
|
91
|
+
|
|
92
|
+
#### Run Now
|
|
93
|
+
|
|
94
|
+
Databricks Job을 즉시 실행합니다.
|
|
95
|
+
|
|
96
|
+
**파라미터:**
|
|
97
|
+
|
|
98
|
+
| 파라미터 | 설명 |
|
|
99
|
+
| ------------------- | ----------------------------------- |
|
|
100
|
+
| Job | 드롭다운에서 선택하거나 Job ID 입력 |
|
|
101
|
+
| Job Parameters | Job에 전달할 JSON 파라미터 (선택) |
|
|
102
|
+
| Wait for Completion | Job 완료까지 대기 여부 |
|
|
103
|
+
| Timeout | 최대 대기 시간 (초) |
|
|
104
|
+
|
|
105
|
+
## 설정
|
|
106
|
+
|
|
107
|
+
### 대용량 결과 지원
|
|
108
|
+
|
|
109
|
+
수백만 행의 대용량 결과를 처리할 때 n8n의 페이로드 크기 제한을 늘려야 할 수 있습니다:
|
|
110
|
+
|
|
111
|
+
```yaml
|
|
112
|
+
# docker-compose.yml
|
|
113
|
+
environment:
|
|
114
|
+
- N8N_PAYLOAD_SIZE_LIMIT=2048 # MB, 기본값 16
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## 개발
|
|
118
|
+
|
|
119
|
+
### Docker를 이용한 로컬 개발
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
# 노드 빌드
|
|
123
|
+
npm run build
|
|
124
|
+
|
|
125
|
+
# Docker로 n8n 시작
|
|
126
|
+
docker-compose up -d
|
|
127
|
+
|
|
128
|
+
# http://localhost:5678 에서 n8n 접속
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### 빌드 명령어
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
npm run build # 프로덕션 빌드
|
|
135
|
+
npm run dev # 개발 모드 시작
|
|
136
|
+
npm run lint # 린트 에러 확인
|
|
137
|
+
npm run lint:fix # 린트 에러 자동 수정
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## 라이선스
|
|
141
|
+
|
|
142
|
+
[MIT](LICENSE.md)
|
|
143
|
+
|
|
144
|
+
## 작성자
|
|
145
|
+
|
|
146
|
+
- **shkim** - [shkim07@miridih.com](mailto:shkim07@miridih.com)
|
|
147
|
+
|
|
148
|
+
## 링크
|
|
149
|
+
|
|
150
|
+
- [상세 기능 가이드](docs/FEATURES.ko.md)
|
|
151
|
+
- [n8n Community Nodes 문서](https://docs.n8n.io/integrations/community-nodes/)
|
|
152
|
+
- [Databricks REST API 레퍼런스](https://docs.databricks.com/api/workspace/introduction)
|
package/README.md
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# n8n-nodes-databricks
|
|
2
|
+
|
|
3
|
+
[한국어](README.ko.md)
|
|
4
|
+
|
|
5
|
+
n8n community node for executing SQL queries and triggering jobs on Databricks.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **SQL Execution**: Run SQL queries on Databricks SQL Warehouse or All-Purpose Cluster
|
|
10
|
+
- **Large Result Support**: Handle results up to 100GB with EXTERNAL_LINKS disposition (SQL Warehouse only)
|
|
11
|
+
- **Workflow Trigger**: Execute Databricks Jobs with parameters
|
|
12
|
+
- **Flexible Output**: Choose between individual rows or DataFrame format
|
|
13
|
+
- **Resource Locator**: Easy selection of warehouses, clusters, and jobs via dropdown
|
|
14
|
+
- **Multiple Auth Methods**: OAuth2 and Personal Access Token support
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
### Community Nodes (Recommended)
|
|
19
|
+
|
|
20
|
+
1. Go to **Settings > Community Nodes**
|
|
21
|
+
2. Select **Install**
|
|
22
|
+
3. Enter `n8n-nodes-databricks-custom`
|
|
23
|
+
4. Select **Install**
|
|
24
|
+
|
|
25
|
+
### Manual Installation
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install n8n-nodes-databricks-custom
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Credentials
|
|
32
|
+
|
|
33
|
+
This node supports two authentication methods:
|
|
34
|
+
|
|
35
|
+
### OAuth2 (Recommended)
|
|
36
|
+
Configure OAuth2 credentials for secure authentication with Databricks.
|
|
37
|
+
|
|
38
|
+
### Personal Access Token
|
|
39
|
+
| Field | Description |
|
|
40
|
+
| ------------------------- | ------------------------------------------------------------------------- |
|
|
41
|
+
| **Workspace URL** | Your Databricks workspace URL (e.g., `https://xxx.cloud.databricks.com`) |
|
|
42
|
+
| **Personal Access Token** | Token generated from Databricks User Settings > Developer > Access tokens |
|
|
43
|
+
|
|
44
|
+
## Operations
|
|
45
|
+
|
|
46
|
+
### SQL Resource
|
|
47
|
+
|
|
48
|
+
#### Execute SQL
|
|
49
|
+
|
|
50
|
+
Run SQL queries on Databricks.
|
|
51
|
+
|
|
52
|
+
**Parameters:**
|
|
53
|
+
|
|
54
|
+
| Parameter | Description |
|
|
55
|
+
| ----------------------- | ------------------------------------------------------------------------------- |
|
|
56
|
+
| Execution Mode | `SQL Warehouse` or `Shared Cluster` |
|
|
57
|
+
| SQL Warehouse / Cluster | Select from dropdown or enter ID |
|
|
58
|
+
| SQL Statement | The SQL query to execute |
|
|
59
|
+
| Output Format | `Individual Rows` (n8n standard) or `DataFrame` (single object with rows array) |
|
|
60
|
+
| Timeout | Maximum wait time in seconds (default: 300) |
|
|
61
|
+
| Large Result Support | Enable for results > 25MB (SQL Warehouse only, up to 100GB) |
|
|
62
|
+
|
|
63
|
+
> **Note**: Shared Cluster mode has a ~1000 row limit due to Command API 1.2 limitations. For large datasets, use SQL Warehouse with Large Result Support.
|
|
64
|
+
|
|
65
|
+
**Output Format Examples:**
|
|
66
|
+
|
|
67
|
+
_Individual Rows:_
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
[
|
|
71
|
+
{ "id": 1, "name": "Alice" },
|
|
72
|
+
{ "id": 2, "name": "Bob" }
|
|
73
|
+
]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
_DataFrame:_
|
|
77
|
+
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"rows": [
|
|
81
|
+
{ "id": 1, "name": "Alice" },
|
|
82
|
+
{ "id": 2, "name": "Bob" }
|
|
83
|
+
],
|
|
84
|
+
"rowCount": 2
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Workflow Resource
|
|
89
|
+
|
|
90
|
+
#### Run Now
|
|
91
|
+
|
|
92
|
+
Trigger a Databricks job immediately.
|
|
93
|
+
|
|
94
|
+
**Parameters:**
|
|
95
|
+
|
|
96
|
+
| Parameter | Description |
|
|
97
|
+
| ------------------- | ------------------------------------ |
|
|
98
|
+
| Job | Select from dropdown or enter Job ID |
|
|
99
|
+
| Job Parameters | Optional JSON parameters for the job |
|
|
100
|
+
| Wait for Completion | Whether to wait for job to finish |
|
|
101
|
+
| Timeout | Maximum wait time in seconds |
|
|
102
|
+
|
|
103
|
+
## Configuration
|
|
104
|
+
|
|
105
|
+
### Large Result Support
|
|
106
|
+
|
|
107
|
+
When handling very large result sets (millions of rows), you may need to increase n8n's payload size limit:
|
|
108
|
+
|
|
109
|
+
```yaml
|
|
110
|
+
# docker-compose.yml
|
|
111
|
+
environment:
|
|
112
|
+
- N8N_PAYLOAD_SIZE_LIMIT=2048 # MB, default is 16
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Development
|
|
116
|
+
|
|
117
|
+
### Local Development with Docker
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Build the node
|
|
121
|
+
npm run build
|
|
122
|
+
|
|
123
|
+
# Start n8n with Docker
|
|
124
|
+
docker-compose up -d
|
|
125
|
+
|
|
126
|
+
# Access n8n at http://localhost:5678
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Build Commands
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
npm run build # Build for production
|
|
133
|
+
npm run dev # Start development mode
|
|
134
|
+
npm run lint # Check for linting errors
|
|
135
|
+
npm run lint:fix # Fix linting errors
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
|
|
140
|
+
[MIT](LICENSE.md)
|
|
141
|
+
|
|
142
|
+
## Links
|
|
143
|
+
|
|
144
|
+
- [n8n Community Nodes Documentation](https://docs.n8n.io/integrations/community-nodes/)
|
|
145
|
+
- [Databricks REST API Reference](https://docs.databricks.com/api/workspace/introduction)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, Icon, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class DatabricksApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
icon: Icon;
|
|
6
|
+
documentationUrl: string;
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
authenticate: IAuthenticateGeneric;
|
|
9
|
+
test: ICredentialTestRequest;
|
|
10
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DatabricksApi = void 0;
|
|
4
|
+
class DatabricksApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'databricksApi';
|
|
7
|
+
this.displayName = 'Databricks API';
|
|
8
|
+
this.icon = 'file:databricks.svg';
|
|
9
|
+
this.documentationUrl = 'https://docs.databricks.com/en/dev-tools/auth/pat.html';
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Host URL',
|
|
13
|
+
name: 'hostUrl',
|
|
14
|
+
type: 'string',
|
|
15
|
+
default: '',
|
|
16
|
+
placeholder: 'https://abc-xxxx.cloud.databricks.com',
|
|
17
|
+
description: 'The URL of your Databricks workspace instance',
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
displayName: 'Personal Access Token',
|
|
22
|
+
name: 'accessToken',
|
|
23
|
+
type: 'string',
|
|
24
|
+
typeOptions: { password: true },
|
|
25
|
+
default: '',
|
|
26
|
+
description: 'Your Databricks personal access token',
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
];
|
|
30
|
+
this.authenticate = {
|
|
31
|
+
type: 'generic',
|
|
32
|
+
properties: {
|
|
33
|
+
headers: {
|
|
34
|
+
Authorization: '=Bearer {{$credentials?.accessToken}}',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
this.test = {
|
|
39
|
+
request: {
|
|
40
|
+
baseURL: '={{$credentials?.hostUrl}}',
|
|
41
|
+
url: '/api/2.0/clusters/list',
|
|
42
|
+
method: 'GET',
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.DatabricksApi = DatabricksApi;
|
|
48
|
+
//# sourceMappingURL=DatabricksApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatabricksApi.credentials.js","sourceRoot":"","sources":["../../credentials/DatabricksApi.credentials.ts"],"names":[],"mappings":";;;AAQA,MAAa,aAAa;IAA1B;QACC,SAAI,GAAG,eAAe,CAAC;QAEvB,gBAAW,GAAG,gBAAgB,CAAC;QAE/B,SAAI,GAAS,qBAAqB,CAAC;QAEnC,qBAAgB,GAAG,wDAAwD,CAAC;QAE5E,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,uCAAuC;gBACpD,WAAW,EAAE,+CAA+C;gBAC5D,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,uBAAuB;gBACpC,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,uCAAuC;gBACpD,QAAQ,EAAE,IAAI;aACd;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,uCAAuC;iBACtD;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,4BAA4B;gBACrC,GAAG,EAAE,wBAAwB;gBAC7B,MAAM,EAAE,KAAK;aACb;SACD,CAAC;IACH,CAAC;CAAA;AA9CD,sCA8CC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ICredentialTestRequest, ICredentialType, INodeProperties, Icon } from 'n8n-workflow';
|
|
2
|
+
export declare class DatabricksOAuth2Api implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
icon: Icon;
|
|
6
|
+
documentationUrl: string;
|
|
7
|
+
extends: string[];
|
|
8
|
+
properties: INodeProperties[];
|
|
9
|
+
test: ICredentialTestRequest;
|
|
10
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DatabricksOAuth2Api = void 0;
|
|
4
|
+
class DatabricksOAuth2Api {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'databricksOAuth2Api';
|
|
7
|
+
this.displayName = 'Databricks OAuth2 API';
|
|
8
|
+
this.icon = 'file:databricks.svg';
|
|
9
|
+
this.documentationUrl = 'https://docs.databricks.com/en/dev-tools/auth/oauth-u2m.html';
|
|
10
|
+
this.extends = ['oAuth2Api'];
|
|
11
|
+
this.properties = [
|
|
12
|
+
{
|
|
13
|
+
displayName: 'Host URL',
|
|
14
|
+
name: 'hostUrl',
|
|
15
|
+
type: 'string',
|
|
16
|
+
default: '',
|
|
17
|
+
placeholder: 'https://abc-xxxx.cloud.databricks.com',
|
|
18
|
+
description: 'The URL of your Databricks workspace instance',
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
displayName: 'Grant Type',
|
|
23
|
+
name: 'grantType',
|
|
24
|
+
type: 'hidden',
|
|
25
|
+
default: 'authorizationCode',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Authorization URL',
|
|
29
|
+
name: 'authUrl',
|
|
30
|
+
type: 'hidden',
|
|
31
|
+
default: '={{$self["hostUrl"]}}/oidc/v1/authorize',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
displayName: 'Access Token URL',
|
|
35
|
+
name: 'accessTokenUrl',
|
|
36
|
+
type: 'hidden',
|
|
37
|
+
default: '={{$self["hostUrl"]}}/oidc/v1/token',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
displayName: 'Scope',
|
|
41
|
+
name: 'scope',
|
|
42
|
+
type: 'hidden',
|
|
43
|
+
default: 'all-apis offline_access',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
displayName: 'Auth URI Query Parameters',
|
|
47
|
+
name: 'authQueryParameters',
|
|
48
|
+
type: 'hidden',
|
|
49
|
+
default: '',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
displayName: 'Authentication',
|
|
53
|
+
name: 'authentication',
|
|
54
|
+
type: 'hidden',
|
|
55
|
+
default: 'body',
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
this.test = {
|
|
59
|
+
request: {
|
|
60
|
+
baseURL: '={{$credentials?.hostUrl}}',
|
|
61
|
+
url: '/api/2.0/clusters/list',
|
|
62
|
+
method: 'GET',
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.DatabricksOAuth2Api = DatabricksOAuth2Api;
|
|
68
|
+
//# sourceMappingURL=DatabricksOAuth2Api.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatabricksOAuth2Api.credentials.js","sourceRoot":"","sources":["../../credentials/DatabricksOAuth2Api.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,mBAAmB;IAAhC;QACC,SAAI,GAAG,qBAAqB,CAAC;QAE7B,gBAAW,GAAG,uBAAuB,CAAC;QAEtC,SAAI,GAAS,qBAAqB,CAAC;QAEnC,qBAAgB,GAAG,8DAA8D,CAAC;QAElF,YAAO,GAAG,CAAC,WAAW,CAAC,CAAC;QAExB,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,uCAAuC;gBACpD,WAAW,EAAE,+CAA+C;gBAC5D,QAAQ,EAAE,IAAI;aACd;YACD;gBACC,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,mBAAmB;aAC5B;YACD;gBACC,WAAW,EAAE,mBAAmB;gBAChC,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,yCAAyC;aAClD;YACD;gBACC,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,qCAAqC;aAC9C;YACD;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,yBAAyB;aAClC;YACD;gBACC,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,qBAAqB;gBAC3B,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM;aACf;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,4BAA4B;gBACrC,GAAG,EAAE,wBAAwB;gBAC7B,MAAM,EAAE,KAAK;aACb;SACD,CAAC;IACH,CAAC;CAAA;AAlED,kDAkEC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<svg version="1.1" id="Layer_1" xmlns:x="ns_extend;" xmlns:i="ns_ai;" xmlns:graph="ns_graphs;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 40.1 42" style="enable-background:new 0 0 40.1 42;" xml:space="preserve">
|
|
2
|
+
<style type="text/css">
|
|
3
|
+
.st0{fill:#FF3621;}
|
|
4
|
+
</style>
|
|
5
|
+
<metadata>
|
|
6
|
+
<sfw xmlns="ns_sfw;">
|
|
7
|
+
<slices>
|
|
8
|
+
</slices>
|
|
9
|
+
<sliceSourceBounds bottomLeftOrigin="true" height="42" width="40.1" x="-69.1" y="-10.5">
|
|
10
|
+
</sliceSourceBounds>
|
|
11
|
+
</sfw>
|
|
12
|
+
</metadata>
|
|
13
|
+
<g>
|
|
14
|
+
<path class="st0" d="M40.1,31.1v-7.4l-0.8-0.5L20.1,33.7l-18.2-10l0-4.3l18.2,9.9l20.1-10.9v-7.3l-0.8-0.5L20.1,21.2L2.6,11.6
|
|
15
|
+
L20.1,2l14.1,7.7l1.1-0.6V8.3L20.1,0L0,10.9V12L20.1,23l18.2-10v4.4l-18.2,10L0.8,16.8L0,17.3v7.4l20.1,10.9l18.2-9.9v4.3l-18.2,10
|
|
16
|
+
L0.8,29.5L0,30v1.1L20.1,42L40.1,31.1z">
|
|
17
|
+
</path>
|
|
18
|
+
</g>
|
|
19
|
+
</svg>
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<svg version="1.1" id="Layer_1" xmlns:x="ns_extend;" xmlns:i="ns_ai;" xmlns:graph="ns_graphs;" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 40.1 42" style="enable-background:new 0 0 40.1 42;" xml:space="preserve">
|
|
2
|
+
<style type="text/css">
|
|
3
|
+
.st0{fill:#FF3621;}
|
|
4
|
+
</style>
|
|
5
|
+
<metadata>
|
|
6
|
+
<sfw xmlns="ns_sfw;">
|
|
7
|
+
<slices>
|
|
8
|
+
</slices>
|
|
9
|
+
<sliceSourceBounds bottomLeftOrigin="true" height="42" width="40.1" x="-69.1" y="-10.5">
|
|
10
|
+
</sliceSourceBounds>
|
|
11
|
+
</sfw>
|
|
12
|
+
</metadata>
|
|
13
|
+
<g>
|
|
14
|
+
<path class="st0" d="M40.1,31.1v-7.4l-0.8-0.5L20.1,33.7l-18.2-10l0-4.3l18.2,9.9l20.1-10.9v-7.3l-0.8-0.5L20.1,21.2L2.6,11.6
|
|
15
|
+
L20.1,2l14.1,7.7l1.1-0.6V8.3L20.1,0L0,10.9V12L20.1,23l18.2-10v4.4l-18.2,10L0.8,16.8L0,17.3v7.4l20.1,10.9l18.2-9.9v4.3l-18.2,10
|
|
16
|
+
L0.8,29.5L0,30v1.1L20.1,42L40.1,31.1z">
|
|
17
|
+
</path>
|
|
18
|
+
</g>
|
|
19
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.0165 0C8.94791 0 0 9.01388 0 20.1653C0 29.0792 5.73324 36.6246 13.6868 39.2952C14.6812 39.496 15.0454 38.8613 15.0454 38.3274C15.0454 37.8599 15.0126 36.2575 15.0126 34.5879C9.4445 35.79 8.28498 32.1841 8.28498 32.1841C7.39015 29.847 6.06429 29.2463 6.06429 29.2463C4.24185 28.011 6.19704 28.011 6.19704 28.011C8.21861 28.1446 9.27938 30.081 9.27938 30.081C11.0686 33.1522 13.9518 32.2844 15.1118 31.7502C15.2773 30.4481 15.8079 29.5467 16.3713 29.046C11.9303 28.5785 7.25781 26.8425 7.25781 19.0967C7.25781 16.8932 8.05267 15.0905 9.31216 13.6884C9.11344 13.1877 8.41732 11.1174 9.51128 8.34644C9.51128 8.34644 11.2014 7.81217 15.0122 10.4164C16.6438 9.97495 18.3263 9.7504 20.0165 9.74851C21.7067 9.74851 23.4295 9.98246 25.0205 10.4164C28.8317 7.81217 30.5218 8.34644 30.5218 8.34644C31.6158 11.1174 30.9192 13.1877 30.7205 13.6884C32.0132 15.0905 32.7753 16.8932 32.7753 19.0967C32.7753 26.8425 28.1028 28.5449 23.6287 29.046C24.358 29.6802 24.9873 30.882 24.9873 32.7851C24.9873 35.4893 24.9545 37.6596 24.9545 38.327C24.9545 38.8613 25.3192 39.496 26.3132 39.2956C34.2667 36.6242 39.9999 29.0792 39.9999 20.1653C40.0327 9.01388 31.052 0 20.0165 0Z" fill="white"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.0165 0C8.94791 0 0 9.01388 0 20.1653C0 29.0792 5.73324 36.6246 13.6868 39.2952C14.6812 39.496 15.0454 38.8613 15.0454 38.3274C15.0454 37.8599 15.0126 36.2575 15.0126 34.5879C9.4445 35.79 8.28498 32.1841 8.28498 32.1841C7.39015 29.847 6.06429 29.2463 6.06429 29.2463C4.24185 28.011 6.19704 28.011 6.19704 28.011C8.21861 28.1446 9.27938 30.081 9.27938 30.081C11.0686 33.1522 13.9518 32.2844 15.1118 31.7502C15.2773 30.4481 15.8079 29.5467 16.3713 29.046C11.9303 28.5785 7.25781 26.8425 7.25781 19.0967C7.25781 16.8932 8.05267 15.0905 9.31216 13.6884C9.11344 13.1877 8.41732 11.1174 9.51128 8.34644C9.51128 8.34644 11.2014 7.81217 15.0122 10.4164C16.6438 9.97495 18.3263 9.7504 20.0165 9.74851C21.7067 9.74851 23.4295 9.98246 25.0205 10.4164C28.8317 7.81217 30.5218 8.34644 30.5218 8.34644C31.6158 11.1174 30.9192 13.1877 30.7205 13.6884C32.0132 15.0905 32.7753 16.8932 32.7753 19.0967C32.7753 26.8425 28.1028 28.5449 23.6287 29.046C24.358 29.6802 24.9873 30.882 24.9873 32.7851C24.9873 35.4893 24.9545 37.6596 24.9545 38.327C24.9545 38.8613 25.3192 39.496 26.3132 39.2956C34.2667 36.6242 39.9999 29.0792 39.9999 20.1653C40.0327 9.01388 31.052 0 20.0165 0Z" fill="#24292F"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
import { getWarehouses } from './listSearch/getWarehouses';
|
|
3
|
+
import { getClusters } from './listSearch/getClusters';
|
|
4
|
+
import { getJobs } from './listSearch/getJobs';
|
|
5
|
+
export declare class Databricks implements INodeType {
|
|
6
|
+
description: INodeTypeDescription;
|
|
7
|
+
methods: {
|
|
8
|
+
listSearch: {
|
|
9
|
+
getWarehouses: typeof getWarehouses;
|
|
10
|
+
getClusters: typeof getClusters;
|
|
11
|
+
getJobs: typeof getJobs;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Databricks = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const sql_1 = require("./resources/sql");
|
|
6
|
+
const workflow_1 = require("./resources/workflow");
|
|
7
|
+
const execute_1 = require("./resources/sql/execute");
|
|
8
|
+
const runNow_1 = require("./resources/workflow/runNow");
|
|
9
|
+
const getWarehouses_1 = require("./listSearch/getWarehouses");
|
|
10
|
+
const getClusters_1 = require("./listSearch/getClusters");
|
|
11
|
+
const getJobs_1 = require("./listSearch/getJobs");
|
|
12
|
+
class Databricks {
|
|
13
|
+
constructor() {
|
|
14
|
+
this.description = {
|
|
15
|
+
displayName: 'Databricks',
|
|
16
|
+
name: 'databricks',
|
|
17
|
+
icon: 'file:../../icons/databricks.svg',
|
|
18
|
+
group: ['transform'],
|
|
19
|
+
version: 1,
|
|
20
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
21
|
+
description: 'Execute SQL queries and trigger jobs on Databricks',
|
|
22
|
+
defaults: {
|
|
23
|
+
name: 'Databricks',
|
|
24
|
+
},
|
|
25
|
+
usableAsTool: true,
|
|
26
|
+
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
27
|
+
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
|
|
28
|
+
credentials: [
|
|
29
|
+
{
|
|
30
|
+
name: 'databricksApi',
|
|
31
|
+
required: true,
|
|
32
|
+
displayOptions: {
|
|
33
|
+
show: {
|
|
34
|
+
authentication: ['accessToken'],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'databricksOAuth2Api',
|
|
40
|
+
required: true,
|
|
41
|
+
displayOptions: {
|
|
42
|
+
show: {
|
|
43
|
+
authentication: ['oAuth2'],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
properties: [
|
|
49
|
+
{
|
|
50
|
+
displayName: 'Authentication',
|
|
51
|
+
name: 'authentication',
|
|
52
|
+
type: 'options',
|
|
53
|
+
options: [
|
|
54
|
+
{
|
|
55
|
+
name: 'OAuth2',
|
|
56
|
+
value: 'oAuth2',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'Personal Access Token',
|
|
60
|
+
value: 'accessToken',
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
default: 'oAuth2',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
displayName: 'Resource',
|
|
67
|
+
name: 'resource',
|
|
68
|
+
type: 'options',
|
|
69
|
+
noDataExpression: true,
|
|
70
|
+
options: [
|
|
71
|
+
{
|
|
72
|
+
name: 'SQL',
|
|
73
|
+
value: 'sql',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: 'Workflow',
|
|
77
|
+
value: 'workflow',
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
default: 'sql',
|
|
81
|
+
},
|
|
82
|
+
...sql_1.sqlDescription,
|
|
83
|
+
...workflow_1.workflowDescription,
|
|
84
|
+
],
|
|
85
|
+
};
|
|
86
|
+
this.methods = {
|
|
87
|
+
listSearch: {
|
|
88
|
+
getWarehouses: getWarehouses_1.getWarehouses,
|
|
89
|
+
getClusters: getClusters_1.getClusters,
|
|
90
|
+
getJobs: getJobs_1.getJobs,
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
async execute() {
|
|
95
|
+
const items = this.getInputData();
|
|
96
|
+
const returnData = [];
|
|
97
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
98
|
+
for (let i = 0; i < items.length; i++) {
|
|
99
|
+
try {
|
|
100
|
+
let results = [];
|
|
101
|
+
if (resource === 'sql') {
|
|
102
|
+
results = await execute_1.executeSql.call(this, i);
|
|
103
|
+
}
|
|
104
|
+
else if (resource === 'workflow') {
|
|
105
|
+
results = await runNow_1.executeWorkflow.call(this, i);
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown resource: ${resource}`, {
|
|
109
|
+
itemIndex: i,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
for (const item of results) {
|
|
113
|
+
returnData.push({ ...item, pairedItem: { item: i } });
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
if (this.continueOnFail()) {
|
|
118
|
+
returnData.push({
|
|
119
|
+
json: { error: error.message },
|
|
120
|
+
pairedItem: { item: i },
|
|
121
|
+
});
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex: i });
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return [returnData];
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
exports.Databricks = Databricks;
|
|
131
|
+
//# sourceMappingURL=Databricks.node.js.map
|