evacommerce
v1.3.97
Published
A sample npm package
Maintainers
Readme
evacommerce
A Node.js package for e-commerce automation and integration.
Installation
npm install evacommerce
Directories and files
src/ ├── browser/ │ ├── electronMethods.js │ ├── navegation.js │ └── puppeteerInputActions.js ├── config/ │ ├── connectToDatabase.js │ ├── createCronInstance.js │ ├── createSequelizeConnection.js │ └── mongoMethods.js ├── core/ │ ├── controllerMethod.js │ ├── machineIdentification.js │ ├── request.js │ ├── startCronExecution.js │ └── startServer.js ├── integrations/ │ ├── facebook/ │ │ └── navigationFacebook.js │ ├── mercadoLivre/ │ │ ├── accessMercadoLivre.js │ │ ├── editionMercadoLivre.js │ │ └── registerMercadoLivre.js │ ├── nuvemShop/ │ │ ├── createNuvemShopInstance.js │ │ └── navigationNuvemShop.js │ └── softUp/ │ └── loginSoftUp.js ├── services/ │ ├── ai/ │ │ ├── chatGpt.js │ │ ├── deepseekMethods.js │ │ └── geminiMethods.js │ └── google/ │ └── googleImageSearch.js └── utils/ ├── consoleMessages.js ├── dateMethods.js ├── downloadImage.js ├── fileMethods.js ├── phoneMethods.js ├── priceMethods.js ├── urlFormatter.js ├── waitForSelector.js └── waitForTimeout.js
Modules and Functions Documentation
Browser Module
electronMethods.js
Functions for handling Electron-specific browser interactions.
- Functions:
openWindowElectron(filePath)- Opens an Electron window with the specified file
- Exports: All Electron window functions
navegation.js
Core navigation utilities for browser automation.
- Functions:
getScreenResolution(page)- Gets the screen resolutiongetChromeExecutablePath()- Gets the Chrome executable path based on platformopenBrowserFirstPage(browser)- Opens or reuses the first page in a browser instanceopenNewPage(browser)- Opens a new browser page with proper viewport settingscreateNavigationInstance(userDataDir, directoryName)- Creates a configured browser instancegetIframe(page, selector)- Gets an iframe from the specified selector
- Exports: All navigation functions
puppeteerInputActions.js
Functions for simulating user input in Puppeteer.
- Functions:
ctrlz(page)- Simulates Ctrl+Z keyboard shortcutctrla(page)- Simulates Ctrl+A keyboard shortcutcopyPasteText(page, selector, inputText)- Copies and pastes text using clipboardclearInputAndWrite(page, selector, inputText, secondElement, timeout)- Clears input field and enters new textwaitForSelectorAndType(page, selector, inputText)- Waits for a selector to appear and types textdeleteFieldValueByBackspace(input)- Deletes field value using backspace
- Exports: All input action functions
Config Module
connectToDatabase.js
Database connection utilities.
- Functions:
connectToDatabase(sequelize)- Establishes and verifies database connection with retry
- Exports: Database connection function
createCronInstance.js
Cron job creation and management.
- Functions:
createCronInstance(cronTime, functionJob, onComplete, start)- Creates a new cron job with timezone settings
- Exports: Cron instance creation function
createSequelizeConnection.js
Sequelize ORM connection management.
- Functions:
createSequelizeConnection({ host, port, username, password, database }, pathModels)- Creates and configures Sequelize connection and loads models
- Exports: Sequelize connection function
mongoMethods.js
MongoDB specific methods.
- Functions:
connectToMongo()- Connects to MongoDB with retry functionalityisDisconnected()- Checks if MongoDB connection is disconnected
- Exports: MongoDB connection functions
Core Module
controllerMethod.js
Controller functions for application flow.
- Functions:
controllerMethod(req, res, schema, methodFunction, parametersMethod)- Handles request validation and executioncontrollerMiddleware(controller)- Middleware for exception handling in controllers
- Exports: Controller helper functions
machineIdentification.js
Machine identification utilities.
- Functions:
getIdMachine()- Gets unique hardware identifier for the machine
- Exports: Machine identification function
request.js
HTTP request utilities.
- Functions:
get(url, options)- Makes GET requestpost(url, data, options)- Makes POST requestput(url, data, options)- Makes PUT requestdelete(url, options)- Makes DELETE request
- Exports: All request functions
startCronExecution.js
Cron execution management.
- Functions:
startCron(cronConfig)- Starts cron executionscheduleCronJob(job, schedule)- Schedules a cron jobstopAllCronJobs()- Stops all running cron jobs
- Exports: All cron execution functions
startServer.js
Server initialization and management.
- Functions:
startServer(port, options)- Starts server on specified portstopServer()- Stops running serverrestartServer()- Restarts running server
- Exports: All server functions
Integrations Module
Facebook Integration
- navigationFacebook.js
- Functions:
loginToFacebook(credentials)- Logs in to FacebookpostToFacebook(content)- Posts content to FacebooknavigateToFacebookPage(pageUrl)- Navigates to specific Facebook page
- Exports: All Facebook navigation functions
- Functions:
MercadoLivre Integration
- accessMercadoLivre.js
- Functions:
loginToML(credentials)- Logs in to MercadoLivrenavigateToMLDashboard()- Navigates to ML dashboard
- Exports: All ML access functions
- Functions:
- editionMercadoLivre.js
- Functions:
editMLListing(listingId, data)- Edits ML listingupdateMLPrice(listingId, price)- Updates price on ML listingupdateMLStock(listingId, stock)- Updates stock on ML listing
- Exports: All ML edition functions
- Functions:
- registerMercadoLivre.js
- Functions:
createMLAccount(userData)- Creates ML accountregisterMLSeller(sellerData)- Registers as ML sellercreateMLListing(productData)- Creates new ML listing
- Exports: All ML registration functions
- Functions:
NuvemShop Integration
- createNuvemShopInstance.js
- Functions:
createNuvemShopStore(storeData)- Creates new NuvemShop storeconfigureNuvemShopStore(storeId, config)- Configures store settings
- Exports: Both NuvemShop store creation functions
- Functions:
- navigationNuvemShop.js
- Functions:
loginToNuvemShop(credentials)- Logs in to NuvemShopaddProductToNuvemShop(productData)- Adds product to NuvemShopeditProductInNuvemShop(productId, data)- Edits product in NuvemShop
- Exports: All NuvemShop navigation functions
- Functions:
SoftUp Integration
- loginSoftUp.js
- Functions:
loginToSoftUp(credentials)- Logs in to SoftUpnavigateToSoftUpDashboard()- Navigates to SoftUp dashboardlogoutFromSoftUp()- Logs out from SoftUp
- Exports: All SoftUp login functions
- Functions:
Services Module
AI Services
- chatGpt.js
- Functions:
generateChatGptResponse(prompt)- Generates response from ChatGPToptimizeProductDescription(description)- Optimizes product descriptions
- Exports: Both ChatGPT functions
- Functions:
- deepseekMethods.js
- Functions:
generateDeepseekResponse(prompt)- Generates response from DeepseekanalyzeProductImage(imagePath)- Analyzes product images
- Exports: Both Deepseek functions
- Functions:
- geminiMethods.js
- Functions:
generateGeminiResponse(prompt)- Generates response from GeminigenerateProductVariations(baseProduct)- Generates product variations
- Exports: Both Gemini functions
- Functions:
Google Services
- googleImageSearch.js
- Functions:
searchImages(query)- Searches for images using GoogledownloadTopImages(query, count)- Downloads top images for queryreverseImageSearch(imagePath)- Performs reverse image search
- Exports: All Google image search functions
- Functions:
Utils Module
- consoleMessages.js
- Functions:
logInfo(message)- Logs informational messagelogSuccess(message)- Logs success messagelogWarning(message)- Logs warning messagelogError(message)- Logs error message
- Exports: All console message functions
- Functions:
- dateMethods.js
- Functions:
formatDate(date, format)- Formats date to specified formatgetDateDifference(date1, date2)- Gets difference between datesisDateValid(dateString)- Validates date string
- Exports: All date utility functions
- Functions:
- downloadImage.js
- Functions:
downloadImage(url, path)- Downloads image from URL to pathresizeImage(imagePath, width, height)- Resizes downloaded image
- Exports: Both image download functions
- Functions:
- fileMethods.js
- Functions:
cleanDirectory(directory)- Cleans all files from a directorycheckFileType(url)- Checks if a file is an image or document based on extension
- Exports: Both file management functions
- Functions:
- phoneMethods.js
- Functions:
addPrefix55IfNotPresent(phoneNumber)- Adds the "55" prefix to a phone number if not present
- Exports: Phone number formatting function
- Functions:
- priceMethods.js
- Functions:
formatPriceChangePeriodToComma(number)- Formats a price by changing period to comma
- Exports: Price formatting function
- Functions:
- urlFormatter.js
- Functions:
formatUrlsToHtml(text)- Converts URLs in text to HTML anchor tagsextractImageUrls(urls)- Extracts image URLs from a list of URLsgetMainDomain(url)- Gets the main domain from a URLbuildFullUrl(domain, urlPath)- Builds a full URL from domain and pathextractIdFromUrlMercadoLivre(url)- Extracts product ID from a Mercado Livre URLextractUrlsForText(text)- Extracts URLs from text
- Exports: All URL formatting and extraction functions
- Functions:
- waitForSelector.js
- Functions:
waitForSelector(page, selector, timeout)- Waits for an element with the specified selector to appear
- Exports: Selector waiting utility function
- Functions:
- waitForTimeout.js
- Functions:
waitForTimeout(ms)- Returns a promise that resolves after the specified milliseconds
- Exports: Timeout utility function
- Functions:
