@bitrix24/b24jssdk
Version:
Bitrix24 REST API JavaScript SDK
1 lines • 1.81 kB
Source Map (JSON)
{"version":3,"file":"as-object.mjs","sources":["../../../../../../../src/core/interaction/batch/processing/v3/as-object.ts"],"sourcesContent":["import type { GetCommandsOptions, IProcessingStrategy } from '../interface-strategy'\nimport type {\n BatchCommandV3, BatchNamedCommandsUniversal, 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 ProcessingAsObjectV3 extends AbstractProcessingV3 implements IProcessingStrategy {\n public prepareCommands(\n calls: BatchNamedCommandsUniversal,\n options: GetCommandsOptions\n ): BatchCommandV3[] {\n const result: BatchCommandV3[] = []\n Object.entries(calls).forEach(([index, row]) => {\n const command = ParseRow.getBatchCommand(row, { ...options, asDefaultValue: index })\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 result.addError(ajaxError, index)\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AASO,MAAM,6BAA6B,oBAAA,CAAoD;AAAA,EAT9F;AAS8F,IAAA,MAAA,CAAA,IAAA,EAAA,sBAAA,CAAA;AAAA;AAAA,EACrF,eAAA,CACL,OACA,OAAA,EACkB;AAClB,IAAA,MAAM,SAA2B,EAAC;AAClC,IAAA,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,CAAE,OAAA,CAAQ,CAAC,CAAC,KAAA,EAAO,GAAG,CAAA,KAAM;AAC9C,MAAA,MAAM,OAAA,GAAU,SAAS,eAAA,CAAgB,GAAA,EAAK,EAAE,GAAG,OAAA,EAAS,cAAA,EAAgB,KAAA,EAAO,CAAA;AACnF,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;AACN,IAAA,MAAA,CAAO,QAAA,CAAS,WAAW,KAAK,CAAA;AAAA,EAClC;AACF;;;;"}