Socket
Socket
Sign inDemoInstall

@hubspot/cms-lib

Package Overview
Dependencies
Maintainers
13
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hubspot/cms-lib - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2-beta.0

api/schema.js

2

errorHandlers.js

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

const { HubSpotAuthError } = require('@hubspot/api-auth-lib/Errors');
const { HubSpotAuthError } = require('./lib/models/Errors');
const { logger } = require('./logger');

@@ -3,0 +3,0 @@

@@ -100,2 +100,6 @@ const request = require('request');

const patchRequest = async (portalId, options) => {
return requestPN.patch(await withAuth(portalId, options));
};
const deleteRequest = async (portalId, options) => {

@@ -156,3 +160,4 @@ return requestPN.del(await withAuth(portalId, options));

put: putRequest,
patch: patchRequest,
delete: deleteRequest,
};

@@ -375,2 +375,3 @@ const fs = require('fs-extra');

const portalId = getPortalId(nameOrId);
if (portalId) {

@@ -392,2 +393,5 @@ const portalConfig = getPortalConfig(portalId);

/*
* Returns a portalId from the config if it exists, else returns null
*/
const getPortalId = nameOrId => {

@@ -394,0 +398,0 @@ const config = getAndLoadConfigIfNeeded();

@@ -1,9 +0,5 @@

const OAuth2Manager = require('@hubspot/api-auth-lib/OAuth2Manager');
const {
updatePortalConfig,
writeConfig,
getPortalConfig,
} = require('./lib/config');
const OAuth2Manager = require('./lib/models/OAuth2Manager');
const { updatePortalConfig, writeConfig } = require('./lib/config');
const { logger, logErrorInstance } = require('./logger');
const { AUTH_METHODS, ENVIRONMENTS } = require('./lib/constants');
const { AUTH_METHODS } = require('./lib/constants');

@@ -42,13 +38,2 @@ const oauthManagers = new Map();

const setupOauth = (portalId, portalConfig) => {
const config = getPortalConfig(portalId) || {};
return new OAuth2Manager(
{
...portalConfig,
environment: portalConfig.env || config.env || ENVIRONMENTS.PROD,
},
logger
);
};
const addOauthToPortalConfig = (portalId, oauth) => {

@@ -69,13 +54,5 @@ logger.log('Updating configuration');

const authenticateWithOauth = async configData => {
const portalId = parseInt(configData.portalId, 10);
const oauth = setupOauth(portalId, configData);
logger.log('Authorizing');
await oauth.authorize();
addOauthToPortalConfig(portalId, oauth);
};
module.exports = {
getOauthManager,
authenticateWithOauth,
addOauthToPortalConfig,
};
{
"name": "@hubspot/cms-lib",
"version": "2.0.1",
"version": "2.0.2-beta.0",
"description": "Library for working with the HubSpot CMS",

@@ -22,2 +22,3 @@ "license": "Apache-2.0",

"moment": "^2.24.0",
"open": "^7.0.3",
"p-queue": "^6.0.2",

@@ -35,3 +36,3 @@ "prettier": "^1.19.1",

},
"gitHead": "08757060ff63ac0a9cf6362f4cb035eca9a46930"
"gitHead": "24034a03b99779398a995a28155663641d5a2d4c"
}

@@ -97,2 +97,4 @@ const path = require('path');

const getAbsoluteFilePath = _path => path.resolve(getCwd(), _path);
module.exports = {

@@ -103,2 +105,3 @@ convertToUnixPath,

getAllowedExtensions,
getAbsoluteFilePath,
getCwd,

@@ -105,0 +108,0 @@ getExt,

const moment = require('moment');
const { HubSpotAuthError } = require('@hubspot/api-auth-lib/Errors');
const { HubSpotAuthError } = require('./lib/models/Errors');
const {

@@ -5,0 +4,0 @@ getEnv,

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