Remove s3

but also upgrade the cad lamdbas to use built javascript files,
allowing us to use typescript, and patching redwood
This commit is contained in:
Kurt Hutten
2021-09-04 06:27:25 +10:00
parent 1c13a38ccb
commit 4a3144d360
28 changed files with 457 additions and 4660 deletions

View File

@@ -57,27 +57,18 @@ export const render = async ({ code, settings }: RenderArgs) => {
if (response.status === 502) {
return createUnhealthyResponse(new Date(), timeoutErrorMessage)
}
const data = await response.json()
const type = data.type !== 'stl' ? 'png' : 'geometry'
const newData = await fetch(data.url).then(async (a) => {
const blob = await a.blob()
const text = await new Response(blob).text()
const { consoleMessage, customizerParams } = splitGziped(text)
return {
data:
data.type !== 'stl'
? blob
: await stlToGeometry(window.URL.createObjectURL(blob)),
consoleMessage,
customizerParams,
}
})
const blob = await response.blob()
const text = await new Response(blob).text()
const { consoleMessage, customizerParams, type } = splitGziped(text)
return createHealthyResponse({
type,
data: newData.data,
consoleMessage: newData.consoleMessage,
type: type !== 'stl' ? 'png' : 'geometry',
data:
type !== 'stl'
? blob
: await stlToGeometry(window.URL.createObjectURL(blob)),
consoleMessage,
date: new Date(),
customizerParams: openScadToCadhubParams(newData.customizerParams || []),
customizerParams: openScadToCadhubParams(customizerParams || []),
})
} catch (e) {
return createUnhealthyResponse(new Date())
@@ -105,23 +96,18 @@ export const stl = async ({ code, settings }: RenderArgs) => {
if (response.status === 502) {
return createUnhealthyResponse(new Date(), timeoutErrorMessage)
}
const data = await response.json()
const newData = await fetch(data.url).then(async (a) => {
const blob = await a.blob()
const text = await new Response(blob).text()
const { consoleMessage, customizerParams } = splitGziped(text)
return {
data: await stlToGeometry(window.URL.createObjectURL(blob)),
consoleMessage,
customizerParams,
}
})
const blob = await response.blob()
const text = await new Response(blob).text()
const { consoleMessage, customizerParams, type } = splitGziped(text)
return createHealthyResponse({
type: 'geometry',
data: newData.data,
consoleMessage: newData.consoleMessage,
type: type !== 'stl' ? 'png' : 'geometry',
data:
type !== 'stl'
? blob
: await stlToGeometry(window.URL.createObjectURL(blob)),
consoleMessage,
date: new Date(),
customizerParams: openScadToCadhubParams(newData.customizerParams || []),
customizerParams: openScadToCadhubParams(customizerParams || []),
})
} catch (e) {
return createUnhealthyResponse(new Date())