Formatting after #411
This commit is contained in:
@@ -32,7 +32,17 @@ export interface HealthyResponse {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createHealthyResponse({ date, data, consoleMessage, type }: {date: Date; data: any; consoleMessage: string, type: HealthyResponse['objectData']['type'] }): HealthyResponse {
|
export function createHealthyResponse({
|
||||||
|
date,
|
||||||
|
data,
|
||||||
|
consoleMessage,
|
||||||
|
type,
|
||||||
|
}: {
|
||||||
|
date: Date
|
||||||
|
data: any
|
||||||
|
consoleMessage: string
|
||||||
|
type: HealthyResponse['objectData']['type']
|
||||||
|
}): HealthyResponse {
|
||||||
return {
|
return {
|
||||||
status: 'healthy',
|
status: 'healthy',
|
||||||
objectData: {
|
objectData: {
|
||||||
@@ -56,7 +66,10 @@ export interface ErrorResponse {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createUnhealthyResponse(date: Date, message = 'network issue'): ErrorResponse {
|
export function createUnhealthyResponse(
|
||||||
|
date: Date,
|
||||||
|
message = 'network issue'
|
||||||
|
): ErrorResponse {
|
||||||
// TODO handle errors better
|
// TODO handle errors better
|
||||||
// I think we should display something overlayed on the viewer window something like "network issue try again"
|
// I think we should display something overlayed on the viewer window something like "network issue try again"
|
||||||
// and in future I think we need timeouts differently as they maybe from a user trying to render something too complex
|
// and in future I think we need timeouts differently as they maybe from a user trying to render something too complex
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
// not an actual and there fore not imported into index.ts in this folder,
|
// not an actual and there fore not imported into index.ts in this folder,
|
||||||
// this is boiler plate code for adding new integrations.
|
// this is boiler plate code for adding new integrations.
|
||||||
|
|
||||||
import {
|
import { RenderArgs, DefaultKernelExport } from './common'
|
||||||
RenderArgs,
|
|
||||||
DefaultKernelExport,
|
|
||||||
} from './common'
|
|
||||||
|
|
||||||
export const render: DefaultKernelExport['render'] = async ({
|
export const render: DefaultKernelExport['render'] = async ({
|
||||||
code,
|
code,
|
||||||
@@ -16,12 +13,12 @@ export const render: DefaultKernelExport['render'] = async ({
|
|||||||
message: {
|
message: {
|
||||||
type: 'message',
|
type: 'message',
|
||||||
message: 'demo',
|
message: 'demo',
|
||||||
time: new Date()
|
time: new Date(),
|
||||||
},
|
},
|
||||||
objectData: {
|
objectData: {
|
||||||
data: 'any',
|
data: 'any',
|
||||||
type: 'geometry'
|
type: 'geometry',
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user