Skip to content

Commit 98f9316

Browse files
committed
Update SyncContext Type Definition
Signed-off-by: marcozabel <[email protected]>
1 parent 5f11be8 commit 98f9316

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class FlagdProvider implements Provider {
1616
readonly hooks: Hook[] = [];
1717
readonly runsOn = 'server';
1818
readonly events = new OpenFeatureEventEmitter();
19-
private syncContext: { [key: string]: any } | null = null;
19+
private syncContext: { [key: string]: string } | null = null;
2020

2121
private readonly _service: Service;
2222

@@ -49,11 +49,11 @@ export class FlagdProvider implements Provider {
4949
}
5050
}
5151

52-
setSyncContext(context: {[key: string]: any}) {
52+
setSyncContext(context: {[key: string]: string}) {
5353
this.syncContext = context;
5454
}
5555

56-
getSyncContext(): {[key: string]: any} | null {
56+
getSyncContext(): {[key: string]: string} | null {
5757
return this.syncContext;
5858
}
5959

libs/providers/flagd/src/lib/service/in-process/grpc/grpc-fetch.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class GrpcFetch implements DataFetch {
1515
private readonly _syncClient: FlagSyncServiceClient;
1616
private readonly _request: SyncFlagsRequest;
1717
private _syncStream: ClientReadableStream<SyncFlagsResponse> | undefined;
18-
private readonly _setSyncContext: (syncContext: { [key: string]: any }) => void;
18+
private readonly _setSyncContext: (syncContext: { [key: string]: string }) => void;
1919
private _logger: Logger | undefined;
2020
/**
2121
* Initialized will be set to true once the initial connection is successful
@@ -30,7 +30,7 @@ export class GrpcFetch implements DataFetch {
3030
*/
3131
private _isConnected = false;
3232

33-
constructor(config: Config, setSyncContext: (syncContext: {[key: string]: any }) => void, syncServiceClient?: FlagSyncServiceClient, logger?: Logger) {
33+
constructor(config: Config, setSyncContext: (syncContext: {[key: string]: string }) => void, syncServiceClient?: FlagSyncServiceClient, logger?: Logger) {
3434
const { host, port, tls, socketPath, selector, defaultAuthority } = config;
3535
let clientOptions: ClientOptions | undefined;
3636
if (defaultAuthority) {
@@ -87,7 +87,7 @@ export class GrpcFetch implements DataFetch {
8787

8888
try {
8989
if (data.syncContext) {
90-
this._setSyncContext(data.syncContext);
90+
this._setSyncContext(data.syncContext as { [key: string]: string });
9191
}
9292
const changes = dataCallback(data.flagConfiguration);
9393
if (this._initialized && changes.length > 0) {

libs/providers/flagd/src/lib/service/in-process/in-process-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class InProcessService implements Service {
1919

2020
constructor(
2121
private readonly config: Config,
22-
setSyncContext: (syncContext: { [key: string]: any }) => void,
22+
setSyncContext: (syncContext: { [key: string]: string }) => void,
2323
dataFetcher?: DataFetch,
2424
logger?: Logger,
2525
) {

0 commit comments

Comments
 (0)