This repository has been archived by the owner on Aug 21, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add service and state for feature flag system * license * Add feature flags for emote and social menus * replace object with key and value store * remove seed import * update feature flags to respect hierarchy * add flags for avaturn and rpm * format * optimize reactor * fix --------- Co-authored-by: Hanzla Mateen <[email protected]>
- Loading branch information
1 parent
3b22b14
commit a536c72
Showing
14 changed files
with
641 additions
and
41 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
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
87 changes: 87 additions & 0 deletions
87
packages/common/src/schemas/setting/feature-flag-setting.schema.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,87 @@ | ||
/* | ||
CPAL-1.0 License | ||
The contents of this file are subject to the Common Public Attribution License | ||
Version 1.0. (the "License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
https://github.com/EtherealEngine/etherealengine/blob/dev/LICENSE. | ||
The License is based on the Mozilla Public License Version 1.1, but Sections 14 | ||
and 15 have been added to cover use of software over a computer network and | ||
provide for limited attribution for the Original Developer. In addition, | ||
Exhibit A has been modified to be consistent with Exhibit B. | ||
Software distributed under the License is distributed on an "AS IS" basis, | ||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the | ||
specific language governing rights and limitations under the License. | ||
The Original Code is Ethereal Engine. | ||
The Original Developer is the Initial Developer. The Initial Developer of the | ||
Original Code is the Ethereal Engine team. | ||
All portions of the code written by the Ethereal Engine team are Copyright © 2021-2023 | ||
Ethereal Engine. All Rights Reserved. | ||
*/ | ||
|
||
// For more information about this file see https://dove.feathersjs.com/guides/cli/service.schemas.html | ||
import type { Static } from '@feathersjs/typebox' | ||
import { getValidator, querySyntax, Type } from '@feathersjs/typebox' | ||
import { OpaqueType } from '../../interfaces/OpaqueType' | ||
import { TypedString } from '../../types/TypeboxUtils' | ||
import { dataValidator, queryValidator } from '../validators' | ||
|
||
export type FeatureFlag = OpaqueType<'FeatureFlag'> & string | ||
|
||
export const featureFlagSettingPath = 'feature-flag-setting' | ||
|
||
export const featureFlagSettingMethods = ['find', 'get', 'create', 'patch', 'remove'] as const | ||
|
||
// Main data model schema | ||
export const featureFlagSettingSchema = Type.Object( | ||
{ | ||
id: Type.String({ | ||
format: 'uuid' | ||
}), | ||
flagName: TypedString<FeatureFlag>(), | ||
flagValue: Type.Boolean(), | ||
createdAt: Type.String({ format: 'date-time' }), | ||
updatedAt: Type.String({ format: 'date-time' }) | ||
}, | ||
{ $id: 'FeatureFlagSetting', additionalProperties: false } | ||
) | ||
export interface FeatureFlagSettingType extends Static<typeof featureFlagSettingSchema> {} | ||
|
||
// Schema for creating new entries | ||
export const featureFlagSettingDataSchema = Type.Pick(featureFlagSettingSchema, ['flagName', 'flagValue'], { | ||
$id: 'FeatureFlagSettingData' | ||
}) | ||
export interface FeatureFlagSettingData extends Static<typeof featureFlagSettingDataSchema> {} | ||
|
||
// Schema for updating existing entries | ||
export const featureFlagSettingPatchSchema = Type.Partial(featureFlagSettingSchema, { | ||
$id: 'FeatureFlagSettingPatch' | ||
}) | ||
export interface FeatureFlagSettingPatch extends Static<typeof featureFlagSettingPatchSchema> {} | ||
|
||
// Schema for allowed query properties | ||
export const featureFlagSettingQueryProperties = Type.Pick(featureFlagSettingSchema, ['id', 'flagName', 'flagValue']) | ||
export const featureFlagSettingQuerySchema = Type.Intersect( | ||
[ | ||
querySyntax(featureFlagSettingQueryProperties), | ||
// Add additional query properties here | ||
Type.Object({}, { additionalProperties: false }) | ||
], | ||
{ additionalProperties: false } | ||
) | ||
export interface FeatureFlagSettingQuery extends Static<typeof featureFlagSettingQuerySchema> {} | ||
|
||
export const featureFlagSettingValidator = /* @__PURE__ */ getValidator(featureFlagSettingSchema, dataValidator) | ||
export const featureFlagSettingDataValidator = /* @__PURE__ */ getValidator(featureFlagSettingDataSchema, dataValidator) | ||
export const featureFlagSettingPatchValidator = /* @__PURE__ */ getValidator( | ||
featureFlagSettingPatchSchema, | ||
dataValidator | ||
) | ||
export const featureFlagSettingQueryValidator = /* @__PURE__ */ getValidator( | ||
featureFlagSettingQuerySchema, | ||
queryValidator | ||
) |
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.