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

@commercelayer/js-auth

Package Overview
Dependencies
Maintainers
2
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commercelayer/js-auth - npm Package Compare versions

Comparing version 5.2.0 to 5.2.1

2

dist/index.d.ts

@@ -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

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