n8n-nodes-google-files-api 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/credentials/GoogleGeminiApi.credentials.d.ts +10 -0
- package/dist/credentials/GoogleGeminiApi.credentials.d.ts.map +1 -0
- package/dist/credentials/GoogleGeminiApi.credentials.js +37 -0
- package/dist/credentials/GoogleGeminiApi.credentials.js.map +1 -0
- package/dist/nodes/GoogleFileApi/GoogleFileApi.node.d.ts +6 -0
- package/dist/nodes/GoogleFileApi/GoogleFileApi.node.d.ts.map +1 -0
- package/dist/nodes/GoogleFileApi/GoogleFileApi.node.js +405 -0
- package/dist/nodes/GoogleFileApi/GoogleFileApi.node.js.map +1 -0
- package/dist/nodes/GoogleFileApi/google-file-api.svg +23 -0
- package/dist/nodes/GoogleFileSearchStore/GoogleFileSearchStore.node.d.ts +6 -0
- package/dist/nodes/GoogleFileSearchStore/GoogleFileSearchStore.node.d.ts.map +1 -0
- package/dist/nodes/GoogleFileSearchStore/GoogleFileSearchStore.node.js +585 -0
- package/dist/nodes/GoogleFileSearchStore/GoogleFileSearchStore.node.js.map +1 -0
- package/dist/nodes/GoogleFileSearchStore/google-file-search.svg +25 -0
- package/package.json +59 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class GoogleGeminiApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
test: ICredentialTestRequest;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=GoogleGeminiApi.credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleGeminiApi.credentials.d.ts","sourceRoot":"","sources":["../../credentials/GoogleGeminiApi.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,oBAAoB,EACpB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,MAAM,cAAc,CAAC;AAEtB,qBAAa,eAAgB,YAAW,eAAe;IACtD,IAAI,SAAqB;IACzB,WAAW,SAAuB;IAClC,gBAAgB,SAA2C;IAC3D,UAAU,EAAE,eAAe,EAAE,CAU3B;IAEF,YAAY,EAAE,oBAAoB,CAOhC;IAEF,IAAI,EAAE,sBAAsB,CAK1B;CACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GoogleGeminiApi = void 0;
|
|
4
|
+
class GoogleGeminiApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'googleGeminiApi';
|
|
7
|
+
this.displayName = 'Google Gemini API';
|
|
8
|
+
this.documentationUrl = 'https://ai.google.dev/gemini-api/docs';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'API Key',
|
|
12
|
+
name: 'apiKey',
|
|
13
|
+
type: 'string',
|
|
14
|
+
typeOptions: { password: true },
|
|
15
|
+
default: '',
|
|
16
|
+
required: true,
|
|
17
|
+
description: 'Google AI Studio에서 발급받은 API Key',
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
this.authenticate = {
|
|
21
|
+
type: 'generic',
|
|
22
|
+
properties: {
|
|
23
|
+
qs: {
|
|
24
|
+
key: '={{$credentials.apiKey}}',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
this.test = {
|
|
29
|
+
request: {
|
|
30
|
+
baseURL: 'https://generativelanguage.googleapis.com',
|
|
31
|
+
url: '/v1beta/models',
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.GoogleGeminiApi = GoogleGeminiApi;
|
|
37
|
+
//# sourceMappingURL=GoogleGeminiApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleGeminiApi.credentials.js","sourceRoot":"","sources":["../../credentials/GoogleGeminiApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,eAAe;IAA5B;QACC,SAAI,GAAG,iBAAiB,CAAC;QACzB,gBAAW,GAAG,mBAAmB,CAAC;QAClC,qBAAgB,GAAG,uCAAuC,CAAC;QAC3D,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,QAAQ,EAAE,IAAI;gBACd,WAAW,EAAE,iCAAiC;aAC9C;SACD,CAAC;QAEF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,EAAE,EAAE;oBACH,GAAG,EAAE,0BAA0B;iBAC/B;aACD;SACD,CAAC;QAEF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,2CAA2C;gBACpD,GAAG,EAAE,gBAAgB;aACrB;SACD,CAAC;IACH,CAAC;CAAA;AA/BD,0CA+BC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class GoogleFileApi implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=GoogleFileApi.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleFileApi.node.d.ts","sourceRoot":"","sources":["../../../nodes/GoogleFileApi/GoogleFileApi.node.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EAGpB,MAAM,cAAc,CAAC;AAEtB,qBAAa,aAAc,YAAW,SAAS;IAC9C,WAAW,EAAE,oBAAoB,CAkK/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CAoQvE"}
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GoogleFileApi = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
class GoogleFileApi {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.description = {
|
|
8
|
+
displayName: 'Google File API',
|
|
9
|
+
name: 'googleFileApi',
|
|
10
|
+
icon: 'file:google-file-api.svg',
|
|
11
|
+
group: ['transform'],
|
|
12
|
+
version: 1,
|
|
13
|
+
subtitle: '={{$parameter["operation"]}}',
|
|
14
|
+
description: 'Google Gemini File API를 통해 파일을 업로드하고 관리합니다',
|
|
15
|
+
defaults: {
|
|
16
|
+
name: 'Google File API',
|
|
17
|
+
},
|
|
18
|
+
inputs: ['main'],
|
|
19
|
+
outputs: ['main'],
|
|
20
|
+
credentials: [
|
|
21
|
+
{
|
|
22
|
+
name: 'googleGeminiApi',
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
properties: [
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Operation',
|
|
29
|
+
name: 'operation',
|
|
30
|
+
type: 'options',
|
|
31
|
+
noDataExpression: true,
|
|
32
|
+
options: [
|
|
33
|
+
{
|
|
34
|
+
name: 'Upload',
|
|
35
|
+
value: 'upload',
|
|
36
|
+
action: 'Upload a file',
|
|
37
|
+
description: '파일을 Google File API에 업로드합니다',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'List',
|
|
41
|
+
value: 'list',
|
|
42
|
+
action: 'List all files',
|
|
43
|
+
description: '업로드된 파일 목록을 조회합니다',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'Get',
|
|
47
|
+
value: 'get',
|
|
48
|
+
action: 'Get file details',
|
|
49
|
+
description: '파일 상세 정보를 조회합니다',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'Delete',
|
|
53
|
+
value: 'delete',
|
|
54
|
+
action: 'Delete a file',
|
|
55
|
+
description: '파일을 삭제합니다',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'Wait for Processing',
|
|
59
|
+
value: 'waitForProcessing',
|
|
60
|
+
action: 'Wait for file processing',
|
|
61
|
+
description: '파일 처리가 완료될 때까지 대기합니다',
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
default: 'upload',
|
|
65
|
+
},
|
|
66
|
+
// Upload 파라미터
|
|
67
|
+
{
|
|
68
|
+
displayName: 'Binary Property',
|
|
69
|
+
name: 'binaryPropertyName',
|
|
70
|
+
type: 'string',
|
|
71
|
+
default: 'data',
|
|
72
|
+
required: true,
|
|
73
|
+
displayOptions: {
|
|
74
|
+
show: {
|
|
75
|
+
operation: ['upload'],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
description: '업로드할 바이너리 데이터가 있는 속성명',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
displayName: 'Display Name',
|
|
82
|
+
name: 'displayName',
|
|
83
|
+
type: 'string',
|
|
84
|
+
default: '',
|
|
85
|
+
displayOptions: {
|
|
86
|
+
show: {
|
|
87
|
+
operation: ['upload'],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
description: '파일의 표시 이름 (최대 512자). 비어있으면 원본 파일명 사용.',
|
|
91
|
+
},
|
|
92
|
+
// List 파라미터
|
|
93
|
+
{
|
|
94
|
+
displayName: 'Page Size',
|
|
95
|
+
name: 'pageSize',
|
|
96
|
+
type: 'number',
|
|
97
|
+
typeOptions: {
|
|
98
|
+
minValue: 1,
|
|
99
|
+
maxValue: 100,
|
|
100
|
+
},
|
|
101
|
+
default: 100,
|
|
102
|
+
displayOptions: {
|
|
103
|
+
show: {
|
|
104
|
+
operation: ['list'],
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
description: '한 페이지에 가져올 파일 수',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
displayName: 'Page Token',
|
|
111
|
+
name: 'pageToken',
|
|
112
|
+
type: 'string',
|
|
113
|
+
default: '',
|
|
114
|
+
displayOptions: {
|
|
115
|
+
show: {
|
|
116
|
+
operation: ['list'],
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
description: '다음 페이지를 가져오기 위한 토큰',
|
|
120
|
+
},
|
|
121
|
+
// Get/Delete/Wait for Processing 파라미터
|
|
122
|
+
{
|
|
123
|
+
displayName: 'File ID',
|
|
124
|
+
name: 'fileId',
|
|
125
|
+
type: 'string',
|
|
126
|
+
required: true,
|
|
127
|
+
default: '',
|
|
128
|
+
displayOptions: {
|
|
129
|
+
show: {
|
|
130
|
+
operation: ['get', 'delete', 'waitForProcessing'],
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
description: '파일 ID (예: files/abc123)',
|
|
134
|
+
},
|
|
135
|
+
// Wait for Processing 파라미터
|
|
136
|
+
{
|
|
137
|
+
displayName: 'Timeout (Seconds)',
|
|
138
|
+
name: 'timeout',
|
|
139
|
+
type: 'number',
|
|
140
|
+
typeOptions: {
|
|
141
|
+
minValue: 10,
|
|
142
|
+
maxValue: 3600,
|
|
143
|
+
},
|
|
144
|
+
default: 300,
|
|
145
|
+
displayOptions: {
|
|
146
|
+
show: {
|
|
147
|
+
operation: ['waitForProcessing'],
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
description: '처리 완료 대기 최대 시간 (초)',
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
displayName: 'Poll Interval (Seconds)',
|
|
154
|
+
name: 'pollInterval',
|
|
155
|
+
type: 'number',
|
|
156
|
+
typeOptions: {
|
|
157
|
+
minValue: 1,
|
|
158
|
+
maxValue: 60,
|
|
159
|
+
},
|
|
160
|
+
default: 5,
|
|
161
|
+
displayOptions: {
|
|
162
|
+
show: {
|
|
163
|
+
operation: ['waitForProcessing'],
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
description: '상태 확인 간격 (초)',
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
async execute() {
|
|
172
|
+
const items = this.getInputData();
|
|
173
|
+
const returnData = [];
|
|
174
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
175
|
+
const credentials = await this.getCredentials('googleGeminiApi');
|
|
176
|
+
const apiKey = credentials.apiKey;
|
|
177
|
+
const baseUrl = 'https://generativelanguage.googleapis.com';
|
|
178
|
+
const sleep = (ms) => {
|
|
179
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
180
|
+
};
|
|
181
|
+
const handleApiError = (error) => {
|
|
182
|
+
const err = error;
|
|
183
|
+
if (err.response) {
|
|
184
|
+
const statusCode = err.response.status;
|
|
185
|
+
const apiMessage = err.response.data?.error?.message || 'Unknown API error';
|
|
186
|
+
if (statusCode === 400) {
|
|
187
|
+
return new n8n_workflow_1.NodeOperationError(this.getNode(), `Bad request: ${apiMessage}`);
|
|
188
|
+
}
|
|
189
|
+
else if (statusCode === 403) {
|
|
190
|
+
return new n8n_workflow_1.NodeOperationError(this.getNode(), 'API Key가 유효하지 않거나 권한이 없습니다');
|
|
191
|
+
}
|
|
192
|
+
else if (statusCode === 404) {
|
|
193
|
+
return new n8n_workflow_1.NodeOperationError(this.getNode(), '파일을 찾을 수 없습니다');
|
|
194
|
+
}
|
|
195
|
+
else if (statusCode === 429) {
|
|
196
|
+
return new n8n_workflow_1.NodeOperationError(this.getNode(), 'API 요청 한도를 초과했습니다. 잠시 후 다시 시도해주세요');
|
|
197
|
+
}
|
|
198
|
+
return new n8n_workflow_1.NodeOperationError(this.getNode(), apiMessage);
|
|
199
|
+
}
|
|
200
|
+
return new n8n_workflow_1.NodeOperationError(this.getNode(), err.message || 'Unknown error occurred');
|
|
201
|
+
};
|
|
202
|
+
for (let i = 0; i < items.length; i++) {
|
|
203
|
+
try {
|
|
204
|
+
let responseData;
|
|
205
|
+
if (operation === 'upload') {
|
|
206
|
+
// Upload operation
|
|
207
|
+
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
|
|
208
|
+
const displayName = this.getNodeParameter('displayName', i);
|
|
209
|
+
const binaryData = items[i].binary?.[binaryPropertyName];
|
|
210
|
+
if (!binaryData) {
|
|
211
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `No binary data found for property "${binaryPropertyName}"`, { itemIndex: i });
|
|
212
|
+
}
|
|
213
|
+
const buffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
|
214
|
+
const mimeType = binaryData.mimeType || 'application/octet-stream';
|
|
215
|
+
const fileName = displayName || binaryData.fileName || 'unnamed_file';
|
|
216
|
+
// Use resumable upload for files > 20MB
|
|
217
|
+
if (buffer.length > 20 * 1024 * 1024) {
|
|
218
|
+
// Resumable upload
|
|
219
|
+
const initResponse = await this.helpers.httpRequest({
|
|
220
|
+
method: 'POST',
|
|
221
|
+
url: `${baseUrl}/upload/v1beta/files?key=${apiKey}`,
|
|
222
|
+
headers: {
|
|
223
|
+
'X-Goog-Upload-Protocol': 'resumable',
|
|
224
|
+
'X-Goog-Upload-Command': 'start',
|
|
225
|
+
'X-Goog-Upload-Header-Content-Length': buffer.length.toString(),
|
|
226
|
+
'X-Goog-Upload-Header-Content-Type': mimeType,
|
|
227
|
+
'Content-Type': 'application/json',
|
|
228
|
+
},
|
|
229
|
+
body: JSON.stringify({
|
|
230
|
+
file: { display_name: fileName },
|
|
231
|
+
}),
|
|
232
|
+
returnFullResponse: true,
|
|
233
|
+
});
|
|
234
|
+
const uploadUrl = initResponse.headers['x-goog-upload-url'];
|
|
235
|
+
if (!uploadUrl) {
|
|
236
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Failed to get resumable upload URL from response');
|
|
237
|
+
}
|
|
238
|
+
const uploadResponse = await this.helpers.httpRequest({
|
|
239
|
+
method: 'POST',
|
|
240
|
+
url: uploadUrl,
|
|
241
|
+
headers: {
|
|
242
|
+
'X-Goog-Upload-Offset': '0',
|
|
243
|
+
'X-Goog-Upload-Command': 'upload, finalize',
|
|
244
|
+
'Content-Type': mimeType,
|
|
245
|
+
},
|
|
246
|
+
body: buffer,
|
|
247
|
+
json: true,
|
|
248
|
+
});
|
|
249
|
+
responseData = uploadResponse.file;
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
// Simple multipart upload
|
|
253
|
+
const boundary = '---n8n-boundary-' + Date.now().toString(16);
|
|
254
|
+
const metadataPart = JSON.stringify({ file: { display_name: fileName } });
|
|
255
|
+
const bodyParts = [
|
|
256
|
+
Buffer.from(`--${boundary}\r\n`),
|
|
257
|
+
Buffer.from('Content-Type: application/json; charset=UTF-8\r\n\r\n'),
|
|
258
|
+
Buffer.from(metadataPart + '\r\n'),
|
|
259
|
+
Buffer.from(`--${boundary}\r\n`),
|
|
260
|
+
Buffer.from(`Content-Type: ${mimeType}\r\n\r\n`),
|
|
261
|
+
buffer,
|
|
262
|
+
Buffer.from(`\r\n--${boundary}--\r\n`),
|
|
263
|
+
];
|
|
264
|
+
const body = Buffer.concat(bodyParts);
|
|
265
|
+
try {
|
|
266
|
+
const response = await this.helpers.httpRequest({
|
|
267
|
+
method: 'POST',
|
|
268
|
+
url: `${baseUrl}/upload/v1beta/files?key=${apiKey}`,
|
|
269
|
+
headers: {
|
|
270
|
+
'Content-Type': `multipart/related; boundary=${boundary}`,
|
|
271
|
+
'Content-Length': body.length.toString(),
|
|
272
|
+
},
|
|
273
|
+
body,
|
|
274
|
+
json: false,
|
|
275
|
+
});
|
|
276
|
+
responseData = typeof response === 'string' ? JSON.parse(response) : response;
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
throw handleApiError(error);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
else if (operation === 'list') {
|
|
284
|
+
// List operation
|
|
285
|
+
const pageSize = this.getNodeParameter('pageSize', i);
|
|
286
|
+
const pageToken = this.getNodeParameter('pageToken', i);
|
|
287
|
+
const qs = {
|
|
288
|
+
key: apiKey,
|
|
289
|
+
pageSize,
|
|
290
|
+
};
|
|
291
|
+
if (pageToken) {
|
|
292
|
+
qs.pageToken = pageToken;
|
|
293
|
+
}
|
|
294
|
+
try {
|
|
295
|
+
responseData = await this.helpers.httpRequest({
|
|
296
|
+
method: 'GET',
|
|
297
|
+
url: `${baseUrl}/v1beta/files`,
|
|
298
|
+
qs,
|
|
299
|
+
json: true,
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
catch (error) {
|
|
303
|
+
throw handleApiError(error);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
else if (operation === 'get') {
|
|
307
|
+
// Get operation
|
|
308
|
+
const fileId = this.getNodeParameter('fileId', i);
|
|
309
|
+
const normalizedFileId = fileId.startsWith('files/') ? fileId : `files/${fileId}`;
|
|
310
|
+
try {
|
|
311
|
+
responseData = await this.helpers.httpRequest({
|
|
312
|
+
method: 'GET',
|
|
313
|
+
url: `${baseUrl}/v1beta/${normalizedFileId}`,
|
|
314
|
+
qs: { key: apiKey },
|
|
315
|
+
json: true,
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
catch (error) {
|
|
319
|
+
throw handleApiError(error);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
else if (operation === 'delete') {
|
|
323
|
+
// Delete operation
|
|
324
|
+
const fileId = this.getNodeParameter('fileId', i);
|
|
325
|
+
const normalizedFileId = fileId.startsWith('files/') ? fileId : `files/${fileId}`;
|
|
326
|
+
try {
|
|
327
|
+
await this.helpers.httpRequest({
|
|
328
|
+
method: 'DELETE',
|
|
329
|
+
url: `${baseUrl}/v1beta/${normalizedFileId}`,
|
|
330
|
+
qs: { key: apiKey },
|
|
331
|
+
json: true,
|
|
332
|
+
});
|
|
333
|
+
responseData = { success: true, deletedFile: normalizedFileId };
|
|
334
|
+
}
|
|
335
|
+
catch (error) {
|
|
336
|
+
throw handleApiError(error);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
else if (operation === 'waitForProcessing') {
|
|
340
|
+
// Wait for Processing operation
|
|
341
|
+
const fileId = this.getNodeParameter('fileId', i);
|
|
342
|
+
const timeout = this.getNodeParameter('timeout', i);
|
|
343
|
+
const pollInterval = this.getNodeParameter('pollInterval', i);
|
|
344
|
+
const normalizedFileId = fileId.startsWith('files/') ? fileId : `files/${fileId}`;
|
|
345
|
+
const startTime = Date.now();
|
|
346
|
+
const timeoutMs = timeout * 1000;
|
|
347
|
+
const pollIntervalMs = pollInterval * 1000;
|
|
348
|
+
let processingComplete = false;
|
|
349
|
+
while (Date.now() - startTime < timeoutMs && !processingComplete) {
|
|
350
|
+
try {
|
|
351
|
+
const response = await this.helpers.httpRequest({
|
|
352
|
+
method: 'GET',
|
|
353
|
+
url: `${baseUrl}/v1beta/${normalizedFileId}`,
|
|
354
|
+
qs: { key: apiKey },
|
|
355
|
+
json: true,
|
|
356
|
+
});
|
|
357
|
+
const state = response.state;
|
|
358
|
+
if (state === 'ACTIVE') {
|
|
359
|
+
responseData = response;
|
|
360
|
+
processingComplete = true;
|
|
361
|
+
}
|
|
362
|
+
else if (state === 'FAILED') {
|
|
363
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `File processing failed: ${normalizedFileId}. Error: ${response.error || 'Unknown error'}`, { itemIndex: i });
|
|
364
|
+
}
|
|
365
|
+
else {
|
|
366
|
+
// State is PROCESSING, wait and retry
|
|
367
|
+
await sleep(pollIntervalMs);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
catch (error) {
|
|
371
|
+
if (error.message?.includes('processing failed')) {
|
|
372
|
+
throw error;
|
|
373
|
+
}
|
|
374
|
+
throw handleApiError(error);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
if (!processingComplete) {
|
|
378
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Timeout waiting for file processing: ${normalizedFileId}. Maximum wait time of ${timeout} seconds exceeded.`, { itemIndex: i });
|
|
379
|
+
}
|
|
380
|
+
responseData = responseData;
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation: ${operation}`);
|
|
384
|
+
}
|
|
385
|
+
returnData.push({
|
|
386
|
+
json: responseData,
|
|
387
|
+
pairedItem: { item: i },
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
catch (error) {
|
|
391
|
+
if (this.continueOnFail()) {
|
|
392
|
+
returnData.push({
|
|
393
|
+
json: { error: error.message },
|
|
394
|
+
pairedItem: { item: i },
|
|
395
|
+
});
|
|
396
|
+
continue;
|
|
397
|
+
}
|
|
398
|
+
throw error;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
return [returnData];
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
exports.GoogleFileApi = GoogleFileApi;
|
|
405
|
+
//# sourceMappingURL=GoogleFileApi.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleFileApi.node.js","sourceRoot":"","sources":["../../../nodes/GoogleFileApi/GoogleFileApi.node.ts"],"names":[],"mappings":";;;AAAA,+CAOsB;AAEtB,MAAa,aAAa;IAA1B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,iBAAiB;YAC9B,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,0BAA0B;YAChC,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8BAA8B;YACxC,WAAW,EAAE,4CAA4C;YACzD,QAAQ,EAAE;gBACT,IAAI,EAAE,iBAAiB;aACvB;Y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,EAAE,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE;wBACzC,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;qBACvB,CAAC,CAAC;oBACH,SAAS;gBACV,CAAC;gBACD,MAAM,KAAK,CAAC;YACb,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AAzaD,sCAyaC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="48" height="48">
|
|
2
|
+
<!-- Google colors inspired file icon -->
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="googleGradient" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
5
|
+
<stop offset="0%" style="stop-color:#4285F4"/>
|
|
6
|
+
<stop offset="50%" style="stop-color:#34A853"/>
|
|
7
|
+
<stop offset="100%" style="stop-color:#FBBC05"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
</defs>
|
|
10
|
+
<!-- File shape -->
|
|
11
|
+
<path d="M12 4h18l10 10v28a2 2 0 0 1-2 2H12a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z" fill="#fff" stroke="url(#googleGradient)" stroke-width="2"/>
|
|
12
|
+
<!-- Folded corner -->
|
|
13
|
+
<path d="M30 4v10h10" fill="none" stroke="url(#googleGradient)" stroke-width="2"/>
|
|
14
|
+
<path d="M30 4l10 10H32a2 2 0 0 1-2-2V4z" fill="#E8F0FE"/>
|
|
15
|
+
<!-- Upload arrow -->
|
|
16
|
+
<g transform="translate(24, 28)">
|
|
17
|
+
<path d="M0 -8L6 0H3v8H-3v-8H-6z" fill="#4285F4"/>
|
|
18
|
+
</g>
|
|
19
|
+
<!-- Google dots -->
|
|
20
|
+
<circle cx="18" cy="34" r="2" fill="#EA4335"/>
|
|
21
|
+
<circle cx="24" cy="34" r="2" fill="#FBBC05"/>
|
|
22
|
+
<circle cx="30" cy="34" r="2" fill="#34A853"/>
|
|
23
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
export declare class GoogleFileSearchStore implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=GoogleFileSearchStore.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleFileSearchStore.node.d.ts","sourceRoot":"","sources":["../../../nodes/GoogleFileSearchStore/GoogleFileSearchStore.node.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EAGpB,MAAM,cAAc,CAAC;AAEtB,qBAAa,qBAAsB,YAAW,SAAS;IACtD,WAAW,EAAE,oBAAoB,CAsT/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CA4RvE"}
|
|
@@ -0,0 +1,585 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GoogleFileSearchStore = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
class GoogleFileSearchStore {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.description = {
|
|
8
|
+
displayName: 'Google File Search Store',
|
|
9
|
+
name: 'googleFileSearchStore',
|
|
10
|
+
icon: 'file:google-file-search.svg',
|
|
11
|
+
group: ['transform'],
|
|
12
|
+
version: 1,
|
|
13
|
+
subtitle: '={{$parameter["operation"]}}',
|
|
14
|
+
description: 'Gemini File Search Store를 관리하고 RAG 기반 문서 검색을 수행합니다',
|
|
15
|
+
defaults: {
|
|
16
|
+
name: 'Google File Search Store',
|
|
17
|
+
},
|
|
18
|
+
inputs: ['main'],
|
|
19
|
+
outputs: ['main'],
|
|
20
|
+
credentials: [
|
|
21
|
+
{
|
|
22
|
+
name: 'googleGeminiApi',
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
properties: [
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Operation',
|
|
29
|
+
name: 'operation',
|
|
30
|
+
type: 'options',
|
|
31
|
+
noDataExpression: true,
|
|
32
|
+
options: [
|
|
33
|
+
{
|
|
34
|
+
name: 'Create Store',
|
|
35
|
+
value: 'createStore',
|
|
36
|
+
action: 'Create a new file search store',
|
|
37
|
+
description: '새 File Search Store를 생성합니다',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'List Stores',
|
|
41
|
+
value: 'listStores',
|
|
42
|
+
action: 'List all stores',
|
|
43
|
+
description: '모든 File Search Store 목록을 조회합니다',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'Get Store',
|
|
47
|
+
value: 'getStore',
|
|
48
|
+
action: 'Get store details',
|
|
49
|
+
description: 'Store 상세 정보를 조회합니다',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'Delete Store',
|
|
53
|
+
value: 'deleteStore',
|
|
54
|
+
action: 'Delete a store',
|
|
55
|
+
description: 'Store를 삭제합니다',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'Upload Document',
|
|
59
|
+
value: 'uploadDocument',
|
|
60
|
+
action: 'Upload document to store',
|
|
61
|
+
description: 'Store에 문서를 업로드하고 인덱싱합니다',
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'Query Documents',
|
|
65
|
+
value: 'queryDocuments',
|
|
66
|
+
action: 'Query documents in store',
|
|
67
|
+
description: 'Store에서 시맨틱 검색을 수행합니다',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'Get Operation Status',
|
|
71
|
+
value: 'getOperationStatus',
|
|
72
|
+
action: 'Get operation status',
|
|
73
|
+
description: '비동기 작업의 상태를 확인합니다',
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
default: 'createStore',
|
|
77
|
+
},
|
|
78
|
+
// Create Store 파라미터
|
|
79
|
+
{
|
|
80
|
+
displayName: 'Display Name',
|
|
81
|
+
name: 'storeDisplayName',
|
|
82
|
+
type: 'string',
|
|
83
|
+
required: true,
|
|
84
|
+
default: '',
|
|
85
|
+
displayOptions: {
|
|
86
|
+
show: {
|
|
87
|
+
operation: ['createStore'],
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
description: 'Store의 표시 이름',
|
|
91
|
+
},
|
|
92
|
+
// Store 관련 공통 파라미터
|
|
93
|
+
{
|
|
94
|
+
displayName: 'Store Name',
|
|
95
|
+
name: 'storeName',
|
|
96
|
+
type: 'string',
|
|
97
|
+
required: true,
|
|
98
|
+
default: '',
|
|
99
|
+
displayOptions: {
|
|
100
|
+
show: {
|
|
101
|
+
operation: ['getStore', 'deleteStore', 'uploadDocument', 'queryDocuments'],
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
description: 'File Search Store 이름 (예: fileSearchStores/abc123)',
|
|
105
|
+
},
|
|
106
|
+
// List Stores 파라미터
|
|
107
|
+
{
|
|
108
|
+
displayName: 'Page Size',
|
|
109
|
+
name: 'pageSize',
|
|
110
|
+
type: 'number',
|
|
111
|
+
typeOptions: {
|
|
112
|
+
minValue: 1,
|
|
113
|
+
maxValue: 100,
|
|
114
|
+
},
|
|
115
|
+
default: 100,
|
|
116
|
+
displayOptions: {
|
|
117
|
+
show: {
|
|
118
|
+
operation: ['listStores'],
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
description: '한 페이지에 가져올 Store 수',
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
displayName: 'Page Token',
|
|
125
|
+
name: 'pageToken',
|
|
126
|
+
type: 'string',
|
|
127
|
+
default: '',
|
|
128
|
+
displayOptions: {
|
|
129
|
+
show: {
|
|
130
|
+
operation: ['listStores'],
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
description: '다음 페이지를 가져오기 위한 토큰',
|
|
134
|
+
},
|
|
135
|
+
// Upload Document 파라미터
|
|
136
|
+
{
|
|
137
|
+
displayName: 'Binary Property',
|
|
138
|
+
name: 'binaryPropertyName',
|
|
139
|
+
type: 'string',
|
|
140
|
+
default: 'data',
|
|
141
|
+
required: true,
|
|
142
|
+
displayOptions: {
|
|
143
|
+
show: {
|
|
144
|
+
operation: ['uploadDocument'],
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
description: '업로드할 바이너리 데이터가 있는 속성명',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
displayName: 'Document Display Name',
|
|
151
|
+
name: 'documentDisplayName',
|
|
152
|
+
type: 'string',
|
|
153
|
+
default: '',
|
|
154
|
+
displayOptions: {
|
|
155
|
+
show: {
|
|
156
|
+
operation: ['uploadDocument'],
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
description: '문서의 표시 이름 (비어있으면 파일명 사용)',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
displayName: 'Chunking Options',
|
|
163
|
+
name: 'chunkingOptions',
|
|
164
|
+
type: 'collection',
|
|
165
|
+
placeholder: 'Add Option',
|
|
166
|
+
default: {},
|
|
167
|
+
displayOptions: {
|
|
168
|
+
show: {
|
|
169
|
+
operation: ['uploadDocument'],
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
options: [
|
|
173
|
+
{
|
|
174
|
+
displayName: 'Max Tokens Per Chunk',
|
|
175
|
+
name: 'maxTokensPerChunk',
|
|
176
|
+
type: 'number',
|
|
177
|
+
typeOptions: {
|
|
178
|
+
minValue: 50,
|
|
179
|
+
maxValue: 1000,
|
|
180
|
+
},
|
|
181
|
+
default: 200,
|
|
182
|
+
description: '청크당 최대 토큰 수',
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
displayName: 'Max Overlap Tokens',
|
|
186
|
+
name: 'maxOverlapTokens',
|
|
187
|
+
type: 'number',
|
|
188
|
+
typeOptions: {
|
|
189
|
+
minValue: 0,
|
|
190
|
+
maxValue: 100,
|
|
191
|
+
},
|
|
192
|
+
default: 20,
|
|
193
|
+
description: '청크 간 중복 토큰 수',
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
displayName: 'Custom Metadata',
|
|
199
|
+
name: 'customMetadata',
|
|
200
|
+
type: 'fixedCollection',
|
|
201
|
+
typeOptions: {
|
|
202
|
+
multipleValues: true,
|
|
203
|
+
},
|
|
204
|
+
default: {},
|
|
205
|
+
displayOptions: {
|
|
206
|
+
show: {
|
|
207
|
+
operation: ['uploadDocument'],
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
description: '문서에 추가할 메타데이터',
|
|
211
|
+
options: [
|
|
212
|
+
{
|
|
213
|
+
name: 'metadataValues',
|
|
214
|
+
displayName: 'Metadata',
|
|
215
|
+
values: [
|
|
216
|
+
{
|
|
217
|
+
displayName: 'Key',
|
|
218
|
+
name: 'key',
|
|
219
|
+
type: 'string',
|
|
220
|
+
default: '',
|
|
221
|
+
description: '메타데이터 키',
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
displayName: 'Value Type',
|
|
225
|
+
name: 'valueType',
|
|
226
|
+
type: 'options',
|
|
227
|
+
options: [
|
|
228
|
+
{ name: 'String', value: 'string' },
|
|
229
|
+
{ name: 'Numeric', value: 'numeric' },
|
|
230
|
+
],
|
|
231
|
+
default: 'string',
|
|
232
|
+
description: '값의 타입',
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
displayName: 'Value',
|
|
236
|
+
name: 'value',
|
|
237
|
+
type: 'string',
|
|
238
|
+
default: '',
|
|
239
|
+
description: '메타데이터 값',
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
},
|
|
243
|
+
],
|
|
244
|
+
},
|
|
245
|
+
// Query Documents 파라미터
|
|
246
|
+
{
|
|
247
|
+
displayName: 'Query',
|
|
248
|
+
name: 'query',
|
|
249
|
+
type: 'string',
|
|
250
|
+
typeOptions: {
|
|
251
|
+
rows: 3,
|
|
252
|
+
},
|
|
253
|
+
required: true,
|
|
254
|
+
default: '',
|
|
255
|
+
displayOptions: {
|
|
256
|
+
show: {
|
|
257
|
+
operation: ['queryDocuments'],
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
description: '검색할 질문 또는 쿼리',
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
displayName: 'Metadata Filter',
|
|
264
|
+
name: 'metadataFilter',
|
|
265
|
+
type: 'string',
|
|
266
|
+
default: '',
|
|
267
|
+
displayOptions: {
|
|
268
|
+
show: {
|
|
269
|
+
operation: ['queryDocuments'],
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
description: 'AIP-160 형식의 메타데이터 필터 (예: author="홍길동")',
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
displayName: 'Include Citations',
|
|
276
|
+
name: 'includeCitations',
|
|
277
|
+
type: 'boolean',
|
|
278
|
+
default: true,
|
|
279
|
+
displayOptions: {
|
|
280
|
+
show: {
|
|
281
|
+
operation: ['queryDocuments'],
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
description: '응답에 인용 출처 포함 여부',
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
displayName: 'Max Results',
|
|
288
|
+
name: 'maxResults',
|
|
289
|
+
type: 'number',
|
|
290
|
+
typeOptions: {
|
|
291
|
+
minValue: 1,
|
|
292
|
+
maxValue: 20,
|
|
293
|
+
},
|
|
294
|
+
default: 10,
|
|
295
|
+
displayOptions: {
|
|
296
|
+
show: {
|
|
297
|
+
operation: ['queryDocuments'],
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
description: '반환할 최대 결과 수',
|
|
301
|
+
},
|
|
302
|
+
// Get Operation Status 파라미터
|
|
303
|
+
{
|
|
304
|
+
displayName: 'Operation Name',
|
|
305
|
+
name: 'operationName',
|
|
306
|
+
type: 'string',
|
|
307
|
+
required: true,
|
|
308
|
+
default: '',
|
|
309
|
+
displayOptions: {
|
|
310
|
+
show: {
|
|
311
|
+
operation: ['getOperationStatus'],
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
description: '확인할 작업의 이름 (예: operations/abc123)',
|
|
315
|
+
},
|
|
316
|
+
],
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
async execute() {
|
|
320
|
+
const items = this.getInputData();
|
|
321
|
+
const returnData = [];
|
|
322
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
323
|
+
const credentials = await this.getCredentials('googleGeminiApi');
|
|
324
|
+
const apiKey = credentials.apiKey;
|
|
325
|
+
const baseUrl = 'https://generativelanguage.googleapis.com';
|
|
326
|
+
const handleApiError = (error) => {
|
|
327
|
+
const err = error;
|
|
328
|
+
if (err.response) {
|
|
329
|
+
const statusCode = err.response.status;
|
|
330
|
+
const apiMessage = err.response.data?.error?.message || 'Unknown API error';
|
|
331
|
+
if (statusCode === 400) {
|
|
332
|
+
return new n8n_workflow_1.NodeOperationError(this.getNode(), `Bad request: ${apiMessage}`);
|
|
333
|
+
}
|
|
334
|
+
else if (statusCode === 403) {
|
|
335
|
+
return new n8n_workflow_1.NodeOperationError(this.getNode(), 'API Key가 유효하지 않거나 권한이 없습니다');
|
|
336
|
+
}
|
|
337
|
+
else if (statusCode === 404) {
|
|
338
|
+
return new n8n_workflow_1.NodeOperationError(this.getNode(), '리소스를 찾을 수 없습니다');
|
|
339
|
+
}
|
|
340
|
+
else if (statusCode === 429) {
|
|
341
|
+
return new n8n_workflow_1.NodeOperationError(this.getNode(), 'API 요청 한도를 초과했습니다. 잠시 후 다시 시도해주세요');
|
|
342
|
+
}
|
|
343
|
+
return new n8n_workflow_1.NodeOperationError(this.getNode(), apiMessage);
|
|
344
|
+
}
|
|
345
|
+
return new n8n_workflow_1.NodeOperationError(this.getNode(), err.message || 'Unknown error occurred');
|
|
346
|
+
};
|
|
347
|
+
for (let i = 0; i < items.length; i++) {
|
|
348
|
+
try {
|
|
349
|
+
let responseData;
|
|
350
|
+
if (operation === 'createStore') {
|
|
351
|
+
// Create Store operation
|
|
352
|
+
const displayName = this.getNodeParameter('storeDisplayName', i);
|
|
353
|
+
try {
|
|
354
|
+
responseData = await this.helpers.httpRequest({
|
|
355
|
+
method: 'POST',
|
|
356
|
+
url: `${baseUrl}/v1beta/fileSearchStores`,
|
|
357
|
+
qs: { key: apiKey },
|
|
358
|
+
headers: {
|
|
359
|
+
'Content-Type': 'application/json',
|
|
360
|
+
},
|
|
361
|
+
body: {
|
|
362
|
+
display_name: displayName,
|
|
363
|
+
},
|
|
364
|
+
json: true,
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
catch (error) {
|
|
368
|
+
throw handleApiError(error);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
else if (operation === 'listStores') {
|
|
372
|
+
// List Stores operation
|
|
373
|
+
const pageSize = this.getNodeParameter('pageSize', i);
|
|
374
|
+
const pageToken = this.getNodeParameter('pageToken', i);
|
|
375
|
+
const qs = {
|
|
376
|
+
key: apiKey,
|
|
377
|
+
pageSize,
|
|
378
|
+
};
|
|
379
|
+
if (pageToken) {
|
|
380
|
+
qs.pageToken = pageToken;
|
|
381
|
+
}
|
|
382
|
+
try {
|
|
383
|
+
responseData = await this.helpers.httpRequest({
|
|
384
|
+
method: 'GET',
|
|
385
|
+
url: `${baseUrl}/v1beta/fileSearchStores`,
|
|
386
|
+
qs,
|
|
387
|
+
json: true,
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
catch (error) {
|
|
391
|
+
throw handleApiError(error);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
else if (operation === 'getStore') {
|
|
395
|
+
// Get Store operation
|
|
396
|
+
const storeName = this.getNodeParameter('storeName', i);
|
|
397
|
+
const normalizedStoreName = storeName.startsWith('fileSearchStores/')
|
|
398
|
+
? storeName
|
|
399
|
+
: `fileSearchStores/${storeName}`;
|
|
400
|
+
try {
|
|
401
|
+
responseData = await this.helpers.httpRequest({
|
|
402
|
+
method: 'GET',
|
|
403
|
+
url: `${baseUrl}/v1beta/${normalizedStoreName}`,
|
|
404
|
+
qs: { key: apiKey },
|
|
405
|
+
json: true,
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
catch (error) {
|
|
409
|
+
throw handleApiError(error);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
else if (operation === 'deleteStore') {
|
|
413
|
+
// Delete Store operation
|
|
414
|
+
const storeName = this.getNodeParameter('storeName', i);
|
|
415
|
+
const normalizedStoreName = storeName.startsWith('fileSearchStores/')
|
|
416
|
+
? storeName
|
|
417
|
+
: `fileSearchStores/${storeName}`;
|
|
418
|
+
try {
|
|
419
|
+
await this.helpers.httpRequest({
|
|
420
|
+
method: 'DELETE',
|
|
421
|
+
url: `${baseUrl}/v1beta/${normalizedStoreName}`,
|
|
422
|
+
qs: { key: apiKey },
|
|
423
|
+
json: true,
|
|
424
|
+
});
|
|
425
|
+
responseData = { success: true, deletedStore: normalizedStoreName };
|
|
426
|
+
}
|
|
427
|
+
catch (error) {
|
|
428
|
+
throw handleApiError(error);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
else if (operation === 'uploadDocument') {
|
|
432
|
+
// Upload Document operation
|
|
433
|
+
const storeName = this.getNodeParameter('storeName', i);
|
|
434
|
+
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
|
|
435
|
+
const documentDisplayName = this.getNodeParameter('documentDisplayName', i);
|
|
436
|
+
const chunkingOptions = this.getNodeParameter('chunkingOptions', i);
|
|
437
|
+
const customMetadata = this.getNodeParameter('customMetadata', i);
|
|
438
|
+
const normalizedStoreName = storeName.startsWith('fileSearchStores/')
|
|
439
|
+
? storeName
|
|
440
|
+
: `fileSearchStores/${storeName}`;
|
|
441
|
+
const binaryData = items[i].binary?.[binaryPropertyName];
|
|
442
|
+
if (!binaryData) {
|
|
443
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `No binary data found for property "${binaryPropertyName}"`, { itemIndex: i });
|
|
444
|
+
}
|
|
445
|
+
const buffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
|
446
|
+
const mimeType = binaryData.mimeType || 'application/octet-stream';
|
|
447
|
+
const fileName = documentDisplayName || binaryData.fileName || 'unnamed_document';
|
|
448
|
+
// Build metadata
|
|
449
|
+
const metadata = {};
|
|
450
|
+
if (customMetadata.metadataValues) {
|
|
451
|
+
const metadataEntries = customMetadata.metadataValues;
|
|
452
|
+
for (const entry of metadataEntries) {
|
|
453
|
+
if (entry.key) {
|
|
454
|
+
if (entry.valueType === 'numeric') {
|
|
455
|
+
metadata[entry.key] = { numericValue: parseFloat(entry.value) };
|
|
456
|
+
}
|
|
457
|
+
else {
|
|
458
|
+
metadata[entry.key] = { stringValue: entry.value };
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
// Build chunking config
|
|
464
|
+
const chunkingConfig = {};
|
|
465
|
+
if (chunkingOptions.maxTokensPerChunk) {
|
|
466
|
+
chunkingConfig.maxTokensPerChunk = chunkingOptions.maxTokensPerChunk;
|
|
467
|
+
}
|
|
468
|
+
if (chunkingOptions.maxOverlapTokens) {
|
|
469
|
+
chunkingConfig.maxOverlapTokens = chunkingOptions.maxOverlapTokens;
|
|
470
|
+
}
|
|
471
|
+
const boundary = '---n8n-boundary-' + Date.now().toString(16);
|
|
472
|
+
const documentConfig = {
|
|
473
|
+
display_name: fileName,
|
|
474
|
+
};
|
|
475
|
+
if (Object.keys(metadata).length > 0) {
|
|
476
|
+
documentConfig.custom_metadata = metadata;
|
|
477
|
+
}
|
|
478
|
+
if (Object.keys(chunkingConfig).length > 0) {
|
|
479
|
+
documentConfig.chunking_config = chunkingConfig;
|
|
480
|
+
}
|
|
481
|
+
const metadataPart = JSON.stringify({ document: documentConfig });
|
|
482
|
+
const bodyParts = [
|
|
483
|
+
Buffer.from(`--${boundary}\r\n`),
|
|
484
|
+
Buffer.from('Content-Type: application/json; charset=UTF-8\r\n\r\n'),
|
|
485
|
+
Buffer.from(metadataPart + '\r\n'),
|
|
486
|
+
Buffer.from(`--${boundary}\r\n`),
|
|
487
|
+
Buffer.from(`Content-Type: ${mimeType}\r\n\r\n`),
|
|
488
|
+
buffer,
|
|
489
|
+
Buffer.from(`\r\n--${boundary}--\r\n`),
|
|
490
|
+
];
|
|
491
|
+
const body = Buffer.concat(bodyParts);
|
|
492
|
+
try {
|
|
493
|
+
const response = await this.helpers.httpRequest({
|
|
494
|
+
method: 'POST',
|
|
495
|
+
url: `${baseUrl}/upload/v1beta/${normalizedStoreName}/documents`,
|
|
496
|
+
qs: { key: apiKey },
|
|
497
|
+
headers: {
|
|
498
|
+
'Content-Type': `multipart/related; boundary=${boundary}`,
|
|
499
|
+
'Content-Length': body.length.toString(),
|
|
500
|
+
},
|
|
501
|
+
body,
|
|
502
|
+
json: false,
|
|
503
|
+
});
|
|
504
|
+
responseData = typeof response === 'string' ? JSON.parse(response) : response;
|
|
505
|
+
}
|
|
506
|
+
catch (error) {
|
|
507
|
+
throw handleApiError(error);
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
else if (operation === 'queryDocuments') {
|
|
511
|
+
// Query Documents operation
|
|
512
|
+
const storeName = this.getNodeParameter('storeName', i);
|
|
513
|
+
const query = this.getNodeParameter('query', i);
|
|
514
|
+
const metadataFilter = this.getNodeParameter('metadataFilter', i);
|
|
515
|
+
const includeCitations = this.getNodeParameter('includeCitations', i);
|
|
516
|
+
const maxResults = this.getNodeParameter('maxResults', i);
|
|
517
|
+
const normalizedStoreName = storeName.startsWith('fileSearchStores/')
|
|
518
|
+
? storeName
|
|
519
|
+
: `fileSearchStores/${storeName}`;
|
|
520
|
+
const requestBody = {
|
|
521
|
+
query,
|
|
522
|
+
maxResults,
|
|
523
|
+
includeCitations,
|
|
524
|
+
};
|
|
525
|
+
if (metadataFilter) {
|
|
526
|
+
requestBody.metadataFilter = metadataFilter;
|
|
527
|
+
}
|
|
528
|
+
try {
|
|
529
|
+
responseData = await this.helpers.httpRequest({
|
|
530
|
+
method: 'POST',
|
|
531
|
+
url: `${baseUrl}/v1beta/${normalizedStoreName}:query`,
|
|
532
|
+
qs: { key: apiKey },
|
|
533
|
+
headers: {
|
|
534
|
+
'Content-Type': 'application/json',
|
|
535
|
+
},
|
|
536
|
+
body: requestBody,
|
|
537
|
+
json: true,
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
catch (error) {
|
|
541
|
+
throw handleApiError(error);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
else if (operation === 'getOperationStatus') {
|
|
545
|
+
// Get Operation Status
|
|
546
|
+
const operationName = this.getNodeParameter('operationName', i);
|
|
547
|
+
const normalizedOperationName = operationName.startsWith('operations/')
|
|
548
|
+
? operationName
|
|
549
|
+
: `operations/${operationName}`;
|
|
550
|
+
try {
|
|
551
|
+
responseData = await this.helpers.httpRequest({
|
|
552
|
+
method: 'GET',
|
|
553
|
+
url: `${baseUrl}/v1beta/${normalizedOperationName}`,
|
|
554
|
+
qs: { key: apiKey },
|
|
555
|
+
json: true,
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
catch (error) {
|
|
559
|
+
throw handleApiError(error);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
else {
|
|
563
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation: ${operation}`);
|
|
564
|
+
}
|
|
565
|
+
returnData.push({
|
|
566
|
+
json: responseData,
|
|
567
|
+
pairedItem: { item: i },
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
catch (error) {
|
|
571
|
+
if (this.continueOnFail()) {
|
|
572
|
+
returnData.push({
|
|
573
|
+
json: { error: error.message },
|
|
574
|
+
pairedItem: { item: i },
|
|
575
|
+
});
|
|
576
|
+
continue;
|
|
577
|
+
}
|
|
578
|
+
throw error;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
return [returnData];
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
exports.GoogleFileSearchStore = GoogleFileSearchStore;
|
|
585
|
+
//# sourceMappingURL=GoogleFileSearchStore.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleFileSearchStore.node.js","sourceRoot":"","sources":["../../../nodes/GoogleFileSearchStore/GoogleFileSearchStore.node.ts"],"names":[],"mappings":";;;AAAA,+CAOsB;AAEtB,MAAa,qBAAqB;IAAlC;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,0BAA0B;YACvC,IAAI,EAAE,uBAAuB;YAC7B,IAAI,EAAE,6BAA6B;YACnC,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8BAA8B;YACxC,WAAW,EAAE,oDAAoD;YACjE,QAAQ,EAAE;gBACT,IAAI,EAAE,0BAA0B;aAChC;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,iBAAiB;oBACvB,QAAQ,EAAE,IAAI;iBACd;aACD;YACD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,WAAW;oBACxB,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACR;4BACC,IAAI,EAAE,cAAc;4BACpB,KAAK,EAAE,aAAa;4BACpB,MAAM,EAAE,gCAAgC;4BACxC,WAAW,EAAE,4BAA4B;yBACzC;wBACD;4BACC,IAAI,EAAE,aAAa;4BACnB,KAAK,EAAE,YAAY;4BACnB,MAAM,EAAE,iBAAiB;4BACzB,WAAW,EAAE,gCAAgC;yBAC7C;wBACD;4BACC,IAAI,EAAE,WAA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MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;4BAC7C,MAAM,EAAE,KAAK;4BACb,GAAG,EAAE,GAAG,OAAO,WAAW,uBAAuB,EAAE;4BACnD,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE;4BACnB,IAAI,EAAE,IAAI;yBACV,CAAgB,CAAC;oBACnB,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBAChB,MAAM,cAAc,CAAC,KAAK,CAAC,CAAC;oBAC7B,CAAC;gBACF,CAAC;qBAAM,CAAC;oBACP,MAAM,IAAI,iCAAkB,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,sBAAsB,SAAS,EAAE,CAAC,CAAC;gBACjF,CAAC;gBAED,UAAU,CAAC,IAAI,CAAC;oBACf,IAAI,EAAE,YAAY;oBAClB,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;iBACvB,CAAC,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBAC3B,UAAU,CAAC,IAAI,CAAC;wBACf,IAAI,EAAE,EAAE,KAAK,EAAG,KAAe,CAAC,OAAO,EAAE;wBACzC,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;qBACvB,CAAC,CAAC;oBACH,SAAS;gBACV,CAAC;gBACD,MAAM,KAAK,CAAC;YACb,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AArlBD,sDAqlBC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="48" height="48">
|
|
2
|
+
<!-- Google colors inspired search store icon -->
|
|
3
|
+
<defs>
|
|
4
|
+
<linearGradient id="googleSearchGradient" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
5
|
+
<stop offset="0%" style="stop-color:#4285F4"/>
|
|
6
|
+
<stop offset="50%" style="stop-color:#34A853"/>
|
|
7
|
+
<stop offset="100%" style="stop-color:#FBBC05"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
</defs>
|
|
10
|
+
<!-- Store/Database shape -->
|
|
11
|
+
<ellipse cx="24" cy="10" rx="16" ry="6" fill="#E8F0FE" stroke="url(#googleSearchGradient)" stroke-width="2"/>
|
|
12
|
+
<path d="M8 10v10c0 3.3 7.2 6 16 6s16-2.7 16-6V10" fill="none" stroke="url(#googleSearchGradient)" stroke-width="2"/>
|
|
13
|
+
<ellipse cx="24" cy="20" rx="16" ry="6" fill="none" stroke="url(#googleSearchGradient)" stroke-width="1" stroke-dasharray="2,2"/>
|
|
14
|
+
<path d="M8 20v10c0 3.3 7.2 6 16 6s16-2.7 16-6V20" fill="none" stroke="url(#googleSearchGradient)" stroke-width="2"/>
|
|
15
|
+
<!-- Search magnifying glass -->
|
|
16
|
+
<g transform="translate(30, 32)">
|
|
17
|
+
<circle cx="0" cy="0" r="7" fill="#fff" stroke="#4285F4" stroke-width="2"/>
|
|
18
|
+
<line x1="5" y1="5" x2="10" y2="10" stroke="#4285F4" stroke-width="3" stroke-linecap="round"/>
|
|
19
|
+
<!-- RAG sparkle -->
|
|
20
|
+
<path d="M-2 -2L0 -4L2 -2L0 0z" fill="#FBBC05"/>
|
|
21
|
+
</g>
|
|
22
|
+
<!-- Document lines in store -->
|
|
23
|
+
<line x1="16" y1="13" x2="32" y2="13" stroke="#34A853" stroke-width="1.5" stroke-linecap="round"/>
|
|
24
|
+
<line x1="16" y1="16" x2="28" y2="16" stroke="#EA4335" stroke-width="1.5" stroke-linecap="round"/>
|
|
25
|
+
</svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-google-files-api",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "n8n nodes for Google Gemini File API and File Search Store",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"n8n-community-node-package",
|
|
7
|
+
"google",
|
|
8
|
+
"gemini",
|
|
9
|
+
"files-api",
|
|
10
|
+
"rag",
|
|
11
|
+
"file-search"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"homepage": "",
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "cranemont",
|
|
17
|
+
"email": "cranemont@gmail.com"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "cranemont/n8n-nodes-google-files-api"
|
|
22
|
+
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=18.17.0"
|
|
25
|
+
},
|
|
26
|
+
"main": "dist/index.js",
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc && gulp build:icons",
|
|
29
|
+
"dev": "tsc --watch",
|
|
30
|
+
"format": "prettier --write .",
|
|
31
|
+
"lint": "eslint . --ext .ts",
|
|
32
|
+
"lintfix": "eslint . --ext .ts --fix",
|
|
33
|
+
"prepublishOnly": "npm run build"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist"
|
|
37
|
+
],
|
|
38
|
+
"n8n": {
|
|
39
|
+
"n8nNodesApiVersion": 1,
|
|
40
|
+
"credentials": [
|
|
41
|
+
"dist/credentials/GoogleGeminiApi.credentials.js"
|
|
42
|
+
],
|
|
43
|
+
"nodes": [
|
|
44
|
+
"dist/nodes/GoogleFileApi/GoogleFileApi.node.js",
|
|
45
|
+
"dist/nodes/GoogleFileSearchStore/GoogleFileSearchStore.node.js"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^20.10.0",
|
|
50
|
+
"eslint": "^8.56.0",
|
|
51
|
+
"gulp": "^4.0.2",
|
|
52
|
+
"n8n-workflow": "^1.22.0",
|
|
53
|
+
"prettier": "^3.1.0",
|
|
54
|
+
"typescript": "^5.3.0"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"n8n-workflow": "*"
|
|
58
|
+
}
|
|
59
|
+
}
|