mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(OpenAI Node): Overhaul (#8335)
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import FormData from 'form-data';
|
||||
import type { BinaryFileType, JsonObject } from './Interfaces';
|
||||
import type { BinaryFileType, IDisplayOptions, INodeProperties, JsonObject } from './Interfaces';
|
||||
import { ApplicationError } from './errors/application.error';
|
||||
|
||||
import { merge } from 'lodash';
|
||||
|
||||
const readStreamClasses = new Set(['ReadStream', 'Readable', 'ReadableStream']);
|
||||
|
||||
// NOTE: BigInt.prototype.toJSON is not available, which causes JSON.stringify to throw an error
|
||||
@@ -165,3 +167,15 @@ export const removeCircularRefs = (obj: JsonObject, seen = new Set()) => {
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export function updateDisplayOptions(
|
||||
displayOptions: IDisplayOptions,
|
||||
properties: INodeProperties[],
|
||||
) {
|
||||
return properties.map((nodeProperty) => {
|
||||
return {
|
||||
...nodeProperty,
|
||||
displayOptions: merge({}, nodeProperty.displayOptions, displayOptions),
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user