@n8n/n8n-nodes-langchain 2.18.1 → 2.18.3

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.
Files changed (137) hide show
  1. package/dist/known/credentials.json +1 -0
  2. package/dist/known/nodes.json +4 -0
  3. package/dist/node-definitions/.nodes-hash +1 -1
  4. package/dist/node-definitions/index.ts +4 -0
  5. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/index.ts +3 -1
  6. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/index.schema.js +32 -0
  7. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/index.ts +30 -0
  8. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_audio/index.schema.js +22 -0
  9. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_audio/index.ts +15 -0
  10. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_audio/operation_analyze.schema.js +34 -0
  11. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_audio/operation_analyze.ts +69 -0
  12. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_audio/operation_transcribe.schema.js +33 -0
  13. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_audio/operation_transcribe.ts +66 -0
  14. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_document/index.schema.js +18 -0
  15. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_document/index.ts +10 -0
  16. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_document/operation_analyze.schema.js +34 -0
  17. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_document/operation_analyze.ts +69 -0
  18. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_file/index.schema.js +18 -0
  19. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_file/index.ts +10 -0
  20. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_file/operation_upload.schema.js +30 -0
  21. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_file/operation_upload.ts +43 -0
  22. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_file_search/index.schema.js +26 -0
  23. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_file_search/index.ts +21 -0
  24. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_file_search/operation_create_store.schema.js +28 -0
  25. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_file_search/operation_create_store.ts +30 -0
  26. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_file_search/operation_delete_store.schema.js +29 -0
  27. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_file_search/operation_delete_store.ts +35 -0
  28. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_file_search/operation_list_stores.schema.js +29 -0
  29. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_file_search/operation_list_stores.ts +35 -0
  30. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_file_search/operation_upload_to_store.schema.js +32 -0
  31. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_file_search/operation_upload_to_store.ts +51 -0
  32. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_image/index.schema.js +24 -0
  33. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_image/index.ts +18 -0
  34. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_image/operation_analyze.schema.js +34 -0
  35. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_image/operation_analyze.ts +69 -0
  36. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_image/operation_edit.schema.js +31 -0
  37. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_image/operation_edit.ts +61 -0
  38. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_image/operation_generate.schema.js +30 -0
  39. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_image/operation_generate.ts +51 -0
  40. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_text/index.schema.js +18 -0
  41. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_text/index.ts +10 -0
  42. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_text/operation_message.schema.js +33 -0
  43. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_text/operation_message.ts +153 -0
  44. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_video/index.schema.js +24 -0
  45. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_video/index.ts +18 -0
  46. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_video/operation_analyze.schema.js +34 -0
  47. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_video/operation_analyze.ts +69 -0
  48. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_video/operation_download.schema.js +29 -0
  49. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_video/operation_download.ts +41 -0
  50. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_video/operation_generate.schema.js +31 -0
  51. package/dist/node-definitions/nodes/n8n-nodes-langchain/googleGemini/v12/resource_video/operation_generate.ts +68 -0
  52. package/dist/node-definitions/nodes/n8n-nodes-langchain/lmChatGoogleGemini/index.ts +3 -1
  53. package/dist/node-definitions/nodes/n8n-nodes-langchain/lmChatGoogleGemini/v11.schema.js +25 -0
  54. package/dist/node-definitions/nodes/n8n-nodes-langchain/lmChatGoogleGemini/v11.ts +69 -0
  55. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/index.ts +12 -0
  56. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/v1/index.schema.js +26 -0
  57. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/v1/index.ts +21 -0
  58. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/v1/resource_audio/index.schema.js +18 -0
  59. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/v1/resource_audio/index.ts +10 -0
  60. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/v1/resource_audio/operation_text_to_speech.schema.js +32 -0
  61. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/v1/resource_audio/operation_text_to_speech.ts +75 -0
  62. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/v1/resource_image/index.schema.js +18 -0
  63. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/v1/resource_image/index.ts +10 -0
  64. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/v1/resource_image/operation_generate.schema.js +33 -0
  65. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/v1/resource_image/operation_generate.ts +64 -0
  66. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/v1/resource_text/index.schema.js +18 -0
  67. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/v1/resource_text/index.ts +10 -0
  68. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/v1/resource_text/operation_message.schema.js +31 -0
  69. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/v1/resource_text/operation_message.ts +82 -0
  70. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/v1/resource_video/index.schema.js +22 -0
  71. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/v1/resource_video/index.ts +15 -0
  72. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/v1/resource_video/operation_image_to_video.schema.js +36 -0
  73. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/v1/resource_video/operation_image_to_video.ts +103 -0
  74. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/v1/resource_video/operation_text_to_video.schema.js +33 -0
  75. package/dist/node-definitions/nodes/n8n-nodes-langchain/minimax/v1/resource_video/operation_text_to_video.ts +60 -0
  76. package/dist/nodes/llms/LmChatGoogleGemini/LmChatGoogleGemini.node.js +65 -48
  77. package/dist/nodes/llms/LmChatGoogleGemini/LmChatGoogleGemini.node.js.map +1 -1
  78. package/dist/nodes/vendors/GoogleGemini/actions/descriptions.js +3 -0
  79. package/dist/nodes/vendors/GoogleGemini/actions/descriptions.js.map +1 -1
  80. package/dist/nodes/vendors/GoogleGemini/actions/image/generate.operation.js +9 -1
  81. package/dist/nodes/vendors/GoogleGemini/actions/image/generate.operation.js.map +1 -1
  82. package/dist/nodes/vendors/GoogleGemini/actions/text/message.operation.js +6 -1
  83. package/dist/nodes/vendors/GoogleGemini/actions/text/message.operation.js.map +1 -1
  84. package/dist/nodes/vendors/GoogleGemini/actions/versionDescription.js +2 -2
  85. package/dist/nodes/vendors/GoogleGemini/actions/versionDescription.js.map +1 -1
  86. package/dist/nodes/vendors/GoogleGemini/methods/listSearch.js +3 -0
  87. package/dist/nodes/vendors/GoogleGemini/methods/listSearch.js.map +1 -1
  88. package/dist/nodes/vendors/MiniMax/MiniMax.node.d.ts +5 -0
  89. package/dist/nodes/vendors/MiniMax/MiniMax.node.js +15 -0
  90. package/dist/nodes/vendors/MiniMax/MiniMax.node.js.map +1 -0
  91. package/dist/nodes/vendors/MiniMax/actions/audio/index.d.ts +4 -0
  92. package/dist/nodes/vendors/MiniMax/actions/audio/index.js +62 -0
  93. package/dist/nodes/vendors/MiniMax/actions/audio/index.js.map +1 -0
  94. package/dist/nodes/vendors/MiniMax/actions/audio/tts.operation.d.ts +29 -0
  95. package/dist/nodes/vendors/MiniMax/actions/audio/tts.operation.js +252 -0
  96. package/dist/nodes/vendors/MiniMax/actions/audio/tts.operation.js.map +1 -0
  97. package/dist/nodes/vendors/MiniMax/actions/image/generate.operation.d.ts +29 -0
  98. package/dist/nodes/vendors/MiniMax/actions/image/generate.operation.js +159 -0
  99. package/dist/nodes/vendors/MiniMax/actions/image/generate.operation.js.map +1 -0
  100. package/dist/nodes/vendors/MiniMax/actions/image/index.d.ts +4 -0
  101. package/dist/nodes/vendors/MiniMax/actions/image/index.js +62 -0
  102. package/dist/nodes/vendors/MiniMax/actions/image/index.js.map +1 -0
  103. package/dist/nodes/vendors/MiniMax/actions/node.type.d.ts +9 -0
  104. package/dist/nodes/vendors/MiniMax/actions/node.type.js +3 -0
  105. package/dist/nodes/vendors/MiniMax/actions/node.type.js.map +1 -0
  106. package/dist/nodes/vendors/MiniMax/actions/router.d.ts +2 -0
  107. package/dist/nodes/vendors/MiniMax/actions/router.js +86 -0
  108. package/dist/nodes/vendors/MiniMax/actions/router.js.map +1 -0
  109. package/dist/nodes/vendors/MiniMax/actions/text/index.d.ts +4 -0
  110. package/dist/nodes/vendors/MiniMax/actions/text/index.js +62 -0
  111. package/dist/nodes/vendors/MiniMax/actions/text/index.js.map +1 -0
  112. package/dist/nodes/vendors/MiniMax/actions/text/message.operation.d.ts +29 -0
  113. package/dist/nodes/vendors/MiniMax/actions/text/message.operation.js +287 -0
  114. package/dist/nodes/vendors/MiniMax/actions/text/message.operation.js.map +1 -0
  115. package/dist/nodes/vendors/MiniMax/actions/versionDescription.d.ts +2 -0
  116. package/dist/nodes/vendors/MiniMax/actions/versionDescription.js +118 -0
  117. package/dist/nodes/vendors/MiniMax/actions/versionDescription.js.map +1 -0
  118. package/dist/nodes/vendors/MiniMax/actions/video/generate.i2v.operation.d.ts +29 -0
  119. package/dist/nodes/vendors/MiniMax/actions/video/generate.i2v.operation.js +324 -0
  120. package/dist/nodes/vendors/MiniMax/actions/video/generate.i2v.operation.js.map +1 -0
  121. package/dist/nodes/vendors/MiniMax/actions/video/generate.t2v.operation.d.ts +29 -0
  122. package/dist/nodes/vendors/MiniMax/actions/video/generate.t2v.operation.js +161 -0
  123. package/dist/nodes/vendors/MiniMax/actions/video/generate.t2v.operation.js.map +1 -0
  124. package/dist/nodes/vendors/MiniMax/actions/video/index.d.ts +5 -0
  125. package/dist/nodes/vendors/MiniMax/actions/video/index.js +71 -0
  126. package/dist/nodes/vendors/MiniMax/actions/video/index.js.map +1 -0
  127. package/dist/nodes/vendors/MiniMax/helpers/interfaces.d.ts +88 -0
  128. package/dist/nodes/vendors/MiniMax/helpers/interfaces.js +3 -0
  129. package/dist/nodes/vendors/MiniMax/helpers/interfaces.js.map +1 -0
  130. package/dist/nodes/vendors/MiniMax/minimax.svg +10 -0
  131. package/dist/nodes/vendors/MiniMax/transport/index.d.ts +14 -0
  132. package/dist/nodes/vendors/MiniMax/transport/index.js +60 -0
  133. package/dist/nodes/vendors/MiniMax/transport/index.js.map +1 -0
  134. package/dist/typecheck.tsbuildinfo +1 -1
  135. package/dist/types/credentials.json +1 -1
  136. package/dist/types/nodes.json +3 -2
  137. package/package.json +10 -9
