### Install Node.js SDK Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Installs the Catalyst Node.js SDK using npm. You can install the latest version or a specific version. ```bash npm install zcatalyst-sdk-node ``` ```bash npm install zcatalyst-sdk-node@2.1.1 ``` -------------------------------- ### ZCQL Operations Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview This section details operations for the ZCQL (Zoho Creator Query Language) service, including getting a component instance and executing ZCQL queries. ```nodejs // Get ZCQL Instance // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/zcql/get-component-instance/ // Execute Query // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/zcql/execute-zcql-query/ ``` -------------------------------- ### Search Operations Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview This section covers operations for the Search service, including getting a component instance and searching for data. ```nodejs // Get Search Instance // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/search/get-a-component-instance/ // Search Data // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/search/search-data/ ``` -------------------------------- ### Serverless Circuits Operations Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview This section covers operations related to Serverless Circuits within the Zoho Catalyst Node.js SDK, including getting an instance and executing a circuit. ```APIDOC Serverless Circuits: getComponentInstance() Description: Gets an instance of the Serverless Circuits component. Parameters: None Returns: Circuits instance Usage Example: const circuits = catalyst.serverless.circuits.getComponentInstance(); executeCircuit(circuitName, payload) Description: Executes a specified serverless circuit with a given payload. Parameters: - circuitName (string): The name of the circuit to execute. - payload (object): The data to pass to the circuit. Returns: Result of the circuit execution. Usage Example: circuits.executeCircuit('myCircuit', { data: 'example' }); ``` -------------------------------- ### Zia Services - Get Instance Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Obtains an instance of the Zia Services component, which provides access to various AI-powered features like OCR, AutoML, and analytics. ```nodejs const ziaServices = require("catalyst-sdk").ziaServices; // Get the Zia Services component instance const ziaInstance = ziaServices.getComponentInstance(); console.log("Zia Services instance obtained successfully."); ``` -------------------------------- ### Serverless Functions Operations Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview This section covers operations related to Serverless Functions within the Zoho Catalyst Node.js SDK, including getting an instance and executing a function. ```APIDOC Serverless Functions: getComponentInstance() Description: Gets an instance of the Serverless Functions component. Parameters: None Returns: Functions instance Usage Example: const functions = catalyst.serverless.functions.getComponentInstance(); executeFunction(functionName, payload) Description: Executes a specified serverless function with a given payload. Parameters: - functionName (string): The name of the function to execute. - payload (object): The data to pass to the function. Returns: Result of the function execution. Usage Example: functions.executeFunction('myFunction', { data: 'example' }); ``` -------------------------------- ### Mail Operations Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview This section covers operations for the Mail service, including getting a mail instance and sending emails. ```nodejs // Get Mail Instance // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/mail/get-component-instance/ // Send Email // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/mail/send-email/ ``` -------------------------------- ### Push Notifications - Get Instance Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Retrieves an instance of the Push Notifications component for interacting with the service. This is a foundational step before sending notifications. ```nodejs const pushNotifications = require("catalyst-sdk").pushNotifications; // Get the Push Notifications component instance const notificationInstance = pushNotifications.getComponentInstance(); console.log("Push Notifications instance obtained successfully."); ``` -------------------------------- ### Job Scheduling - Get All Job Pools Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Retrieves details for all available job pools within the Job Scheduling system. Requires an initialized Job Scheduling instance. ```nodejs const jobScheduling = require("catalyst-sdk").jobScheduling; async function getAllJobPools() { try { const response = await jobScheduling.jobPool.getAllJobPool(); console.log("All Job Pools:", response); } catch (error) { console.error("Error getting all job pools:", error); } } // Example usage: // getAllJobPools(); ``` -------------------------------- ### Job Scheduling - Get Job Details Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Retrieves the details of a specific job using its unique job ID. Requires an initialized Job Scheduling instance. ```nodejs const jobScheduling = require("catalyst-sdk").jobScheduling; async function getJobDetails(jobId) { try { const response = await jobScheduling.jobs.getJob({ jobId: jobId }); console.log(`Details for Job ${jobId}:`, response); } catch (error) { console.error(`Error getting details for Job ${jobId}:`, error); } } // Example usage: // getJobDetails("your_job_id"); ``` -------------------------------- ### Job Scheduling - Get Specific Job Pool Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Fetches detailed information for a specific job pool identified by its ID. Requires an initialized Job Scheduling instance. ```nodejs const jobScheduling = require("catalyst-sdk").jobScheduling; async function getJobPoolDetails(poolId) { try { const response = await jobScheduling.jobPool.getJobPool({ poolId: poolId }); console.log(`Details for Job Pool ${poolId}:`, response); } catch (error) { console.error(`Error getting details for Job Pool ${poolId}:`, error); } } // Example usage: // getJobPoolDetails("your_pool_id"); ``` -------------------------------- ### Initialize SDK in BasicIO Functions Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Initializes the Catalyst Node.js SDK for Basic I/O functions. The SDK is initialized using the provided 'context' object. ```javascript const catalyst = require('zcatalyst-sdk-node'); module.exports = (context, basicIO) => { const app = catalyst.initialize(context); // Access Catalyst components via the 'app' variable // Your business logic here } ``` -------------------------------- ### Node.js SDK Documentation Links Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Provides links to key documentation sections for the Catalyst Zoho Node.js SDK v2. ```Node.js /** * Catalyst Zoho Node.js SDK v2 Documentation: * - Overview: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview/ * - Upgrade Guide: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/upgrade-sdk/ * - Integrate SDK in Third-Party Apps: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/integrate-sdk-in-third-party-apps/ */ ``` -------------------------------- ### SmartBrowz - Create Instance Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Initializes and obtains an instance of the SmartBrowz component, used for PDF generation and screenshotting. Requires the SDK. ```nodejs const smartBrowz = require("catalyst-sdk").smartBrowz; // Create a SmartBrowz instance const smartBrowzInstance = smartBrowz.createSmartBrowzInstance(); console.log("SmartBrowz instance created successfully."); ``` -------------------------------- ### Initialize SDK in Advanced I/O Functions (Basic Template) Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Initializes the Catalyst Node.js SDK within an Advanced I/O function using the basic template. The initialized 'app' variable is used to access Catalyst components. ```javascript var catalyst = require('zcatalyst-sdk-node'); module.exports = (req, res) => { var app = catalyst.initialize(req); // Access Catalyst components via the 'app' variable // Your business logic here } ``` -------------------------------- ### Job Scheduling - Initialize Instance Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Initializes the Job Scheduling component, allowing for the creation and management of scheduled jobs and cron tasks. ```nodejs const jobScheduling = require("catalyst-sdk").jobScheduling; // Initialize the Job Scheduling component jobScheduling.initializeJobSchedulingInstance(); console.log("Job Scheduling instance initialized."); ``` -------------------------------- ### Initialize SDK in Event Functions Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Initializes the Catalyst Node.js SDK for Event functions. The SDK is initialized using the provided 'context' object. ```javascript const catalyst = require('zcatalyst-sdk-node'); module.exports = (event, context) => { const app = catalyst.initialize(context); // Access Catalyst components via the 'app' variable // Your business logic here } ``` -------------------------------- ### Initialize SDK in Cron Functions Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Initializes the Catalyst Node.js SDK for Cron functions. The SDK is initialized using the provided 'context' object. ```javascript const catalyst = require('zcatalyst-sdk-node'); module.exports = (cronDetails, context) => { const app = catalyst.initialize(context); // Access Catalyst components via the 'app' variable // Your business logic here } ``` -------------------------------- ### Initialize SDK with Admin Scope Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Initializes the Catalyst SDK with 'admin' scope, granting unrestricted access to all components and functionalities. This allows performing operations like SELECT queries on the Data Store. ```javascript const catalyst = require('zcatalyst-sdk-node'); module.exports = async (req, res) => { const app = catalyst.initialize(req); const adminApp = catalyst.initialize(req, { scope: 'admin'}); // catalyst app object with admin scope await adminApp.zcql().executeZCQLQuery('select * from test'); } ``` -------------------------------- ### Initialize SDK in Advanced I/O Functions (Express.js) Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Initializes the Catalyst Node.js SDK within an Advanced I/O function using Express.js. The SDK is initialized with the request object. ```javascript var catalyst = require('zcatalyst-sdk-node'); const express = require('express'); const expressApp = express(); expressApp.get('/', (req, res) => { var app = catalyst.initialize(req); // Access Catalyst components via the 'app' variable // Your business logic here }); module.exports = expressApp; ``` -------------------------------- ### SmartBrowz - PDF & Screenshot Generation Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Generates PDF documents or screenshots from given URLs using the SmartBrowz service. Requires a SmartBrowz instance. ```nodejs const smartBrowz = require("catalyst-sdk").smartBrowz; async function generatePdfOrScreenshot(url, type = 'pdf') { try { const smartBrowzInstance = smartBrowz.createSmartBrowzInstance(); let response; if (type === 'pdf') { response = await smartBrowzInstance.generatePdfnscreenshot({ url: url, outputType: 'pdf' }); console.log("PDF generated successfully:", response); } else if (type === 'screenshot') { response = await smartBrowzInstance.generatePdfnscreenshot({ url: url, outputType: 'screenshot' }); console.log("Screenshot generated successfully:", response); } else { console.error("Invalid output type. Use 'pdf' or 'screenshot'."); return; } } catch (error) { console.error(`Error generating ${type} for ${url}:`, error); } } // Example usage: // generatePdfOrScreenshot('https://www.zoho.com', 'pdf'); // generatePdfOrScreenshot('https://www.zoho.com', 'screenshot'); ``` -------------------------------- ### Initialize SDK with User Scope Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Initializes the Catalyst SDK with 'user' scope, allowing restricted access to components and specific functionalities, such as read-only access to the Data Store. This snippet demonstrates executing a SELECT query with user privileges. ```javascript const catalyst = require('zcatalyst-sdk-node'); module.exports = async (req, res) => { const app = catalyst.initialize(req); const userApp = catalyst.initialize(req, { scope: 'user'}); // catalyst app object with user scope await userApp.zcql().executeZCQLQuery('select * from test'); } ``` -------------------------------- ### Zia Services - AutoML Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Interacts with the AutoML service for building and deploying machine learning models. Requires a Zia Services instance. ```nodejs const ziaServices = require("catalyst-sdk").ziaServices; async function useAutoML(datasetId, modelName) { try { const ziaInstance = ziaServices.getComponentInstance(); // The specific AutoML operations would depend on the SDK's capabilities // This is a placeholder for demonstration. const response = await ziaInstance.autoML({ datasetId: datasetId, modelName: modelName }); console.log("AutoML operation result:", response); } catch (error) { console.error("Error using AutoML:", error); } } // Example usage: // useAutoML("your_dataset_id", "my_prediction_model"); ``` -------------------------------- ### File Store Operations Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview This section details operations for managing files and folders within the File Store service. It includes retrieving component and folder instances, fetching folder details, uploading, downloading, and deleting files. ```nodejs // Get File Store Instance // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/file-store/get-component-instance/ // Get Folder Instance // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/file-store/get-folder-instance/ // Retrieve Folder Details // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/file-store/retrieve-folder-details/ // Upload File // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/file-store/upload-file/ // Download File from Folder // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/file-store/download-file-from-folder/ // Delete a File // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/file-store/delete-file/ ``` -------------------------------- ### SmartBrowz - Dataverse Integration Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Interacts with Dataverse through the SmartBrowz service. Specific functionalities depend on the Dataverse integration details within SmartBrowz. ```nodejs const smartBrowz = require("catalyst-sdk").smartBrowz; async function useSmartBrowzDataverse(data) { try { const smartBrowzInstance = smartBrowz.createSmartBrowzInstance(); // The specific method for Dataverse interaction would be called here. // This is a placeholder. const response = await smartBrowzInstance.dataverse({ data: data }); console.log("SmartBrowz Dataverse operation result:", response); } catch (error) { console.error("Error using SmartBrowz Dataverse:", error); } } // Example usage: // useSmartBrowzDataverse({ key: 'value' }); ``` -------------------------------- ### Job Scheduling - Create Job Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Creates a new job within the Job Scheduling system. Requires specifying job details like name, type, and schedule. ```nodejs const jobScheduling = require("catalyst-sdk").jobScheduling; async function createJob(jobDetails) { try { const response = await jobScheduling.jobs.createJob({ jobDetails: jobDetails }); console.log("Job created successfully:", response); } catch (error) { console.error("Error creating job:", error); } } // Example usage: // const myJob = { // name: "My Daily Task", // type: "script", // script: "path/to/your/script.js", // schedule: { type: "recurring", cron: "0 0 * * *" } // Daily at midnight // }; // createJob(myJob); ``` -------------------------------- ### Cloud Scale Data Store Operations Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview This section covers operations for interacting with the Data Store service in Zoho Catalyst Cloud Scale, including metadata retrieval, row manipulation, and bulk operations. ```APIDOC Cloud Scale Data Store: getComponentInstance() Description: Gets an instance of the Data Store component. Parameters: None Returns: Data Store instance Usage Example: const dataStore = catalyst.cloudscale.dataStore.getComponentInstance(); getTableMeta(tableName) Description: Retrieves metadata for a specified table. Parameters: - tableName (string): The name of the table. Returns: Table metadata object. Usage Example: dataStore.getTableMeta('myTable'); getTableInstance(tableName) Description: Gets an instance of a specific table. Parameters: - tableName (string): The name of the table. Returns: Table instance. Usage Example: dataStore.getTableInstance('myTable'); getColumnMeta(tableName, columnName) Description: Retrieves metadata for a specific column in a table. Parameters: - tableName (string): The name of the table. - columnName (string): The name of the column. Returns: Column metadata object. Usage Example: dataStore.getColumnMeta('myTable', 'myColumn'); getRows(tableName, queryParams) Description: Retrieves rows from a table based on query parameters. Parameters: - tableName (string): The name of the table. - queryParams (object): Parameters for filtering and sorting rows. Returns: Array of row objects. Usage Example: dataStore.getRows('myTable', { filterBy: 'columnA', value: 'someValue' }); insertRows(tableName, rows) Description: Inserts one or more rows into a table. Parameters: - tableName (string): The name of the table. - rows (array): An array of row objects to insert. Returns: Insertion status. Usage Example: dataStore.insertRows('myTable', [{ columnA: 'value1' }, { columnA: 'value2' }]); updateRows(tableName, rows) Description: Updates existing rows in a table. Parameters: - tableName (string): The name of the table. - rows (array): An array of row objects with updated data. Returns: Update status. Usage Example: dataStore.updateRows('myTable', [{ id: 1, columnA: 'newValue' }]); deleteRow(tableName, rowId) Description: Deletes a specific row from a table. Parameters: - tableName (string): The name of the table. - rowId (string|number): The ID of the row to delete. Returns: Deletion status. Usage Example: dataStore.deleteRow('myTable', 1); bulkReadRows(tableName, rowIds) Description: Reads multiple rows from a table using their IDs. Parameters: - tableName (string): The name of the table. - rowIds (array): An array of row IDs to read. Returns: Array of row objects. Usage Example: dataStore.bulkReadRows('myTable', [1, 2, 3]); bulkWriteRows(tableName, rows) Description: Performs bulk insertion or update of rows in a table. Parameters: - tableName (string): The name of the table. - rows (array): An array of row objects for bulk write. Returns: Bulk write status. Usage Example: dataStore.bulkWriteRows('myTable', [{ id: 1, columnA: 'updated' }, { columnB: 'new' }]); bulkDeleteRows(tableName, rowIds) Description: Deletes multiple rows from a table using their IDs. Parameters: - tableName (string): The name of the table. - rowIds (array): An array of row IDs to delete. Returns: Bulk deletion status. Usage Example: dataStore.bulkDeleteRows('myTable', [1, 2, 3]); ``` -------------------------------- ### Cloud Scale NoSQL Operations Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview This section covers operations for interacting with the NoSQL database service in Zoho Catalyst Cloud Scale, including table and item management, and querying. ```APIDOC Cloud Scale NoSQL: getComponentInstance() Description: Gets an instance of the NoSQL component. Parameters: None Returns: NoSQL instance Usage Example: const nosql = catalyst.cloudscale.nosql.getComponentInstance(); getTableMetadata(tableName) Description: Retrieves metadata for a specified NoSQL table. Parameters: - tableName (string): The name of the NoSQL table. Returns: Table metadata object. Usage Example: nosql.getTableMetadata('myNoSQLTable'); getTableInstance(tableName) Description: Gets an instance of a specific NoSQL table. Parameters: - tableName (string): The name of the NoSQL table. Returns: NoSQL table instance. Usage Example: nosql.getTableInstance('myNoSQLTable'); constructNoSQLItem(itemData) Description: Constructs a NoSQL item object from provided data. Parameters: - itemData (object): The data for the NoSQL item. Returns: Constructed NoSQL item object. Usage Example: nosql.constructNoSQLItem({ primaryKey: 'item1', attribute1: 'value1' }); insertItems(tableName, items) Description: Inserts one or more items into a NoSQL table. Parameters: - tableName (string): The name of the NoSQL table. - items (array): An array of NoSQL item objects to insert. Returns: Insertion status. Usage Example: nosql.insertItems('myNoSQLTable', [{ primaryKey: 'item1', attribute1: 'value1' }]); updateItems(tableName, items) Description: Updates existing items in a NoSQL table. Parameters: - tableName (string): The name of the NoSQL table. - items (array): An array of NoSQL item objects with updated data. Returns: Update status. Usage Example: nosql.updateItems('myNoSQLTable', [{ primaryKey: 'item1', attribute1: 'newValue' }]); fetchItems(tableName, query) Description: Fetches items from a NoSQL table based on a query. Parameters: - tableName (string): The name of the NoSQL table. - query (object): The query object for fetching items. Returns: Array of fetched NoSQL item objects. Usage Example: nosql.fetchItems('myNoSQLTable', { primaryKey: 'item1' }); queryTable(tableName, query) Description: Executes a query against a NoSQL table. Parameters: - tableName (string): The name of the NoSQL table. - query (object): The query to execute. Returns: Query results. Usage Example: nosql.queryTable('myNoSQLTable', { filterBy: 'attribute1', value: 'someValue' }); queryIndex(tableName, indexName, query) Description: Executes a query against a specific index in a NoSQL table. Parameters: - tableName (string): The name of the NoSQL table. - indexName (string): The name of the index to query. - query (object): The query to execute on the index. Returns: Query results from the index. Usage Example: nosql.queryIndex('myNoSQLTable', 'myIndex', { key: 'someKey' }); ``` -------------------------------- ### Cloud Scale Authentication Operations Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview This section details various operations for managing authentication within Zoho Catalyst's Cloud Scale, including user management, token generation, and validation. ```APIDOC Cloud Scale Authentication: getComponentInstance() Description: Gets an instance of the Cloud Scale Authentication component. Parameters: None Returns: Authentication instance Usage Example: const auth = catalyst.cloudscale.authentication.getComponentInstance(); addNewUser(userDetails) Description: Adds a new user to the organization. Parameters: - userDetails (object): An object containing user details (e.g., name, email). Returns: User creation status. Usage Example: auth.addNewUser({ name: 'John Doe', email: 'john.doe@example.com' }); getAllOrgIDs() Description: Retrieves all organization IDs associated with the account. Parameters: None Returns: Array of organization IDs. Usage Example: auth.getAllOrgIDs(); addUsertoExistingOrg(userId, orgId) Description: Adds an existing user to a specified organization. Parameters: - userId (string): The ID of the user to add. - orgId (string): The ID of the organization to add the user to. Returns: Status of adding user to organization. Usage Example: auth.addUsertoExistingOrg('user123', 'org456'); getUsersInOrg(orgId) Description: Retrieves all users belonging to a specific organization. Parameters: - orgId (string): The ID of the organization. Returns: Array of user objects. Usage Example: auth.getUsersInOrg('org456'); resetPassword(userId, newPassword) Description: Resets the password for a given user. Parameters: - userId (string): The ID of the user whose password needs to be reset. - newPassword (string): The new password for the user. Returns: Password reset status. Usage Example: auth.resetPassword('user123', 'newSecurePassword'); generateThirdPartyServerToken(userId, validityPeriod) Description: Generates a custom server token for a user with a specified validity period. Parameters: - userId (string): The ID of the user for whom the token is generated. - validityPeriod (number): The validity period of the token in minutes. Returns: Generated server token. Usage Example: auth.generateThirdPartyServerToken('user123', 60); customUserValidation(userId, token) Description: Validates a user using custom credentials or token. Parameters: - userId (string): The ID of the user to validate. - token (string): The token or credential for validation. Returns: Validation status. Usage Example: auth.customUserValidation('user123', 'validationToken'); getUserDetails(userId) Description: Retrieves detailed information about a specific user. Parameters: - userId (string): The ID of the user. Returns: User details object. Usage Example: auth.getUserDetails('user123'); updateUserDetails(userId, updatedDetails) Description: Updates the details of an existing user. Parameters: - userId (string): The ID of the user to update. - updatedDetails (object): An object containing the updated user details. Returns: User update status. Usage Example: auth.updateUserDetails('user123', { name: 'Johnathan Doe' }); enableDisableUser(userId, status) Description: Enables or disables a user account. Parameters: - userId (string): The ID of the user. - status (boolean): 'true' to enable, 'false' to disable. Returns: User status update result. Usage Example: auth.enableDisableUser('user123', false); deleteUser(userId) Description: Deletes a user from the system. Parameters: - userId (string): The ID of the user to delete. Returns: User deletion status. Usage Example: auth.deleteUser('user123'); ``` -------------------------------- ### Stratus Object Storage Operations Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview This section covers various operations for managing objects within Stratus, Zoho's object storage service. It includes creating, downloading, uploading, copying, renaming, moving, deleting, and retrieving details of objects and their versions. It also covers managing object metadata and extracting zipped objects. ```nodejs // Create Stratus Instance // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/stratus/create-stratus-instance/ // Check Bucket Availability // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/stratus/check-bucket/ // List Buckets // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/stratus/list-buckets/ // Create Bucket Instance // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/stratus/create-bucket-instance/ // Get Bucket Details // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/stratus/get-bucket-details/ // Get Bucket CORS // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/stratus/get-bucket-cors/ // List Objects in a Bucket // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/stratus/list-objects/ // Check Object Availability // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/stratus/check-object-availability/ // Download Object // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/stratus/download-object/ // Upload Object // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/stratus/upload-object/ // Extract a Zipped Object // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/stratus/extract-zipped-object/ // Copy Object // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/stratus/copy-objects/ // Rename and Move Operations on an Object // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/stratus/rename-move-object/ // Delete Objects // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/stratus/delete-objects/ // Create Object Instance // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/stratus/create-object-instance/ // List Object Versions // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/stratus/list-object-versions/ // Get Object Details // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/stratus/object-details/ // Put Object Meta Data // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/stratus/put-object-meta/ ``` -------------------------------- ### Zia Services - Object Recognition Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Identifies and labels objects within an image using the Object Recognition service. Requires a Zia Services instance. ```nodejs const ziaServices = require("catalyst-sdk").ziaServices; async function recognizeObjects(imageUrl) { try { const ziaInstance = ziaServices.getComponentInstance(); const response = await ziaInstance.objectRecognition({ imageUrl: imageUrl }); console.log("Object Recognition Result:", response); } catch (error) { console.error("Error recognizing objects:", error); } } // Example usage: // recognizeObjects("https://example.com/image_with_objects.jpg"); ``` -------------------------------- ### Retrieve Project Data Cached During Project Initialization Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview This API retrieves project data that was cached during the project initialization phase. It is part of the General Projects operations in the Zoho Catalyst Node.js SDK. ```APIDOC Projects: getProjectDataCachedDuringInitialization() Description: Retrieves project data cached during initialization. Parameters: None Returns: Project data object Usage Example: const catalyst = require('catalyst-sdk'); catalyst.projects.getProjectDataCachedDuringInitialization(); ``` -------------------------------- ### Zia Services - Text Analytics (Keyword Extraction) Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Extracts important keywords and phrases from a given text. Requires a Zia Services instance. ```nodejs const ziaServices = require("catalyst-sdk").ziaServices; async function extractKeywords(text) { try { const ziaInstance = ziaServices.getComponentInstance(); const response = await ziaInstance.textAnalytics.keywordExtraction({ text: text }); console.log("Keyword Extraction Result:", response); } catch (error) { console.error("Error extracting keywords:", error); } } // Example usage: // extractKeywords("Zoho Catalyst provides a comprehensive platform for building cloud applications."); ``` -------------------------------- ### Cache Operations Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview This section outlines operations for interacting with the Cache service. It covers retrieving component and segment instances, retrieving, inserting, updating, and deleting data from the cache. ```nodejs // Get component instance // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/cache/get-component-instance/ // Get segment instance // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/cache/get-segment-instance/ // Retrieve data from the cache // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/cache/retrieve-data-from-cache/ // Insert data to cache // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/cache/insert-data-into-cache/ // Update Data in Cache // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/cache/update-data-in-cache/ // Delete key value pair // https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/cloud-scale/cache/delete-key-value-pair/ ``` -------------------------------- ### Zia Services - Identity Scanner (Passbook) Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Processes Passbook documents using the Identity Scanner service. Requires a Zia Services instance. ```nodejs const ziaServices = require("catalyst-sdk").ziaServices; async function processPassbook(imageUrl) { try { const ziaInstance = ziaServices.getComponentInstance(); const response = await ziaInstance.identityScanner.passbook({ imageUrl: imageUrl }); console.log("Passbook Processing Result:", response); } catch (error) { console.error("Error processing Passbook:", error); } } // Example usage: // processPassbook("https://example.com/passbook_entry.jpg"); ``` -------------------------------- ### Zia Services - Identity Scanner (PAN) Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Processes PAN card documents using the Identity Scanner service. Requires a Zia Services instance. ```nodejs const ziaServices = require("catalyst-sdk").ziaServices; async function processPan(imageUrl) { try { const ziaInstance = ziaServices.getComponentInstance(); const response = await ziaInstance.identityScanner.pan({ imageUrl: imageUrl }); console.log("PAN Processing Result:", response); } catch (error) { console.error("Error processing PAN:", error); } } // Example usage: // processPan("https://example.com/pan_card.jpg"); ``` -------------------------------- ### Job Scheduling - Cron Commands Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Manages cron jobs, including creation (one-time, recurring, cron expression-based), retrieval, update, pausing, resuming, running, and deletion. ```APIDOC JobScheduling.Cron: createOneTimeCron(cronDetails: object) Creates a cron job that runs once at a specified time. Parameters: cronDetails: Object containing cron job configuration (e.g., name, time, script). Returns: Object with details of the created cron job. createRecurringCron(cronDetails: object) Creates a cron job that runs on a recurring schedule (e.g., daily, weekly). Parameters: cronDetails: Object containing cron job configuration (e.g., name, schedule, script). Returns: Object with details of the created cron job. createCronCronExpressions(cronDetails: object) Creates a cron job using standard cron expressions for flexible scheduling. Parameters: cronDetails: Object containing cron job configuration (e.g., name, cronExpression, script). Returns: Object with details of the created cron job. getCronDetails(cronId: string) Retrieves the details of a specific cron job using its ID. Parameters: cronId: The unique identifier of the cron job. Returns: Object containing the cron job details. getAllCronDetails() Retrieves details for all configured cron jobs. Returns: Array of objects, each containing cron job details. updateCron(cronId: string, updatedCronDetails: object) Updates an existing cron job with new configuration. Parameters: cronId: The ID of the cron job to update. updatedCronDetails: Object with the updated configuration. Returns: Object confirming the update. pauseCron(cronId: string) Pauses the execution of a specific cron job. Parameters: cronId: The ID of the cron job to pause. Returns: Object confirming the pause action. resumeCron(cronId: string) Resumes a paused cron job, allowing it to execute according to its schedule. Parameters: cronId: The ID of the cron job to resume. Returns: Object confirming the resume action. runCron(cronId: string) Manually triggers the execution of a specific cron job immediately. Parameters: cronId: The ID of the cron job to run. Returns: Object confirming the run action. deleteCron(cronId: string) Deletes a cron job from the system. Parameters: cronId: The ID of the cron job to delete. Returns: Object confirming the deletion. Example Usage (Create Recurring Cron): const cronConfig = { name: "Daily Report", schedule: { type: "recurring", interval: "daily" }, script: "path/to/report_script.js" }; jobScheduling.cron.createRecurringCron(cronConfig); ``` -------------------------------- ### Zia Services - Barcode Scanner Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Scans and decodes barcode information from images using the Barcode Scanner service. Requires a Zia Services instance. ```nodejs const ziaServices = require("catalyst-sdk").ziaServices; async function scanBarcode(imageUrl) { try { const ziaInstance = ziaServices.getComponentInstance(); const response = await ziaInstance.barcodeScanner({ imageUrl: imageUrl }); console.log("Barcode Scan Result:", response); } catch (error) { console.error("Error scanning barcode:", error); } } // Example usage: // scanBarcode("https://example.com/image_with_barcode.png"); ``` -------------------------------- ### Zia Services - Face Analytics Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Performs face analysis on images, including detection and attribute recognition. Requires a Zia Services instance. ```nodejs const ziaServices = require("catalyst-sdk").ziaServices; async function analyzeFace(imageUrl) { try { const ziaInstance = ziaServices.getComponentInstance(); const response = await ziaInstance.faceAnalytics({ imageUrl: imageUrl }); console.log("Face Analytics Result:", response); } catch (error) { console.error("Error analyzing face:", error); } } // Example usage: // analyzeFace("https://example.com/face_image.jpg"); ``` -------------------------------- ### Zia Services - Text Analytics (All Text Analytics) Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Performs a comprehensive suite of text analytics operations, including sentiment, entity recognition, and keyword extraction. Requires a Zia Services instance. ```nodejs const ziaServices = require("catalyst-sdk").ziaServices; async function analyzeAllText(text) { try { const ziaInstance = ziaServices.getComponentInstance(); const response = await ziaInstance.textAnalytics.allTextAnalytics({ text: text }); console.log("All Text Analytics Result:", response); } catch (error) { console.error("Error performing all text analytics:", error); } } // Example usage: // analyzeAllText("Zoho Catalyst is a powerful platform for developers."); ``` -------------------------------- ### Zia Services - Identity Scanner (Facial Comparison) Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Compares two faces to determine their similarity using the Identity Scanner service. Requires a Zia Services instance. ```nodejs const ziaServices = require("catalyst-sdk").ziaServices; async function compareFaces(imageUrl1, imageUrl2) { try { const ziaInstance = ziaServices.getComponentInstance(); const response = await ziaInstance.identityScanner.facialComparison({ imageUrl1: imageUrl1, imageUrl2: imageUrl2 }); console.log("Facial Comparison Result:", response); } catch (error) { console.error("Error comparing faces:", error); } } // Example usage: // compareFaces("https://example.com/face1.jpg", "https://example.com/face2.jpg"); ``` -------------------------------- ### Zia Services - Text Analytics (Sentiment Analysis) Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Analyzes the sentiment of a given text. Requires a Zia Services instance. ```nodejs const ziaServices = require("catalyst-sdk").ziaServices; async function analyzeSentiment(text) { try { const ziaInstance = ziaServices.getComponentInstance(); const response = await ziaInstance.textAnalytics.sentimentAnalysis({ text: text }); console.log("Sentiment Analysis Result:", response); } catch (error) { console.error("Error analyzing sentiment:", error); } } // Example usage: // analyzeSentiment("This is a wonderful product!"); ``` -------------------------------- ### Push Notifications - Send to Web Apps Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Sends notifications to web applications using the Push Notifications service. Requires a valid Push Notifications instance. ```nodejs const pushNotifications = require("catalyst-sdk").pushNotifications; async function sendWebNotification(message, title, iconUrl, webAppId) { try { const notificationInstance = pushNotifications.getComponentInstance(); const response = await notificationInstance.sendNotifications({ message: message, title: title, iconUrl: iconUrl, webAppId: webAppId }); console.log("Notification sent to web app:", response); } catch (error) { console.error("Error sending notification to web app:", error); } } // Example usage: sendWebNotification("Hello from Catalyst!", "Welcome", "https://example.com/icon.png", "your_web_app_id"); ``` -------------------------------- ### Zia Services - Identity Scanner (Cheque) Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Processes Cheque documents using the Identity Scanner service. Requires a Zia Services instance. ```nodejs const ziaServices = require("catalyst-sdk").ziaServices; async function processCheque(imageUrl) { try { const ziaInstance = ziaServices.getComponentInstance(); const response = await ziaInstance.identityScanner.cheque({ imageUrl: imageUrl }); console.log("Cheque Processing Result:", response); } catch (error) { console.error("Error processing Cheque:", error); } } // Example usage: // processCheque("https://example.com/cheque_image.jpg"); ``` -------------------------------- ### Zia Services - Text Analytics (Named Entity Recognition) Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Identifies and categorizes named entities (like people, organizations, locations) in a text. Requires a Zia Services instance. ```nodejs const ziaServices = require("catalyst-sdk").ziaServices; async function recognizeEntities(text) { try { const ziaInstance = ziaServices.getComponentInstance(); const response = await ziaInstance.textAnalytics.namedEntityRecognition({ text: text }); console.log("Named Entity Recognition Result:", response); } catch (error) { console.error("Error recognizing entities:", error); } } // Example usage: // recognizeEntities("Apple is looking at buying U.K. startup for $1 billion."); ``` -------------------------------- ### Zia Services - Identity Scanner (Aadhaar) Source: https://docs.catalyst.zoho.com/en/sdk/nodejs/v2/overview Processes Aadhaar-related documents using the Identity Scanner service. Requires a Zia Services instance. ```nodejs const ziaServices = require("catalyst-sdk").ziaServices; async function processAadhaar(imageUrl) { try { const ziaInstance = ziaServices.getComponentInstance(); const response = await ziaInstance.identityScanner.aadhaar({ imageUrl: imageUrl }); console.log("Aadhaar Processing Result:", response); } catch (error) { console.error("Error processing Aadhaar:", error); } } // Example usage: // processAadhaar("https://example.com/aadhaar_card.jpg"); ```