18 var _0x04d3=['OptionSet','Options','Value','LogicalName','DisplayName','Label',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','UserLocalizedLabel','false',')/Microsoft.Dynamics.CRM.','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','count','set','update','then','destroy','sendStatus','error','stack','name','map','Dynamics365Account','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','merge','find','create','body','getConfigurations','findOne','Dynamics365Configuration','filter','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','slice','substring','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','tenantId','CloudProvider','data5','data7','modernAuthentication','access_token','remoteUri','https://login.microsoftonline.com/','/oauth2/token','password','clientSecret','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','EntityDefinitions(','4.0','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','push','isNil','BooleanAttributeMetadata','lastIndexOf','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','all','test','Wrong\x20credentials','statusCode','GET','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)'];(function(_0x4b96e5,_0x28eddf){var _0x5aabe5=function(_0x5d32fd){while(--_0x5d32fd){_0x4b96e5['push'](_0x4b96e5['shift']());}};_0x5aabe5(++_0x28eddf);}(_0x04d3,0x19a));var _0x304d=function(_0x869091,_0x3b4cd7){_0x869091=_0x869091-0x0;var _0x5992c5=_0x04d3[_0x869091];return _0x5992c5;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0x304d('0x0'));var qs=require(_0x304d('0x1'));var logger=require(_0x304d('0x2'))(_0x304d('0x3'));var db=require(_0x304d('0x4'))['db'];var integrations=require(_0x304d('0x5'));function respondWithResult(_0x9ab8c0,_0x5b5fc2){_0x5b5fc2=_0x5b5fc2||0xc8;return function(_0x3bdb4b){if(_0x3bdb4b){return _0x9ab8c0[_0x304d('0x6')](_0x5b5fc2)[_0x304d('0x7')](_0x3bdb4b);}};}function respondWithFilteredResult(_0x13d29b,_0x2bb31e){return function(_0x1bd6a4){if(_0x1bd6a4){var _0x1a284f=typeof _0x2bb31e['offset']===_0x304d('0x8')&&typeof _0x2bb31e[_0x304d('0x9')]===_0x304d('0x8');var _0x32b6b5=_0x1bd6a4[_0x304d('0xa')];var _0x3644cd=_0x1a284f?0x0:_0x2bb31e['offset'];var _0x21bddb=_0x1a284f?_0x1bd6a4[_0x304d('0xa')]:_0x2bb31e['offset']+_0x2bb31e[_0x304d('0x9')];var _0x5399bf;if(_0x21bddb>=_0x32b6b5){_0x21bddb=_0x32b6b5;_0x5399bf=0xc8;}else{_0x5399bf=0xce;}_0x13d29b[_0x304d('0x6')](_0x5399bf);return _0x13d29b[_0x304d('0xb')]('Content-Range',_0x3644cd+'-'+_0x21bddb+'/'+_0x32b6b5)['json'](_0x1bd6a4);}return null;};}function saveUpdates(_0x3db9ce){return function(_0x199cb5){if(_0x199cb5){return _0x199cb5[_0x304d('0xc')](_0x3db9ce)[_0x304d('0xd')](function(_0x449e8c){return _0x449e8c;});}return null;};}function removeEntity(_0x5a3eb1){return function(_0x5cf212){if(_0x5cf212){return _0x5cf212[_0x304d('0xe')]()[_0x304d('0xd')](function(){_0x5a3eb1[_0x304d('0x6')](0xcc)['end']();});}};}function handleEntityNotFound(_0x192b67){return function(_0x1dc4f2){if(!_0x1dc4f2){_0x192b67[_0x304d('0xf')](0x194);}return _0x1dc4f2;};}function handleError(_0x23184e,_0x3fdc86){_0x3fdc86=_0x3fdc86||0x1f4;return function(_0x54ec22){logger[_0x304d('0x10')](_0x54ec22[_0x304d('0x11')]);if(_0x54ec22[_0x304d('0x12')]){delete _0x54ec22['name'];}_0x23184e[_0x304d('0x6')](_0x3fdc86)['send'](_0x54ec22);};}exports['index']=function(_0x4f4973,_0x29cbd5){var _0x5c9209={},_0x14aad0={},_0x1af120={'count':0x0,'rows':[]};var _0x1d7f0b=_[_0x304d('0x13')](db[_0x304d('0x14')]['rawAttributes'],function(_0x3e0a80){return{'name':_0x3e0a80[_0x304d('0x15')],'type':_0x3e0a80[_0x304d('0x16')][_0x304d('0x17')]};});_0x14aad0[_0x304d('0x18')]=_[_0x304d('0x13')](_0x1d7f0b,'name');_0x14aad0[_0x304d('0x19')]=_[_0x304d('0x1a')](_0x4f4973[_0x304d('0x19')]);_0x14aad0[_0x304d('0x1b')]=_[_0x304d('0x1c')](_0x14aad0[_0x304d('0x18')],_0x14aad0[_0x304d('0x19')]);_0x5c9209[_0x304d('0x1d')]=_[_0x304d('0x1c')](_0x14aad0[_0x304d('0x18')],qs[_0x304d('0x1e')](_0x4f4973[_0x304d('0x19')][_0x304d('0x1e')]));_0x5c9209['attributes']=_0x5c9209[_0x304d('0x1d')]['length']?_0x5c9209[_0x304d('0x1d')]:_0x14aad0[_0x304d('0x18')];if(!_0x4f4973[_0x304d('0x19')][_0x304d('0x1f')](_0x304d('0x20'))){_0x5c9209[_0x304d('0x9')]=qs['limit'](_0x4f4973['query'][_0x304d('0x9')]);_0x5c9209['offset']=qs['offset'](_0x4f4973[_0x304d('0x19')][_0x304d('0x21')]);}_0x5c9209[_0x304d('0x22')]=qs[_0x304d('0x23')](_0x4f4973[_0x304d('0x19')][_0x304d('0x23')]);_0x5c9209[_0x304d('0x24')]=qs[_0x304d('0x1b')](_[_0x304d('0x25')](_0x4f4973[_0x304d('0x19')],_0x14aad0[_0x304d('0x1b')]),_0x1d7f0b);if(_0x4f4973[_0x304d('0x19')]['filter']){_0x5c9209['where']=_['merge'](_0x5c9209[_0x304d('0x24')],{'$or':_[_0x304d('0x13')](_0x1d7f0b,function(_0x2eee55){if(_0x2eee55['type']!=='VIRTUAL'){var _0x193cac={};_0x193cac[_0x2eee55['name']]={'$like':'%'+_0x4f4973[_0x304d('0x19')]['filter']+'%'};return _0x193cac;}})});}_0x5c9209=_['merge']({},_0x5c9209,_0x4f4973[_0x304d('0x26')]);var _0x12ad2a={'where':_0x5c9209[_0x304d('0x24')]};return db[_0x304d('0x14')][_0x304d('0xa')](_0x12ad2a)[_0x304d('0xd')](function(_0x5bcd10){_0x1af120['count']=_0x5bcd10;if(_0x4f4973[_0x304d('0x19')][_0x304d('0x27')]){_0x5c9209['include']=[{'all':!![]}];}return db[_0x304d('0x14')][_0x304d('0x28')](_0x5c9209);})['then'](function(_0x5978b3){_0x1af120[_0x304d('0x29')]=_0x5978b3;return _0x1af120;})[_0x304d('0xd')](respondWithFilteredResult(_0x29cbd5,_0x5c9209))[_0x304d('0x2a')](handleError(_0x29cbd5,null));};exports[_0x304d('0x2b')]=function(_0x109721,_0x45f621){var _0x5addd0={'raw':![],'where':{'id':_0x109721[_0x304d('0x2c')]['id']}},_0x286696={};_0x286696['model']=_[_0x304d('0x1a')](db[_0x304d('0x14')][_0x304d('0x2d')]);_0x286696['query']=_['keys'](_0x109721[_0x304d('0x19')]);_0x286696[_0x304d('0x1b')]=_['intersection'](_0x286696['model'],_0x286696[_0x304d('0x19')]);_0x5addd0[_0x304d('0x1d')]=_[_0x304d('0x1c')](_0x286696[_0x304d('0x18')],qs[_0x304d('0x1e')](_0x109721['query']['fields']));_0x5addd0['attributes']=_0x5addd0[_0x304d('0x1d')][_0x304d('0x2e')]?_0x5addd0['attributes']:_0x286696['model'];if(_0x109721[_0x304d('0x19')]['includeAll']){_0x5addd0['include']=[{'all':!![]}];}_0x5addd0=_[_0x304d('0x2f')]({},_0x5addd0,_0x109721[_0x304d('0x26')]);return db[_0x304d('0x14')][_0x304d('0x30')](_0x5addd0)[_0x304d('0xd')](handleEntityNotFound(_0x45f621,null))['then'](respondWithResult(_0x45f621,null))[_0x304d('0x2a')](handleError(_0x45f621,null));};exports['create']=function(_0x50ee83,_0x35c9ea){return db[_0x304d('0x14')][_0x304d('0x31')](_0x50ee83[_0x304d('0x32')],{})['then'](respondWithResult(_0x35c9ea,0xc9))['catch'](handleError(_0x35c9ea,null));};exports['update']=function(_0x42b27f,_0xf82389){if(_0x42b27f['body']['id']){delete _0x42b27f[_0x304d('0x32')]['id'];}return db[_0x304d('0x14')][_0x304d('0x30')]({'where':{'id':_0x42b27f[_0x304d('0x2c')]['id']}})['then'](handleEntityNotFound(_0xf82389,null))[_0x304d('0xd')](saveUpdates(_0x42b27f['body'],null))['then'](respondWithResult(_0xf82389,null))[_0x304d('0x2a')](handleError(_0xf82389,null));};exports[_0x304d('0xe')]=function(_0x3d9400,_0x5bd3f0){return db[_0x304d('0x14')][_0x304d('0x30')]({'where':{'id':_0x3d9400['params']['id']}})['then'](handleEntityNotFound(_0x5bd3f0,null))[_0x304d('0xd')](removeEntity(_0x5bd3f0,null))[_0x304d('0x2a')](handleError(_0x5bd3f0,null));};exports[_0x304d('0x33')]=function(_0x41eb56,_0x508163){var _0x3ee980={};var _0x145b7c={};var _0x488b7f;var _0x124aba;return db[_0x304d('0x14')][_0x304d('0x34')]({'where':{'id':_0x41eb56[_0x304d('0x2c')]['id']}})[_0x304d('0xd')](handleEntityNotFound(_0x508163,null))[_0x304d('0xd')](function(_0x1c406b){if(_0x1c406b){_0x488b7f=_0x1c406b;_0x145b7c[_0x304d('0x18')]=_[_0x304d('0x1a')](db[_0x304d('0x35')]['rawAttributes']);_0x145b7c[_0x304d('0x19')]=_[_0x304d('0x1a')](_0x41eb56['query']);_0x145b7c[_0x304d('0x1b')]=_[_0x304d('0x1c')](_0x145b7c[_0x304d('0x18')],_0x145b7c[_0x304d('0x19')]);_0x3ee980[_0x304d('0x1d')]=_[_0x304d('0x1c')](_0x145b7c['model'],qs[_0x304d('0x1e')](_0x41eb56['query'][_0x304d('0x1e')]));_0x3ee980[_0x304d('0x1d')]=_0x3ee980['attributes']['length']?_0x3ee980[_0x304d('0x1d')]:_0x145b7c[_0x304d('0x18')];_0x3ee980[_0x304d('0x22')]=qs[_0x304d('0x23')](_0x41eb56[_0x304d('0x19')][_0x304d('0x23')]);_0x3ee980['where']=qs[_0x304d('0x1b')](_['pick'](_0x41eb56['query'],_0x145b7c[_0x304d('0x1b')]));if(_0x41eb56[_0x304d('0x19')][_0x304d('0x36')]){_0x3ee980['where']=_['merge'](_0x3ee980[_0x304d('0x24')],{'$or':_[_0x304d('0x13')](_0x3ee980[_0x304d('0x1d')],function(_0x9bb5a5){var _0x287443={};_0x287443[_0x9bb5a5]={'$like':'%'+_0x41eb56[_0x304d('0x19')][_0x304d('0x36')]+'%'};return _0x287443;})});}_0x3ee980=_[_0x304d('0x2f')]({},_0x3ee980,_0x41eb56[_0x304d('0x26')]);return _0x488b7f[_0x304d('0x33')](_0x3ee980);}})[_0x304d('0xd')](function(_0x454ece){if(_0x454ece){_0x124aba=_0x454ece[_0x304d('0x2e')];if(!_0x41eb56[_0x304d('0x19')][_0x304d('0x1f')](_0x304d('0x20'))){_0x3ee980[_0x304d('0x9')]=qs[_0x304d('0x9')](_0x41eb56[_0x304d('0x19')][_0x304d('0x9')]);_0x3ee980[_0x304d('0x21')]=qs[_0x304d('0x21')](_0x41eb56[_0x304d('0x19')][_0x304d('0x21')]);}return _0x488b7f[_0x304d('0x33')](_0x3ee980);}})['then'](function(_0x307c8d){if(_0x307c8d){return _0x307c8d?{'count':_0x124aba,'rows':_0x307c8d}:null;}})['then'](respondWithResult(_0x508163,null))[_0x304d('0x2a')](handleError(_0x508163,null));};exports[_0x304d('0x37')]=function(_0x1ae08f,_0x274c7c){if(_0x1ae08f[_0x304d('0x32')]['id']){delete _0x1ae08f[_0x304d('0x32')]['id'];}return db['Dynamics365Account'][_0x304d('0x34')]({'where':{'id':_0x1ae08f['params']['id']}})[_0x304d('0xd')](handleEntityNotFound(_0x274c7c,null))[_0x304d('0xd')](function(_0x4f7b92){if(_0x4f7b92){_0x1ae08f[_0x304d('0x32')][_0x304d('0x38')]=_0x4f7b92['id'];_0x1ae08f[_0x304d('0x32')][_0x304d('0x39')]=integrations[_0x304d('0x3a')](_0x1ae08f[_0x304d('0x32')][_0x304d('0x3b')],_0x1ae08f[_0x304d('0x32')][_0x304d('0x16')]);_0x1ae08f[_0x304d('0x32')]['Descriptions']=integrations[_0x304d('0x3c')](_0x1ae08f[_0x304d('0x32')][_0x304d('0x3b')],_0x1ae08f['body']['type']);return db['Dynamics365Configuration'][_0x304d('0x31')](_0x1ae08f['body'],{'include':[{'model':db[_0x304d('0x3d')],'as':_0x304d('0x39')},{'model':db[_0x304d('0x3d')],'as':_0x304d('0x3e')}]});}return null;})['then'](respondWithResult(_0x274c7c,null))[_0x304d('0x2a')](handleError(_0x274c7c,null));};function sanitizeRemoteUri(_0x344441){var _0x4f8f15=_0x344441[_0x304d('0x3f')](-0x1);if(_0x4f8f15==='/')return _0x344441[_0x304d('0x40')](0x0,_0x344441['lastIndexOf'](_0x4f8f15));return _0x344441;}function getWebApiUrl(_0x3b62da){return util['format'](_0x304d('0x41'),_0x3b62da);}exports[_0x304d('0x42')]=function(_0x54ee53,_0x13abcc){var _0x4b3866=_0x54ee53[_0x304d('0x19')][_0x304d('0x43')];var _0x577a02=_0x4b3866===_0x304d('0x44')?_0x304d('0x45'):_0x304d('0x46');var _0x1b8c4e='';var _0x4211ba='';var _0x4ee5cf='';var _0x31f439='';var _0x64eff6='';var _0x22bd3d='';var _0x13f5f1='';var _0x39a423='';var _0x3bfb64=[_0x304d('0x47'),_0x304d('0x48'),_0x304d('0x49'),_0x304d('0x4a'),_0x304d('0x4b'),_0x304d('0x4c'),_0x304d('0x4d'),_0x304d('0x4e'),_0x304d('0x4f'),'phonecall_activity_parties'];var _0x2f05aa=[_0x304d('0x50'),_0x304d('0x51'),_0x304d('0x52'),_0x304d('0x53'),_0x304d('0x54'),_0x304d('0x55'),_0x304d('0x56'),_0x304d('0x57'),_0x304d('0x58'),_0x304d('0x59'),_0x304d('0x5a'),_0x304d('0x5b'),_0x304d('0x5c'),_0x304d('0x5d'),'createdonbehalfbyyominame',_0x304d('0x5e'),_0x304d('0x5f'),_0x304d('0x60'),_0x304d('0x61'),_0x304d('0x62'),_0x304d('0x63'),_0x304d('0x64'),'escalatedon',_0x304d('0x65'),_0x304d('0x66'),_0x304d('0x67'),_0x304d('0x68'),_0x304d('0x69'),'kbarticleidname',_0x304d('0x6a'),_0x304d('0x6b'),_0x304d('0x6c'),_0x304d('0x6d'),_0x304d('0x6e'),_0x304d('0x6f'),_0x304d('0x70'),_0x304d('0x71'),'modifiedonbehalfbyyominame',_0x304d('0x72'),_0x304d('0x73'),_0x304d('0x74'),_0x304d('0x75'),_0x304d('0x76'),_0x304d('0x77'),_0x304d('0x78'),_0x304d('0x79'),'parentcaseidname',_0x304d('0x7a'),_0x304d('0x7b'),_0x304d('0x7c'),_0x304d('0x7d'),_0x304d('0x7e'),'resolveby',_0x304d('0x7f'),_0x304d('0x80'),_0x304d('0x81'),'responsiblecontactidyominame',_0x304d('0x82'),_0x304d('0x83'),_0x304d('0x84'),_0x304d('0x85'),_0x304d('0x86'),_0x304d('0x87'),_0x304d('0x88'),'ticketnumber',_0x304d('0x89'),_0x304d('0x8a'),_0x304d('0x8b'),_0x304d('0x8c'),_0x304d('0x8d')];var _0x32b11b=_0x3bfb64[_0x304d('0x8e')](_0x2f05aa);return db[_0x304d('0x14')]['findOne']({'where':{'id':_0x54ee53[_0x304d('0x2c')]['id']},'attributes':['id',_0x304d('0x8f'),'password','remoteUri',_0x304d('0x90'),'clientId','clientSecret','modernAuthentication'],'include':[{'model':db[_0x304d('0x91')],'as':_0x304d('0x91'),'attributes':['id',_0x304d('0x92'),_0x304d('0x93')]}]})['then'](handleEntityNotFound(_0x13abcc,null))['then'](function(_0x5001a4){if(_0x5001a4){if(_0x5001a4[_0x304d('0x94')]){_0x5001a4[_0x304d('0x95')]=_0x5001a4[_0x304d('0x91')][_0x304d('0x92')];_0x39a423=sanitizeRemoteUri(_0x5001a4[_0x304d('0x91')]['data7']);_0x13f5f1=getWebApiUrl(_0x39a423);return _0x5001a4;}_0x39a423=sanitizeRemoteUri(_0x5001a4[_0x304d('0x96')]);_0x13f5f1=getWebApiUrl(_0x39a423);var _0x1c4c57={'method':'POST','uri':_0x304d('0x97')+_0x5001a4[_0x304d('0x90')]+_0x304d('0x98'),'form':{'client_id':_0x5001a4['clientId'],'resource':_0x39a423,'username':_0x5001a4[_0x304d('0x8f')],'password':_0x5001a4[_0x304d('0x99')],'grant_type':'password','client_secret':_0x5001a4[_0x304d('0x9a')]},'json':!![]};return rp(_0x1c4c57);}})['then'](function(_0x181c6a){_0x22bd3d=_0x181c6a[_0x304d('0x95')];var _0x3225f1={'method':'GET','uri':encodeURI(_0x13f5f1+_0x304d('0x9b')+_0x577a02+'\x27'),'headers':{'Authorization':_0x304d('0x9c')+_0x22bd3d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3225f1);})[_0x304d('0xd')](function(_0x428df2){var _0x51cf2e=_0x428df2[_0x304d('0x9d')][0x0];var _0x96a439=_0x51cf2e[_0x304d('0x9e')];var _0x33ba2c={'method':'GET','uri':_0x13f5f1+_0x304d('0x9f')+_0x96a439+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x304d('0x9c')+_0x22bd3d,'If-None-Match':null,'OData-Version':_0x304d('0xa0')},'json':!![]};return rp(_0x33ba2c);})['then'](function(_0x536889){_0x1b8c4e=_0x536889;_0x4211ba=_0x1b8c4e[_0x304d('0xa1')];_0x4211ba=_[_0x304d('0xa2')](_0x4211ba,function(_0x53368a){return!_0x32b11b[_0x304d('0xa3')](_0x53368a['LogicalName']);});var _0x4858c8=[];var _0x1a723b=[];_0x4211ba[_0x304d('0xa4')](function(_0x5f45ea){if(_0x5f45ea[_0x304d('0xa5')]){var _0x2a3c96=_0x5f45ea[_0x304d('0xa5')][_0x304d('0x40')](_0x5f45ea[_0x304d('0xa5')]['lastIndexOf']('.')+0x1);if(_0x2a3c96===_0x304d('0xa6')){_0x4858c8[_0x304d('0xa7')](getSelectList(_0x13f5f1,_0x4b3866,_0x1a723b,_0x1b8c4e['MetadataId'],_0x5f45ea[_0x304d('0x9e')],_0x22bd3d));}}});return Promise['all'](_0x4858c8);})['then'](function(_0x7c3efb){_0x4ee5cf=_0x7c3efb[0x0];var _0x49a576=[];var _0x3511ac=[];_0x4211ba['forEach'](function(_0x4c1e5a){if(!_[_0x304d('0xa8')](_0x4c1e5a['@odata.type'])){var _0x204c04=_0x4c1e5a[_0x304d('0xa5')][_0x304d('0x40')](_0x4c1e5a[_0x304d('0xa5')]['lastIndexOf']('.')+0x1);if(_0x204c04===_0x304d('0xa9')){_0x49a576['push'](getBooleanList(_0x13f5f1,_0x4b3866,_0x3511ac,_0x1b8c4e[_0x304d('0x9e')],_0x4c1e5a['MetadataId'],_0x22bd3d));}}});return Promise['all'](_0x49a576);})['then'](function(_0x5dda28){_0x31f439=_0x5dda28[0x0];var _0xe579f7=[];var _0x54a08b=[];_0x4211ba[_0x304d('0xa4')](function(_0x16dd00){if(_0x16dd00[_0x304d('0xa5')]){var _0x3661ad=_0x16dd00[_0x304d('0xa5')][_0x304d('0x40')](_0x16dd00[_0x304d('0xa5')][_0x304d('0xaa')]('.')+0x1);if(_0x3661ad===_0x304d('0xab')||_0x3661ad===_0x304d('0xac')||_0x3661ad===_0x304d('0xad')||_0x3661ad===_0x304d('0xae')||_0x3661ad===_0x304d('0xaf')||_0x3661ad===_0x304d('0xb0')||_0x3661ad===_0x304d('0xb1')||_0x3661ad===_0x304d('0xb2')||_0x3661ad===_0x304d('0xb3')||_0x3661ad===_0x304d('0xb4')){_0xe579f7[_0x304d('0xa7')](getInputList(_0x13f5f1,_0x4b3866,_0x3661ad,_0x54a08b,_0x1b8c4e['MetadataId'],_0x16dd00[_0x304d('0x9e')],_0x22bd3d));}}});return Promise[_0x304d('0xb5')](_0xe579f7);})[_0x304d('0xd')](function(_0x103388){_0x64eff6=_0x103388[0x0];var _0x3ec539=_0x4ee5cf[_0x304d('0x8e')](_0x31f439)[_0x304d('0x8e')](_0x64eff6);var _0x153b1e={'count':_0x3ec539[_0x304d('0x2e')],'rows':_0x3ec539};return _0x153b1e;})[_0x304d('0xd')](respondWithResult(_0x13abcc,null))['catch'](function(_0x856d33){var _0x287f25=_0x54ee53['query'][_0x304d('0xb6')]?0x1f4:_0x856d33['statusCode']||0x1f4;logger[_0x304d('0x10')](_0x856d33[_0x304d('0x11')]);delete _0x856d33[_0x304d('0x12')];if(_0x287f25===0x191){_0x287f25=0x190;}_0x13abcc['status'](_0x287f25)['send'](_0x54ee53[_0x304d('0x19')]['test']?{'message':_0x304d('0xb7'),'statusCode':_0x856d33[_0x304d('0xb8')]}:_0x856d33);});};function getSelectList(_0x1b6503,_0x19c838,_0x511fe5,_0x4c2454,_0x57b43c,_0x3f5d5c){var _0x31f96b={'method':_0x304d('0xb9'),'uri':_0x1b6503+_0x304d('0x9f')+_0x4c2454+')/Attributes('+_0x57b43c+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x304d('0xba'),'headers':{'Authorization':_0x304d('0x9c')+_0x3f5d5c,'If-None-Match':null,'OData-Version':_0x304d('0xa0')},'json':!![]};return rp(_0x31f96b)[_0x304d('0xd')](function(_0x1e24a5){var _0x93fcb5=[];var _0x5899aa=_0x1e24a5[_0x304d('0xbb')][_0x304d('0xbc')];_0x5899aa[_0x304d('0xa4')](function(_0x413315){_0x93fcb5['push']({'name':_0x413315['Label']['UserLocalizedLabel']['Label'],'value':String(_0x413315[_0x304d('0xbd')])});});var _0x3463b6={'id':_0x19c838+'_'+_0x1e24a5[_0x304d('0xbe')],'name':_0x1e24a5[_0x304d('0xbf')]['UserLocalizedLabel'][_0x304d('0xc0')],'custom':![],'options':_0x93fcb5};_0x511fe5[_0x304d('0xa7')](_0x3463b6);return _0x511fe5;});}function getBooleanList(_0x1c970e,_0x11c62a,_0x1fbcca,_0x1d521a,_0xc159d,_0x5c7992){var _0x5bdda5={'method':_0x304d('0xb9'),'uri':_0x1c970e+'EntityDefinitions('+_0x1d521a+_0x304d('0xc1')+_0xc159d+_0x304d('0xc2'),'headers':{'Authorization':'Bearer\x20'+_0x5c7992,'If-None-Match':null,'OData-Version':_0x304d('0xa0')},'json':!![]};return rp(_0x5bdda5)[_0x304d('0xd')](function(_0x1e886d){var _0x5d20b0=[];_0x5d20b0[_0x304d('0xa7')]({'name':_0x1e886d[_0x304d('0xbb')][_0x304d('0xc3')][_0x304d('0xc0')][_0x304d('0xc4')][_0x304d('0xc0')],'value':'true'},{'name':_0x1e886d[_0x304d('0xbb')]['FalseOption'][_0x304d('0xc0')][_0x304d('0xc4')]['Label'],'value':_0x304d('0xc5')});var _0x33cfc3={'id':_0x11c62a+'_'+_0x1e886d[_0x304d('0xbe')],'name':_0x1e886d[_0x304d('0xbf')][_0x304d('0xc4')][_0x304d('0xc0')],'custom':![],'options':_0x5d20b0};_0x1fbcca[_0x304d('0xa7')](_0x33cfc3);return _0x1fbcca;});}function getInputList(_0x226dd0,_0x4ed6d6,_0x265b96,_0x4f3829,_0x62aa4a,_0x4b9373,_0x404ed5){var _0x4bcabd={'method':'GET','uri':_0x226dd0+_0x304d('0x9f')+_0x62aa4a+_0x304d('0xc1')+_0x4b9373+_0x304d('0xc6')+_0x265b96+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x304d('0x9c')+_0x404ed5,'If-None-Match':null,'OData-Version':_0x304d('0xa0')},'json':!![]};return rp(_0x4bcabd)[_0x304d('0xd')](function(_0x4e1f29){var _0x405e90={'id':_0x4ed6d6+'_'+_0x4e1f29[_0x304d('0xbe')],'name':_0x4e1f29[_0x304d('0xbf')][_0x304d('0xc4')]?_0x4e1f29[_0x304d('0xbf')][_0x304d('0xc4')][_0x304d('0xc0')]:_0x4e1f29['LogicalName'],'custom':![],'options':[]};_0x4f3829[_0x304d('0xa7')](_0x405e90);return _0x4f3829;});}