/** * State object for Salesforce Bulk API 1.0 operations * @typedef {Object} Bulk1QueryState * @property {Array} data - The processed records or query results from the Bulk API operation * @property {Array} references - Array of previous state data objects used in the job * @private */ /** * @typedef {Object} Bulk1LoadState - State object for bulk load operations * @property {Object} data - The processed records or results from the bulk load operation * @property {Object} data.successfulResults - Array of successful results * @property {Object} data.failedResults - Array of failed results * @property {Object} data.unprocessedRecords - Array of unprocessed records * @property {Array} references - Array of previous state data objects used in the job * @private */ /** * Options for configuring Salesforce Bulk API 1.0 operations * @typedef {Object} Bulk1Options * @public * @property {boolean} [allowNoOp=false] - Skipping bulk operation if no records * @property {boolean} [failOnError=true] - Fail the operation on error * @property {number} [pollTimeout=300000] - Polling timeout in milliseconds. Default: 300000 (30 seconds) * @property {number} [pollInterval=6000] - Polling interval in milliseconds. Default: 6000 (6 seconds) * @property {boolean} [concurrencyMode='Parallel'] - Concurrency mode: 'Parallel' or 'Serial' */ /** * Executes a bulk query using Salesforce Bulk API 1.0 * @public * @example Query records * bulk1.query('SELECT Id, Name FROM Account'); * @example Query with custom options * bulk1.query('SELECT Id, Name FROM Account', { * pollInterval: 1000, * pollTimeout: 24000 * }); * @function * @param {string} query - SOQL query string to execute * @state {Bulk1QueryState} * @returns {Operation} */ export function query(query: string): Operation; /** * Bulk inserts records using Salesforce Bulk API 1.0 * @public * @example Insert multiple records * bulk1.insert('Account', [{ Name: 'Coco' }, { Name: 'Melon' }]); * @example Bulk insert continue on error * bulk1.insert('Account', [{ Name: 'Coco' }, { Name: 'Melon' }], { * pollInterval: 1000, * failOnError: false * }); * @function * @param {string} sObject - The Salesforce object type * @param {Array} records - Array of records to insert * @param {Bulk1Options} [options] - Bulk insert options * @state {Bulk1LoadState} * @returns {Operation} */ export function insert(sObject: string, records: any[], options?: Bulk1Options): Operation; /** * Bulk updates records using Salesforce Bulk API 1.0 * @public * @example Update multiple records * bulk1.update('Account', [{ Id: '001xx', Name: 'Updated Name' }]); * @example Bulk update continue on error * bulk1.update('Account', [{ Id: '001xx', Name: 'Updated Name' }], { * pollInterval: 1000, * failOnError: false * }); * @function * @param {string} sObject - The Salesforce object type * @param {Array} records - Array of records to update * @param {Bulk1Options} [options] - Bulk update options * @state {Bulk1LoadState} * @returns {Operation} */ export function update(sObject: string, records: any[], options?: Bulk1Options): Operation; /** * Bulk upserts records using Salesforce Bulk API 1.0 * @public * @example Upsert multiple records * bulk1.upsert('Account', [{ External_Id__c: 'EXT001', Name: 'Upserted Name' }], { extIdField: 'External_Id__c' }); * @example Bulk upsert continue on error * bulk1.upsert('Account', [{ External_Id__c: 'EXT001', Name: 'Upserted Name' }], { * extIdField: 'External_Id__c', * pollInterval: 3000, * failOnError: false * }); * @function * @param {string} sObject - The Salesforce object type * @param {string} externalIdFieldName - External ID field name for upsert matching * @param {Array} records - Array of records to upsert * @param {Bulk1Options} options - Bulk upsert options * @state {Bulk1LoadState} * @returns {Operation} */ export function upsert(sObject: string, externalIdFieldName: string, records: any[], options?: Bulk1Options): Operation; /** * Bulk deletes records using Salesforce Bulk API 1.0 * @public * @example Delete multiple records * bulk1.delete('Account', [{ Id: '001xx' }]); * @example Bulk delete continue on error * bulk1.delete('Account', [{ Id: '001xx' }], { * pollInterval: 3000, * failOnError: false * }); * @function * @param {string} sObject - The Salesforce object type * @param {Array} records - Array of records to delete (must include Id field) * @param {Bulk1Options} [options] - Bulk delete options * @state {Bulk1LoadState} * @returns {Operation} */ export function destroy(sObject: string, records: any[], options?: Bulk1Options): Operation; /** * State object for Salesforce Bulk API 1.0 operations */ export type Bulk1QueryState = { /** * - The processed records or query results from the Bulk API operation */ data: any[]; /** * - Array of previous state data objects used in the job */ references: any[]; }; /** * - State object for bulk load operations */ export type Bulk1LoadState = { /** * - The processed records or results from the bulk load operation */ data: { successfulResults: any; failedResults: any; unprocessedRecords: any; }; /** * - Array of previous state data objects used in the job */ references: any[]; }; /** * Options for configuring Salesforce Bulk API 1.0 operations */ export type Bulk1Options = any;