UNPKG

n8n-nodes-instantly-dev

Version:

n8n community node for Instantly API v2

42 lines 1.41 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getCampaignId = getCampaignId; exports.getEmailAccount = getEmailAccount; exports.getResourceLocatorValue = getResourceLocatorValue; /** * Resource locator utilities for extracting IDs and values */ /** * Helper function to extract campaign ID from resourceLocator */ function getCampaignId(context, itemIndex) { const campaignLocator = context.getNodeParameter('campaignId', itemIndex); if (typeof campaignLocator === 'string') { // Backward compatibility - if it's still a string return campaignLocator; } // Extract value from resourceLocator return campaignLocator.value || campaignLocator; } /** * Helper function to extract email from resourceLocator */ function getEmailAccount(context, itemIndex) { const emailLocator = context.getNodeParameter('emailAccount', itemIndex); if (typeof emailLocator === 'string') { // Backward compatibility - if it's still a string return emailLocator; } // Extract value from resourceLocator return emailLocator.value || emailLocator; } /** * Generic helper to extract value from any resource locator */ function getResourceLocatorValue(locator) { if (typeof locator === 'string') { return locator; } return locator.value || locator; } //# sourceMappingURL=resourceLocatorHelpers.js.map