66 UserAttributes ,
77} from '@optimizely/optimizely-sdk' ;
88
9- import type { Adapter } from 'flags' ;
9+ import type { Adapter , JsonValue } from 'flags' ;
1010import { dispatchEvent } from './edge-runtime-hooks' ;
1111import {
1212 createForwardingEventProcessor ,
@@ -32,11 +32,6 @@ export type UserContext = {
3232type AdapterResponse = {
3333 decide : < T > (
3434 getValue : ( decision : OptimizelyDecision ) => T ,
35- {
36- attributes,
37- } : {
38- attributes ?: UserAttributes ;
39- } ,
4035 ) => Adapter < T , UserContext > ;
4136 initialize : ( ) => Promise < Client > ;
4237} ;
@@ -50,7 +45,7 @@ const requestHandler: RequestHandler = {
5045 const abortController = new AbortController ( ) ;
5146
5247 const responsePromise = fetch ( requestUrl , {
53- headers : headers as any ,
48+ headers : headers as Record < string , string > ,
5449 method,
5550 body : data ,
5651 signal : abortController . signal ,
@@ -88,7 +83,9 @@ export function createOptimizelyAdapter({
8883 let projectConfigManager : OpaqueConfigManager | undefined ;
8984 if ( edgeConfig ) {
9085 const edgeConfigClient = createClient ( edgeConfig . connectionString ) ;
91- const datafile = await edgeConfigClient . get < string > ( edgeConfig . itemKey ) ;
86+ const datafile = await edgeConfigClient . get < JsonValue > (
87+ edgeConfig . itemKey ,
88+ ) ;
9289
9390 if ( ! datafile ) {
9491 throw new Error (
0 commit comments