New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

civicrm-api

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

civicrm-api - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

dist/index.modern.js

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

import{isEmpty as t,mapValues as e,forIn as i}from"lodash-es";import{bold as r,gray as s,yellow as n}from"picocolors";function a(){return a=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},a.apply(this,arguments)}const o=["headers"];async function h([e,i,h,c],u={}){let{headers:p}=u,d=function(t,e){if(null==t)return{};var i,r,s={},n=Object.keys(t);for(r=0;r<n.length;r++)e.indexOf(i=n[r])>=0||(s[i]=t[i]);return s}(u,o);const m=crypto.randomUUID(),l=new URL(`civicrm/ajax/api4/${e}/${i}`,this.baseUrl);t(h)||(l.search=new URLSearchParams({params:JSON.stringify(h)}).toString()),void 0!==c&&l.searchParams.append("index",String(c));const f=performance.now(),g=await fetch(l,a({method:"POST",headers:a({Authorization:`Bearer ${this.apiKey}`,"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest","X-Request-ID":m},p)},d));if(this.debug){const t=`${Math.round(performance.now()-f)}ms`;console.group(`${r("CiviCRM request")} ${m} ${s(g.url)} ${g.status} in ${n(t)}`)}if(!g.ok){const t=await g.text();throw this.debug&&(console.error(t),console.groupEnd()),new Error("CiviCRM request failed")}const v=await g.json();return this.debug&&console.groupEnd(),v.values}var c;!function(t){t.get="get",t.create="create",t.update="update",t.save="save",t.delete="delete",t.getChecksum="getChecksum"}(c||(c={}));class u{constructor(t,e){this.entity=void 0,this.request=void 0,this.innerPromise=void 0,this.action=void 0,this.params=void 0,this.index=void 0,this.chains={},this.requestOptions={},this.entity=t,this.request=e}get requestParams(){const i=a({},this.params);return t(this.chains)||(i.chain=e(this.chains,t=>t.requestParams)),[this.entity,this.action,i,this.index]}get(t){return this.action=c.get,this.params=t,this}create(t){return this.action=c.create,this.params=t,this}update(t){return this.action=c.update,this.params=t,this}save(t){return this.action=c.save,this.params=t,this}delete(t){return this.action=c.delete,this.params=t,this}getChecksum(t){return this.action=c.getChecksum,this.params=t,this}one(){return this.index=0,this}options(t){return this.requestOptions=t,this}chain(t,e){return this.chains[t]=e,this}then(t,e){return this.getInnerPromise().then(t,e)}getInnerPromise(){return this.innerPromise||(this.innerPromise=this.request(this.requestParams,this.requestOptions)),this.innerPromise}}function p(t){if(!t.baseUrl)throw new Error("baseUrl is required");if(!t.apiKey)throw new Error("apiKey is required");const e={};return i(t.entities,(i,r)=>{Reflect.defineProperty(e,r,{get:()=>new u(i,(e,i)=>h.bind(t)(e,a({},t.requestOptions,i)))})}),e}export{p as createClient};
import{isEmpty as t,mapValues as e,forIn as i}from"lodash-es";import{bold as s,gray as r,yellow as n}from"picocolors";function a(){return a=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},a.apply(this,arguments)}const o=["headers"];async function h([e,i,h,c],u={}){let{headers:p}=u,d=function(t,e){if(null==t)return{};var i,s,r={},n=Object.keys(t);for(s=0;s<n.length;s++)e.indexOf(i=n[s])>=0||(r[i]=t[i]);return r}(u,o);const m=crypto.randomUUID(),l=new URL(`civicrm/ajax/api4/${e}/${i}`,this.baseUrl);t(h)||(l.search=new URLSearchParams({params:JSON.stringify(h)}).toString()),void 0!==c&&l.searchParams.append("index",String(c));const f=performance.now(),g=await fetch(l,a({method:"POST",headers:a({"X-Civi-Auth":`Bearer ${this.apiKey}`,"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest","X-Request-ID":m},p)},d));if(this.debug){const t=`${Math.round(performance.now()-f)}ms`;console.group(`${s("CiviCRM request")} ${m} ${r(g.url)} ${g.status} in ${n(t)}`)}if(!g.ok){const t=await g.text();throw this.debug&&(console.error(t),console.groupEnd()),new Error("CiviCRM request failed")}const v=await g.json();return this.debug&&console.groupEnd(),v.values}var c;!function(t){t.get="get",t.create="create",t.update="update",t.save="save",t.delete="delete",t.getChecksum="getChecksum"}(c||(c={}));class u{constructor(t,e){this.entity=void 0,this.request=void 0,this.innerPromise=void 0,this.action=void 0,this.params=void 0,this.index=void 0,this.chains={},this.requestOptions={},this.entity=t,this.request=e}get requestParams(){const i=a({},this.params);return t(this.chains)||(i.chain=e(this.chains,t=>t.requestParams)),[this.entity,this.action,i,this.index]}get(t){return this.action=c.get,this.params=t,this}create(t){return this.action=c.create,this.params=t,this}update(t){return this.action=c.update,this.params=t,this}save(t){return this.action=c.save,this.params=t,this}delete(t){return this.action=c.delete,this.params=t,this}getChecksum(t){return this.action=c.getChecksum,this.params=t,this}one(){return this.index=0,this}options(t){return this.requestOptions=t,this}chain(t,e){return this.chains[t]=e,this}then(t,e){return this.getInnerPromise().then(t,e)}getInnerPromise(){return this.innerPromise||(this.innerPromise=this.request(this.requestParams,this.requestOptions)),this.innerPromise}}function p(t){if(!t.baseUrl)throw new Error("baseUrl is required");if(!t.apiKey)throw new Error("apiKey is required");const e={};return i(t.entities,(i,s)=>{Reflect.defineProperty(e,s,{get:()=>new u(i,(e,i)=>h.bind(t)(e,a({},t.requestOptions,i)))})}),e}export{p as createClient};
//# sourceMappingURL=index.modern.js.map

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

