{"version":3,"file":"as-array.cjs","sources":["../../../../../../../src/core/interaction/batch/processing/v3/as-array.ts"],"sourcesContent":["import type { GetCommandsOptions, IProcessingStrategy } from '../interface-strategy'\nimport type {\n  BatchCommandsArrayUniversal,\n  BatchCommandsObjectUniversal,\n  BatchCommandV3, ICallBatchResult\n} from '../../../../../types/http'\nimport type { Result } from '../../../../result'\nimport type { AjaxError } from '../../../../http/ajax-error'\nimport { AbstractProcessingV3 } from './abstract-processing'\nimport { ParseRow } from '../../parse-row'\n\nexport class ProcessingAsArrayV3 extends AbstractProcessingV3 implements IProcessingStrategy {\n  public prepareCommands(\n    calls: BatchCommandsArrayUniversal | BatchCommandsObjectUniversal,\n    options: GetCommandsOptions\n  ): BatchCommandV3[] {\n    const result: BatchCommandV3[] = []\n    calls.forEach((row) => {\n      const command = ParseRow.getBatchCommand(row, options)\n      result.push(command)\n    })\n\n    return result\n  }\n\n  protected _processResponseError<T>(\n    result: Result<ICallBatchResult<T>>,\n    ajaxError: AjaxError,\n    index: string\n  ): void {\n    // Key the error by the command's numeric position so getErrorsByKey() /\n    // getErrorMessagesByKey() tell the caller *which* command failed, matching\n    // object/named-command mode. (#255)\n    result.addError(ajaxError, index)\n  }\n}\n"],"names":["AbstractProcessingV3","ParseRow"],"mappings":";;;;;;;;;;;;;;;AAWO,MAAM,4BAA4BA,uCAAA,CAAoD;AAAA,EAX7F;AAW6F,IAAA,MAAA,CAAA,IAAA,EAAA,qBAAA,CAAA;AAAA;AAAA,EACpF,eAAA,CACL,OACA,OAAA,EACkB;AAClB,IAAA,MAAM,SAA2B,EAAC;AAClC,IAAA,KAAA,CAAM,OAAA,CAAQ,CAAC,GAAA,KAAQ;AACrB,MAAA,MAAM,OAAA,GAAUC,iBAAA,CAAS,eAAA,CAAgB,GAAA,EAAK,OAAO,CAAA;AACrD,MAAA,MAAA,CAAO,KAAK,OAAO,CAAA;AAAA,IACrB,CAAC,CAAA;AAED,IAAA,OAAO,MAAA;AAAA,EACT;AAAA,EAEU,qBAAA,CACR,MAAA,EACA,SAAA,EACA,KAAA,EACM;AAIN,IAAA,MAAA,CAAO,QAAA,CAAS,WAAW,KAAK,CAAA;AAAA,EAClC;AACF;;;;"}