diff --git a/packages/types/src/sdk/featureFlag.ts b/packages/types/src/sdk/featureFlag.ts new file mode 100644 index 0000000000..ca0046696a --- /dev/null +++ b/packages/types/src/sdk/featureFlag.ts @@ -0,0 +1,9 @@ +export enum FeatureFlag { + LICENSING = "LICENSING", + PER_CREATOR_PER_USER_PRICE = "PER_CREATOR_PER_USER_PRICE", + PER_CREATOR_PER_USER_PRICE_ALERT = "PER_CREATOR_PER_USER_PRICE_ALERT", +} + +export interface TenantFeatureFlags { + [key: string]: FeatureFlag[] +} diff --git a/packages/types/src/sdk/index.ts b/packages/types/src/sdk/index.ts index c48cbaf65c..d87ec58b0c 100644 --- a/packages/types/src/sdk/index.ts +++ b/packages/types/src/sdk/index.ts @@ -11,6 +11,7 @@ export * from "./auth" export * from "./locks" export * from "./db" export * from "./middleware" +export * from "./featureFlag" export * from "./environmentVariables" export * from "./auditLogs" export * from "./sso" diff --git a/packages/types/src/sdk/koa.ts b/packages/types/src/sdk/koa.ts index 07ce2efb6e..a7df701171 100644 --- a/packages/types/src/sdk/koa.ts +++ b/packages/types/src/sdk/koa.ts @@ -1,6 +1,6 @@ import { Context, Request } from "koa" import { User, Role, UserRoles, Account, ConfigType } from "../documents" -import { License } from "../sdk" +import { FeatureFlag, License } from "../sdk" import { Files } from "formidable" export interface ContextUser extends Omit { @@ -11,6 +11,7 @@ export interface ContextUser extends Omit { role?: Role roles?: UserRoles csrfToken?: string + featureFlags?: FeatureFlag[] accountPortalAccess?: boolean providerType?: ConfigType account?: Account