feat: updated the Metadata type to allow for custom properties (#975)
## This PR - Updates the `Metadata` type to a `Record` so that Providers can provide more than just the `name` property as part of the `metadata`. ### Notes Conversation [here](https://cloud-native.slack.com/archives/C03J36ZP020/p1721747906370629). --------- Signed-off-by: Juan Bernal <juanxwtf@gmail.com>
This commit is contained in:
parent
964d65b775
commit
16b0d74340
|
|
@ -13851,7 +13851,7 @@
|
||||||
},
|
},
|
||||||
"packages/client": {
|
"packages/client": {
|
||||||
"name": "@openfeature/web-sdk",
|
"name": "@openfeature/web-sdk",
|
||||||
"version": "1.2.0",
|
"version": "1.2.1",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@openfeature/core": "1.3.0"
|
"@openfeature/core": "1.3.0"
|
||||||
|
|
@ -13883,7 +13883,7 @@
|
||||||
},
|
},
|
||||||
"packages/react": {
|
"packages/react": {
|
||||||
"name": "@openfeature/react-sdk",
|
"name": "@openfeature/react-sdk",
|
||||||
"version": "0.4.1",
|
"version": "0.4.2",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@openfeature/core": "*",
|
"@openfeature/core": "*",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import { Metadata } from '../types';
|
|
||||||
import { ProviderMetadata } from '../provider/provider';
|
import { ProviderMetadata } from '../provider/provider';
|
||||||
|
|
||||||
export interface ClientMetadata extends Metadata {
|
export interface ClientMetadata {
|
||||||
/**
|
/**
|
||||||
* @deprecated alias of "domain", use domain instead
|
* @deprecated alias of "domain", use domain instead
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ export { ClientProviderStatus as AllProviderStatus };
|
||||||
/**
|
/**
|
||||||
* Static data about the provider.
|
* Static data about the provider.
|
||||||
*/
|
*/
|
||||||
export interface ProviderMetadata extends Metadata {
|
export interface ProviderMetadata extends Readonly<Metadata> {
|
||||||
readonly name: string;
|
readonly name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -99,7 +99,7 @@ export interface CommonProvider<S extends ClientProviderStatus | ServerProviderS
|
||||||
/**
|
/**
|
||||||
* @deprecated the SDK now maintains the provider's state; there's no need for providers to implement this field.
|
* @deprecated the SDK now maintains the provider's state; there's no need for providers to implement this field.
|
||||||
* Returns a representation of the current readiness of the provider.
|
* Returns a representation of the current readiness of the provider.
|
||||||
*
|
*
|
||||||
* _Providers which do not implement this method are assumed to be ready immediately._
|
* _Providers which do not implement this method are assumed to be ready immediately._
|
||||||
*/
|
*/
|
||||||
readonly status?: S;
|
readonly status?: S;
|
||||||
|
|
@ -125,4 +125,4 @@ export interface CommonProvider<S extends ClientProviderStatus | ServerProviderS
|
||||||
* @param context
|
* @param context
|
||||||
*/
|
*/
|
||||||
initialize?(context?: EvaluationContext): Promise<void>;
|
initialize?(context?: EvaluationContext): Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1 @@
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
export type Metadata = Record<string, string>;
|
||||||
export interface Metadata {}
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue