@kyuda/n8n-nodes-databricks 2.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 +180 -0
- package/dist/credentials/Databricks.credentials.d.ts +10 -0
- package/dist/credentials/Databricks.credentials.js +88 -0
- package/dist/credentials/Databricks.credentials.js.map +1 -0
- package/dist/credentials/databricks.svg +19 -0
- package/dist/nodes/Databricks/Databricks.node.d.ts +18 -0
- package/dist/nodes/Databricks/Databricks.node.js +404 -0
- package/dist/nodes/Databricks/Databricks.node.js.map +1 -0
- package/dist/nodes/Databricks/databricks.dark.svg +19 -0
- package/dist/nodes/Databricks/databricks.svg +19 -0
- package/dist/nodes/Databricks/helpers.d.ts +27 -0
- package/dist/nodes/Databricks/helpers.js +169 -0
- package/dist/nodes/Databricks/helpers.js.map +1 -0
- package/dist/nodes/Databricks/resources/clusters/handler.d.ts +2 -0
- package/dist/nodes/Databricks/resources/clusters/handler.js +38 -0
- package/dist/nodes/Databricks/resources/clusters/handler.js.map +1 -0
- package/dist/nodes/Databricks/resources/clusters/operations.d.ts +2 -0
- package/dist/nodes/Databricks/resources/clusters/operations.js +24 -0
- package/dist/nodes/Databricks/resources/clusters/operations.js.map +1 -0
- package/dist/nodes/Databricks/resources/clusters/parameters.d.ts +2 -0
- package/dist/nodes/Databricks/resources/clusters/parameters.js +49 -0
- package/dist/nodes/Databricks/resources/clusters/parameters.js.map +1 -0
- package/dist/nodes/Databricks/resources/databricksSql/handler.d.ts +2 -0
- package/dist/nodes/Databricks/resources/databricksSql/handler.js +59 -0
- package/dist/nodes/Databricks/resources/databricksSql/handler.js.map +1 -0
- package/dist/nodes/Databricks/resources/databricksSql/operations.d.ts +2 -0
- package/dist/nodes/Databricks/resources/databricksSql/operations.js +24 -0
- package/dist/nodes/Databricks/resources/databricksSql/operations.js.map +1 -0
- package/dist/nodes/Databricks/resources/databricksSql/parameters.d.ts +2 -0
- package/dist/nodes/Databricks/resources/databricksSql/parameters.js +94 -0
- package/dist/nodes/Databricks/resources/databricksSql/parameters.js.map +1 -0
- package/dist/nodes/Databricks/resources/files/handler.d.ts +2 -0
- package/dist/nodes/Databricks/resources/files/handler.js +157 -0
- package/dist/nodes/Databricks/resources/files/handler.js.map +1 -0
- package/dist/nodes/Databricks/resources/files/operations.d.ts +2 -0
- package/dist/nodes/Databricks/resources/files/operations.js +71 -0
- package/dist/nodes/Databricks/resources/files/operations.js.map +1 -0
- package/dist/nodes/Databricks/resources/files/parameters.d.ts +2 -0
- package/dist/nodes/Databricks/resources/files/parameters.js +124 -0
- package/dist/nodes/Databricks/resources/files/parameters.js.map +1 -0
- package/dist/nodes/Databricks/resources/genie/handler.d.ts +2 -0
- package/dist/nodes/Databricks/resources/genie/handler.js +54 -0
- package/dist/nodes/Databricks/resources/genie/handler.js.map +1 -0
- package/dist/nodes/Databricks/resources/genie/operations.d.ts +2 -0
- package/dist/nodes/Databricks/resources/genie/operations.js +96 -0
- package/dist/nodes/Databricks/resources/genie/operations.js.map +1 -0
- package/dist/nodes/Databricks/resources/genie/parameters.d.ts +2 -0
- package/dist/nodes/Databricks/resources/genie/parameters.js +96 -0
- package/dist/nodes/Databricks/resources/genie/parameters.js.map +1 -0
- package/dist/nodes/Databricks/resources/index.d.ts +24 -0
- package/dist/nodes/Databricks/resources/index.js +50 -0
- package/dist/nodes/Databricks/resources/index.js.map +1 -0
- package/dist/nodes/Databricks/resources/jobs/handler.d.ts +2 -0
- package/dist/nodes/Databricks/resources/jobs/handler.js +90 -0
- package/dist/nodes/Databricks/resources/jobs/handler.js.map +1 -0
- package/dist/nodes/Databricks/resources/jobs/operations.d.ts +2 -0
- package/dist/nodes/Databricks/resources/jobs/operations.js +25 -0
- package/dist/nodes/Databricks/resources/jobs/operations.js.map +1 -0
- package/dist/nodes/Databricks/resources/jobs/parameters.d.ts +2 -0
- package/dist/nodes/Databricks/resources/jobs/parameters.js +195 -0
- package/dist/nodes/Databricks/resources/jobs/parameters.js.map +1 -0
- package/dist/nodes/Databricks/resources/modelServing/handler.d.ts +2 -0
- package/dist/nodes/Databricks/resources/modelServing/handler.js +75 -0
- package/dist/nodes/Databricks/resources/modelServing/handler.js.map +1 -0
- package/dist/nodes/Databricks/resources/modelServing/operations.d.ts +2 -0
- package/dist/nodes/Databricks/resources/modelServing/operations.js +24 -0
- package/dist/nodes/Databricks/resources/modelServing/operations.js.map +1 -0
- package/dist/nodes/Databricks/resources/modelServing/parameters.d.ts +2 -0
- package/dist/nodes/Databricks/resources/modelServing/parameters.js +76 -0
- package/dist/nodes/Databricks/resources/modelServing/parameters.js.map +1 -0
- package/dist/nodes/Databricks/resources/unityCatalog/handler.d.ts +2 -0
- package/dist/nodes/Databricks/resources/unityCatalog/handler.js +146 -0
- package/dist/nodes/Databricks/resources/unityCatalog/handler.js.map +1 -0
- package/dist/nodes/Databricks/resources/unityCatalog/operations.d.ts +2 -0
- package/dist/nodes/Databricks/resources/unityCatalog/operations.js +238 -0
- package/dist/nodes/Databricks/resources/unityCatalog/operations.js.map +1 -0
- package/dist/nodes/Databricks/resources/unityCatalog/parameters.d.ts +2 -0
- package/dist/nodes/Databricks/resources/unityCatalog/parameters.js +412 -0
- package/dist/nodes/Databricks/resources/unityCatalog/parameters.js.map +1 -0
- package/dist/nodes/Databricks/resources/vectorSearch/handler.d.ts +2 -0
- package/dist/nodes/Databricks/resources/vectorSearch/handler.js +50 -0
- package/dist/nodes/Databricks/resources/vectorSearch/handler.js.map +1 -0
- package/dist/nodes/Databricks/resources/vectorSearch/operations.d.ts +2 -0
- package/dist/nodes/Databricks/resources/vectorSearch/operations.js +48 -0
- package/dist/nodes/Databricks/resources/vectorSearch/operations.js.map +1 -0
- package/dist/nodes/Databricks/resources/vectorSearch/parameters.d.ts +2 -0
- package/dist/nodes/Databricks/resources/vectorSearch/parameters.js +224 -0
- package/dist/nodes/Databricks/resources/vectorSearch/parameters.js.map +1 -0
- package/dist/package.json +70 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.executeFilesOperation = executeFilesOperation;
|
|
7
|
+
const mime_types_1 = __importDefault(require("mime-types"));
|
|
8
|
+
const helpers_1 = require("../../helpers");
|
|
9
|
+
async function executeFilesOperation(ctx, operation, i) {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
const { credentials, host } = await (0, helpers_1.getCredentialsAndHost)(ctx);
|
|
12
|
+
const volumePath = ctx.getNodeParameter('volumePath', i);
|
|
13
|
+
const { catalog, schema, volume } = (0, helpers_1.parseVolumePath)(volumePath);
|
|
14
|
+
const volumeBase = `/api/2.0/fs/files/Volumes/${(0, helpers_1.safePath)(catalog)}/${(0, helpers_1.safePath)(schema)}/${(0, helpers_1.safePath)(volume)}`;
|
|
15
|
+
const dirBase = `/api/2.0/fs/directories/Volumes/${(0, helpers_1.safePath)(catalog)}/${(0, helpers_1.safePath)(schema)}/${(0, helpers_1.safePath)(volume)}`;
|
|
16
|
+
if (operation === 'uploadFile') {
|
|
17
|
+
const dataFieldName = ctx.getNodeParameter('dataFieldName', i);
|
|
18
|
+
const filePath = ctx.getNodeParameter('filePath', i);
|
|
19
|
+
(0, helpers_1.validatePathNoTraversal)(filePath);
|
|
20
|
+
const binaryData = await ctx.helpers.getBinaryDataBuffer(i, dataFieldName);
|
|
21
|
+
const items = ctx.getInputData();
|
|
22
|
+
await ctx.helpers.httpRequest({
|
|
23
|
+
method: 'PUT',
|
|
24
|
+
url: `${host}${volumeBase}/${filePath}`,
|
|
25
|
+
body: binaryData,
|
|
26
|
+
headers: {
|
|
27
|
+
Authorization: `Bearer ${credentials.token}`,
|
|
28
|
+
'Content-Type': ((_b = (_a = items[i].binary) === null || _a === void 0 ? void 0 : _a[dataFieldName]) === null || _b === void 0 ? void 0 : _b.mimeType) || 'application/octet-stream',
|
|
29
|
+
},
|
|
30
|
+
encoding: 'arraybuffer',
|
|
31
|
+
});
|
|
32
|
+
return [
|
|
33
|
+
{
|
|
34
|
+
json: { success: true, message: `File uploaded successfully to ${filePath}` },
|
|
35
|
+
pairedItem: { item: i },
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
if (operation === 'downloadFile') {
|
|
40
|
+
const filePath = ctx.getNodeParameter('filePath', i);
|
|
41
|
+
(0, helpers_1.validatePathNoTraversal)(filePath);
|
|
42
|
+
const response = await ctx.helpers.httpRequest({
|
|
43
|
+
method: 'GET',
|
|
44
|
+
url: `${host}${volumeBase}/${filePath}`,
|
|
45
|
+
headers: { Authorization: `Bearer ${credentials.token}` },
|
|
46
|
+
encoding: 'arraybuffer',
|
|
47
|
+
returnFullResponse: true,
|
|
48
|
+
});
|
|
49
|
+
const fileName = filePath.split('/').pop() || 'downloaded-file';
|
|
50
|
+
let contentType = response.headers['content-type'];
|
|
51
|
+
if (!contentType || contentType === 'application/octet-stream') {
|
|
52
|
+
const detectedType = mime_types_1.default.lookup(fileName);
|
|
53
|
+
contentType = detectedType || 'application/octet-stream';
|
|
54
|
+
}
|
|
55
|
+
const buffer = Buffer.from(response.body);
|
|
56
|
+
return [
|
|
57
|
+
{
|
|
58
|
+
json: { fileName, size: buffer.length, contentType, catalog, schema, volume, filePath },
|
|
59
|
+
binary: {
|
|
60
|
+
data: { data: buffer.toString('base64'), mimeType: contentType, fileName },
|
|
61
|
+
},
|
|
62
|
+
pairedItem: { item: i },
|
|
63
|
+
},
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
if (operation === 'deleteFile') {
|
|
67
|
+
const filePath = ctx.getNodeParameter('filePath', i);
|
|
68
|
+
(0, helpers_1.validatePathNoTraversal)(filePath);
|
|
69
|
+
await ctx.helpers.httpRequest({
|
|
70
|
+
method: 'DELETE',
|
|
71
|
+
url: `${host}${volumeBase}/${filePath}`,
|
|
72
|
+
headers: { Authorization: `Bearer ${credentials.token}` },
|
|
73
|
+
json: true,
|
|
74
|
+
});
|
|
75
|
+
return [
|
|
76
|
+
{
|
|
77
|
+
json: { success: true, message: `File deleted successfully: ${filePath}`, volumePath, filePath },
|
|
78
|
+
pairedItem: { item: i },
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
if (operation === 'getFileInfo') {
|
|
83
|
+
const filePath = ctx.getNodeParameter('filePath', i);
|
|
84
|
+
(0, helpers_1.validatePathNoTraversal)(filePath);
|
|
85
|
+
const response = await ctx.helpers.httpRequest({
|
|
86
|
+
method: 'HEAD',
|
|
87
|
+
url: `${host}${volumeBase}/${filePath}`,
|
|
88
|
+
headers: { Authorization: `Bearer ${credentials.token}` },
|
|
89
|
+
returnFullResponse: true,
|
|
90
|
+
});
|
|
91
|
+
return [
|
|
92
|
+
{
|
|
93
|
+
json: {
|
|
94
|
+
volumePath,
|
|
95
|
+
filePath,
|
|
96
|
+
headers: response.headers,
|
|
97
|
+
contentLength: response.headers['content-length'],
|
|
98
|
+
contentType: response.headers['content-type'],
|
|
99
|
+
lastModified: response.headers['last-modified'],
|
|
100
|
+
},
|
|
101
|
+
pairedItem: { item: i },
|
|
102
|
+
},
|
|
103
|
+
];
|
|
104
|
+
}
|
|
105
|
+
if (operation === 'listDirectory') {
|
|
106
|
+
const directoryPath = ctx.getNodeParameter('directoryPath', i);
|
|
107
|
+
(0, helpers_1.validatePathNoTraversal)(directoryPath);
|
|
108
|
+
const additionalFields = ctx.getNodeParameter('additionalFields', i, {});
|
|
109
|
+
const qs = {};
|
|
110
|
+
if (additionalFields.pageSize)
|
|
111
|
+
qs.page_size = additionalFields.pageSize;
|
|
112
|
+
if (additionalFields.pageToken)
|
|
113
|
+
qs.page_token = additionalFields.pageToken;
|
|
114
|
+
const response = await ctx.helpers.httpRequest({
|
|
115
|
+
method: 'GET',
|
|
116
|
+
url: `${host}${dirBase}/${directoryPath}`,
|
|
117
|
+
headers: { Authorization: `Bearer ${credentials.token}` },
|
|
118
|
+
qs,
|
|
119
|
+
json: true,
|
|
120
|
+
});
|
|
121
|
+
return [{ json: response, pairedItem: { item: i } }];
|
|
122
|
+
}
|
|
123
|
+
if (operation === 'createDirectory') {
|
|
124
|
+
const directoryPath = ctx.getNodeParameter('directoryPath', i);
|
|
125
|
+
(0, helpers_1.validatePathNoTraversal)(directoryPath);
|
|
126
|
+
await ctx.helpers.httpRequest({
|
|
127
|
+
method: 'PUT',
|
|
128
|
+
url: `${host}${dirBase}/${directoryPath}`,
|
|
129
|
+
headers: { Authorization: `Bearer ${credentials.token}` },
|
|
130
|
+
json: true,
|
|
131
|
+
});
|
|
132
|
+
return [
|
|
133
|
+
{
|
|
134
|
+
json: { success: true, message: `Directory created successfully: ${directoryPath}`, volumePath, directoryPath },
|
|
135
|
+
pairedItem: { item: i },
|
|
136
|
+
},
|
|
137
|
+
];
|
|
138
|
+
}
|
|
139
|
+
if (operation === 'deleteDirectory') {
|
|
140
|
+
const directoryPath = ctx.getNodeParameter('directoryPath', i);
|
|
141
|
+
(0, helpers_1.validatePathNoTraversal)(directoryPath);
|
|
142
|
+
await ctx.helpers.httpRequest({
|
|
143
|
+
method: 'DELETE',
|
|
144
|
+
url: `${host}${dirBase}/${directoryPath}`,
|
|
145
|
+
headers: { Authorization: `Bearer ${credentials.token}` },
|
|
146
|
+
json: true,
|
|
147
|
+
});
|
|
148
|
+
return [
|
|
149
|
+
{
|
|
150
|
+
json: { success: true, message: `Directory deleted successfully: ${directoryPath}`, volumePath, directoryPath },
|
|
151
|
+
pairedItem: { item: i },
|
|
152
|
+
},
|
|
153
|
+
];
|
|
154
|
+
}
|
|
155
|
+
throw new Error(`Unsupported Files operation: ${operation}`);
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"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AW,CAAC;YAC7B,MAAM,EAAE,QAAQ;YAChB,GAAG,EAAE,GAAG,IAAI,GAAG,OAAO,IAAI,aAAa,EAAE;YACzC,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,WAAW,CAAC,KAAK,EAAE,EAAE;YACzD,IAAI,EAAE,IAAI;SACV,CAAC,CAAC;QAEH,OAAO;YACN;gBACC,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,mCAAmC,aAAa,EAAE,EAAE,UAAU,EAAE,aAAa,EAAE;gBAC/G,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;aACvB;SACD,CAAC;IACH,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,gCAAgC,SAAS,EAAE,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filesOperations = void 0;
|
|
4
|
+
exports.filesOperations = {
|
|
5
|
+
displayName: 'Operation',
|
|
6
|
+
name: 'operation',
|
|
7
|
+
type: 'options',
|
|
8
|
+
noDataExpression: true,
|
|
9
|
+
displayOptions: {
|
|
10
|
+
show: {
|
|
11
|
+
resource: ['files'],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
options: [
|
|
15
|
+
{
|
|
16
|
+
name: 'Upload File',
|
|
17
|
+
value: 'uploadFile',
|
|
18
|
+
description: 'Upload a file (up to 5 GiB) to Databricks volumes',
|
|
19
|
+
action: 'Upload a file',
|
|
20
|
+
routing: {
|
|
21
|
+
request: {
|
|
22
|
+
method: 'PUT',
|
|
23
|
+
url: '=/api/2.0/fs/files/Volumes/{{$parameter.catalog}}/{{$parameter.schema}}/{{$parameter.volume}}/{{$parameter.path}}',
|
|
24
|
+
body: '={{$binary[$parameter.dataFieldName].data}}',
|
|
25
|
+
headers: {
|
|
26
|
+
'Content-Type': "application/octet-stream"
|
|
27
|
+
},
|
|
28
|
+
encoding: 'arraybuffer'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Download File',
|
|
34
|
+
value: 'downloadFile',
|
|
35
|
+
description: 'Download file content from Databricks workspace',
|
|
36
|
+
action: 'Download a file',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'Delete File',
|
|
40
|
+
value: 'deleteFile',
|
|
41
|
+
description: 'Delete a file from Databricks workspace',
|
|
42
|
+
action: 'Delete a file',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'Get File Metadata',
|
|
46
|
+
value: 'getFileInfo',
|
|
47
|
+
description: 'Get file metadata from Databricks workspace',
|
|
48
|
+
action: 'Get file info',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'List Directory',
|
|
52
|
+
value: 'listDirectory',
|
|
53
|
+
description: 'List directory contents in volume',
|
|
54
|
+
action: 'List a directory',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'Create Directory',
|
|
58
|
+
value: 'createDirectory',
|
|
59
|
+
description: 'Create a directory in volume',
|
|
60
|
+
action: 'Create a directory',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'Delete Directory',
|
|
64
|
+
value: 'deleteDirectory',
|
|
65
|
+
description: 'Delete a directory in volume',
|
|
66
|
+
action: 'Delete a directory',
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
default: 'listDirectory',
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../../nodes/Databricks/resources/files/operations.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAoB;IAC/C,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,SAAS;IACf,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE;QACf,IAAI,EAAE;YACL,QAAQ,EAAE,CAAC,OAAO,CAAC;SACnB;KACD;IACD,OAAO,EAAE;QACR;YACC,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,mDAAmD;YAChE,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE;gBACR,OAAO,EAAE;oBACR,MAAM,EAAE,KAAK;oBACb,GAAG,EAAE,mHAAmH;oBACxH,IAAI,EAAE,6CAA6C;oBACnD,OAAO,EAAE;wBACR,cAAc,EAAE,0BAA0B;qBAC1C;oBACD,QAAQ,EAAE,aAAa;iBACvB;aACD;SACD;QACF;YACC,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,iDAAiD;YAC9D,MAAM,EAAE,iBAAiB;SACzB;QACD;YACC,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,yCAAyC;YACtD,MAAM,EAAE,eAAe;SACvB;QACD;YACC,IAAI,EAAE,mBAAmB;YACzB,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,6CAA6C;YAC1D,MAAM,EAAE,eAAe;SACvB;QACD;YACC,IAAI,EAAE,gBAAgB;YACtB,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,mCAAmC;YAChD,MAAM,EAAE,kBAAkB;SAC1B;QACD;YACC,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,8BAA8B;YAC3C,MAAM,EAAE,oBAAoB;SAC5B;QACD;YACC,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,iBAAiB;YACxB,WAAW,EAAE,8BAA8B;YAC3C,MAAM,EAAE,oBAAoB;SAC5B;KACA;IACD,OAAO,EAAE,eAAe;CACxB,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filesParameters = void 0;
|
|
4
|
+
exports.filesParameters = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Volume Path',
|
|
7
|
+
name: 'volumePath',
|
|
8
|
+
type: 'string',
|
|
9
|
+
required: true,
|
|
10
|
+
default: '',
|
|
11
|
+
placeholder: 'catalog.schema.volume',
|
|
12
|
+
description: 'Full path to the volume in format: catalog.schema.volume',
|
|
13
|
+
displayOptions: {
|
|
14
|
+
show: {
|
|
15
|
+
resource: ['files'],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
displayName: 'File Path',
|
|
21
|
+
name: 'filePath',
|
|
22
|
+
type: 'string',
|
|
23
|
+
required: true,
|
|
24
|
+
default: '',
|
|
25
|
+
displayOptions: {
|
|
26
|
+
show: {
|
|
27
|
+
operation: [
|
|
28
|
+
'uploadFile',
|
|
29
|
+
'downloadFile',
|
|
30
|
+
'deleteFile',
|
|
31
|
+
'getFileInfo',
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
description: 'Path to the file within the volume (e.g. "folder/file.txt" or "file.txt"). Do not include leading slash.',
|
|
36
|
+
placeholder: 'folder/file.txt',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
displayName: 'Input Data Field Name',
|
|
40
|
+
name: 'dataFieldName',
|
|
41
|
+
type: 'string',
|
|
42
|
+
default: 'data',
|
|
43
|
+
required: true,
|
|
44
|
+
description: 'Name of the field from input that contains the binary data to be uploaded',
|
|
45
|
+
displayOptions: {
|
|
46
|
+
show: {
|
|
47
|
+
resource: ['files'],
|
|
48
|
+
operation: ['uploadFile'],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
displayName: 'Directory Path',
|
|
54
|
+
name: 'directoryPath',
|
|
55
|
+
type: 'string',
|
|
56
|
+
required: true,
|
|
57
|
+
default: '',
|
|
58
|
+
displayOptions: {
|
|
59
|
+
show: {
|
|
60
|
+
operation: [
|
|
61
|
+
'createDirectory',
|
|
62
|
+
'deleteDirectory',
|
|
63
|
+
'listDirectory',
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
description: 'Path to directory within the volume (e.g. "folder1" or "folder1/subfolder"). Do not include leading slash.',
|
|
68
|
+
placeholder: 'folder1',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
displayName: 'Additional Fields',
|
|
72
|
+
name: 'additionalFields',
|
|
73
|
+
type: 'collection',
|
|
74
|
+
placeholder: 'Add Field',
|
|
75
|
+
default: {},
|
|
76
|
+
displayOptions: {
|
|
77
|
+
show: {
|
|
78
|
+
operation: [
|
|
79
|
+
'listDirectory',
|
|
80
|
+
'uploadFile',
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
options: [
|
|
85
|
+
{
|
|
86
|
+
displayName: 'Page Size',
|
|
87
|
+
name: 'pageSize',
|
|
88
|
+
type: 'number',
|
|
89
|
+
default: 1000,
|
|
90
|
+
description: 'Number of files to return per page',
|
|
91
|
+
displayOptions: {
|
|
92
|
+
show: {
|
|
93
|
+
'/operation': ['listDirectory'],
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
displayName: 'Page Token',
|
|
99
|
+
name: 'pageToken',
|
|
100
|
+
type: 'string',
|
|
101
|
+
default: '',
|
|
102
|
+
description: 'Token for the next page of results',
|
|
103
|
+
displayOptions: {
|
|
104
|
+
show: {
|
|
105
|
+
'/operation': ['listDirectory'],
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
displayName: 'Overwrite',
|
|
111
|
+
name: 'overwrite',
|
|
112
|
+
type: 'boolean',
|
|
113
|
+
default: false,
|
|
114
|
+
description: 'Whether to overwrite an existing file',
|
|
115
|
+
displayOptions: {
|
|
116
|
+
show: {
|
|
117
|
+
'/operation': ['uploadFile'],
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
];
|
|
124
|
+
//# sourceMappingURL=parameters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../../../nodes/Databricks/resources/files/parameters.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAsB;IACjD;QACC,WAAW,EAAE,aAAa;QAC1B,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,uBAAuB;QACpC,WAAW,EAAE,0DAA0D;QACvE,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,OAAO,CAAC;aACnB;SACD;KACD;IACE;QACI,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,SAAS,EAAE;oBACP,YAAY;oBACZ,cAAc;oBACd,YAAY;oBACZ,aAAa;iBAChB;aACJ;SACJ;QACD,WAAW,EAAE,0GAA0G;QACvH,WAAW,EAAE,iBAAiB;KACjC;IACD;QACI,WAAW,EAAE,uBAAuB;QACpC,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,2EAA2E;QACxF,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE,CAAC,OAAO,CAAC;gBACnB,SAAS,EAAE,CAAC,YAAY,CAAC;aAC5B;SACJ;KACJ;IAED;QACI,WAAW,EAAE,gBAAgB;QAC7B,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,SAAS,EAAE;oBACP,iBAAiB;oBACjB,iBAAiB;oBACjB,eAAe;iBAClB;aACJ;SACJ;QACD,WAAW,EAAE,4GAA4G;QACzH,WAAW,EAAE,SAAS;KACzB;IACD;QACI,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,WAAW;QACxB,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,SAAS,EAAE;oBACP,eAAe;oBACf,YAAY;iBACf;aACJ;SACJ;QACD,OAAO,EAAE;YACL;gBACI,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,IAAI;gBACb,WAAW,EAAE,oCAAoC;gBACjD,cAAc,EAAE;oBACZ,IAAI,EAAE;wBACF,YAAY,EAAE,CAAC,eAAe,CAAC;qBAClC;iBACJ;aACJ;YACD;gBACI,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,oCAAoC;gBACjD,cAAc,EAAE;oBACZ,IAAI,EAAE;wBACF,YAAY,EAAE,CAAC,eAAe,CAAC;qBAClC;iBACJ;aACJ;YACD;gBACI,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE,uCAAuC;gBACpD,cAAc,EAAE;oBACZ,IAAI,EAAE;wBACF,YAAY,EAAE,CAAC,YAAY,CAAC;qBAC/B;iBACJ;aACJ;SACJ;KACJ;CACJ,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeGenieOperation = executeGenieOperation;
|
|
4
|
+
const helpers_1 = require("../../helpers");
|
|
5
|
+
async function executeGenieOperation(ctx, operation, i) {
|
|
6
|
+
const { credentials, host } = await (0, helpers_1.getCredentialsAndHost)(ctx);
|
|
7
|
+
let url;
|
|
8
|
+
let method;
|
|
9
|
+
let body;
|
|
10
|
+
switch (operation) {
|
|
11
|
+
case 'createMessage':
|
|
12
|
+
url = `${host}/api/2.0/genie/spaces/${ctx.getNodeParameter('spaceId', i)}/conversations/${ctx.getNodeParameter('conversationId', i)}/messages`;
|
|
13
|
+
method = 'POST';
|
|
14
|
+
body = { content: ctx.getNodeParameter('message', i) };
|
|
15
|
+
break;
|
|
16
|
+
case 'getMessage':
|
|
17
|
+
url = `${host}/api/2.0/genie/spaces/${ctx.getNodeParameter('spaceId', i)}/conversations/${ctx.getNodeParameter('conversationId', i)}/messages/${ctx.getNodeParameter('messageId', i)}`;
|
|
18
|
+
method = 'GET';
|
|
19
|
+
break;
|
|
20
|
+
case 'getQueryResults':
|
|
21
|
+
url = `${host}/api/2.0/genie/spaces/${ctx.getNodeParameter('spaceId', i)}/conversations/${ctx.getNodeParameter('conversationId', i)}/messages/${ctx.getNodeParameter('messageId', i)}/attachments/${ctx.getNodeParameter('attachmentId', i)}/query-result`;
|
|
22
|
+
method = 'GET';
|
|
23
|
+
break;
|
|
24
|
+
case 'executeMessageQuery':
|
|
25
|
+
url = `${host}/api/2.0/genie/spaces/${ctx.getNodeParameter('spaceId', i)}/conversations/${ctx.getNodeParameter('conversationId', i)}/messages/${ctx.getNodeParameter('messageId', i)}/attachments/${ctx.getNodeParameter('attachmentId', i)}/execute-query`;
|
|
26
|
+
method = 'POST';
|
|
27
|
+
break;
|
|
28
|
+
case 'getSpace':
|
|
29
|
+
url = `${host}/api/2.0/genie/spaces/${ctx.getNodeParameter('spaceId', i)}`;
|
|
30
|
+
method = 'GET';
|
|
31
|
+
break;
|
|
32
|
+
case 'startConversation': {
|
|
33
|
+
const spaceId = ctx.getNodeParameter('spaceId', i);
|
|
34
|
+
url = `${host}/api/2.0/genie/spaces/${spaceId}/start-conversation`;
|
|
35
|
+
method = 'POST';
|
|
36
|
+
body = { content: ctx.getNodeParameter('initialMessage', i) };
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
default:
|
|
40
|
+
throw new Error(`Unsupported Genie operation: ${operation}`);
|
|
41
|
+
}
|
|
42
|
+
const response = await ctx.helpers.httpRequest({
|
|
43
|
+
method,
|
|
44
|
+
url,
|
|
45
|
+
body,
|
|
46
|
+
headers: {
|
|
47
|
+
Authorization: `Bearer ${credentials.token}`,
|
|
48
|
+
'Content-Type': 'application/json',
|
|
49
|
+
},
|
|
50
|
+
json: true,
|
|
51
|
+
});
|
|
52
|
+
return [{ json: response, pairedItem: { item: i } }];
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../../nodes/Databricks/resources/genie/handler.ts"],"names":[],"mappings":";;AAGA,sDA8DC;AAhED,2CAAsD;AAE/C,KAAK,UAAU,qBAAqB,CAC1C,GAAsB,EACtB,SAAiB,EACjB,CAAS;IAET,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,+BAAqB,EAAC,GAAG,CAAC,CAAC;IAE/D,IAAI,GAAW,CAAC;IAChB,IAAI,MAA2B,CAAC;IAChC,IAAI,IAAwB,CAAC;IAE7B,QAAQ,SAAS,EAAE,CAAC;QACnB,KAAK,eAAe;YACnB,GAAG,GAAG,GAAG,IAAI,yBAAyB,GAAG,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAW,kBAAkB,GAAG,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,CAAC,CAAW,WAAW,CAAC;YACnK,MAAM,GAAG,MAAM,CAAC;YAChB,IAAI,GAAG,EAAE,OAAO,EAAE,GAAG,CAAC,gBAAgB,CAAC,SAAS,EAA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,gBAAgB,CAAC,SAAS,EAAE,CAAC,CAAW,CAAC;YAC7D,GAAG,GAAG,GAAG,IAAI,yBAAyB,OAAO,qBAAqB,CAAC;YACnE,MAAM,GAAG,MAAM,CAAC;YAChB,IAAI,GAAG,EAAE,OAAO,EAAE,GAAG,CAAC,gBAAgB,CAAC,gBAAgB,EAAE,CAAC,CAAW,EAAE,CAAC;YACxE,MAAM;QACP,CAAC;QAED;YACC,MAAM,IAAI,KAAK,CAAC,gCAAgC,SAAS,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC;QAC9C,MAAM;QACN,GAAG;QACH,IAAI;QACJ,OAAO,EAAE;YACR,aAAa,EAAE,UAAU,WAAW,CAAC,KAAK,EAAE;YAC5C,cAAc,EAAE,kBAAkB;SAClC;QACD,IAAI,EAAE,IAAI;KACV,CAAC,CAAC;IAEH,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.genieOperations = void 0;
|
|
4
|
+
exports.genieOperations = {
|
|
5
|
+
displayName: 'Operation',
|
|
6
|
+
name: 'operation',
|
|
7
|
+
type: 'options',
|
|
8
|
+
noDataExpression: true,
|
|
9
|
+
displayOptions: {
|
|
10
|
+
show: {
|
|
11
|
+
resource: ['genie'],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
options: [
|
|
15
|
+
{
|
|
16
|
+
name: 'Create Conversation Message',
|
|
17
|
+
value: 'createMessage',
|
|
18
|
+
description: 'Create a new conversation message',
|
|
19
|
+
action: 'Create a conversation message',
|
|
20
|
+
routing: {
|
|
21
|
+
request: {
|
|
22
|
+
method: 'POST',
|
|
23
|
+
url: '=/api/2.0/genie/spaces/{{$parameter.spaceId}}/conversations/{{$parameter.conversationId}}/messages',
|
|
24
|
+
body: {
|
|
25
|
+
content: '={{$parameter.message}}',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'Get Conversation Message',
|
|
32
|
+
value: 'getMessage',
|
|
33
|
+
description: 'Get a conversation message by ID',
|
|
34
|
+
action: 'Get a conversation message',
|
|
35
|
+
routing: {
|
|
36
|
+
request: {
|
|
37
|
+
method: 'GET',
|
|
38
|
+
url: '=/api/2.0/genie/spaces/{{$parameter.spaceId}}/conversations/{{$parameter.conversationId}}/messages/{{$parameter.messageId}}'
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'Start Conversation',
|
|
44
|
+
value: 'startConversation',
|
|
45
|
+
description: 'Start a new conversation',
|
|
46
|
+
action: 'Start a conversation',
|
|
47
|
+
routing: {
|
|
48
|
+
request: {
|
|
49
|
+
method: 'POST',
|
|
50
|
+
url: '=/api/2.0/genie/spaces/{{$parameter.spaceId}}/conversations',
|
|
51
|
+
body: {
|
|
52
|
+
initial_message: '={{$parameter.initialMessage}}',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'Execute Message SQL Query',
|
|
59
|
+
value: 'executeMessageQuery',
|
|
60
|
+
description: 'Execute a SQL query from a message attachment',
|
|
61
|
+
action: 'Execute a message SQL query',
|
|
62
|
+
routing: {
|
|
63
|
+
request: {
|
|
64
|
+
method: 'POST',
|
|
65
|
+
url: '=/api/2.0/genie/spaces/{{$parameter.spaceId}}/conversations/{{$parameter.conversationId}}/messages/{{$parameter.messageId}}/attachments/{{$parameter.attachmentId}}/execute-query',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'Get Query Results',
|
|
71
|
+
value: 'getQueryResults',
|
|
72
|
+
description: 'Get results of a SQL query execution',
|
|
73
|
+
action: 'Get query results',
|
|
74
|
+
routing: {
|
|
75
|
+
request: {
|
|
76
|
+
method: 'GET',
|
|
77
|
+
url: '=/api/2.0/genie/spaces/{{$parameter.spaceId}}/conversations/{{$parameter.conversationId}}/messages/{{$parameter.messageId}}/attachments/{{$parameter.attachmentId}}/query-result',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'Get Genie Space',
|
|
83
|
+
value: 'getSpace',
|
|
84
|
+
description: 'Get details of a Genie space',
|
|
85
|
+
action: 'Get a Genie space',
|
|
86
|
+
routing: {
|
|
87
|
+
request: {
|
|
88
|
+
method: 'GET',
|
|
89
|
+
url: '=/api/2.0/genie/spaces/{{$parameter.spaceId}}',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
default: 'startConversation',
|
|
95
|
+
};
|
|
96
|
+
//# sourceMappingURL=operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../../nodes/Databricks/resources/genie/operations.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAoB;IAC5C,WAAW,EAAE,WAAW;IACxB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,SAAS;IACf,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE;QACZ,IAAI,EAAE;YACF,QAAQ,EAAE,CAAC,OAAO,CAAC;SACtB;KACJ;IACD,OAAO,EAAE;QACL;YACI,IAAI,EAAE,6BAA6B;YACnC,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,mCAAmC;YAChD,MAAM,EAAE,+BAA+B;YACvC,OAAO,EAAE;gBACL,OAAO,EAAE;oBACL,MAAM,EAAE,MAAM;oBACd,GAAG,EAAE,oGAAoG;oBACzG,IAAI,EAAE;wB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"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.genieParameters = void 0;
|
|
4
|
+
exports.genieParameters = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Space ID',
|
|
7
|
+
name: 'spaceId',
|
|
8
|
+
type: 'string',
|
|
9
|
+
required: true,
|
|
10
|
+
default: '',
|
|
11
|
+
description: 'The ID of the Genie space',
|
|
12
|
+
displayOptions: {
|
|
13
|
+
show: {
|
|
14
|
+
resource: ['genie'],
|
|
15
|
+
operation: ['startConversation', 'getSpace', 'createMessage', 'getQueryResults', 'executeMessageQuery', 'getMessage'],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
displayName: 'Conversation ID',
|
|
21
|
+
name: 'conversationId',
|
|
22
|
+
type: 'string',
|
|
23
|
+
required: true,
|
|
24
|
+
default: '',
|
|
25
|
+
description: 'The ID of the conversation',
|
|
26
|
+
displayOptions: {
|
|
27
|
+
show: {
|
|
28
|
+
resource: ['genie'],
|
|
29
|
+
operation: ['createMessage', 'getQueryResults', 'executeMessageQuery', 'getMessage'],
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
displayName: 'Message ID',
|
|
35
|
+
name: 'messageId',
|
|
36
|
+
type: 'string',
|
|
37
|
+
required: true,
|
|
38
|
+
default: '',
|
|
39
|
+
description: 'The ID of the message',
|
|
40
|
+
displayOptions: {
|
|
41
|
+
show: {
|
|
42
|
+
resource: ['genie'],
|
|
43
|
+
operation: ['getMessage', 'executeMessageQuery', 'getQueryResults'],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
displayName: 'Attachment ID',
|
|
49
|
+
name: 'attachmentId',
|
|
50
|
+
type: 'string',
|
|
51
|
+
required: true,
|
|
52
|
+
default: '',
|
|
53
|
+
description: 'The ID of the message attachment',
|
|
54
|
+
displayOptions: {
|
|
55
|
+
show: {
|
|
56
|
+
resource: ['genie'],
|
|
57
|
+
operation: ['executeMessageQuery', 'getQueryResults'],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
displayName: 'Message',
|
|
63
|
+
name: 'message',
|
|
64
|
+
type: 'string',
|
|
65
|
+
typeOptions: {
|
|
66
|
+
rows: 4,
|
|
67
|
+
},
|
|
68
|
+
required: true,
|
|
69
|
+
default: '',
|
|
70
|
+
description: 'The message to be sent to Genie Space',
|
|
71
|
+
displayOptions: {
|
|
72
|
+
show: {
|
|
73
|
+
resource: ['genie'],
|
|
74
|
+
operation: ['createMessage'],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
displayName: 'Initial Message',
|
|
80
|
+
name: 'initialMessage',
|
|
81
|
+
type: 'string',
|
|
82
|
+
typeOptions: {
|
|
83
|
+
rows: 4,
|
|
84
|
+
},
|
|
85
|
+
required: true,
|
|
86
|
+
default: '',
|
|
87
|
+
description: 'The initial message to start the conversation',
|
|
88
|
+
displayOptions: {
|
|
89
|
+
show: {
|
|
90
|
+
resource: ['genie'],
|
|
91
|
+
operation: ['startConversation'],
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
];
|
|
96
|
+
//# sourceMappingURL=parameters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parameters.js","sourceRoot":"","sources":["../../../../../nodes/Databricks/resources/genie/parameters.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAsB;IAC9C;QACI,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,2BAA2B;QACxC,cAAc,EAAE;YACZ,IAAI,EAAE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