ligo/tools/webide/packages/server/src/schemas/share-v0.ts
Jev Björsell c119c44c13
Import webide into main ligo monorepo
When this is merged https://gitlab.com/ligolang/ligo-web-ide/ will be
marked as deprecated.

This MR does not hook up the webide build to the main CI. The CI
integration will come in a subsequent MR for the sake of making review
easier.
2020-02-06 19:04:18 -08:00

30 lines
690 B
TypeScript

import joi from '@hapi/joi';
import { Migration } from './migration';
export interface SchemaV0 {
code: string;
language: string;
entrypoint: string;
parameters: string;
storage: string;
}
export class SchemaMigrationV0 extends Migration {
protected readonly schema = joi.object({
code: joi.string().required(),
language: joi.string().required(),
entrypoint: joi.string().required(),
parameters: joi.any().required(),
storage: joi.any().required()
});
protected readonly previous: Migration | null = null;
protected migrate(_: any): any {
throw new Error(
'Called migrate() on the first migration. Cannot migrate v0 -> v0.'
);
}
}