Skip to content

Commit

Permalink
Merge pull request #189 from HubSpot/enabled-features-endpoint
Browse files Browse the repository at this point in the history
Add fetchEnabledFeatures
  • Loading branch information
camden11 authored Sep 5, 2024
2 parents 8320c6f + dd6a1a3 commit 598faa2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 11 additions & 1 deletion api/localDevAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { getAxiosConfig } from '../http/getAxiosConfig';
import http from '../http';
import { ENVIRONMENTS } from '../constants/environments';
import { Environment } from '../types/Config';
import { ScopeData, AccessTokenResponse } from '../types/Accounts';
import {
ScopeData,
AccessTokenResponse,
EnabledFeaturesResponse,
} from '../types/Accounts';
import axios from 'axios';
import { PublicAppInstallationData } from '../types/Apps';

Expand Down Expand Up @@ -59,3 +63,9 @@ export async function fetchAppInstallationData(
},
});
}

export async function fetchEnabledFeatures(accountId: number) {
return http.get<EnabledFeaturesResponse>(accountId, {
url: `${LOCALDEVAUTH_API_AUTH_PATH}/enabled-features`,
});
}
4 changes: 4 additions & 0 deletions types/Accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ export type AccessTokenResponse = {
accountType: ValueOf<typeof HUBSPOT_ACCOUNT_TYPES>;
};

export type EnabledFeaturesResponse = {
enabledFeatures: { [key: string]: boolean };
};

export type UpdateAccountConfigOptions =
Partial<FlatAccountFields_DEPRECATED> & {
environment?: Environment;
Expand Down

0 comments on commit 598faa2

Please sign in to comment.