import { syscall } from "../syscall.ts"; import { KV, KvKey, KvQuery } from "../types.ts"; export function set(key: KvKey, value: any): Promise { return syscall("datastore.set", key, value); } export function batchSet(kvs: KV[]): Promise { return syscall("datastore.batchSet", kvs); } export function get(key: KvKey): Promise { return syscall("datastore.get", key); } export function batchGet(keys: KvKey[]): Promise<(any | undefined)[]> { return syscall("datastore.batchGet", keys); } export function del(key: KvKey): Promise { return syscall("datastore.delete", key); } export function batchDel(keys: KvKey[]): Promise { return syscall("datastore.batchDelete", keys); } export function query( query: KvQuery, variables: Record = {}, ): Promise { return syscall("datastore.query", query, variables); } export function queryDelete( query: KvQuery, variables?: Record, ): Promise { return syscall("datastore.queryDelete", query, variables); } export function listFunctions(): Promise { return syscall("datastore.listFunctions"); }