@hubspot/local-dev-lib
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -13,2 +13,3 @@ import { Environment } from '../types/Config'; | ||
encodedOAuthRefreshToken: string; | ||
hubName: string; | ||
}; | ||
@@ -15,0 +16,0 @@ export declare function fetchAccessToken(personalAccessKey: string, env?: Environment, portalId?: number): Promise<AccessTokenResponse>; |
@@ -9,6 +9,7 @@ import { CLIAccount } from '../types/Accounts'; | ||
encodedOAuthRefreshToken: string; | ||
hubName: string; | ||
}; | ||
export declare function getAccessToken(personalAccessKey: string, env?: Environment, accountId?: number): Promise<AccessToken>; | ||
export declare function accessTokenForPersonalAccessKey(accountId: number): Promise<string | undefined>; | ||
export declare const updateConfigWithPersonalAccessKey: (personalAccessKey: string, env?: Environment, name?: string, makeDefault?: boolean) => Promise<CLIAccount | null>; | ||
export declare function updateConfigWithAccessToken(token: AccessToken, personalAccessKey: string, env?: Environment, name?: string, makeDefault?: boolean): Promise<CLIAccount | null>; | ||
export {}; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.updateConfigWithPersonalAccessKey = exports.accessTokenForPersonalAccessKey = exports.getAccessToken = void 0; | ||
exports.updateConfigWithAccessToken = exports.accessTokenForPersonalAccessKey = exports.getAccessToken = void 0; | ||
const moment_1 = __importDefault(require("moment")); | ||
@@ -40,2 +40,3 @@ const environments_1 = require("../constants/environments"); | ||
encodedOAuthRefreshToken: response.encodedOAuthRefreshToken, | ||
hubName: response.hubName, | ||
}; | ||
@@ -95,13 +96,5 @@ } | ||
exports.accessTokenForPersonalAccessKey = accessTokenForPersonalAccessKey; | ||
// Adds an account to the config using authType: personalAccessKey | ||
const updateConfigWithPersonalAccessKey = async (personalAccessKey, env, name, makeDefault = false) => { | ||
async function updateConfigWithAccessToken(token, personalAccessKey, env, name, makeDefault = false) { | ||
const { portalId, accessToken, expiresAt } = token; | ||
const accountEnv = env || (0, config_1.getEnv)(name); | ||
let token; | ||
try { | ||
token = await getAccessToken(personalAccessKey, accountEnv); | ||
} | ||
catch (err) { | ||
(0, standardErrors_1.throwError)(err); | ||
} | ||
const { portalId, accessToken, expiresAt } = token; | ||
let hubInfo; | ||
@@ -138,3 +131,3 @@ try { | ||
return updatedConfig; | ||
}; | ||
exports.updateConfigWithPersonalAccessKey = updateConfigWithPersonalAccessKey; | ||
} | ||
exports.updateConfigWithAccessToken = updateConfigWithAccessToken; |
export declare function commaSeparatedValues(arr: Array<string>, conjunction?: null | string, ifempty?: string): string; | ||
export declare function toKebabCase(str: string): string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.commaSeparatedValues = void 0; | ||
exports.toKebabCase = exports.commaSeparatedValues = void 0; | ||
function commaSeparatedValues(arr, conjunction = 'and', ifempty = '') { | ||
@@ -17,1 +17,9 @@ const l = arr.length; | ||
exports.commaSeparatedValues = commaSeparatedValues; | ||
function toKebabCase(str) { | ||
return (str | ||
.replace(/[.,/#!$%^&*;:{}=\-_'"`~()]/g, '') | ||
.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g) || []) | ||
.join('-') | ||
.toLowerCase(); | ||
} | ||
exports.toKebabCase = toKebabCase; |
{ | ||
"name": "@hubspot/local-dev-lib", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Provides library functionality for HubSpot local development tooling, including the HubSpot CLI", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
393902
9934
2