Skip to content

Commit 8568af1

Browse files
authored
chore: migrate buf (#456)
Signed-off-by: Todd Baert <[email protected]>
1 parent 626cda8 commit 8568af1

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

libs/providers/flagd-web/schemas

libs/providers/flagd-web/src/lib/flagd-web-provider.spec.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { CallbackClient, Code, ConnectError, PromiseClient } from '@bufbuild/con
22
import { Struct } from '@bufbuild/protobuf';
33
import { Client, ErrorCode, JsonValue, OpenFeature, ProviderEvents, StandardResolutionReasons } from '@openfeature/web-sdk';
44
import fetchMock from 'jest-fetch-mock';
5-
import { Service } from '../proto/ts/schema/v1/schema_connectweb';
5+
import { Service } from '../proto/ts/schema/v1/schema_connect';
66
import { AnyFlag, EventStreamResponse, ResolveAllResponse } from '../proto/ts/schema/v1/schema_pb';
77
import { FlagdWebProvider } from './flagd-web-provider';
88

@@ -245,10 +245,8 @@ describe(FlagdWebProvider.name, () => {
245245
});
246246

247247
describe('shutdown', () => {
248-
let client: Client;
249248
let mockCallbackClient: MockCallbackClient;
250249
const mockPromiseClient = new MockPromiseClient() as unknown as PromiseClient<typeof Service>;
251-
const context = { some: 'value' };
252250

253251
beforeEach(() => {
254252
mockCallbackClient = new MockCallbackClient();
@@ -260,7 +258,6 @@ describe(FlagdWebProvider.name, () => {
260258
mockCallbackClient as unknown as CallbackClient<typeof Service>
261259
)
262260
);
263-
client = OpenFeature.getClient('events-test');
264261
});
265262

266263
describe('API close', () => {

libs/providers/flagd-web/src/lib/flagd-web-provider.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
StandardResolutionReasons,
1616
TypeMismatchError,
1717
} from '@openfeature/web-sdk';
18-
import { Service } from '../proto/ts/schema/v1/schema_connectweb';
18+
import { Service } from '../proto/ts/schema/v1/schema_connect';
1919
import { AnyFlag } from '../proto/ts/schema/v1/schema_pb';
2020
import { FlagdProviderOptions, getOptions } from './options';
2121

@@ -67,23 +67,23 @@ export class FlagdWebProvider implements Provider {
6767
await this.fetchAll(newContext);
6868
}
6969

70-
async initialize(context: EvaluationContext): Promise<void> {
70+
async initialize(): Promise<void> {
7171
await this.retryConnect();
7272
}
7373

74-
resolveBooleanEvaluation(flagKey: string, _: boolean): ResolutionDetails<boolean> {
74+
resolveBooleanEvaluation(flagKey: string): ResolutionDetails<boolean> {
7575
return this.evaluate(flagKey, 'boolValue');
7676
}
7777

78-
resolveStringEvaluation(flagKey: string, _: string): ResolutionDetails<string> {
78+
resolveStringEvaluation(flagKey: string): ResolutionDetails<string> {
7979
return this.evaluate(flagKey, 'stringValue');
8080
}
8181

82-
resolveNumberEvaluation(flagKey: string, _: number): ResolutionDetails<number> {
82+
resolveNumberEvaluation(flagKey: string): ResolutionDetails<number> {
8383
return this.evaluate(flagKey, 'doubleValue');
8484
}
8585

86-
resolveObjectEvaluation<U extends JsonValue>(flagKey: string, _: U): ResolutionDetails<U> {
86+
resolveObjectEvaluation<U extends JsonValue>(flagKey: string): ResolutionDetails<U> {
8787
return this.evaluate(flagKey, 'objectValue');
8888
}
8989

libs/providers/flagd/schemas

0 commit comments

Comments
 (0)