Skip to content

Commit 598faa2

Browse files
authored
Merge pull request #189 from HubSpot/enabled-features-endpoint
Add fetchEnabledFeatures
2 parents 8320c6f + dd6a1a3 commit 598faa2

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

api/localDevAuth.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ import { getAxiosConfig } from '../http/getAxiosConfig';
22
import http from '../http';
33
import { ENVIRONMENTS } from '../constants/environments';
44
import { Environment } from '../types/Config';
5-
import { ScopeData, AccessTokenResponse } from '../types/Accounts';
5+
import {
6+
ScopeData,
7+
AccessTokenResponse,
8+
EnabledFeaturesResponse,
9+
} from '../types/Accounts';
610
import axios from 'axios';
711
import { PublicAppInstallationData } from '../types/Apps';
812

@@ -59,3 +63,9 @@ export async function fetchAppInstallationData(
5963
},
6064
});
6165
}
66+
67+
export async function fetchEnabledFeatures(accountId: number) {
68+
return http.get<EnabledFeaturesResponse>(accountId, {
69+
url: `${LOCALDEVAUTH_API_AUTH_PATH}/enabled-features`,
70+
});
71+
}

types/Accounts.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ export type AccessTokenResponse = {
140140
accountType: ValueOf<typeof HUBSPOT_ACCOUNT_TYPES>;
141141
};
142142

143+
export type EnabledFeaturesResponse = {
144+
enabledFeatures: { [key: string]: boolean };
145+
};
146+
143147
export type UpdateAccountConfigOptions =
144148
Partial<FlatAccountFields_DEPRECATED> & {
145149
environment?: Environment;

0 commit comments

Comments
 (0)