@@ -0,0 +1,324 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.execute = execute;
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ const transport_1 = require("../../transport");
7
+ const properties = [
8
+ {
9
+ displayName: 'Model',
10
+ name: 'modelId',
11
+ type: 'options',
12
+ options: [
13
+ {
14
+ name: 'I2V-01',
15
+ value: 'I2V-01',
16
+ description: 'Standard image-to-video model',
17
+ },
18
+ {
19
+ name: 'I2V-01-Director',
20
+ value: 'I2V-01-Director',
21
+ description: 'Image-to-video with camera control commands',
22
+ },
23
+ {
24
+ name: 'I2V-01-Live',
25
+ value: 'I2V-01-live',
26
+ description: 'Image-to-video live model',
27
+ },
28
+ {
29
+ name: 'MiniMax-Hailuo-02',
30
+ value: 'MiniMax-Hailuo-02',
31
+ description: 'Model supporting higher resolution and longer duration',
32
+ },
33
+ {
34
+ name: 'MiniMax-Hailuo-2.3',
35
+ value: 'MiniMax-Hailuo-2.3',
36
+ description: 'Latest model with enhanced realism',
37
+ },
38
+ {
39
+ name: 'MiniMax-Hailuo-2.3-Fast',
40
+ value: 'MiniMax-Hailuo-2.3-Fast',
41
+ description: 'Faster image-to-video model for value and efficiency',
42
+ },
43
+ ],
44
+ default: 'MiniMax-Hailuo-2.3',
45
+ description: 'The model to use for video generation',
46
+ },
47
+ {
48
+ displayName: 'Image Input Type',
49
+ name: 'imageInputType',
50
+ type: 'options',
51
+ options: [
52
+ { name: 'URL', value: 'url' },
53
+ { name: 'Binary File', value: 'binary' },
54
+ ],
55
+ default: 'url',
56
+ description: 'How to provide the first frame image',
57
+ },
58
+ {
59
+ displayName: 'Image URL',
60
+ name: 'imageUrl',
61
+ type: 'string',
62
+ default: '',
63
+ required: true,
64
+ placeholder: 'https://example.com/image.jpg',
65
+ description: 'Public URL of the image to use as first frame (JPG, JPEG, PNG, WebP, <20MB)',
66
+ displayOptions: {
67
+ show: {
68
+ imageInputType: ['url'],
69
+ },
70
+ },
71
+ },
72
+ {
73
+ displayName: 'Input Data Field Name',
74
+ name: 'binaryPropertyName',
75
+ type: 'string',
76
+ default: 'data',
77
+ required: true,
78
+ placeholder: 'e.g. data',
79
+ hint: 'The name of the input field containing the binary image data',
80
+ typeOptions: {
81
+ binaryDataProperty: true,
82
+ },
83
+ displayOptions: {
84
+ show: {
85
+ imageInputType: ['binary'],
86
+ },
87
+ },
88
+ },
89
+ {
90
+ displayName: 'Prompt',
91
+ name: 'prompt',
92
+ type: 'string',
93
+ typeOptions: {
94
+ rows: 4,
95
+ },
96
+ default: '',
97
+ description: 'Optional text description of the video (max 2000 characters). Camera movements can be controlled using [command] syntax.',
98
+ placeholder: 'e.g. The subject smiles and waves at the camera [Zoom in]',
99
+ },
100
+ {
101
+ displayName: 'Duration (Seconds)',
102
+ name: 'duration',
103
+ type: 'options',
104
+ options: [
105
+ { name: '6 Seconds', value: 6 },
106
+ { name: '10 Seconds', value: 10 },
107
+ ],
108
+ default: 6,
109
+ description: 'Duration of the generated video',
110
+ },
111
+ {
112
+ displayName: 'Resolution',
113
+ name: 'resolution',
114
+ type: 'options',
115
+ options: [
116
+ { name: '512P', value: '512P' },
117
+ { name: '720P', value: '720P' },
118
+ { name: '768P', value: '768P' },
119
+ { name: '1080P', value: '1080P' },
120
+ ],
121
+ default: '768P',
122
+ description: 'Resolution of the generated video. Available options depend on the model.',
123
+ },
124
+ {
125
+ displayName: 'Download Video',
126
+ name: 'downloadVideo',
127
+ type: 'boolean',
128
+ default: true,
129
+ description: 'Whether to download the generated video as binary data. When disabled, only the video URL is returned.',
130
+ },
131
+ {
132
+ displayName: 'Options',
133
+ name: 'options',
134
+ placeholder: 'Add Option',
135
+ type: 'collection',
136
+ default: {},
137
+ options: [
138
+ {
139
+ displayName: 'Prompt Optimizer',
140
+ name: 'promptOptimizer',
141
+ type: 'boolean',
142
+ default: true,
143
+ description: 'Whether to automatically optimize the prompt',
144
+ },
145
+ {
146
+ displayName: 'Last Frame Image Input Type',
147
+ name: 'lastFrameInputType',
148
+ type: 'options',
149
+ options: [
150
+ { name: 'None', value: 'none' },
151
+ { name: 'URL', value: 'url' },
152
+ { name: 'Binary File', value: 'binary' },
153
+ ],
154
+ default: 'none',
155
+ description: 'Provide a last frame image to generate a first-and-last-frame video. Only supported by MiniMax-Hailuo-2.3 and MiniMax-Hailuo-02.',
156
+ },
157
+ {
158
+ displayName: 'Last Frame Image URL',
159
+ name: 'lastFrameImageUrl',
160
+ type: 'string',
161
+ default: '',
162
+ placeholder: 'https://example.com/last-frame.jpg',
163
+ displayOptions: {
164
+ show: {
165
+ lastFrameInputType: ['url'],
166
+ },
167
+ },
168
+ },
169
+ {
170
+ displayName: 'Last Frame Data Field Name',
171
+ name: 'lastFrameBinaryPropertyName',
172
+ type: 'string',
173
+ default: 'lastFrame',
174
+ placeholder: 'e.g. lastFrame',
175
+ typeOptions: {
176
+ binaryDataProperty: true,
177
+ },
178
+ displayOptions: {
179
+ show: {
180
+ lastFrameInputType: ['binary'],
181
+ },
182
+ },
183
+ },
184
+ {
185
+ displayName: 'Subject Reference Input Type',
186
+ name: 'subjectReferenceInputType',
187
+ type: 'options',
188
+ options: [
189
+ { name: 'None', value: 'none' },
190
+ { name: 'URL', value: 'url' },
191
+ { name: 'Binary File', value: 'binary' },
192
+ ],
193
+ default: 'none',
194
+ description: 'Provide a face photo for facial consistency in the generated video. Only supported by MiniMax-Hailuo-2.3.',
195
+ },
196
+ {
197
+ displayName: 'Subject Reference Image URL',
198
+ name: 'subjectReferenceImageUrl',
199
+ type: 'string',
200
+ default: '',
201
+ placeholder: 'https://example.com/face.jpg',
202
+ displayOptions: {
203
+ show: {
204
+ subjectReferenceInputType: ['url'],
205
+ },
206
+ },
207
+ },
208
+ {
209
+ displayName: 'Subject Reference Data Field Name',
210
+ name: 'subjectReferenceBinaryPropertyName',
211
+ type: 'string',
212
+ default: 'subjectReference',
213
+ placeholder: 'e.g. subjectReference',
214
+ typeOptions: {
215
+ binaryDataProperty: true,
216
+ },
217
+ displayOptions: {
218
+ show: {
219
+ subjectReferenceInputType: ['binary'],
220
+ },
221
+ },
222
+ },
223
+ ],
224
+ },
225
+ ];
226
+ const displayOptions = {
227
+ show: {
228
+ resource: ['video'],
229
+ operation: ['imageToVideo'],
230
+ },
231
+ };
232
+ exports.description = (0, n8n_workflow_1.updateDisplayOptions)(displayOptions, properties);
233
+ async function resolveImageInput(executeFunctions, itemIndex, inputType, urlValue, binaryPropertyName) {
234
+ if (inputType === 'binary') {
235
+ const binaryData = executeFunctions.helpers.assertBinaryData(itemIndex, binaryPropertyName);
236
+ const buffer = await executeFunctions.helpers.getBinaryDataBuffer(itemIndex, binaryPropertyName);
237
+ return `data:${binaryData.mimeType};base64,${buffer.toString('base64')}`;
238
+ }
239
+ return urlValue;
240
+ }
241
+ async function execute(itemIndex) {
242
+ const model = this.getNodeParameter('modelId', itemIndex);
243
+ const imageInputType = this.getNodeParameter('imageInputType', itemIndex);
244
+ const prompt = this.getNodeParameter('prompt', itemIndex, '');
245
+ const duration = this.getNodeParameter('duration', itemIndex);
246
+ const resolution = this.getNodeParameter('resolution', itemIndex);
247
+ const downloadVideo = this.getNodeParameter('downloadVideo', itemIndex, true);
248
+ const options = this.getNodeParameter('options', itemIndex, {});
249
+ let firstFrameImage;
250
+ if (imageInputType === 'binary') {
251
+ const binaryPropertyName = this.getNodeParameter('binaryPropertyName', itemIndex);
252
+ firstFrameImage = await resolveImageInput(this, itemIndex, 'binary', '', binaryPropertyName);
253
+ }
254
+ else {
255
+ const imageUrl = this.getNodeParameter('imageUrl', itemIndex);
256
+ firstFrameImage = imageUrl;
257
+ }
258
+ const body = {
259
+ model,
260
+ first_frame_image: firstFrameImage,
261
+ duration,
262
+ resolution,
263
+ };
264
+ if (prompt) {
265
+ body.prompt = prompt;
266
+ }
267
+ if (options.promptOptimizer !== undefined) {
268
+ body.prompt_optimizer = options.promptOptimizer;
269
+ }
270
+ const lastFrameInputType = options.lastFrameInputType || 'none';
271
+ if (lastFrameInputType !== 'none') {
272
+ body.last_frame_image = await resolveImageInput(this, itemIndex, lastFrameInputType, options.lastFrameImageUrl || '', options.lastFrameBinaryPropertyName || 'lastFrame');
273
+ }
274
+ const subjectRefInputType = options.subjectReferenceInputType || 'none';
275
+ if (subjectRefInputType !== 'none') {
276
+ body.subject_reference = [
277
+ {
278
+ image: await resolveImageInput(this, itemIndex, subjectRefInputType, options.subjectReferenceImageUrl || '', options.subjectReferenceBinaryPropertyName || 'subjectReference'),
279
+ },
280
+ ];
281
+ }
282
+ const createResponse = (await transport_1.apiRequest.call(this, 'POST', '/video_generation', {
283
+ body,
284
+ }));
285
+ if (createResponse.base_resp?.status_code !== 0) {
286
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Failed to create video task: ${createResponse.base_resp?.status_msg || 'Unknown error'}`);
287
+ }
288
+ const taskId = createResponse.task_id;
289
+ if (!taskId) {
290
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No task_id returned from video generation request');
291
+ }
292
+ const { fileId } = await transport_1.pollVideoTask.call(this, taskId);
293
+ const videoUrl = await transport_1.getVideoDownloadUrl.call(this, fileId);
294
+ const jsonData = {
295
+ videoUrl,
296
+ taskId,
297
+ fileId,
298
+ };
299
+ if (downloadVideo && videoUrl) {
300
+ const videoResponse = await this.helpers.httpRequest({
301
+ method: 'GET',
302
+ url: videoUrl,
303
+ encoding: 'arraybuffer',
304
+ returnFullResponse: true,
305
+ });
306
+ const contentType = videoResponse.headers?.['content-type'] || 'video/mp4';
307
+ const fileContent = Buffer.from(videoResponse.body);
308
+ const binaryData = await this.helpers.prepareBinaryData(fileContent, 'video.mp4', contentType);
309
+ return [
310
+ {
311
+ binary: { data: binaryData },
312
+ json: jsonData,
313
+ pairedItem: { item: itemIndex },
314
+ },
315
+ ];
316
+ }
317
+ return [
318
+ {
319
+ json: jsonData,
320
+ pairedItem: { item: itemIndex },
321
+ },
322
+ ];
323
+ }
324
+ //# sourceMappingURL=generate.i2v.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.i2v.operation.js","sourceRoot":"","sources":["../../../../../../nodes/vendors/MiniMax/actions/video/generate.i2v.operation.ts"],"names":[],"mappings":";;;AAsQA,0BAqHC;AArXD,+CAAwE;AAGxE,+CAAiF;AAEjF,MAAM,UAAU,GAAsB;IACrC;QACC,WAAW,EAAE,OAAO;QACpB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,SAAS;QACf,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,+BAA+B;aAC5C;YACD;gBACC,IAAI,EAAE,iBAAiB;gBACvB,KAAK,EAAE,iBAAiB;gBACxB,WAAW,EAAE,6CAA6C;aAC1D;YACD;gBACC,IAAI,EAAE,aAAa;gBACnB,KAAK,EAAE,aAAa;gBACpB,WAAW,EAAE,2BAA2B;aACxC;YACD;gBACC,IAAI,EAAE,mBAAmB;gBACzB,KA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AAO,EAAE,EACd,mDAAmD,CACnD,CAAC;IACH,CAAC;IAED,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,yBAAa,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,MAAM,+BAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAE9D,MAAM,QAAQ,GAAgB;QAC7B,QAAQ;QACR,MAAM;QACN,MAAM;KACN,CAAC;IAEF,IAAI,aAAa,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;YACpD,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,QAAQ;YACb,QAAQ,EAAE,aAAa;YACvB,kBAAkB,EAAE,IAAI;SACxB,CAAC,CAAC;QAEH,MAAM,WAAW,GAAI,aAAa,CAAC,OAAO,EAAE,CAAC,cAAc,CAAY,IAAI,WAAW,CAAC;QACvF,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,IAAmB,CAAC,CAAC;QACnE,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;QAE/F,OAAO;YACN;gBACC,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;gBAC5B,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;aAC/B;SACD,CAAC;IACH,CAAC;IAED,OAAO;QACN;YACC,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;SAC/B;KACD,CAAC;AACH,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeProperties } from 'n8n-workflow';
2
+ export declare const description: {
3
+ displayOptions: import("n8n-workflow").IDisplayOptions;
4
+ displayName: string;
5
+ name: string;
6
+ type: import("n8n-workflow").NodePropertyTypes;
7
+ typeOptions?: import("n8n-workflow").INodePropertyTypeOptions;
8
+ default: import("n8n-workflow").NodeParameterValueType;
9
+ description?: string;
10
+ hint?: string;
11
+ builderHint?: import("n8n-workflow").IParameterBuilderHint;
12
+ disabledOptions?: import("n8n-workflow").IDisplayOptions;
13
+ options?: Array<import("n8n-workflow").INodePropertyOptions | INodeProperties | import("n8n-workflow").INodePropertyCollection>;
14
+ placeholder?: string;
15
+ isNodeSetting?: boolean;
16
+ noDataExpression?: boolean;
17
+ required?: boolean;
18
+ routing?: import("n8n-workflow").INodePropertyRouting;
19
+ credentialTypes?: Array<"extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth">;
20
+ extractValue?: import("n8n-workflow").INodePropertyValueExtractor;
21
+ modes?: import("n8n-workflow").INodePropertyMode[];
22
+ requiresDataPath?: "single" | "multiple";
23
+ doNotInherit?: boolean;
24
+ validateType?: import("n8n-workflow").FieldType;
25
+ ignoreValidationDuringExecution?: boolean;
26
+ allowArbitraryValues?: boolean;
27
+ resolvableField?: boolean;
28
+ }[];
29
+ export declare function execute(this: IExecuteFunctions, itemIndex: number): Promise<INodeExecutionData[]>;
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.description = void 0;
4
+ exports.execute = execute;
5
+ const n8n_workflow_1 = require("n8n-workflow");
6
+ const transport_1 = require("../../transport");
7
+ const properties = [
8
+ {
9
+ displayName: 'Model',
10
+ name: 'modelId',
11
+ type: 'options',
12
+ options: [
13
+ {
14
+ name: 'MiniMax-Hailuo-2.3',
15
+ value: 'MiniMax-Hailuo-2.3',
16
+ description: 'Latest video generation model with enhanced realism',
17
+ },
18
+ {
19
+ name: 'MiniMax-Hailuo-02',
20
+ value: 'MiniMax-Hailuo-02',
21
+ description: 'Video model supporting higher resolution and longer duration',
22
+ },
23
+ {
24
+ name: 'T2V-01-Director',
25
+ value: 'T2V-01-Director',
26
+ description: 'Text-to-video model with camera control commands',
27
+ },
28
+ {
29
+ name: 'T2V-01',
30
+ value: 'T2V-01',
31
+ description: 'Standard text-to-video model',
32
+ },
33
+ ],
34
+ default: 'MiniMax-Hailuo-2.3',
35
+ description: 'The model to use for video generation',
36
+ },
37
+ {
38
+ displayName: 'Prompt',
39
+ name: 'prompt',
40
+ type: 'string',
41
+ typeOptions: {
42
+ rows: 4,
43
+ },
44
+ default: '',
45
+ required: true,
46
+ description: 'Text description of the video (max 2000 characters). Camera movements can be controlled using [command] syntax, e.g. [Push in], [Pan left].',
47
+ placeholder: 'e.g. A cat playing with a ball of yarn [Static shot]',
48
+ },
49
+ {
50
+ displayName: 'Duration (Seconds)',
51
+ name: 'duration',
52
+ type: 'options',
53
+ options: [
54
+ { name: '6 Seconds', value: 6 },
55
+ { name: '10 Seconds', value: 10 },
56
+ ],
57
+ default: 6,
58
+ description: 'Duration of the generated video',
59
+ },
60
+ {
61
+ displayName: 'Resolution',
62
+ name: 'resolution',
63
+ type: 'options',
64
+ options: [
65
+ { name: '720P', value: '720P' },
66
+ { name: '768P', value: '768P' },
67
+ { name: '1080P', value: '1080P' },
68
+ ],
69
+ default: '768P',
70
+ description: 'Resolution of the generated video. Available options depend on the model.',
71
+ },
72
+ {
73
+ displayName: 'Download Video',
74
+ name: 'downloadVideo',
75
+ type: 'boolean',
76
+ default: true,
77
+ description: 'Whether to download the generated video as binary data. When disabled, only the video URL is returned.',
78
+ },
79
+ {
80
+ displayName: 'Options',
81
+ name: 'options',
82
+ placeholder: 'Add Option',
83
+ type: 'collection',
84
+ default: {},
85
+ options: [
86
+ {
87
+ displayName: 'Prompt Optimizer',
88
+ name: 'promptOptimizer',
89
+ type: 'boolean',
90
+ default: true,
91
+ description: 'Whether to automatically optimize the prompt for better results',
92
+ },
93
+ ],
94
+ },
95
+ ];
96
+ const displayOptions = {
97
+ show: {
98
+ resource: ['video'],
99
+ operation: ['textToVideo'],
100
+ },
101
+ };
102
+ exports.description = (0, n8n_workflow_1.updateDisplayOptions)(displayOptions, properties);
103
+ async function execute(itemIndex) {
104
+ const model = this.getNodeParameter('modelId', itemIndex);
105
+ const prompt = this.getNodeParameter('prompt', itemIndex);
106
+ const duration = this.getNodeParameter('duration', itemIndex);
107
+ const resolution = this.getNodeParameter('resolution', itemIndex);
108
+ const downloadVideo = this.getNodeParameter('downloadVideo', itemIndex, true);
109
+ const options = this.getNodeParameter('options', itemIndex, {});
110
+ const body = {
111
+ model,
112
+ prompt,
113
+ duration,
114
+ resolution,
115
+ };
116
+ if (options.promptOptimizer !== undefined) {
117
+ body.prompt_optimizer = options.promptOptimizer;
118
+ }
119
+ const createResponse = (await transport_1.apiRequest.call(this, 'POST', '/video_generation', {
120
+ body,
121
+ }));
122
+ if (createResponse.base_resp?.status_code !== 0) {
123
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Failed to create video task: ${createResponse.base_resp?.status_msg || 'Unknown error'}`);
124
+ }
125
+ const taskId = createResponse.task_id;
126
+ if (!taskId) {
127
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'No task_id returned from video generation request');
128
+ }
129
+ const { fileId } = await transport_1.pollVideoTask.call(this, taskId);
130
+ const videoUrl = await transport_1.getVideoDownloadUrl.call(this, fileId);
131
+ const jsonData = {
132
+ videoUrl,
133
+ taskId,
134
+ fileId,
135
+ };
136
+ if (downloadVideo && videoUrl) {
137
+ const videoResponse = await this.helpers.httpRequest({
138
+ method: 'GET',
139
+ url: videoUrl,
140
+ encoding: 'arraybuffer',
141
+ returnFullResponse: true,
142
+ });
143
+ const contentType = videoResponse.headers?.['content-type'] || 'video/mp4';
144
+ const fileContent = Buffer.from(videoResponse.body);
145
+ const binaryData = await this.helpers.prepareBinaryData(fileContent, 'video.mp4', contentType);
146
+ return [
147
+ {
148
+ binary: { data: binaryData },
149
+ json: jsonData,
150
+ pairedItem: { item: itemIndex },
151
+ },
152
+ ];
153
+ }
154
+ return [
155
+ {
156
+ json: jsonData,
157
+ pairedItem: { item: itemIndex },
158
+ },
159
+ ];
160
+ }
161
+ //# sourceMappingURL=generate.t2v.operation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.t2v.operation.js","sourceRoot":"","sources":["../../../../../../nodes/vendors/MiniMax/actions/video/generate.t2v.operation.ts"],"names":[],"mappings":";;;AAgHA,0BA+EC;AAzLD,+CAAwE;AAGxE,+CAAiF;AAEjF,MAAM,UAAU,GAAsB;IACrC;QACC,WAAW,EAAE,OAAO;QACpB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,SAAS;QACf,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,oBAAoB;gBAC1B,KAAK,EAAE,oBAAoB;gBAC3B,WAAW,EAAE,qDAAqD;aAClE;YACD;gBACC,IAAI,EAAE,mBAAmB;gBACzB,KAAK,EAAE,mBAAmB;gBAC1B,WAAW,EAAE,8DAA8D;aAC3E;YACD;gBACC,IAAI,EAAE,iBAAiB;gBACvB,KAAK,EAAE,iBAAiB;gBACxB,WAAW,EAAE,kDAAkD;aAC/D;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,8BAA8B;aAC3C;SACD;QACD,OAAO,EAAE,oBAAoB;QAC7B,WAAW,EAAE,uCAAuC;KACpD;IACD;QACC,WAAW,EAAE,QAAQ;QACrB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE;YACZ,IAAI,EAAE,CAAC;SACP;QACD,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,WAAW,EACV,6IAA6I;QAC9I,WAAW,EAAE,sDAAsD;KACnE;IACD;QACC,WAAW,EAAE,oBAAoB;QACjC,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE;YACR,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,EAAE;YAC/B,EAAE,IAAI,EAAE,YAAY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,GAAG,MAAM,+BAAmB,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAE9D,MAAM,QAAQ,GAAgB;QAC7B,QAAQ;QACR,MAAM;QACN,MAAM;KACN,CAAC;IAEF,IAAI,aAAa,IAAI,QAAQ,EAAE,CAAC;QAC/B,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC;YACpD,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,QAAQ;YACb,QAAQ,EAAE,aAAa;YACvB,kBAAkB,EAAE,IAAI;SACxB,CAAC,CAAC;QAEH,MAAM,WAAW,GAAI,aAAa,CAAC,OAAO,EAAE,CAAC,cAAc,CAAY,IAAI,WAAW,CAAC;QACvF,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,IAAmB,CAAC,CAAC;QACnE,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;QAE/F,OAAO;YACN;gBACC,MAAM,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE;gBAC5B,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;aAC/B;SACD,CAAC;IACH,CAAC;IAED,OAAO;QACN;YACC,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;SAC/B;KACD,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ import * as textToVideo from './generate.t2v.operation';
3
+ import * as imageToVideo from './generate.i2v.operation';
4
+ export { textToVideo, imageToVideo };
5
+ export declare const description: INodeProperties[];
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.description = exports.imageToVideo = exports.textToVideo = void 0;
37
+ const textToVideo = __importStar(require("./generate.t2v.operation"));
38
+ exports.textToVideo = textToVideo;
39
+ const imageToVideo = __importStar(require("./generate.i2v.operation"));
40
+ exports.imageToVideo = imageToVideo;
41
+ exports.description = [
42
+ {
43
+ displayName: 'Operation',
44
+ name: 'operation',
45
+ type: 'options',
46
+ noDataExpression: true,
47
+ displayOptions: {
48
+ show: {
49
+ resource: ['video'],
50
+ },
51
+ },
52
+ options: [
53
+ {
54
+ name: 'Generate Video From Text',
55
+ value: 'textToVideo',
56
+ action: 'Generate video from text prompt',
57
+ description: 'Generate a video from a text prompt',
58
+ },
59
+ {
60
+ name: 'Generate Video From Image',
61
+ value: 'imageToVideo',
62
+ action: 'Generate video from image',
63
+ description: 'Generate a video from an image, with optional last frame and subject reference',
64
+ },
65
+ ],
66
+ default: 'textToVideo',
67
+ },
68
+ ...textToVideo.description,
69
+ ...imageToVideo.description,
70
+ ];
71
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../nodes/vendors/MiniMax/actions/video/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,sEAAwD;AAG/C,kCAAW;AAFpB,uEAAyD;AAEnC,oCAAY;AAErB,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,OAAO,CAAC;aACnB;SACD;QACD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,0BAA0B;gBAChC,KAAK,EAAE,aAAa;gBACpB,MAAM,EAAE,iCAAiC;gBACzC,WAAW,EAAE,qCAAqC;aAClD;YACD;gBACC,IAAI,EAAE,2BAA2B;gBACjC,KAAK,EAAE,cAAc;gBACrB,MAAM,EAAE,2BAA2B;gBACnC,WAAW,EACV,gFAAgF;aACjF;SACD;QACD,OAAO,EAAE,aAAa;KACtB;IACD,GAAG,WAAW,CAAC,WAAW;IAC1B,GAAG,YAAY,CAAC,WAAW;CAC3B,CAAC"}