(appId: AvailableAppIds)
| 21 | } |
| 22 | |
| 23 | async function createApp(appId: AvailableAppIds) { |
| 24 | const metadataJson: Metadata = require(`../canisters/${appId}/metadata.json`) |
| 25 | |
| 26 | const metadata: CreateAppArgs["metadata"] = Object.entries( |
| 27 | metadataJson |
| 28 | ).reduce((acc, [key, value]) => { |
| 29 | if (key === "logo") { |
| 30 | acc.push([ |
| 31 | "logo", |
| 32 | { |
| 33 | Blob: loadImageFile(value, false) |
| 34 | } |
| 35 | ]) |
| 36 | return acc |
| 37 | } |
| 38 | |
| 39 | acc.push([key, { Text: value }]) |
| 40 | return acc |
| 41 | }, [] as CreateAppArgs["metadata"]) |
| 42 | |
| 43 | return await callSystemMethod("create_app", { |
| 44 | name: appId, |
| 45 | description: metadataJson.description, |
| 46 | metadata |
| 47 | }) |
| 48 | } |
| 49 | |
| 50 | async function addRelease( |
| 51 | app_id: string, |
no test coverage detected