n8n-nodes-googleflow-ai 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/LICENSE.md +19 -0
- package/README.md +260 -0
- package/dist/credentials/googleFlowCredentialsApi.credentials.d.ts +9 -0
- package/dist/credentials/googleFlowCredentialsApi.credentials.d.ts.map +1 -0
- package/dist/credentials/googleFlowCredentialsApi.credentials.js +32 -0
- package/dist/credentials/googleFlowCredentialsApi.credentials.js.map +1 -0
- package/dist/credentials/icon.png +0 -0
- package/dist/credentials/jimengCredentialsApi.credentials.d.ts +8 -0
- package/dist/credentials/jimengCredentialsApi.credentials.js +22 -0
- package/dist/credentials/jimengCredentialsApi.credentials.js.map +1 -0
- package/dist/nodes/googleflow/GoogleFlow.node.d.ts +9 -0
- package/dist/nodes/googleflow/GoogleFlow.node.d.ts.map +1 -0
- package/dist/nodes/googleflow/GoogleFlow.node.js +79 -0
- package/dist/nodes/googleflow/GoogleFlow.node.js.map +1 -0
- package/dist/nodes/googleflow/icon.png +0 -0
- package/dist/nodes/googleflow/resource/imageGenerate.d.ts +67 -0
- package/dist/nodes/googleflow/resource/imageGenerate.d.ts.map +1 -0
- package/dist/nodes/googleflow/resource/imageGenerate.js +168 -0
- package/dist/nodes/googleflow/resource/imageGenerate.js.map +1 -0
- package/dist/nodes/googleflow/resource/index.d.ts +3 -0
- package/dist/nodes/googleflow/resource/index.d.ts.map +1 -0
- package/dist/nodes/googleflow/resource/index.js +11 -0
- package/dist/nodes/googleflow/resource/index.js.map +1 -0
- package/dist/nodes/googleflow/resource/videoGenerate.d.ts +84 -0
- package/dist/nodes/googleflow/resource/videoGenerate.d.ts.map +1 -0
- package/dist/nodes/googleflow/resource/videoGenerate.js +200 -0
- package/dist/nodes/googleflow/resource/videoGenerate.js.map +1 -0
- package/dist/nodes/help/dreamina.d.ts +86 -0
- package/dist/nodes/help/dreamina.js +778 -0
- package/dist/nodes/help/dreamina.js.map +1 -0
- package/dist/nodes/help/googleflow.d.ts +57 -0
- package/dist/nodes/help/googleflow.d.ts.map +1 -0
- package/dist/nodes/help/googleflow.js +227 -0
- package/dist/nodes/help/googleflow.js.map +1 -0
- package/dist/nodes/help/jimeng.d.ts +83 -0
- package/dist/nodes/help/jimeng.js +779 -0
- package/dist/nodes/help/jimeng.js.map +1 -0
- package/dist/nodes/help/util.d.ts +45 -0
- package/dist/nodes/help/util.js +320 -0
- package/dist/nodes/help/util.js.map +1 -0
- package/dist/nodes/jimeng/Jimeng.node.d.ts +8 -0
- package/dist/nodes/jimeng/Jimeng.node.js +83 -0
- package/dist/nodes/jimeng/Jimeng.node.js.map +1 -0
- package/dist/nodes/jimeng/icon.png +0 -0
- package/dist/nodes/jimeng/resource/dreamina.d.ts +3 -0
- package/dist/nodes/jimeng/resource/dreamina.js +8 -0
- package/dist/nodes/jimeng/resource/dreamina.js.map +1 -0
- package/dist/nodes/jimeng/resource/dreaminaImg/desc.d.ts +3 -0
- package/dist/nodes/jimeng/resource/dreaminaImg/desc.js +37 -0
- package/dist/nodes/jimeng/resource/dreaminaImg/desc.js.map +1 -0
- package/dist/nodes/jimeng/resource/dreaminaImg/img.d.ts +3 -0
- package/dist/nodes/jimeng/resource/dreaminaImg/img.js +151 -0
- package/dist/nodes/jimeng/resource/dreaminaImg/img.js.map +1 -0
- package/dist/nodes/jimeng/resource/dreaminaImg/text.d.ts +3 -0
- package/dist/nodes/jimeng/resource/dreaminaImg/text.js +122 -0
- package/dist/nodes/jimeng/resource/dreaminaImg/text.js.map +1 -0
- package/dist/nodes/jimeng/resource/img/desc.d.ts +3 -0
- package/dist/nodes/jimeng/resource/img/desc.js +30 -0
- package/dist/nodes/jimeng/resource/img/desc.js.map +1 -0
- package/dist/nodes/jimeng/resource/img/img.d.ts +3 -0
- package/dist/nodes/jimeng/resource/img/img.js +156 -0
- package/dist/nodes/jimeng/resource/img/img.js.map +1 -0
- package/dist/nodes/jimeng/resource/img/text.d.ts +3 -0
- package/dist/nodes/jimeng/resource/img/text.js +116 -0
- package/dist/nodes/jimeng/resource/img/text.js.map +1 -0
- package/dist/nodes/jimeng/resource/testtoimg.d.ts +3 -0
- package/dist/nodes/jimeng/resource/testtoimg.js +8 -0
- package/dist/nodes/jimeng/resource/testtoimg.js.map +1 -0
- package/dist/nodes/jimeng/resource/video/desc.d.ts +3 -0
- package/dist/nodes/jimeng/resource/video/desc.js +30 -0
- package/dist/nodes/jimeng/resource/video/desc.js.map +1 -0
- package/dist/nodes/jimeng/resource/video/img.d.ts +3 -0
- package/dist/nodes/jimeng/resource/video/img.js +92 -0
- package/dist/nodes/jimeng/resource/video/img.js.map +1 -0
- package/dist/nodes/jimeng/resource/video/text.d.ts +3 -0
- package/dist/nodes/jimeng/resource/video/text.js +103 -0
- package/dist/nodes/jimeng/resource/video/text.js.map +1 -0
- package/dist/nodes/jimeng/resource/video.d.ts +3 -0
- package/dist/nodes/jimeng/resource/video.js +8 -0
- package/dist/nodes/jimeng/resource/video.js.map +1 -0
- package/dist/package.json +55 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/index.js +2 -0
- package/package.json +54 -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.md
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
# n8n-nodes-googleflow-ai
|
|
2
|
+
|
|
3
|
+
Google Flow (Nano Banana / Veo) AI 图像和视频生成节点 for n8n
|
|
4
|
+
|
|
5
|
+
## 功能
|
|
6
|
+
|
|
7
|
+
此节点允许你在 n8n 工作流中使用 Google Flow 的 AI 模型进行图像和视频生成:
|
|
8
|
+
|
|
9
|
+
- **图像生成**:使用 Nano Banana Pro 等模型生成高质量图像
|
|
10
|
+
- 文生图(Text to Image)
|
|
11
|
+
- 图生图(Image to Image)
|
|
12
|
+
- 支持多种宽高比
|
|
13
|
+
- 支持批量生成(1-4 张)
|
|
14
|
+
|
|
15
|
+
- **视频生成**:使用 Veo 3.1 等模型生成 AI 视频
|
|
16
|
+
- 文生视频(Text to Video)
|
|
17
|
+
- 图生视频(Image to Video)
|
|
18
|
+
- 自动状态轮询
|
|
19
|
+
- 支持多种视频风格
|
|
20
|
+
|
|
21
|
+
## 安装
|
|
22
|
+
|
|
23
|
+
### 方法 1:通过 n8n 社区节点(推荐)
|
|
24
|
+
|
|
25
|
+
1. 打开 n8n
|
|
26
|
+
2. 进入 **Settings** → **Community Nodes**
|
|
27
|
+
3. 点击 **Install**
|
|
28
|
+
4. 搜索 `n8n-nodes-googleflow-ai`
|
|
29
|
+
5. 点击安装
|
|
30
|
+
|
|
31
|
+
### 方法 2:使用 npm 安装
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install n8n-nodes-googleflow-ai
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 方法 3:Docker 安装
|
|
38
|
+
|
|
39
|
+
将插件目录挂载到 n8n 容器的 `/home/node/.n8n/node_modules/` 目录
|
|
40
|
+
|
|
41
|
+
## 凭证配置
|
|
42
|
+
|
|
43
|
+
### 获取 Bearer Token
|
|
44
|
+
|
|
45
|
+
1. 访问 [Google AI Studio](https://aistudio.google.com/)
|
|
46
|
+
2. 登录你的 Google 账号
|
|
47
|
+
3. 点击右上角头像 → **API Keys**
|
|
48
|
+
4. 创建新的 API Key 或使用现有的
|
|
49
|
+
5. 复制 API Key(格式:`AIzaSy...`)
|
|
50
|
+
|
|
51
|
+
### 获取 Project ID
|
|
52
|
+
|
|
53
|
+
1. 访问 [Google Cloud Console](https://console.cloud.google.com/)
|
|
54
|
+
2. 创建或选择一个项目
|
|
55
|
+
3. 在项目概览页面找到 **Project ID**(格式:`xxxxxxxxx`)
|
|
56
|
+
|
|
57
|
+
### 在 n8n 中配置凭证
|
|
58
|
+
|
|
59
|
+
1. 打开 n8n
|
|
60
|
+
2. 进入 **Credentials** → **Add Credential**
|
|
61
|
+
3. 选择 **Google Flow API**
|
|
62
|
+
4. 填写:
|
|
63
|
+
- **Bearer Token**:填入 API Key(不需要加 "Bearer " 前缀)
|
|
64
|
+
- **Project ID**:填入项目 ID
|
|
65
|
+
5. 点击 **Save**
|
|
66
|
+
|
|
67
|
+
## 使用方法
|
|
68
|
+
|
|
69
|
+
### 图像生成
|
|
70
|
+
|
|
71
|
+
1. 添加 **Google Flow Node** 到工作流
|
|
72
|
+
2. 配置参数:
|
|
73
|
+
- **Resource**:选择 `Image`
|
|
74
|
+
- **Operation**:选择 `Generate`
|
|
75
|
+
- **Model**:选择模型(如 `Nano Banana Pro`)
|
|
76
|
+
- **Prompt**:输入图像描述
|
|
77
|
+
- **Aspect Ratio**:选择宽高比(1:1, 16:9, 9:16 等)
|
|
78
|
+
- **Generation Count**:选择生成数量(1-4)
|
|
79
|
+
3. 执行节点
|
|
80
|
+
4. 输出为图像 URL 或二进制数据
|
|
81
|
+
|
|
82
|
+
#### 示例配置
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"resource": "Image",
|
|
87
|
+
"operation": "Generate",
|
|
88
|
+
"model": "Nano Banana Pro",
|
|
89
|
+
"prompt": "一只可爱的猫咪在阳光下睡觉",
|
|
90
|
+
"aspectRatio": "1:1",
|
|
91
|
+
"generationCount": 2
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 视频生成
|
|
96
|
+
|
|
97
|
+
1. 添加 **Google Flow Node** 到工作流
|
|
98
|
+
2. 配置参数:
|
|
99
|
+
- **Resource**:选择 `Video`
|
|
100
|
+
- **Operation**:选择 `Generate`
|
|
101
|
+
- **Model**:选择模型(如 `Veo 3.1`)
|
|
102
|
+
- **Prompt**:输入视频描述
|
|
103
|
+
- **Duration**:选择时长(5 秒或 10 秒)
|
|
104
|
+
- **Style**:选择风格(可选)
|
|
105
|
+
3. 执行节点
|
|
106
|
+
4. 节点会自动轮询生成状态
|
|
107
|
+
5. 输出为视频 URL 或二进制数据
|
|
108
|
+
|
|
109
|
+
#### 示例配置
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"resource": "Video",
|
|
114
|
+
"operation": "Generate",
|
|
115
|
+
"model": "Veo 3.1",
|
|
116
|
+
"prompt": "海浪拍打沙滩的慢动作镜头",
|
|
117
|
+
"duration": "5s",
|
|
118
|
+
"style": "Cinematic"
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## 支持的操作
|
|
123
|
+
|
|
124
|
+
### Image Resource
|
|
125
|
+
|
|
126
|
+
- **Generate** - 生成图像
|
|
127
|
+
- 支持文生图和图生图
|
|
128
|
+
- 批量生成最多 4 张
|
|
129
|
+
- 自动处理图像 URL
|
|
130
|
+
|
|
131
|
+
### Video Resource
|
|
132
|
+
|
|
133
|
+
- **Generate** - 生成视频
|
|
134
|
+
- 支持文生视频和图生视频
|
|
135
|
+
- 自动轮询生成状态
|
|
136
|
+
- 支持多种视频风格
|
|
137
|
+
|
|
138
|
+
## 节点参数说明
|
|
139
|
+
|
|
140
|
+
### 通用参数
|
|
141
|
+
|
|
142
|
+
| 参数 | 类型 | 说明 |
|
|
143
|
+
|------|------|------|
|
|
144
|
+
| Resource | 选项 | 选择资源类型(Image 或 Video) |
|
|
145
|
+
| Operation | 选项 | 选择操作类型(Generate) |
|
|
146
|
+
| Model | 选项 | 选择 AI 模型 |
|
|
147
|
+
| Prompt | 文本 | 生成内容的描述 |
|
|
148
|
+
|
|
149
|
+
### 图像专用参数
|
|
150
|
+
|
|
151
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
152
|
+
|------|------|--------|------|
|
|
153
|
+
| Aspect Ratio | 选项 | 1:1 | 图像宽高比 |
|
|
154
|
+
| Generation Count | 数字 | 1 | 生成数量(1-4) |
|
|
155
|
+
|
|
156
|
+
### 视频专用参数
|
|
157
|
+
|
|
158
|
+
| 参数 | 类型 | 默认值 | 说明 |
|
|
159
|
+
|------|------|--------|------|
|
|
160
|
+
| Duration | 选项 | 5s | 视频时长 |
|
|
161
|
+
| Style | 选项 | - | 视频风格 |
|
|
162
|
+
|
|
163
|
+
## 输出格式
|
|
164
|
+
|
|
165
|
+
### 图像输出
|
|
166
|
+
|
|
167
|
+
```json
|
|
168
|
+
{
|
|
169
|
+
"images": [
|
|
170
|
+
{
|
|
171
|
+
"url": "https://...",
|
|
172
|
+
"width": 1024,
|
|
173
|
+
"height": 1024
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
"prompt": "原始提示词",
|
|
177
|
+
"model": "使用的模型"
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### 视频输出
|
|
182
|
+
|
|
183
|
+
```json
|
|
184
|
+
{
|
|
185
|
+
"video": {
|
|
186
|
+
"url": "https://...",
|
|
187
|
+
"duration": 5,
|
|
188
|
+
"format": "mp4"
|
|
189
|
+
},
|
|
190
|
+
"prompt": "原始提示词",
|
|
191
|
+
"model": "使用的模型",
|
|
192
|
+
"status": "completed"
|
|
193
|
+
}
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## 示例工作流
|
|
197
|
+
|
|
198
|
+
### 示例 1:自动生成社交媒体图片
|
|
199
|
+
|
|
200
|
+
1. **Trigger**:定时触发器
|
|
201
|
+
2. **Google Flow Node**:生成图像
|
|
202
|
+
- Prompt: "今日天气晴朗,适合外出游玩"
|
|
203
|
+
- Aspect Ratio: 1:1
|
|
204
|
+
3. **Save Binary Data**:保存图像
|
|
205
|
+
|
|
206
|
+
### 示例 2:批量生成产品描述视频
|
|
207
|
+
|
|
208
|
+
1. **Trigger**:Webhook
|
|
209
|
+
2. **Loop Over Items**:循环产品列表
|
|
210
|
+
3. **Google Flow Node**:生成视频
|
|
211
|
+
- Prompt: 从产品描述生成
|
|
212
|
+
- Duration: 5s
|
|
213
|
+
4. **Upload to Storage**:上传视频
|
|
214
|
+
|
|
215
|
+
## 常见问题
|
|
216
|
+
|
|
217
|
+
### Q: Bearer Token 在哪里获取?
|
|
218
|
+
|
|
219
|
+
A: 在 Google AI Studio 的 API Keys 页面获取,格式为 `AIzaSy...`
|
|
220
|
+
|
|
221
|
+
### Q: Project ID 是什么?
|
|
222
|
+
|
|
223
|
+
A: Google Cloud 项目的唯一标识符,在 Google Cloud Console 中查看
|
|
224
|
+
|
|
225
|
+
### Q: 视频生成需要多长时间?
|
|
226
|
+
|
|
227
|
+
A: 通常 30 秒到 2 分钟,节点会自动轮询直到完成
|
|
228
|
+
|
|
229
|
+
### Q: 可以批量生成多少张图像?
|
|
230
|
+
|
|
231
|
+
A: 最多 4 张,通过 Generation Count 参数设置
|
|
232
|
+
|
|
233
|
+
### Q: 支持哪些图像尺寸?
|
|
234
|
+
|
|
235
|
+
A: 支持 1:1, 16:9, 9:16, 4:3, 3:4 等多种宽高比
|
|
236
|
+
|
|
237
|
+
## 技术支持
|
|
238
|
+
|
|
239
|
+
- **GitHub**: https://github.com/webcpy/n8n-pluguns
|
|
240
|
+
- **Issues**: https://github.com/webcpy/n8n-pluguns/issues
|
|
241
|
+
- **npm**: https://www.npmjs.com/package/n8n-nodes-googleflow-ai
|
|
242
|
+
|
|
243
|
+
## 更新日志
|
|
244
|
+
|
|
245
|
+
### 1.0.0
|
|
246
|
+
|
|
247
|
+
- 初始版本
|
|
248
|
+
- 支持图像生成(Nano Banana Pro)
|
|
249
|
+
- 支持视频生成(Veo 3.1)
|
|
250
|
+
- 自动状态轮询
|
|
251
|
+
- 批量生成支持
|
|
252
|
+
|
|
253
|
+
## 许可证
|
|
254
|
+
|
|
255
|
+
MIT License
|
|
256
|
+
|
|
257
|
+
## 作者
|
|
258
|
+
|
|
259
|
+
webcpy <webcpy@163.com>
|
|
260
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ICredentialType, INodeProperties, Icon } from 'n8n-workflow';
|
|
2
|
+
export declare class googleFlowCredentialsApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
icon: Icon;
|
|
7
|
+
properties: INodeProperties[];
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=googleFlowCredentialsApi.credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"googleFlowCredentialsApi.credentials.d.ts","sourceRoot":"","sources":["../../src/credentials/googleFlowCredentialsApi.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE3E,qBAAa,wBAAyB,YAAW,eAAe;IAC5D,IAAI,SAA8B;IAClC,WAAW,SAAiC;IAC5C,gBAAgB,SAA0C;IAC1D,IAAI,EAAE,IAAI,CAAmB;IAC7B,UAAU,EAAE,eAAe,EAAE,CAkB3B;CACL"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.googleFlowCredentialsApi = void 0;
|
|
4
|
+
class googleFlowCredentialsApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'googleFlowCredentialsApi';
|
|
7
|
+
this.displayName = 'Google Flow Credentials API';
|
|
8
|
+
this.documentationUrl = 'https://labs.google/fx/zh/tools/flow';
|
|
9
|
+
this.icon = 'file:icon.png';
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Bearer Token',
|
|
13
|
+
name: 'bearerToken',
|
|
14
|
+
type: 'string',
|
|
15
|
+
default: '',
|
|
16
|
+
description: '从 Google Flow 网页抓取到的 Bearer Token(Authorization header 中的值)',
|
|
17
|
+
typeOptions: {
|
|
18
|
+
password: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
displayName: 'Project ID',
|
|
23
|
+
name: 'projectId',
|
|
24
|
+
type: 'string',
|
|
25
|
+
default: '',
|
|
26
|
+
description: 'Google Flow 项目 ID(从 URL 中获取,例如:5627476b-489f-4aa9-9565-509e39d6b25c)',
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.googleFlowCredentialsApi = googleFlowCredentialsApi;
|
|
32
|
+
//# sourceMappingURL=googleFlowCredentialsApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"googleFlowCredentialsApi.credentials.js","sourceRoot":"","sources":["../../src/credentials/googleFlowCredentialsApi.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,wBAAwB;IAArC;QACI,SAAI,GAAG,0BAA0B,CAAC;QAClC,gBAAW,GAAG,6BAA6B,CAAC;QAC5C,qBAAgB,GAAG,sCAAsC,CAAC;QAC1D,SAAI,GAAS,eAAe,CAAC;QAC7B,eAAU,GAAsB;YAC5B;gBACI,WAAW,EAAE,cAAc;gBAC3B,IAAI,EAAE,aAAa;gBACnB,IAAI,EAAE,QAAiB;gBACvB,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,6DAA6D;gBAC1E,WAAW,EAAE;oBACT,QAAQ,EAAE,IAAI;iBACjB;aACJ;YACD;gBACI,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAiB;gBACvB,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,sEAAsE;aACtF;SACJ,CAAC;IACN,CAAC;CAAA;AAxBD,4DAwBC"}
|
|
Binary file
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.jimengCredentialsApi = void 0;
|
|
4
|
+
class jimengCredentialsApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'jimengCredentialsApi';
|
|
7
|
+
this.displayName = 'jimeng Credentials API';
|
|
8
|
+
this.documentationUrl = "https://wcnejkpmpmu0.feishu.cn/wiki/YyiOwL4JzifOjvkv9uXcUFmDnVf?fromScene=spaceOverview";
|
|
9
|
+
this.icon = 'file:icon.png';
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'sessionid',
|
|
13
|
+
name: 'sessionid',
|
|
14
|
+
type: 'string',
|
|
15
|
+
default: '',
|
|
16
|
+
description: '用来替代凭证中即梦sessionid',
|
|
17
|
+
}
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.jimengCredentialsApi = jimengCredentialsApi;
|
|
22
|
+
//# sourceMappingURL=jimengCredentialsApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jimengCredentialsApi.credentials.js","sourceRoot":"","sources":["../../credentials/jimengCredentialsApi.credentials.ts"],"names":[],"mappings":";;;AAMA,MAAa,oBAAoB;IAAjC;QACE,SAAI,GAAG,sBAAsB,CAAC;QAC9B,gBAAW,GAAG,wBAAwB,CAAC;QACvC,qBAAgB,GAAC,yFAAyF,CAAA;QAE1G,SAAI,GAAG,eAAe,CAAC;QACvB,eAAU,GAAsB;YAC9B;gBACE,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,oBAAoB;aAClC;SACF,CAAC;IACJ,CAAC;CAAA;AAfD,oDAeC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { INodeType, INodeTypeDescription, IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
export declare class GoogleFlow implements INodeType {
|
|
3
|
+
description: INodeTypeDescription;
|
|
4
|
+
methods: {
|
|
5
|
+
loadOptions: {};
|
|
6
|
+
};
|
|
7
|
+
execute(this: IExecuteFunctions): Promise<any[][]>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=GoogleFlow.node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleFlow.node.d.ts","sourceRoot":"","sources":["../../../src/nodes/googleflow/GoogleFlow.node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAKvF,qBAAa,UAAW,YAAW,SAAS;IACxC,WAAW,EAAE,oBAAoB,CAmB/B;IAEF,OAAO;;MAEL;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB;CAsDxC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GoogleFlow = void 0;
|
|
4
|
+
const plugins_help_1 = require("plugins-help");
|
|
5
|
+
const resourceBuilder = plugins_help_1.ResourceFactory.build(__dirname);
|
|
6
|
+
class GoogleFlow {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.description = {
|
|
9
|
+
displayName: 'Google Flow Node',
|
|
10
|
+
name: 'googleFlow',
|
|
11
|
+
icon: 'file:icon.png',
|
|
12
|
+
group: ['transform'],
|
|
13
|
+
version: 1,
|
|
14
|
+
description: 'Google Flow (Nano Banana/Veo) AI 生成节点',
|
|
15
|
+
defaults: {
|
|
16
|
+
name: 'Google Flow Node',
|
|
17
|
+
},
|
|
18
|
+
inputs: ['main'],
|
|
19
|
+
outputs: ['main'],
|
|
20
|
+
credentials: [
|
|
21
|
+
{
|
|
22
|
+
name: 'googleFlowCredentialsApi',
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
properties: resourceBuilder.build(),
|
|
27
|
+
};
|
|
28
|
+
this.methods = {
|
|
29
|
+
loadOptions: {},
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
async execute() {
|
|
33
|
+
const items = this.getInputData();
|
|
34
|
+
let responseData = {};
|
|
35
|
+
let returnData = [];
|
|
36
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
37
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
38
|
+
const callFunc = resourceBuilder.getCall(resource, operation);
|
|
39
|
+
if (!callFunc) {
|
|
40
|
+
throw new Error('未实现方法:' + resource + '.' + operation);
|
|
41
|
+
}
|
|
42
|
+
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
43
|
+
try {
|
|
44
|
+
this.logger.debug('call function', {
|
|
45
|
+
resource,
|
|
46
|
+
operation,
|
|
47
|
+
itemIndex,
|
|
48
|
+
});
|
|
49
|
+
responseData = await callFunc.call(this, itemIndex);
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
this.logger.error('call function error', {
|
|
53
|
+
resource,
|
|
54
|
+
operation,
|
|
55
|
+
itemIndex,
|
|
56
|
+
errorMessage: error.message,
|
|
57
|
+
stack: error.stack,
|
|
58
|
+
});
|
|
59
|
+
if (this.continueOnFail()) {
|
|
60
|
+
returnData.push({
|
|
61
|
+
json: {
|
|
62
|
+
error: error.message,
|
|
63
|
+
},
|
|
64
|
+
pairedItem: itemIndex,
|
|
65
|
+
});
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
throw error;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: itemIndex } });
|
|
73
|
+
returnData.push(...executionData);
|
|
74
|
+
}
|
|
75
|
+
return [returnData];
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.GoogleFlow = GoogleFlow;
|
|
79
|
+
//# sourceMappingURL=GoogleFlow.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleFlow.node.js","sourceRoot":"","sources":["../../../src/nodes/googleflow/GoogleFlow.node.ts"],"names":[],"mappings":";;;AACA,+CAA+C;AAE/C,MAAM,eAAe,GAAG,8BAAe,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AAEzD,MAAa,UAAU;IAAvB;QACI,gBAAW,GAAyB;YAChC,WAAW,EAAE,kBAAkB;YAC/B,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,uCAAuC;YACpD,QAAQ,EAAE;gBACN,IAAI,EAAE,kBAAkB;aAC3B;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE;gBACT;oBACI,IAAI,EAAE,0BAA0B;oBAChC,QAAQ,EAAE,IAAI;iBACjB;aACJ;YACD,UAAU,EAAE,eAAe,CAAC,KAAK,EAAE;SACtC,CAAC;QAEF,YAAO,GAAG;YACN,WAAW,EAAE,EAAE;SAClB,CAAC;IAwDN,CAAC;IAtDG,KAAK,CAAC,OAAO;QACT,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAClC,IAAI,YAAY,GAAQ,EAAE,CAAC;QAC3B,IAAI,UAAU,GAAU,EAAE,CAAC;QAE3B,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QACtD,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;QAExD,MAAM,QAAQ,GAAG,eAAe,CAAC,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAE9D,IAAI,CAAC,QAAQ,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,QAAQ,GAAG,QAAQ,GAAG,GAAG,GAAG,SAAS,CAAC,CAAC;QAC3D,CAAC;QAED,KAAK,IAAI,SAAS,GAAG,CAAC,EAAE,SAAS,GAAG,KAAK,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC;YAC5D,IAAI,CAAC;gBACD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,EAAE;oBAC/B,QAAQ;oBACR,SAAS;oBACT,SAAS;iBACZ,CAAC,CAAC;gBAEH,YAAY,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;YACxD,CAAC;YAAC,OAAO,KAAU,EAAE,CAAC;gBAClB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE;oBACrC,QAAQ;oBACR,SAAS;oBACT,SAAS;oBACT,YAAY,EAAE,KAAK,CAAC,OAAO;oBAC3B,KAAK,EAAE,KAAK,CAAC,KAAK;iBACrB,CAAC,CAAC;gBAEH,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;oBACxB,UAAU,CAAC,IAAI,CAAC;wBACZ,IAAI,EAAE;4BACF,KAAK,EAAE,KAAK,CAAC,OAAO;yBACvB;wBACD,UAAU,EAAE,SAAS;qBACxB,CAAC,CAAC;oBACH,SAAS;gBACb,CAAC;qBAAM,CAAC;oBACJ,MAAM,KAAK,CAAC;gBAChB,CAAC;YACL,CAAC;YAED,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,0BAA0B,CACzD,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,EAC1C,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,CACpC,CAAC;YACF,UAAU,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC;QACtC,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACxB,CAAC;CACJ;AAhFD,gCAgFC"}
|
|
Binary file
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
declare const GoogleFlowImageGenerate: {
|
|
3
|
+
name: string;
|
|
4
|
+
value: string;
|
|
5
|
+
order: number;
|
|
6
|
+
options: ({
|
|
7
|
+
displayName: string;
|
|
8
|
+
name: string;
|
|
9
|
+
type: string;
|
|
10
|
+
default: string;
|
|
11
|
+
description: string;
|
|
12
|
+
options?: undefined;
|
|
13
|
+
displayOptions?: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
displayName: string;
|
|
16
|
+
name: string;
|
|
17
|
+
type: string;
|
|
18
|
+
default: string;
|
|
19
|
+
options: {
|
|
20
|
+
name: string;
|
|
21
|
+
value: string;
|
|
22
|
+
}[];
|
|
23
|
+
description?: undefined;
|
|
24
|
+
displayOptions?: undefined;
|
|
25
|
+
} | {
|
|
26
|
+
displayName: string;
|
|
27
|
+
name: string;
|
|
28
|
+
type: string;
|
|
29
|
+
default: string;
|
|
30
|
+
description: string;
|
|
31
|
+
displayOptions: {
|
|
32
|
+
show: {
|
|
33
|
+
modelName: string[];
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
options?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
displayName: string;
|
|
39
|
+
name: string;
|
|
40
|
+
type: string;
|
|
41
|
+
default: number;
|
|
42
|
+
options: {
|
|
43
|
+
name: string;
|
|
44
|
+
value: number;
|
|
45
|
+
}[];
|
|
46
|
+
description?: undefined;
|
|
47
|
+
displayOptions?: undefined;
|
|
48
|
+
} | {
|
|
49
|
+
displayName: string;
|
|
50
|
+
name: string;
|
|
51
|
+
type: string;
|
|
52
|
+
default: number;
|
|
53
|
+
description: string;
|
|
54
|
+
options?: undefined;
|
|
55
|
+
displayOptions?: undefined;
|
|
56
|
+
})[];
|
|
57
|
+
call(this: IExecuteFunctions, index: number): Promise<{
|
|
58
|
+
imageUrl: string;
|
|
59
|
+
mediaId: string;
|
|
60
|
+
status: number;
|
|
61
|
+
width: number | undefined;
|
|
62
|
+
height: number | undefined;
|
|
63
|
+
failCode: string;
|
|
64
|
+
}>;
|
|
65
|
+
};
|
|
66
|
+
export default GoogleFlowImageGenerate;
|
|
67
|
+
//# sourceMappingURL=imageGenerate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imageGenerate.d.ts","sourceRoot":"","sources":["../../../../src/nodes/googleflow/resource/imageGenerate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA6HR,iBAAiB,SAAS,MAAM;;;;;;;;CAkDpD,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|