@commercelayer/js-auth
Advanced tools
Comparing version 5.2.0 to 5.2.1
@@ -124,2 +124,2 @@ /** | ||
export { type GrantType, type TAuthorizationCode, type TAuthorizationCodeReturn, type TBaseOptions, type TBaseReturn, type TClientCredentials, type TOptions, type TPassword, type TPasswordReturn, type TRefreshToken, type TReturn, core, provisioning }; | ||
export { type GrantType, type TAuthorizationCode, type TAuthorizationCodeReturn, type TBaseOptions, type TBaseReturn, type TClientCredentials, type TOptions, type TPassword, type TPasswordReturn, type TProvisioningOptions, type TProvisioningReturn, type TRefreshToken, type TReturn, core, provisioning }; |
@@ -1,2 +0,2 @@ | ||
function c(e){return e.replace(/[A-Z]/g,function(t){return"_"+t.toLowerCase()})}function m(e){return e.replace(/([-_][a-z])/g,t=>t.toUpperCase().replace("-","").replace("_",""))}async function i({attributes:e,headers:t,endpoint:r}){let a=Object.keys(e).reduce((o,n)=>{let s=c(n);return o[s]=e[n],o},{});return await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...t},body:JSON.stringify(a)}).then(async o=>{let n=await o.json();return n.expires=new Date(Date.now()+n.expires_in*1e3),Object.keys(n).reduce((s,p)=>{let u=m(p);return s[u]=n[p],s},{})})}async function y(e,{domain:t="commercelayer.io",slug:r,headers:a,...o}){return await i({attributes:{grant_type:e,...o},endpoint:`https://${r}.${t}/oauth/token`,headers:a})}var C={authentication:y};async function T({domain:e="commercelayer.io",headers:t,...r}){return await i({attributes:{grant_type:"client_credentials",scope:"provisioning-api",...r},endpoint:`https://auth.${e}/oauth/token`,headers:t})}var d={authentication:T};export{C as core,d as provisioning}; | ||
function c(e){return e.replace(/[A-Z]/g,function(t){return"_"+t.toLowerCase()})}function m(e){return e.replace(/([-_][a-z])/g,t=>t.toUpperCase().replace("-","").replace("_",""))}async function i({attributes:e,headers:t,endpoint:r}){let a=Object.keys(e).reduce((o,n)=>{let s=c(n);return o[s]=e[n],o},{});return await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...t},body:JSON.stringify(a)}).then(async o=>{let n=await o.json();return n.expires=new Date(Date.now()+n.expires_in*1e3),Object.keys(n).reduce((s,p)=>{let u=m(p);return s[u]=n[p],s},{})})}async function y(e,{domain:t="commercelayer.io",slug:r,headers:a,...o}){return await i({attributes:{grant_type:e,...o},endpoint:`https://${r}.${t}/oauth/token`,headers:a})}var T={authentication:y};async function C({domain:e="commercelayer.io",headers:t,...r}){return await i({attributes:{grant_type:"client_credentials",scope:"provisioning-api",...r},endpoint:`https://auth.${e}/oauth/token`,headers:t})}var d={authentication:C};export{T as core,d as provisioning}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@commercelayer/js-auth", | ||
"version": "5.2.0", | ||
"version": "5.2.1", | ||
"description": "Commerce Layer Javascript Auth", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -13,3 +13,2 @@ # Commerce Layer JS Auth | ||
- [Installation](#installation) | ||
- [Using E6 import](#using-es6-import) | ||
- [Authorization flows](#authorization-flows) | ||
@@ -16,0 +15,0 @@ - [Use cases](#use-cases) |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33859
129
253