sync
This commit is contained in:
parent
96fbc37f01
commit
a34d020bc6
26 changed files with 979 additions and 54 deletions
22
js/src/session/session.ts
Normal file
22
js/src/session/session.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { Identifier } from "../id/id";
|
||||
import { Storage } from "../storage/storage";
|
||||
import { Log } from "../util/log";
|
||||
|
||||
export namespace Session {
|
||||
const log = Log.create({ service: "session" });
|
||||
|
||||
export interface Info {
|
||||
id: string;
|
||||
title: string;
|
||||
}
|
||||
|
||||
export async function create() {
|
||||
const result: Info = {
|
||||
id: Identifier.create("session"),
|
||||
title: "New Session - " + new Date().toISOString(),
|
||||
};
|
||||
log.info("created", result);
|
||||
await Storage.write("session/info/" + result.id, JSON.stringify(result));
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue