1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

feat: clean api behind a flag (#3288)

This commit is contained in:
Mateusz Kwasniewski 2023-03-09 16:20:12 +01:00 committed by GitHub
parent 785d056a40
commit 898d4f0b70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 27 deletions

View File

@ -71,6 +71,7 @@ exports[`should create default config 1`] = `
"anonymiseEventLog": false,
"bulkOperations": false,
"caseInsensitiveInOperators": false,
"cleanClientApi": false,
"crOnVariants": false,
"embedProxy": true,
"embedProxyFrontend": true,
@ -95,6 +96,7 @@ exports[`should create default config 1`] = `
"anonymiseEventLog": false,
"bulkOperations": false,
"caseInsensitiveInOperators": false,
"cleanClientApi": false,
"crOnVariants": false,
"embedProxy": true,
"embedProxyFrontend": true,

View File

@ -692,33 +692,37 @@ class FeatureToggleService {
query,
includeIds,
);
return result.map(
({
name,
type,
enabled,
project,
stale,
strategies,
variants,
description,
createdAt,
lastSeenAt,
impressionData,
}) => ({
name,
type,
enabled,
project,
stale,
strategies,
variants,
description,
createdAt,
lastSeenAt,
impressionData,
}),
);
if (this.flagResolver.isEnabled('cleanClientApi')) {
return result.map(
({
name,
type,
enabled,
project,
stale,
strategies,
variants,
description,
createdAt,
lastSeenAt,
impressionData,
}) => ({
name,
type,
enabled,
project,
stale,
strategies,
variants,
description,
createdAt,
lastSeenAt,
impressionData,
}),
);
} else {
return result;
}
}
/**

View File

@ -72,6 +72,7 @@ const flags = {
process.env.PROJECT_SCOPED_SEGMENTS,
false,
),
cleanClientApi: parseEnvVarBoolean(process.env.CLEAN_CLIENT_API, false),
};
export const defaultExperimentalOptions: IExperimentalOptions = {