{"version":3,"sources":["Honeywell.ClientModel.JsonService.ts"],"names":["jsonSubmit","responseCallback","responseFormat","actionUrl","payLoad","additionalData","$","ajax","url","data","JSON","stringify","dataType","type","success","result","error","this","AdditionalData","postRequest","Q","exports"],"mappings":"wEAKA,SAAgBA,GAAWC,EACvBC,EACAC,EACAC,EACAC,GACA,MAAOC,GAAEC,MACLC,IAAKL,EACLM,KAAMC,KAAKC,UAAUP,GACrBQ,SAAUV,EACVW,KAAM,OACNC,QAAS,SAASC,GACU,MAApBd,GACAA,EAAiBc,GAAQ,EAAMV,IAGvCW,MAAO,SAASD,GACY,MAApBd,GACAA,EAAiBc,GAAQ,EAAOE,KAAKC,mBAMrD,QAAgBC,GACZjB,EACAC,EACAC,GACA,MAAOgB,GAAEd,EAAEC,MACPC,IAAKL,EACLM,KAAMC,KAAKC,UAAUP,GACrBQ,SAAUV,EACVW,KAAM,2DA/BdQ,EAAArB,WAAAA,EAuBAqB,EAAAF,YAAAA","file":"Honeywell.ClientModel.JsonService.js","sourcesContent":["//// \r\n/**This is to use Commerce JSON calls*/\r\nimport * as $ from \"jquery\";\r\nimport * as Q from \"q\";\r\n\r\nexport function jsonSubmit(responseCallback: (result: any, success: boolean, additionalData: any) => any,\r\n responseFormat: string,\r\n actionUrl: string,\r\n payLoad: any,\r\n additionalData: any) {\r\n return $.ajax({\r\n url: actionUrl,\r\n data: JSON.stringify(payLoad),\r\n dataType: responseFormat,\r\n type: \"POST\",\r\n success: function(result) {\r\n if (responseCallback != null) {\r\n responseCallback(result, true, additionalData);\r\n }\r\n },\r\n error: function(result) {\r\n if (responseCallback != null) {\r\n responseCallback(result, false, this.AdditionalData);\r\n }\r\n }\r\n });\r\n}\r\n\r\nexport function postRequest(\r\n responseFormat: string,\r\n actionUrl: string,\r\n payLoad: any): Q.Promise {\r\n return Q($.ajax({\r\n url: actionUrl,\r\n data: JSON.stringify(payLoad),\r\n dataType: responseFormat,\r\n type: \"POST\"\r\n }));\r\n}\r\n"]}