This commit is contained in:
Michael Zhang 2023-03-22 22:06:30 -05:00
parent 287c94e246
commit b79801a1d7
6 changed files with 47 additions and 5 deletions

1
docs/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
book

6
docs/book.toml Normal file
View file

@ -0,0 +1,6 @@
[book]
authors = ["Michael Zhang"]
language = "en"
multilingual = false
src = "src"
title = "mznotes documentation"

5
docs/src/SUMMARY.md Normal file
View file

@ -0,0 +1,5 @@
# Summary
## App Developers
- [`meta.json`](./app/meta_json.md)

View file

@ -0,0 +1,3 @@
# `meta.json`
`meta.json` is the entrypoint for installing an application.

View file

@ -23,6 +23,7 @@
cargo-watch
deno
mdbook
(python310.withPackages (p: with p; [ ipython numpy scipy sympy ]))
]) ++ (with toolchain; [

View file

@ -1,8 +1,29 @@
type NodeCreationRequest = {
};
interface ICreateNodeRequest {
/**
* A label for humans. This is not used by the database in any way, it's just
* something to print when debugging.
*/
label: string;
/**
* A mapping from labels to node creation requests.
*/
auxiliary_nodes: Map<string, ICreateNodeRequest>;
/**
* A set of edges, using the IDs in auxiliary_nodes.
*/
edges: Set<ICreateEdgeRequest>;
}
interface ICreateEdgeRequest {
from_node: string;
to_node: string;
metadata: unknown;
}
export default class Database {
public createNode(request: NodeCreationRequest): Node {
public createNode(request: ICreateNodeRequest): Node {
// TODO: Calculate the interfaces that must be implemented
// - Use the interface application rules
// - Insert them into the database
@ -13,11 +34,16 @@ export default class Database {
// TODO: Run pre-creation hooks
// TODO: Create all the nodes according to their requests
// TODO: Run all validations on all of the nodes
let node = new Node();
return node;
}
}
export class Node {
public delete() {
}
public delete() {}
}