@hubspot/local-dev-lib
Advanced tools
Comparing version 1.9.0 to 1.9.1
@@ -1,4 +0,5 @@ | ||
import { PublicApp, PublicAppDeveloperTestAccountInstallData } from '../types/Apps'; | ||
import { PublicApp, PublicApInstallCounts, PublicAppDeveloperTestAccountInstallData } from '../types/Apps'; | ||
export declare function fetchPublicAppsForPortal(accountId: number): Promise<Array<PublicApp>>; | ||
export declare function fetchPublicAppDeveloperTestAccountInstallData(appId: number, accountId: number): Promise<PublicAppDeveloperTestAccountInstallData>; | ||
export declare function fetchPublicAppProductionInstallCounts(appId: number, accountId: number): Promise<PublicApInstallCounts>; | ||
export declare function fetchPublicAppMetadata(appId: number, accountId: number): Promise<PublicApp>; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.fetchPublicAppMetadata = exports.fetchPublicAppDeveloperTestAccountInstallData = exports.fetchPublicAppsForPortal = void 0; | ||
exports.fetchPublicAppMetadata = exports.fetchPublicAppProductionInstallCounts = exports.fetchPublicAppDeveloperTestAccountInstallData = exports.fetchPublicAppsForPortal = void 0; | ||
const http_1 = __importDefault(require("../http")); | ||
@@ -23,2 +23,8 @@ const APPS_DEV_API_PATH = 'apps-dev/external/public/v3'; | ||
exports.fetchPublicAppDeveloperTestAccountInstallData = fetchPublicAppDeveloperTestAccountInstallData; | ||
function fetchPublicAppProductionInstallCounts(appId, accountId) { | ||
return http_1.default.get(accountId, { | ||
url: `${APPS_DEV_API_PATH}/${appId}/install-counts-without-test-portals`, | ||
}); | ||
} | ||
exports.fetchPublicAppProductionInstallCounts = fetchPublicAppProductionInstallCounts; | ||
function fetchPublicAppMetadata(appId, accountId) { | ||
@@ -25,0 +31,0 @@ return http_1.default.get(accountId, { |
@@ -5,6 +5,11 @@ import { AxiosResponse } from 'axios'; | ||
declare function getRequest<T>(accountId: number, options: HttpOptions): Promise<T>; | ||
declare function getRequest<T>(accountId: number, options: HttpOptions, withFullResponse: true): Promise<AxiosResponse<T>>; | ||
declare function postRequest<T>(accountId: number, options: HttpOptions): Promise<T>; | ||
declare function postRequest<T>(accountId: number, options: HttpOptions, withFullResponse: true): Promise<AxiosResponse<T>>; | ||
declare function putRequest<T>(accountId: number, options: HttpOptions): Promise<T>; | ||
declare function putRequest<T>(accountId: number, options: HttpOptions, withFullResponse: true): Promise<AxiosResponse<T>>; | ||
declare function patchRequest<T>(accountId: number, options: HttpOptions): Promise<T>; | ||
declare function patchRequest<T>(accountId: number, options: HttpOptions, withFullResponse: true): Promise<AxiosResponse<T>>; | ||
declare function deleteRequest<T>(accountId: number, options: HttpOptions): Promise<T>; | ||
declare function deleteRequest<T>(accountId: number, options: HttpOptions, withFullResponse: true): Promise<AxiosResponse<T>>; | ||
declare const http: { | ||
@@ -11,0 +16,0 @@ get: typeof getRequest; |
@@ -91,28 +91,43 @@ "use strict"; | ||
} | ||
async function getRequest(accountId, options) { | ||
async function getRequest(accountId, options, withFullResponse) { | ||
const { params, ...rest } = options; | ||
const axiosConfig = addQueryParams(rest, params); | ||
const configWithAuth = await withAuth(accountId, axiosConfig); | ||
const { data } = await (0, axios_1.default)(configWithAuth); | ||
return data; | ||
const response = await (0, axios_1.default)(configWithAuth); | ||
if (withFullResponse) { | ||
return response; | ||
} | ||
return response.data; | ||
} | ||
async function postRequest(accountId, options) { | ||
async function postRequest(accountId, options, withFullResponse) { | ||
const configWithAuth = await withAuth(accountId, options); | ||
const { data } = await (0, axios_1.default)({ ...configWithAuth, method: 'post' }); | ||
return data; | ||
const response = await (0, axios_1.default)({ ...configWithAuth, method: 'post' }); | ||
if (withFullResponse) { | ||
return response; | ||
} | ||
return response.data; | ||
} | ||
async function putRequest(accountId, options) { | ||
async function putRequest(accountId, options, withFullResponse) { | ||
const configWithAuth = await withAuth(accountId, options); | ||
const { data } = await (0, axios_1.default)({ ...configWithAuth, method: 'put' }); | ||
return data; | ||
const response = await (0, axios_1.default)({ ...configWithAuth, method: 'put' }); | ||
if (withFullResponse) { | ||
return response; | ||
} | ||
return response.data; | ||
} | ||
async function patchRequest(accountId, options) { | ||
async function patchRequest(accountId, options, withFullResponse) { | ||
const configWithAuth = await withAuth(accountId, options); | ||
const { data } = await (0, axios_1.default)({ ...configWithAuth, method: 'patch' }); | ||
return data; | ||
const response = await (0, axios_1.default)({ ...configWithAuth, method: 'patch' }); | ||
if (withFullResponse) { | ||
return response; | ||
} | ||
return response.data; | ||
} | ||
async function deleteRequest(accountId, options) { | ||
async function deleteRequest(accountId, options, withFullResponse = false) { | ||
const configWithAuth = await withAuth(accountId, options); | ||
const { data } = await (0, axios_1.default)({ ...configWithAuth, method: 'delete' }); | ||
return data; | ||
const response = await (0, axios_1.default)({ ...configWithAuth, method: 'delete' }); | ||
if (withFullResponse) { | ||
return response; | ||
} | ||
return response.data; | ||
} | ||
@@ -119,0 +134,0 @@ function createGetRequestStream(contentType) { |
{ | ||
"name": "@hubspot/local-dev-lib", | ||
"version": "1.9.0", | ||
"version": "1.9.1", | ||
"description": "Provides library functionality for HubSpot local development tooling, including the HubSpot CLI", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -16,2 +16,7 @@ export type PublicAppInstallationData = { | ||
}; | ||
export type PublicApInstallCounts = { | ||
uniquePortalInstallCount: number; | ||
uniqueUserInstallCount: number; | ||
uniqueBusinessUnitInstallCount: number; | ||
}; | ||
export type PublicApp = { | ||
@@ -38,7 +43,3 @@ id: number; | ||
isAdvancedScopesSettingEnabled: boolean; | ||
publicApplicationInstallCounts: { | ||
uniquePortalInstallCount: number; | ||
uniqueUserInstallCount: number; | ||
uniqueBusinessUnitInstallCount: number; | ||
}; | ||
publicApplicationInstallCounts: PublicApInstallCounts; | ||
redirectUrls: Array<string>; | ||
@@ -45,0 +46,0 @@ scopeGroupIds: Array<number>; |
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
414413
10376