-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #174 from frontegg/next
FeatureFlags FTW
- Loading branch information
Showing
26 changed files
with
667 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// TODO: remove this completely some time to not replicate API types | ||
export * as VendorEntitlementsV1 from './vendor-entitlements/v1'; | ||
|
5 changes: 5 additions & 0 deletions
5
src/clients/entitlements/api-types/vendor-entitlements/v1/entitlements/feature-set.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import type { Id as FeatureId } from './feature'; | ||
|
||
export type Id = string; | ||
|
||
export type Tuple = [Id, FeatureId[]]; |
5 changes: 5 additions & 0 deletions
5
src/clients/entitlements/api-types/vendor-entitlements/v1/entitlements/feature.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export type Id = string; | ||
export type Key = string; | ||
type PermissionId = string; | ||
|
||
export type Tuple = [Id, Key, PermissionId[]]; |
9 changes: 9 additions & 0 deletions
9
src/clients/entitlements/api-types/vendor-entitlements/v1/entitlements/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import type * as FeatureSet from './feature-set'; | ||
|
||
type TenantId = string; | ||
type UserId = string; | ||
type ExpirationDate = string; | ||
export type Tuple = [FeatureSet.Id, TenantId, UserId | undefined, ExpirationDate | undefined]; | ||
|
||
export * as Feature from './feature'; | ||
export * as FeatureSet from './feature-set'; |
23 changes: 23 additions & 0 deletions
23
src/clients/entitlements/api-types/vendor-entitlements/v1/feature-flags/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import type { Feature } from '../entitlements'; | ||
import type { OperationEnum } from '@frontegg/entitlements-javascript-commons'; | ||
|
||
type On = boolean; | ||
type TreatmentEnum = 'true' | 'false'; | ||
type DefaultTreatment = TreatmentEnum; | ||
type OffTreatment = TreatmentEnum; | ||
type TreatmentType = 'boolean'; | ||
|
||
export interface IRule { | ||
description: string; | ||
conditionLogic: 'and'; | ||
conditions: { | ||
attribute: string; | ||
attributeType: 'custom' | 'frontegg'; | ||
negate: boolean; | ||
op: OperationEnum; | ||
value: Record<string, any>; | ||
}[]; | ||
treatment: TreatmentEnum; | ||
} | ||
|
||
export type Tuple = [Feature.Key, On, TreatmentType, DefaultTreatment, OffTreatment, IRule[]]; |
15 changes: 15 additions & 0 deletions
15
src/clients/entitlements/api-types/vendor-entitlements/v1/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as Entitlements from './entitlements'; | ||
import * as FeatureFlags from './feature-flags'; | ||
|
||
export * as FeatureFlags from './feature-flags'; | ||
export * as Entitlements from './entitlements'; | ||
|
||
export type GetDTO = { | ||
data: { | ||
features: Entitlements.Feature.Tuple[]; | ||
featureBundles: Entitlements.FeatureSet.Tuple[]; | ||
entitlements: Entitlements.Tuple[]; | ||
featureFlags: FeatureFlags.Tuple[]; | ||
}; | ||
snapshotOffset: number; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.