Skip to content

feat!: rename FeatureClient decorator to OpenFeatureClient #949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions packages/nest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ It is also possible to inject the default or domain scoped OpenFeature clients i

```ts
import { Injectable } from '@nestjs/common';
import { FeatureClient, Client } from '@openfeature/nestjs-sdk';
import { OpenFeatureClient, Client } from '@openfeature/nestjs-sdk';

@Injectable()
export class OpenFeatureTestService {
constructor(
@FeatureClient() private defaultClient: Client,
@FeatureClient({ domain: 'my-domain' }) private scopedClient: Client,
@OpenFeatureClient() private defaultClient: Client,
@OpenFeatureClient({ domain: 'my-domain' }) private scopedClient: Client,
) {}

public async getBoolean() {
Expand Down
2 changes: 1 addition & 1 deletion packages/nest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0",
"@nestjs/core": "^8.0.0 || ^9.0.0 || ^10.0.0",
"rxjs": "^6.0.0 || ^7.0.0 || 8.0.0",
"@openfeature/server-sdk": ">=1.7.5"
"@openfeature/server-sdk": ">=1.14.0"
},
"devDependencies": {
"@nestjs/common": "^10.3.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/nest/src/feature.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ interface FeatureClientProps {
* @param {FeatureClientProps} [props] The options for injecting the client.
* @returns {PropertyDecorator & ParameterDecorator} The decorator function.
*/
export const FeatureClient = (props?: FeatureClientProps) => Inject(getOpenFeatureClientToken(props?.domain));
export const OpenFeatureClient = (props?: FeatureClientProps) => Inject(getOpenFeatureClientToken(props?.domain));

/**
* Options for injecting a feature flag into a route handler.
Expand Down
6 changes: 3 additions & 3 deletions packages/nest/test/test-app.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Controller, Get, Injectable, UseInterceptors } from '@nestjs/common';
import { Observable, map } from 'rxjs';
import { BooleanFeatureFlag, ObjectFeatureFlag, NumberFeatureFlag, FeatureClient, StringFeatureFlag } from '../src';
import { BooleanFeatureFlag, ObjectFeatureFlag, NumberFeatureFlag, OpenFeatureClient, StringFeatureFlag } from '../src';
import { Client, EvaluationDetails, FlagValue } from '@openfeature/server-sdk';
import { EvaluationContextInterceptor } from '../src';

@Injectable()
export class OpenFeatureTestService {
constructor(
@FeatureClient() public defaultClient: Client,
@FeatureClient({ domain: 'domainScopedClient' }) public domainScopedClient: Client,
@OpenFeatureClient() public defaultClient: Client,
@OpenFeatureClient({ domain: 'domainScopedClient' }) public domainScopedClient: Client,
) {}

public async serviceMethod(flag: EvaluationDetails<FlagValue>) {
Expand Down
Loading