File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
apps/workers-observability/src/tools Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ This tool provides three primary views of your Worker data:
128128 }
129129 }
130130
131- if ( query . view === 'events' ) {
131+ if ( query . view === 'events' ) {
132132 const events = response ?. events ?. events
133133 return {
134134 content : [
@@ -140,16 +140,13 @@ This tool provides three primary views of your Worker data:
140140 }
141141 }
142142
143- if ( query . view === 'invocations' ) {
143+ if ( query . view === 'invocations' ) {
144144 const invocations = Object . entries ( response ?. invocations || { } ) . map ( ( [ _ , logs ] ) => {
145145 const invocationLog = logs . find ( ( log ) => log . $metadata . type === 'cf-worker-event' )
146146 return invocationLog ?. $metadata ?? logs [ 0 ] ?. $metadata
147- } ) ;
147+ } )
148148
149- const tsv = await writeToString (
150- invocations ,
151- { headers : true , delimiter : '\t' }
152- )
149+ const tsv = await writeToString ( invocations , { headers : true , delimiter : '\t' } )
153150 return {
154151 content : [
155152 {
Original file line number Diff line number Diff line change @@ -40,6 +40,16 @@ export async function fetchCloudflareApi<T>({
4040} ) : Promise < T > {
4141 const url = `https://api.cloudflare.com/client/v4/accounts/${ accountId } ${ endpoint } `
4242
43+ // @ts -expect-error We don't have actual env in this package
44+ if ( env . DEV_DISABLE_OAUTH ) {
45+ options . headers = {
46+ ...options . headers ,
47+ // @ts -expect-error We don't have actual env in this package
48+ 'X-Auth-Email' : env . DEV_CLOUDFLARE_EMAIL ,
49+ // @ts -expect-error We don't have actual env in this package
50+ 'X-Auth-Key' : env . DEV_CLOUDFLARE_API_TOKEN ,
51+ }
52+ }
4353 const response = await fetch ( url , {
4454 ...options ,
4555 headers : {
You can’t perform that action at this time.
0 commit comments