Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/cvetdv.ru/bitrix/js/im/v2/provider/service/bot/dist/ |
Upload File : |
{"version":3,"file":"context.bundle.js","sources":["../src/context.js"],"sourcesContent":["import { EventEmitter } from 'main.core.events';\n\nimport { runAction } from 'im.v2.lib.rest';\nimport { EventType, RestMethod } from 'im.v2.const';\n\nimport type { JsonObject } from 'main.core';\n\nexport class BotContextService\n{\n\tscheduleContextRequest(dialogId: string, context: JsonObject): void\n\t{\n\t\tconst eventHandler = (event) => {\n\t\t\tconst { dialogId: eventDialogId } = event.getData();\n\t\t\tif (eventDialogId !== dialogId)\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tEventEmitter.unsubscribe(EventType.dialog.onDialogInited, eventHandler);\n\t\t\tvoid this.#sendBotContext(dialogId, context);\n\t\t};\n\n\t\tEventEmitter.subscribe(EventType.dialog.onDialogInited, eventHandler);\n\t}\n\n\t#sendBotContext(dialogId: string, context: JsonObject): Promise\n\t{\n\t\treturn runAction(RestMethod.imV2ChatBotSendContext, {\n\t\t\tdata: { dialogId, context },\n\t\t}).catch(([error]) => {\n\t\t\tconsole.error('BotContextService: send context error', error);\n\t\t});\n\t}\n}\n"],"names":["BotContextService","scheduleContextRequest","dialogId","context","eventHandler","event","eventDialogId","getData","EventEmitter","unsubscribe","EventType","dialog","onDialogInited","subscribe","runAction","RestMethod","imV2ChatBotSendContext","data","catch","error","console"],"mappings":";;;;;;;CAGoD;AAIpD,CAAO,MAAMA,iBAAiB,CAC9B;GAAA;KAAA;OAAA;;;GACCC,sBAAsB,CAACC,QAAgB,EAAEC,OAAmB,EAC5D;KACC,MAAMC,YAAY,GAAIC,KAAK,IAAK;OAC/B,MAAM;SAAEH,QAAQ,EAAEI;QAAe,GAAGD,KAAK,CAACE,OAAO,EAAE;OACnD,IAAID,aAAa,KAAKJ,QAAQ,EAC9B;SACC;;OAGDM,6BAAY,CAACC,WAAW,CAACC,qBAAS,CAACC,MAAM,CAACC,cAAc,EAAER,YAAY,CAAC;OACvE,6CAAK,IAAI,oCAAiBF,QAAQ,EAAEC,OAAO,CAAC;MAC5C;KAEDK,6BAAY,CAACK,SAAS,CAACH,qBAAS,CAACC,MAAM,CAACC,cAAc,EAAER,YAAY,CAAC;;CAWvE;CAAC,0BARgBF,QAAgB,EAAEC,OAAmB,EACrD;GACC,OAAOW,wBAAS,CAACC,sBAAU,CAACC,sBAAsB,EAAE;KACnDC,IAAI,EAAE;OAAEf,QAAQ;OAAEC;;IAClB,CAAC,CAACe,KAAK,CAAC,CAAC,CAACC,KAAK,CAAC,KAAK;KACrBC,OAAO,CAACD,KAAK,CAAC,uCAAuC,EAAEA,KAAK,CAAC;IAC7D,CAAC;CACH;;;;;;;;"}