Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mkm-actions-forms

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mkm-actions-forms - npm Package Compare versions

Comparing version 2.0.14 to 2.0.15

2

lib/index.js

@@ -1,2 +0,2 @@

module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.success=t.message=t.info=t.warning=t.error=t.update=t.dismiss=t.toastActionCreator=void 0;var r,o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(1)),s=n(2),a=n(8),u=(r=a)&&r.__esModule?r:{default:r};var i=t.toastActionCreator=function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:o.TOAST_MESSAGE,payload:Object.assign({id:n.id||(0,u.default)("toast")},n,{message:t,type:e})}}};t.dismiss=function(e){return{type:o.TOAST_DISMISS,payload:{id:e}}},t.update=function(e,t){return{type:o.TOAST_UPDATE,payload:{id:e,options:t}}},t.error=i(s.toast.TYPE.ERROR),t.warning=i(s.toast.TYPE.WARNING),t.info=i(s.toast.TYPE.INFO),t.message=i(s.toast.TYPE.DEFAULT),t.success=i(s.toast.TYPE.SUCCESS)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.TOAST_DISMISS="TOAST_DISMISS",t.TOAST_MESSAGE="TOAST_MESSAGE",t.TOAST_UPDATE="TOAST_UPDATE"},function(e,t){e.exports=require("react-toastify")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SET_EDITING_FORM_TEMPLATE="SET_EDITING_FORM_TEMPLATE",t.SET_EDITING_FORM_TEMPLATE_MAPPINGS="SET_EDITING_FORM_TEMPLATE_MAPPINGS"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEmailForLaterResponses=t.getLatestResponse=t.deleteDraftResponse=t.updateDraftResponse=t.createDraftResponse=t.getDraftResponse=t.submitCompletedResponse=t.translateFormTemplate=t.updateFormTemplateMappings=t.publishFormTemplate=t.saveOrUpdateFormTemplate=t.createFormTemplate=t.getPublishedFormTemplate=t.getFormTemplate=void 0;var r,o=n(5),s=n(14),a=(r=s)&&r.__esModule?r:{default:r};t.default=a.default,t.getFormTemplate=o.getFormTemplate,t.getPublishedFormTemplate=o.getPublishedFormTemplate,t.createFormTemplate=o.createFormTemplate,t.saveOrUpdateFormTemplate=o.saveOrUpdateFormTemplate,t.publishFormTemplate=o.publishFormTemplate,t.updateFormTemplateMappings=o.updateFormTemplateMappings,t.translateFormTemplate=o.translateFormTemplate,t.submitCompletedResponse=o.submitCompletedResponse,t.getDraftResponse=o.getDraftResponse,t.createDraftResponse=o.createDraftResponse,t.updateDraftResponse=o.updateDraftResponse,t.deleteDraftResponse=o.deleteDraftResponse,t.getLatestResponse=o.getLatestResponse,t.getEmailForLaterResponses=o.getEmailForLaterResponses},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFormTemplate=function(e){return function(t){return u.getFormTemplate(e).then((function(e){return"formTemplate not found"!==e&&t(function(e){return function(t){t({type:s.SET_EDITING_FORM_TEMPLATE,payload:e})}}(e)),e})).catch((function(e){throw e}))}},t.getPublishedFormTemplate=function(e){return function(t){return u.getPublishedFormTemplate(e).then((function(e){return e})).catch((function(e){throw e}))}},t.saveOrUpdateFormTemplate=function(e){return function(t){return e.id?u.updateFormTemplate(e).then((function(){return(0,o.success)("Successfully updated assessment")})).catch((function(e){throw e})):u.createFormTemplate(e).then((function(){return(0,o.success)("Successfully created assessment")})).catch((function(e){throw e}))}},t.publishFormTemplate=function(e){return function(t){return u.publishFormTemplate(e).then((function(){return(0,o.success)("Successfully published assessment")})).catch((function(e){throw e}))}},t.createFormTemplate=function(e){return function(t){return u.createFormTemplate(e).then((function(){return(0,o.success)("Successfully created assessment")})).catch((function(e){throw e}))}},t.updateFormTemplateMappings=function(e){return function(t){t({type:s.SET_EDITING_FORM_TEMPLATE_MAPPINGS,payload:e})}},t.translateFormTemplate=function(e,t){return function(n){return u.translateFormTemplate(e,t).then((function(){return n((0,o.success)("Successfully translated assessment")),!0})).catch((function(e){return e}))}},t.submitCompletedResponse=function(e){return function(t){return u.submitCompletedResponse(e).then((function(e){return t((0,o.success)("Successfully submitted response")),e})).catch((function(e){throw e}))}},t.getDraftResponse=function(e){return function(t){return u.getDraftResponse(e).then((function(e){return e})).catch((function(e){throw e}))}},t.createDraftResponse=function(e){return function(t){return u.createDraftResponse(e).then((function(e){return e})).catch((function(e){throw e}))}},t.updateDraftResponse=function(e){return function(t){return u.updateDraftResponse(e).then((function(e){return e})).catch((function(e){throw e}))}},t.deleteDraftResponse=function(e){return function(t){return u.deleteDraftResponse(e).then((function(e){return t((0,o.success)("Successfully deleted draft")),e})).catch((function(e){throw e}))}},t.getLatestResponse=function(e,t){return function(n){return u.getLatestResponse(e,t).then((function(e){return e})).catch((function(e){throw e}))}},t.getEmailForLaterResponses=function(e){return function(t){return u.getEmailForLaterResponses(e).then((function(e){return e})).catch((function(e){throw e}))}};var r=n(6),o=n(7),s=n(3),a={apiUri:process.env.REACT_APP_API_GATEWAY_URL,upstreamPath:"formauthoring/"},u=new r.FormService(a)},function(e,t){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){"use strict";var r=n(2),o=n(10),s=Object.prototype.toString;function a(e){return"[object Array]"===s.call(e)}function u(e){return null!==e&&"object"==typeof e}function i(e){return"[object Function]"===s.call(e)}function c(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),a(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:a,isArrayBuffer:function(e){return"[object ArrayBuffer]"===s.call(e)},isBuffer:o,isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:u,isUndefined:function(e){return void 0===e},isDate:function(e){return"[object Date]"===s.call(e)},isFile:function(e){return"[object File]"===s.call(e)},isBlob:function(e){return"[object Blob]"===s.call(e)},isFunction:i,isStream:function(e){return u(e)&&i(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function e(){var t={};function n(n,r){"object"==typeof t[r]&&"object"==typeof n?t[r]=e(t[r],n):t[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return t},extend:function(e,t,n){return c(t,(function(t,o){e[o]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(e,t,n){"use strict";(function(t){var r=n(0),o=n(13),s={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u,i={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t)&&(u=n(3)),u),transformRequest:[function(e,t){return o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(a(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){i.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){i.headers[e]=r.merge(s)})),e.exports=i}).call(this,n(12))},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},function(e,t,n){"use strict";var r=n(0),o=n(14),s=n(16),a=n(17),u=n(18),i=n(4);e.exports=function(e){return new Promise((function(t,c){var f=e.data,l=e.headers;r.isFormData(f)&&delete l["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var d=e.auth.username||"",m=e.auth.password||"";l.Authorization="Basic "+btoa(d+":"+m)}if(p.open(e.method.toUpperCase(),s(e.url,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in p?a(p.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:n,config:e,request:p};o(t,c,r),p=null}},p.onerror=function(){c(i("Network Error",e,null,p)),p=null},p.ontimeout=function(){c(i("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var h=n(19),y=(e.withCredentials||u(e.url))&&e.xsrfCookieName?h.read(e.xsrfCookieName):void 0;y&&(l[e.xsrfHeaderName]=y)}if("setRequestHeader"in p&&r.forEach(l,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete l[t]:p.setRequestHeader(t,e)})),e.withCredentials&&(p.withCredentials=!0),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),c(e),p=null)})),void 0===f&&(f=null),p.send(f)}))}},function(e,t,n){"use strict";var r=n(15);e.exports=function(e,t,n,o,s){var a=new Error(e);return r(a,t,n,o,s)}},function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.instance=t.FormService=void 0;var r,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=((r=n(8))&&r.__esModule?r:{default:r}).default.create({timeout:3e5,params:{},headers:{Pragma:"no-cache"}});s.interceptors.request.use((function(e){var t=localStorage.getItem("authToken"),n=localStorage.getItem("roleToken"),r=localStorage.getItem("deviceId");return t&&(e.headers.Authorization="Bearer "+t),n&&(e.headers["x-current-role-token"]="Bearer "+n),r&&(e.headers.DeviceId=r),e}));var a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=localStorage.getItem("gatewayURL");this.apiUrl=(n||t.apiUri)+t.upstreamPath}return o(e,[{key:"getFormTemplate",value:function(e){var t=this;return new Promise((function(n,r){s.get(t.apiUrl+"formtemplates/"+e).then((function(e){n(e.data)})).catch((function(e){return n("formTemplate not found")}))}))}},{key:"getPublishedFormTemplate",value:function(e){var t=this;return new Promise((function(n,r){s.get(t.apiUrl+"formtemplates/"+e+"/published").then((function(e){n(e.data)})).catch((function(e){return n("published formTemplate not found")}))}))}},{key:"createFormTemplate",value:function(e){var t=this;return new Promise((function(n,r){s.post(t.apiUrl+"formtemplates",e).then((function(e){e.data&&n(e.data)})).catch((function(e){return r(e.message)}))}))}},{key:"updateFormTemplate",value:function(e){var t=this;return new Promise((function(n,r){s.put(t.apiUrl+"formtemplates/"+e.id,e).then((function(e){e.data&&n(e.data)})).catch((function(e){return r(e.message)}))}))}},{key:"publishFormTemplate",value:function(e){var t=this;return new Promise((function(n,r){s.put(t.apiUrl+"formtemplates/publish",e).then((function(e){e.data&&n(e.data)})).catch((function(e){return r(e.message)}))}))}},{key:"translateFormTemplate",value:function(e,t){var n=this;return new Promise((function(r,o){s.put(n.apiUrl+"formtemplates/"+e+"/autotranslations",t).then((function(e){e.data&&r(e.data)})).catch((function(e){return o(e.message)}))}))}},{key:"submitCompletedResponse",value:function(e){var t=this;return new Promise((function(n,r){s.post(t.apiUrl+"epads/"+e.submitterId+"/submitForm",e).then((function(e){e.data&&n(e.data)})).catch((function(e){return r("Failed to submit form")}))}))}},{key:"getDraftResponse",value:function(e){var t=this;return new Promise((function(n,r){s.get(t.apiUrl+"formresponses/"+e).then((function(e){n(e.data)})).catch((function(e){return n("Draft not found")}))}))}},{key:"createDraftResponse",value:function(e){var t=this;return new Promise((function(n,r){s.post(t.apiUrl+"formresponses",e).then((function(e){n(e.data)})).catch((function(e){return n("Unable to create draft")}))}))}},{key:"updateDraftResponse",value:function(e){var t=this;return console.log("== update drafts service ==",e),new Promise((function(n,r){s.put(t.apiUrl+"formresponses/"+e.id,e).then((function(e){n(e.data)})).catch((function(e){return n("Unable to update draft")}))}))}},{key:"deleteDraftResponse",value:function(e){var t=this;return new Promise((function(n,r){s.delete(t.apiUrl+"formresponses/"+e).then((function(e){n(e.data)})).catch((function(e){return n("Unable to delete draft")}))}))}},{key:"getLatestResponse",value:function(e,t){var n=this;return new Promise((function(r,o){s.get(n.apiUrl+"formresponses/responsesForForm/"+e+"/latest/"+t).then((function(e){r(e.data)})).catch((function(e){return r("Response not found")}))}))}},{key:"getEmailForLaterResponses",value:function(e){var t=this;return new Promise((function(n,r){s.get(t.apiUrl+"formresponses/responsesForForm/"+e+"/emailForLater").then((function(e){n(e.data)})).catch((function(e){return n([])}))}))}}]),e}();t.FormService=a,t.instance=s},function(e,t,n){e.exports=n(9)},function(e,t,n){"use strict";var r=n(0),o=n(2),s=n(11),a=n(1);function u(e){var t=new s(e),n=o(s.prototype.request,t);return r.extend(n,s.prototype,t),r.extend(n,t),n}var i=u(a);i.Axios=s,i.create=function(e){return u(r.merge(a,e))},i.Cancel=n(6),i.CancelToken=n(25),i.isCancel=n(5),i.all=function(e){return Promise.all(e)},i.spread=n(26),e.exports=i,e.exports.default=i},function(e,t){
module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.success=t.message=t.info=t.warning=t.error=t.update=t.dismiss=t.toastActionCreator=void 0;var r,o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(1)),s=n(2),a=n(8),u=(r=a)&&r.__esModule?r:{default:r};var i=t.toastActionCreator=function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{type:o.TOAST_MESSAGE,payload:Object.assign({id:n.id||(0,u.default)("toast")},n,{message:t,type:e})}}};t.dismiss=function(e){return{type:o.TOAST_DISMISS,payload:{id:e}}},t.update=function(e,t){return{type:o.TOAST_UPDATE,payload:{id:e,options:t}}},t.error=i(s.toast.TYPE.ERROR),t.warning=i(s.toast.TYPE.WARNING),t.info=i(s.toast.TYPE.INFO),t.message=i(s.toast.TYPE.DEFAULT),t.success=i(s.toast.TYPE.SUCCESS)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.TOAST_DISMISS="TOAST_DISMISS",t.TOAST_MESSAGE="TOAST_MESSAGE",t.TOAST_UPDATE="TOAST_UPDATE"},function(e,t){e.exports=require("react-toastify")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.SET_EDITING_FORM_TEMPLATE="SET_EDITING_FORM_TEMPLATE",t.SET_EDITING_FORM_TEMPLATE_MAPPINGS="SET_EDITING_FORM_TEMPLATE_MAPPINGS"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEmailForLaterResponses=t.getLatestResponse=t.deleteDraftResponse=t.updateDraftResponse=t.createDraftResponse=t.getDraftResponse=t.submitCompletedResponse=t.translateFormTemplate=t.updateFormTemplateMappings=t.publishFormTemplate=t.saveOrUpdateFormTemplate=t.createFormTemplate=t.getPublishedFormTemplate=t.getFormTemplate=void 0;var r,o=n(5),s=n(14),a=(r=s)&&r.__esModule?r:{default:r};t.default=a.default,t.getFormTemplate=o.getFormTemplate,t.getPublishedFormTemplate=o.getPublishedFormTemplate,t.createFormTemplate=o.createFormTemplate,t.saveOrUpdateFormTemplate=o.saveOrUpdateFormTemplate,t.publishFormTemplate=o.publishFormTemplate,t.updateFormTemplateMappings=o.updateFormTemplateMappings,t.translateFormTemplate=o.translateFormTemplate,t.submitCompletedResponse=o.submitCompletedResponse,t.getDraftResponse=o.getDraftResponse,t.createDraftResponse=o.createDraftResponse,t.updateDraftResponse=o.updateDraftResponse,t.deleteDraftResponse=o.deleteDraftResponse,t.getLatestResponse=o.getLatestResponse,t.getEmailForLaterResponses=o.getEmailForLaterResponses},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFormTemplate=function(e){return function(t){return u.getFormTemplate(e).then((function(e){return"formTemplate not found"!==e&&t(function(e){return function(t){t({type:s.SET_EDITING_FORM_TEMPLATE,payload:e})}}(e)),e})).catch((function(e){throw e}))}},t.getPublishedFormTemplate=function(e){return function(t){return u.getPublishedFormTemplate(e).then((function(e){return e})).catch((function(e){throw e}))}},t.saveOrUpdateFormTemplate=function(e){return function(t){return e.id?u.updateFormTemplate(e).then((function(){return(0,o.success)("Successfully updated assessment")})).catch((function(e){throw e})):u.createFormTemplate(e).then((function(){return(0,o.success)("Successfully created assessment")})).catch((function(e){throw e}))}},t.publishFormTemplate=function(e){return function(t){return u.publishFormTemplate(e).then((function(){return(0,o.success)("Successfully published assessment")})).catch((function(e){throw e}))}},t.createFormTemplate=function(e){return function(t){return u.createFormTemplate(e).then((function(){return(0,o.success)("Successfully created assessment")})).catch((function(e){throw e}))}},t.updateFormTemplateMappings=function(e){return function(t){t({type:s.SET_EDITING_FORM_TEMPLATE_MAPPINGS,payload:e})}},t.translateFormTemplate=function(e,t){return function(n){return u.translateFormTemplate(e,t).then((function(){return n((0,o.success)("Successfully translated assessment")),!0})).catch((function(e){return e}))}},t.submitCompletedResponse=function(e){return function(t){return u.submitCompletedResponse(e).then((function(e){return t((0,o.success)("Successfully submitted response")),e})).catch((function(e){throw e}))}},t.getDraftResponse=function(e){return function(t){return u.getDraftResponse(e).then((function(e){return e})).catch((function(e){throw e}))}},t.createDraftResponse=function(e){return function(t){return u.createDraftResponse(e).then((function(e){return e})).catch((function(e){throw e}))}},t.updateDraftResponse=function(e){return function(t){return u.updateDraftResponse(e).then((function(e){return e})).catch((function(e){throw e}))}},t.deleteDraftResponse=function(e){return function(t){return u.deleteDraftResponse(e).then((function(e){return t((0,o.success)("Successfully deleted draft")),e})).catch((function(e){throw e}))}},t.getLatestResponse=function(e,t){return function(n){return u.getLatestResponse(e,t).then((function(e){return e})).catch((function(e){throw e}))}},t.getEmailForLaterResponses=function(e,t){return function(n){return u.getEmailForLaterResponses(e,t).then((function(e){return e})).catch((function(e){throw e}))}};var r=n(6),o=n(7),s=n(3),a={apiUri:process.env.REACT_APP_API_GATEWAY_URL,upstreamPath:"formauthoring/"},u=new r.FormService(a)},function(e,t){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){"use strict";var r=n(2),o=n(10),s=Object.prototype.toString;function a(e){return"[object Array]"===s.call(e)}function u(e){return null!==e&&"object"==typeof e}function i(e){return"[object Function]"===s.call(e)}function c(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),a(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:a,isArrayBuffer:function(e){return"[object ArrayBuffer]"===s.call(e)},isBuffer:o,isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:u,isUndefined:function(e){return void 0===e},isDate:function(e){return"[object Date]"===s.call(e)},isFile:function(e){return"[object File]"===s.call(e)},isBlob:function(e){return"[object Blob]"===s.call(e)},isFunction:i,isStream:function(e){return u(e)&&i(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function e(){var t={};function n(n,r){"object"==typeof t[r]&&"object"==typeof n?t[r]=e(t[r],n):t[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return t},extend:function(e,t,n){return c(t,(function(t,o){e[o]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(e,t,n){"use strict";(function(t){var r=n(0),o=n(13),s={"Content-Type":"application/x-www-form-urlencoded"};function a(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var u,i={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t)&&(u=n(3)),u),transformRequest:[function(e,t){return o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(a(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(a(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(e){i.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){i.headers[e]=r.merge(s)})),e.exports=i}).call(this,n(12))},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},function(e,t,n){"use strict";var r=n(0),o=n(14),s=n(16),a=n(17),u=n(18),i=n(4);e.exports=function(e){return new Promise((function(t,c){var f=e.data,l=e.headers;r.isFormData(f)&&delete l["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var d=e.auth.username||"",m=e.auth.password||"";l.Authorization="Basic "+btoa(d+":"+m)}if(p.open(e.method.toUpperCase(),s(e.url,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in p?a(p.getAllResponseHeaders()):null,r={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:n,config:e,request:p};o(t,c,r),p=null}},p.onerror=function(){c(i("Network Error",e,null,p)),p=null},p.ontimeout=function(){c(i("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var h=n(19),y=(e.withCredentials||u(e.url))&&e.xsrfCookieName?h.read(e.xsrfCookieName):void 0;y&&(l[e.xsrfHeaderName]=y)}if("setRequestHeader"in p&&r.forEach(l,(function(e,t){void 0===f&&"content-type"===t.toLowerCase()?delete l[t]:p.setRequestHeader(t,e)})),e.withCredentials&&(p.withCredentials=!0),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),c(e),p=null)})),void 0===f&&(f=null),p.send(f)}))}},function(e,t,n){"use strict";var r=n(15);e.exports=function(e,t,n,o,s){var a=new Error(e);return r(a,t,n,o,s)}},function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.instance=t.FormService=void 0;var r,o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=((r=n(8))&&r.__esModule?r:{default:r}).default.create({timeout:3e5,params:{},headers:{Pragma:"no-cache"}});s.interceptors.request.use((function(e){var t=localStorage.getItem("authToken"),n=localStorage.getItem("roleToken"),r=localStorage.getItem("deviceId");return t&&(e.headers.Authorization="Bearer "+t),n&&(e.headers["x-current-role-token"]="Bearer "+n),r&&(e.headers.DeviceId=r),e}));var a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=localStorage.getItem("gatewayURL");this.apiUrl=(n||t.apiUri)+t.upstreamPath}return o(e,[{key:"getFormTemplate",value:function(e){var t=this;return new Promise((function(n,r){s.get(t.apiUrl+"formtemplates/"+e).then((function(e){n(e.data)})).catch((function(e){return n("formTemplate not found")}))}))}},{key:"getPublishedFormTemplate",value:function(e){var t=this;return new Promise((function(n,r){s.get(t.apiUrl+"formtemplates/"+e+"/published").then((function(e){n(e.data)})).catch((function(e){return n("published formTemplate not found")}))}))}},{key:"createFormTemplate",value:function(e){var t=this;return new Promise((function(n,r){s.post(t.apiUrl+"formtemplates",e).then((function(e){e.data&&n(e.data)})).catch((function(e){return r(e.message)}))}))}},{key:"updateFormTemplate",value:function(e){var t=this;return new Promise((function(n,r){s.put(t.apiUrl+"formtemplates/"+e.id,e).then((function(e){e.data&&n(e.data)})).catch((function(e){return r(e.message)}))}))}},{key:"publishFormTemplate",value:function(e){var t=this;return new Promise((function(n,r){s.put(t.apiUrl+"formtemplates/publish",e).then((function(e){e.data&&n(e.data)})).catch((function(e){return r(e.message)}))}))}},{key:"translateFormTemplate",value:function(e,t){var n=this;return new Promise((function(r,o){s.put(n.apiUrl+"formtemplates/"+e+"/autotranslations",t).then((function(e){e.data&&r(e.data)})).catch((function(e){return o(e.message)}))}))}},{key:"submitCompletedResponse",value:function(e){var t=this;return new Promise((function(n,r){s.post(t.apiUrl+"epads/"+e.submitterId+"/submitForm",e).then((function(e){e.data&&n(e.data)})).catch((function(e){return r("Failed to submit form")}))}))}},{key:"getDraftResponse",value:function(e){var t=this;return new Promise((function(n,r){s.get(t.apiUrl+"formresponses/"+e).then((function(e){n(e.data)})).catch((function(e){return n("Draft not found")}))}))}},{key:"createDraftResponse",value:function(e){var t=this;return new Promise((function(n,r){s.post(t.apiUrl+"formresponses",e).then((function(e){n(e.data)})).catch((function(e){return n("Unable to create draft")}))}))}},{key:"updateDraftResponse",value:function(e){var t=this;return console.log("== update drafts service ==",e),new Promise((function(n,r){s.put(t.apiUrl+"formresponses/"+e.id,e).then((function(e){n(e.data)})).catch((function(e){return n("Unable to update draft")}))}))}},{key:"deleteDraftResponse",value:function(e){var t=this;return new Promise((function(n,r){s.delete(t.apiUrl+"formresponses/"+e).then((function(e){n(e.data)})).catch((function(e){return n("Unable to delete draft")}))}))}},{key:"getLatestResponse",value:function(e,t){var n=this;return new Promise((function(r,o){s.get(n.apiUrl+"formresponses/responsesForForm/"+e+"/latest/"+t).then((function(e){r(e.data)})).catch((function(e){return r("Response not found")}))}))}},{key:"getEmailForLaterResponses",value:function(e,t){var n=this;return new Promise((function(t,r){s.get(n.apiUrl+"formresponses/responsesForForm/"+e+"/emailForLater/{reference}").then((function(e){t(e.data)})).catch((function(e){return t([])}))}))}}]),e}();t.FormService=a,t.instance=s},function(e,t,n){e.exports=n(9)},function(e,t,n){"use strict";var r=n(0),o=n(2),s=n(11),a=n(1);function u(e){var t=new s(e),n=o(s.prototype.request,t);return r.extend(n,s.prototype,t),r.extend(n,t),n}var i=u(a);i.Axios=s,i.create=function(e){return u(r.merge(a,e))},i.Cancel=n(6),i.CancelToken=n(25),i.isCancel=n(5),i.all=function(e){return Promise.all(e)},i.spread=n(26),e.exports=i,e.exports.default=i},function(e,t){
/*!

@@ -3,0 +3,0 @@ * Determine if an object is a Buffer

{
"name": "mkm-actions-forms",
"version": "2.0.14",
"version": "2.0.15",
"description": "Redux actions to support forms",

@@ -54,4 +54,4 @@ "main": "./lib/index.js",

"dependencies": {
"mkm-service-forms": "^2.0.9"
"mkm-service-forms": "^2.0.10"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc