Skip to content

Commit

Permalink
feat(wip): forward life-cycle events over http
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito committed Jan 6, 2025
1 parent 28875f9 commit 687e58b
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 57 deletions.
10 changes: 5 additions & 5 deletions src/node/SetupServerApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class SetupServerApi
const remoteConnectionPromise = remoteClient.connect().then(
() => {
// Forward the life-cycle events from this process to the remote.
// this.forwardLifeCycleEventsToRemote()
this.forwardLifeCycleEventsToRemote()

this.handlersController.currentHandlers = new Proxy(
this.handlersController.currentHandlers,
Expand Down Expand Up @@ -184,10 +184,10 @@ export class SetupServerApi
for (const event of events) {
this.emitter.on(event, (args) => {
if (!shouldBypassRequest(args.request)) {
// remoteClient.handleLifeCycleEvent({
// type: event,
// args,
// })
remoteClient.handleLifeCycleEvent({
type: event,
args,
})
}
})
}
Expand Down
114 changes: 62 additions & 52 deletions src/node/setupRemoteServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,56 +474,66 @@ export class RemoteClient {
return responsePromise
}

// public async handleLifeCycleEvent<
// EventType extends keyof LifeCycleEventsMap,
// >(event: {
// type: EventType
// args: LifeCycleEventsMap[EventType][0]
// }): Promise<void> {
// const url = new URL('/life-cycle-events', this.url)
// const payload: Record<string, unknown> = {
// event: event.type,
// requestId: event.args.requestId,
// request: {
// url: event.args.request.url,
// method: event.args.request.method,
// headers: Array.from(event.args.request.headers),
// body: await event.args.request.arrayBuffer(),
// },
// }

// switch (event.type) {
// case 'unhandledException': {
// payload.error = event.args.error
// break
// }

// case 'response:bypass':
// case 'response:mocked': {
// payload.response = {
// status: event.args.response.status,
// statustext: event.args.response.statusText,
// headers: Array.from(event.args.response.headers),
// body: await event.args.response.arrayBuffer(),
// }
// break
// }
// }

// const response = await fetch(url, {
// method: 'POST',
// headers: {
// 'content-type': 'application/json',
// },
// body: JSON.stringify(payload),
// })

// invariant(
// response && response.ok,
// 'Failed to forward a life-cycle event "%s" (%s %s) to the remote',
// event.type,
// event.args.request.method,
// event.args.request.url,
// )
// }
public async handleLifeCycleEvent<
EventType extends keyof LifeCycleEventsMap,
>(event: {
type: EventType
args: LifeCycleEventsMap[EventType][0]
}): Promise<void> {
invariant(
this.connected,
'Failed to forward life-cycle events for "%s %s": remote client not connected',
event.args.request.method,
event.args.request.url,
)

const url = new URL('/life-cycle-events', this.url)
const payload: Record<string, unknown> = {
event: event.type,
requestId: event.args.requestId,
request: {
url: event.args.request.url,
method: event.args.request.method,
headers: Array.from(event.args.request.headers),
body: await event.args.request.arrayBuffer(),
},
}

switch (event.type) {
case 'unhandledException': {
payload.error = event.args.error

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (4.8)

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (4.8)

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / build (20)

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / build (20)

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.0)

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.0)

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (4.9)

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (4.9)

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / exports

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / exports

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / build (18)

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / build (18)

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.3)

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.3)

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.1)

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.1)

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.2)

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.2)

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.4)

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.4)

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.5)

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 504 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.5)

Property 'error' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.
break
}

case 'response:bypass':
case 'response:mocked': {
payload.response = {
status: event.args.response.status,

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (4.8)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (4.8)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / build (20)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / build (20)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.0)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.0)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (4.9)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (4.9)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / exports

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / exports

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / build (18)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / build (18)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.3)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.3)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.1)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.1)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.2)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.2)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.4)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.4)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.5)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 511 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.5)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.
statustext: event.args.response.statusText,

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (4.8)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (4.8)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / build (20)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / build (20)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.0)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.0)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (4.9)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (4.9)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / exports

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / exports

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / build (18)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / build (18)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.3)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.3)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.1)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.1)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.2)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.2)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.4)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.4)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.5)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 512 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.5)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.
headers: Array.from(event.args.response.headers),

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (4.8)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (4.8)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / build (20)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / build (20)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.0)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.0)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (4.9)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (4.9)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / exports

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / exports

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / build (18)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / build (18)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.3)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.3)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.1)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.1)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.2)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.2)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.4)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.4)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.5)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 513 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.5)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.
body: await event.args.response.arrayBuffer(),

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (4.8)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (4.8)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / build (20)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / build (20)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.0)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.0)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (4.9)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (4.9)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / exports

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / exports

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / build (18)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / build (18)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.3)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.3)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.1)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.1)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.2)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.2)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.4)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.4)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.5)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.

Check failure on line 514 in src/node/setupRemoteServer.ts

View workflow job for this annotation

GitHub Actions / typescript (5.5)

Property 'response' does not exist on type '{ request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { request: Request; requestId: string; } | { ...; } | { ...; } | { ...; }'.
}
break
}
}

/**
* @todo @fixme Design the protocol for forwarding life-cycle events.
*/
const response = await fetch(url, {
method: 'POST',
headers: {
'content-type': 'application/json',
},
body: JSON.stringify(payload),
})

invariant(
response && response.ok,
'Failed to forward a life-cycle event "%s" (%s %s) to the remote',
event.type,
event.args.request.method,
event.args.request.url,
)
}
}

0 comments on commit 687e58b

Please sign in to comment.