@inite/n8n-nodes-instagram-private-api
Version:
n8n node for Instagram Private API with 2FA support
34 lines (33 loc) • 1.49 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.InstagramPrivateApiUi = void 0;
class InstagramPrivateApiUi {
static async handleLoginButtonClick(credentials, credentialData) {
// Call the loginToInstagram method
if (typeof credentials.loginToInstagram === 'function') {
try {
// Update the login status to show progress
credentialData.loginStatus = 'Logging in...';
// Call the login method
const updatedCredentials = await credentials.loginToInstagram(credentialData);
// Return the updated credentials
return updatedCredentials;
}
catch (error) {
// Update the login status with the error
credentialData.loginStatus = `Login failed: ${error.message}`;
return credentialData;
}
}
return credentialData;
}
static async handleLoginButtonClickWithCollection(credentials, credentialData) {
var _a, _b;
// Check if the login button was clicked
if (((_b = (_a = credentialData.login) === null || _a === void 0 ? void 0 : _a.loginValues) === null || _b === void 0 ? void 0 : _b.loginButton) === 'Login to Instagram') {
return this.handleLoginButtonClick(credentials, credentialData);
}
return credentialData;
}
}
exports.InstagramPrivateApiUi = InstagramPrivateApiUi;