import{isEmpty as e,mapValues as t,forIn as r}from"lodash-es";import{bold as n,gray as i,yellow as o}from"picocolors";function s(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a.apply(this,arguments)}var u,h=["headers"],c=function(t,r){var s=t[0],u=t[1],c=t[2],f=t[3],p=void 0===r?{}:r,m=p.headers,d=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(i[r]=e[r]);return i}(p,h);try{var v=this,l=crypto.randomUUID(),g=new URL("civicrm/ajax/api4/"+s+"/"+u,v.baseUrl);e(c)||(g.search=new URLSearchParams({params:JSON.stringify(c)}).toString()),void 0!==f&&g.searchParams.append("index",String(f));var y=performance.now();return Promise.resolve(fetch(g,a({method:"POST",headers:a({Authorization:"Bearer "+v.apiKey,"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest","X-Request-ID":l},m)},d))).then(function(e){function t(t){return Promise.resolve(e.json()).then(function(e){return v.debug&&console.groupEnd(),e.values})}if(v.debug){var r=Math.round(performance.now()-y)+"ms";console.group(n("CiviCRM request")+" "+l+" "+i(e.url)+" "+e.status+" in "+o(r))}var s=function(){if(!e.ok)return Promise.resolve(e.text()).then(function(e){throw v.debug&&(console.error(e),console.groupEnd()),new Error("CiviCRM request failed")})}();return s&&s.then?s.then(t):t()})}catch(e){return Promise.reject(e)}};!function(e){e.get="get",e.create="create",e.update="update",e.save="save",e.delete="delete",e.getChecksum="getChecksum"}(u||(u={}));var f=/*#__PURE__*/function(){function r(e,t){this.entity=void 0,this.request=void 0,this.innerPromise=void 0,this.action=void 0,this.params=void 0,this.index=void 0,this.chains={},this.requestOptions={},this.entity=e,this.request=t}var n,i,o=r.prototype;return o.get=function(e){return this.action=u.get,this.params=e,this},o.create=function(e){return this.action=u.create,this.params=e,this},o.update=function(e){return this.action=u.update,this.params=e,this},o.save=function(e){return this.action=u.save,this.params=e,this},o.delete=function(e){return this.action=u.delete,this.params=e,this},o.getChecksum=function(e){return this.action=u.getChecksum,this.params=e,this},o.one=function(){return this.index=0,this},o.options=function(e){return this.requestOptions=e,this},o.chain=function(e,t){return this.chains[e]=t,this},o.then=function(e,t){return this.getInnerPromise().then(e,t)},o.getInnerPromise=function(){return this.innerPromise||(this.innerPromise=this.request(this.requestParams,this.requestOptions)),this.innerPromise},n=r,(i=[{key:"requestParams",get:function(){var r=a({},this.params);return e(this.chains)||(r.chain=t(this.chains,function(e){return e.requestParams})),[this.entity,this.action,r,this.index]}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),r}();function p(e){if(!e.baseUrl)throw new Error("baseUrl is required");if(!e.apiKey)throw new Error("apiKey is required");var t={};return r(e.entities,function(r,n){Reflect.defineProperty(t,n,{get:function(){return new f(r,function(t,r){return c.bind(e)(t,a({},e.requestOptions,r))})}})}),t}export{p as createClient};
import{isEmpty as e,mapValues as t,forIn as r}from"lodash-es";import{bold as i,gray as n,yellow as s}from"picocolors";function o(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},a.apply(this,arguments)}var u,h=["headers"],c=function(t,r){var o=t[0],u=t[1],c=t[2],f=t[3],p=void 0===r?{}:r,m=p.headers,d=function(e,t){if(null==e)return{};var r,i,n={},s=Object.keys(e);for(i=0;i<s.length;i++)t.indexOf(r=s[i])>=0||(n[r]=e[r]);return n}(p,h);try{var v=this,l=crypto.randomUUID(),g=new URL("civicrm/ajax/api4/"+o+"/"+u,v.baseUrl);e(c)||(g.search=new URLSearchParams({params:JSON.stringify(c)}).toString()),void 0!==f&&g.searchParams.append("index",String(f));var y=performance.now();return Promise.resolve(fetch(g,a({method:"POST",headers:a({"X-Civi-Auth":"Bearer "+v.apiKey,"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest","X-Request-ID":l},m)},d))).then(function(e){function t(t){return Promise.resolve(e.json()).then(function(e){return v.debug&&console.groupEnd(),e.values})}if(v.debug){var r=Math.round(performance.now()-y)+"ms";console.group(i("CiviCRM request")+" "+l+" "+n(e.url)+" "+e.status+" in "+s(r))}var o=function(){if(!e.ok)return Promise.resolve(e.text()).then(function(e){throw v.debug&&(console.error(e),console.groupEnd()),new Error("CiviCRM request failed")})}();return o&&o.then?o.then(t):t()})}catch(e){return Promise.reject(e)}};!function(e){e.get="get",e.create="create",e.update="update",e.save="save",e.delete="delete",e.getChecksum="getChecksum"}(u||(u={}));var f=/*#__PURE__*/function(){function r(e,t){this.entity=void 0,this.request=void 0,this.innerPromise=void 0,this.action=void 0,this.params=void 0,this.index=void 0,this.chains={},this.requestOptions={},this.entity=e,this.request=t}var i,n,s=r.prototype;return s.get=function(e){return this.action=u.get,this.params=e,this},s.create=function(e){return this.action=u.create,this.params=e,this},s.update=function(e){return this.action=u.update,this.params=e,this},s.save=function(e){return this.action=u.save,this.params=e,this},s.delete=function(e){return this.action=u.delete,this.params=e,this},s.getChecksum=function(e){return this.action=u.getChecksum,this.params=e,this},s.one=function(){return this.index=0,this},s.options=function(e){return this.requestOptions=e,this},s.chain=function(e,t){return this.chains[e]=t,this},s.then=function(e,t){return this.getInnerPromise().then(e,t)},s.getInnerPromise=function(){return this.innerPromise||(this.innerPromise=this.request(this.requestParams,this.requestOptions)),this.innerPromise},i=r,(n=[{key:"requestParams",get:function(){var r=a({},this.params);return e(this.chains)||(r.chain=t(this.chains,function(e){return e.requestParams})),[this.entity,this.action,r,this.index]}}])&&function(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,o(i.key),i)}}(i.prototype,n),Object.defineProperty(i,"prototype",{writable:!1}),r}();function p(e){if(!e.baseUrl)throw new Error("baseUrl is required");if(!e.apiKey)throw new Error("apiKey is required");var t={};return r(e.entities,function(r,i){Reflect.defineProperty(t,i,{get:function(){return new f(r,function(t,r){return c.bind(e)(t,a({},e.requestOptions,r))})}})}),t}export{p as createClient};
//# sourceMappingURL=index.module.js.map

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("lodash-es"),require("picocolors")):"function"==typeof define&&define.amd?define(["exports","lodash-es","picocolors"],t):t((e||self).civicrmApi={},e.lodashEs,e.picocolors)}(this,function(e,t,r){function i(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},n.apply(this,arguments)}var o,s=["headers"],a=function(e,i){var o=e[0],a=e[1],u=e[2],c=e[3],h=void 0===i?{}:i,f=h.headers,p=function(e,t){if(null==e)return{};var r,i,n={},o=Object.keys(e);for(i=0;i<o.length;i++)t.indexOf(r=o[i])>=0||(n[r]=e[r]);return n}(h,s);try{var d=this,l=crypto.randomUUID(),m=new URL("civicrm/ajax/api4/"+o+"/"+a,d.baseUrl);t.isEmpty(u)||(m.search=new URLSearchParams({params:JSON.stringify(u)}).toString()),void 0!==c&&m.searchParams.append("index",String(c));var v=performance.now();return Promise.resolve(fetch(m,n({method:"POST",headers:n({Authorization:"Bearer "+d.apiKey,"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest","X-Request-ID":l},f)},p))).then(function(e){function t(t){return Promise.resolve(e.json()).then(function(e){return d.debug&&console.groupEnd(),e.values})}if(d.debug){var i=Math.round(performance.now()-v)+"ms";console.group(r.bold("CiviCRM request")+" "+l+" "+r.gray(e.url)+" "+e.status+" in "+r.yellow(i))}var n=function(){if(!e.ok)return Promise.resolve(e.text()).then(function(e){throw d.debug&&(console.error(e),console.groupEnd()),new Error("CiviCRM request failed")})}();return n&&n.then?n.then(t):t()})}catch(e){return Promise.reject(e)}};!function(e){e.get="get",e.create="create",e.update="update",e.save="save",e.delete="delete",e.getChecksum="getChecksum"}(o||(o={}));var u=/*#__PURE__*/function(){function e(e,t){this.entity=void 0,this.request=void 0,this.innerPromise=void 0,this.action=void 0,this.params=void 0,this.index=void 0,this.chains={},this.requestOptions={},this.entity=e,this.request=t}var r,s,a=e.prototype;return a.get=function(e){return this.action=o.get,this.params=e,this},a.create=function(e){return this.action=o.create,this.params=e,this},a.update=function(e){return this.action=o.update,this.params=e,this},a.save=function(e){return this.action=o.save,this.params=e,this},a.delete=function(e){return this.action=o.delete,this.params=e,this},a.getChecksum=function(e){return this.action=o.getChecksum,this.params=e,this},a.one=function(){return this.index=0,this},a.options=function(e){return this.requestOptions=e,this},a.chain=function(e,t){return this.chains[e]=t,this},a.then=function(e,t){return this.getInnerPromise().then(e,t)},a.getInnerPromise=function(){return this.innerPromise||(this.innerPromise=this.request(this.requestParams,this.requestOptions)),this.innerPromise},r=e,(s=[{key:"requestParams",get:function(){var e=n({},this.params);return t.isEmpty(this.chains)||(e.chain=t.mapValues(this.chains,function(e){return e.requestParams})),[this.entity,this.action,e,this.index]}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}(r.prototype,s),Object.defineProperty(r,"prototype",{writable:!1}),e}();e.createClient=function(e){if(!e.baseUrl)throw new Error("baseUrl is required");if(!e.apiKey)throw new Error("apiKey is required");var r={};return t.forIn(e.entities,function(t,i){Reflect.defineProperty(r,i,{get:function(){return new u(t,function(t,r){return a.bind(e)(t,n({},e.requestOptions,r))})}})}),r}});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("lodash-es"),require("picocolors")):"function"==typeof define&&define.amd?define(["exports","lodash-es","picocolors"],t):t((e||self).civicrmApi={},e.lodashEs,e.picocolors)}(this,function(e,t,r){function i(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},n.apply(this,arguments)}var o,s=["headers"],a=function(e,i){var o=e[0],a=e[1],u=e[2],c=e[3],h=void 0===i?{}:i,f=h.headers,p=function(e,t){if(null==e)return{};var r,i,n={},o=Object.keys(e);for(i=0;i<o.length;i++)t.indexOf(r=o[i])>=0||(n[r]=e[r]);return n}(h,s);try{var d=this,l=crypto.randomUUID(),m=new URL("civicrm/ajax/api4/"+o+"/"+a,d.baseUrl);t.isEmpty(u)||(m.search=new URLSearchParams({params:JSON.stringify(u)}).toString()),void 0!==c&&m.searchParams.append("index",String(c));var v=performance.now();return Promise.resolve(fetch(m,n({method:"POST",headers:n({"X-Civi-Auth":"Bearer "+d.apiKey,"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest","X-Request-ID":l},f)},p))).then(function(e){function t(t){return Promise.resolve(e.json()).then(function(e){return d.debug&&console.groupEnd(),e.values})}if(d.debug){var i=Math.round(performance.now()-v)+"ms";console.group(r.bold("CiviCRM request")+" "+l+" "+r.gray(e.url)+" "+e.status+" in "+r.yellow(i))}var n=function(){if(!e.ok)return Promise.resolve(e.text()).then(function(e){throw d.debug&&(console.error(e),console.groupEnd()),new Error("CiviCRM request failed")})}();return n&&n.then?n.then(t):t()})}catch(e){return Promise.reject(e)}};!function(e){e.get="get",e.create="create",e.update="update",e.save="save",e.delete="delete",e.getChecksum="getChecksum"}(o||(o={}));var u=/*#__PURE__*/function(){function e(e,t){this.entity=void 0,this.request=void 0,this.innerPromise=void 0,this.action=void 0,this.params=void 0,this.index=void 0,this.chains={},this.requestOptions={},this.entity=e,this.request=t}var r,s,a=e.prototype;return a.get=function(e){return this.action=o.get,this.params=e,this},a.create=function(e){return this.action=o.create,this.params=e,this},a.update=function(e){return this.action=o.update,this.params=e,this},a.save=function(e){return this.action=o.save,this.params=e,this},a.delete=function(e){return this.action=o.delete,this.params=e,this},a.getChecksum=function(e){return this.action=o.getChecksum,this.params=e,this},a.one=function(){return this.index=0,this},a.options=function(e){return this.requestOptions=e,this},a.chain=function(e,t){return this.chains[e]=t,this},a.then=function(e,t){return this.getInnerPromise().then(e,t)},a.getInnerPromise=function(){return this.innerPromise||(this.innerPromise=this.request(this.requestParams,this.requestOptions)),this.innerPromise},r=e,(s=[{key:"requestParams",get:function(){var e=n({},this.params);return t.isEmpty(this.chains)||(e.chain=t.mapValues(this.chains,function(e){return e.requestParams})),[this.entity,this.action,e,this.index]}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}(r.prototype,s),Object.defineProperty(r,"prototype",{writable:!1}),e}();e.createClient=function(e){if(!e.baseUrl)throw new Error("baseUrl is required");if(!e.apiKey)throw new Error("apiKey is required");var r={};return t.forIn(e.entities,function(t,i){Reflect.defineProperty(r,i,{get:function(){return new u(t,function(t,r){return a.bind(e)(t,n({},e.requestOptions,r))})}})}),r}});
//# sourceMappingURL=index.umd.js.map
{
"name": "civicrm-api",
"type": "module",
"version": "0.1.0",
"version": "0.1.1",
"source": "src/index.ts",

@@ -6,0 +6,0 @@ "main": "./dist/index.cjs",

@@ -34,3 +34,3 @@ import { isEmpty } from "lodash-es";

headers: {
Authorization: `Bearer ${this.apiKey}`,
"X-Civi-Auth": `Bearer ${this.apiKey}`,
"Content-Type": "application/x-www-form-urlencoded",

@@ -37,0 +37,0 @@ "X-Requested-With": "XMLHttpRequest",

@@ -61,3 +61,3 @@ import { DeferredPromise } from "@open-draft/deferred-promise";

expect(req.headers.get("Authorization")).toBe("Bearer mock-api-key");
expect(req.headers.get("X-Civi-Auth")).toBe("Bearer mock-api-key");
expect(req.headers.get("X-Requested-With")).toBe("XMLHttpRequest");

@@ -90,3 +90,3 @@ expect(req.headers.get("Content-Type")).toBe(

expect(req.headers.get("Authorization")).toBe("Bearer mock-api-key");
expect(req.headers.get("X-Civi-Auth")).toBe("Bearer mock-api-key");
expect(req.headers.get("X-Correlation-Id")).toBe("mock-correlation-id");

@@ -113,3 +113,3 @@ });

expect(req.cache).toBe("no-cache");
expect(req.headers.get("Authorization")).toBe("Bearer mock-api-key");
expect(req.headers.get("X-Civi-Auth")).toBe("Bearer mock-api-key");
expect(req.headers.get("X-Correlation-Id")).toBe("mock-correlation-id");

@@ -116,0 +116,0 @@ });

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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