mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor(core): Introduce overload for record-type node parameter (no-changelog) (#4648)
* 📘 Set up overload * 🔥 Remove inferrable record assertions * 👕 Fix semicolon * 👕 Fix another semicolon
This commit is contained in:
@@ -319,7 +319,7 @@ export class Odoo implements INodeType {
|
||||
try {
|
||||
if (resource === 'contact') {
|
||||
if (operation === 'create') {
|
||||
let additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
let additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
|
||||
if (additionalFields.address) {
|
||||
const addressFields = (additionalFields.address as IDataObject).value as IDataObject;
|
||||
@@ -365,7 +365,7 @@ export class Odoo implements INodeType {
|
||||
|
||||
if (operation === 'get') {
|
||||
const contactId = this.getNodeParameter('contactId', i) as string;
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
const fields = (options.fieldsList as IDataObject[]) || [];
|
||||
responseData = await odooGet.call(
|
||||
this,
|
||||
@@ -382,7 +382,7 @@ export class Odoo implements INodeType {
|
||||
|
||||
if (operation === 'getAll') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i);
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
const fields = (options.fieldsList as IDataObject[]) || [];
|
||||
if (returnAll) {
|
||||
responseData = await odooGetAll.call(
|
||||
@@ -415,7 +415,7 @@ export class Odoo implements INodeType {
|
||||
|
||||
if (operation === 'update') {
|
||||
const contactId = this.getNodeParameter('contactId', i) as string;
|
||||
let updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||
let updateFields = this.getNodeParameter('updateFields', i);
|
||||
|
||||
if (updateFields.address) {
|
||||
const addressFields = (updateFields.address as IDataObject).value as IDataObject;
|
||||
@@ -474,7 +474,7 @@ export class Odoo implements INodeType {
|
||||
|
||||
if (operation === 'get') {
|
||||
const customResourceId = this.getNodeParameter('customResourceId', i) as string;
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
const fields = (options.fieldsList as IDataObject[]) || [];
|
||||
responseData = await odooGet.call(
|
||||
this,
|
||||
@@ -491,7 +491,7 @@ export class Odoo implements INodeType {
|
||||
|
||||
if (operation === 'getAll') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i);
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
const fields = (options.fieldsList as IDataObject[]) || [];
|
||||
const filter = this.getNodeParameter('filterRequest', i) as IOdooFilterOperations;
|
||||
if (returnAll) {
|
||||
@@ -542,7 +542,7 @@ export class Odoo implements INodeType {
|
||||
|
||||
if (resource === 'note') {
|
||||
if (operation === 'create') {
|
||||
// const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
// const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
const memo = this.getNodeParameter('memo', i) as string;
|
||||
const fields: IDataObject = {
|
||||
memo,
|
||||
@@ -576,7 +576,7 @@ export class Odoo implements INodeType {
|
||||
|
||||
if (operation === 'get') {
|
||||
const noteId = this.getNodeParameter('noteId', i) as string;
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
const fields = (options.fieldsList as IDataObject[]) || [];
|
||||
responseData = await odooGet.call(
|
||||
this,
|
||||
@@ -593,7 +593,7 @@ export class Odoo implements INodeType {
|
||||
|
||||
if (operation === 'getAll') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i);
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
const fields = (options.fieldsList as IDataObject[]) || [];
|
||||
if (returnAll) {
|
||||
responseData = await odooGetAll.call(
|
||||
@@ -646,7 +646,7 @@ export class Odoo implements INodeType {
|
||||
|
||||
if (resource === 'opportunity') {
|
||||
if (operation === 'create') {
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject;
|
||||
const additionalFields = this.getNodeParameter('additionalFields', i);
|
||||
const name = this.getNodeParameter('opportunityName', i) as string;
|
||||
const fields: IDataObject = {
|
||||
name,
|
||||
@@ -681,7 +681,7 @@ export class Odoo implements INodeType {
|
||||
|
||||
if (operation === 'get') {
|
||||
const opportunityId = this.getNodeParameter('opportunityId', i) as string;
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
const fields = (options.fieldsList as IDataObject[]) || [];
|
||||
responseData = await odooGet.call(
|
||||
this,
|
||||
@@ -698,7 +698,7 @@ export class Odoo implements INodeType {
|
||||
|
||||
if (operation === 'getAll') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i);
|
||||
const options = this.getNodeParameter('options', i) as IDataObject;
|
||||
const options = this.getNodeParameter('options', i);
|
||||
const fields = (options.fieldsList as IDataObject[]) || [];
|
||||
if (returnAll) {
|
||||
responseData = await odooGetAll.call(
|
||||
@@ -731,7 +731,7 @@ export class Odoo implements INodeType {
|
||||
|
||||
if (operation === 'update') {
|
||||
const opportunityId = this.getNodeParameter('opportunityId', i) as string;
|
||||
const updateFields = this.getNodeParameter('updateFields', i) as IDataObject;
|
||||
const updateFields = this.getNodeParameter('updateFields', i);
|
||||
responseData = await odooUpdate.call(
|
||||
this,
|
||||
db,
|
||||
|
||||
Reference in New Issue
Block a user