import { INodeExecutionData, IExecuteFunctions } from 'n8n-workflow'; import { INetSuiteCredentials } from './auth.types'; import type { ILogger } from './logger.types'; export interface INetSuiteOperationOptions { item?: INodeExecutionData; fns: IExecuteFunctions; credentials: INetSuiteCredentials; itemIndex: number; maxRetries?: number; logger?: ILogger; } export type NetSuiteOperationType = 'listRecords' | 'getRecord' | 'getMetadata' | 'insertRecord' | 'updateRecord' | 'upsertRecord' | 'removeRecord' | 'runSuiteQL' | 'rawRequest' | 'callRestlet'; export type NetSuiteHttpMethod = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE' | 'HEAD' | 'OPTIONS'; export interface INetSuiteRecordOptions { recordType: string; internalId?: string; expandSubResources?: boolean; simpleEnumFormat?: boolean; fields?: string; query?: string; returnAll?: boolean; limit?: number; offset?: number; } export interface INetSuiteError { type?: string; title?: string; status?: number; 'o:errorDetails'?: Array<{ detail: string; 'o:errorCode': string; 'o:errorPath'?: string; 'o:urlPath'?: string; 'o:errorHeader'?: string; 'o:errorQueryParam'?: string; }>; } export interface INetSuiteEnhancedError extends Error { status?: number; statusCode?: number; body?: INetSuiteError; errorCode?: string; errorPath?: string; retryAfter?: string; isIdempotent?: boolean; } export interface INetSuiteRequestCache { [key: string]: { timestamp: number; status: 'pending' | 'completed' | 'failed'; result?: any; error?: any; }; } export interface IIdempotencyOptions { enabled: boolean; keyPrefix?: string; ttl?: number; }