Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/DogPawHat/confect-workflow.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041import { FunctionSpec, GenericId, GroupSpec } from "@confect/core";import { Schema } from "effect";import { Notes } from "../tables/Notes";
export const notes = GroupSpec.make("notes") .addFunction( FunctionSpec.publicMutation({ name: "insert", args: Schema.Struct({ text: Schema.String }), returns: GenericId.GenericId("notes"), }), ) .addFunction( FunctionSpec.publicQuery({ name: "list", args: Schema.Struct({}), returns: Schema.Array(Notes.Doc), }), ) .addFunction( FunctionSpec.publicMutation({ name: "delete_", args: Schema.Struct({ noteId: GenericId.GenericId("notes") }), returns: Schema.Null, }), ) .addFunction( FunctionSpec.publicQuery({ name: "getFirst", args: Schema.Struct({}), returns: Schema.Option(Notes.Doc), }), ) .addFunction( FunctionSpec.internalQuery({ name: "internalGetFirst", args: Schema.Struct({}), returns: Schema.Option(Notes.Doc), }), );