diff --git a/src/lib/surreal/_generated/assignment/assignmentSchemaGen.ts b/src/lib/surreal/_generated/assignment/assignmentSchemaGen.ts new file mode 100644 index 0000000000000000000000000000000000000000..5e31debe0c821d452ba8d212da6341d987356e2f --- /dev/null +++ b/src/lib/surreal/_generated/assignment/assignmentSchemaGen.ts @@ -0,0 +1,27 @@ +// ==================== +// DO NOT EDIT THIS FILE! +// This file is autogenerated and will be overwritten during generation! +// ==================== + +import { z } from "zod"; +import { recordId } from "../recordSchema.js" + +// the create schema for table assignment +export const assignmentInputSchemaGen = z.object({ +description: z.string(), + full_score: z.number(), + module: recordId('module'), + name: z.string(), + programming_language: z.string(), + solution: z.string() +}).passthrough(); + +// the select schema for table assignment +export const assignmentOutputSchemaGen = z.object({ +description: z.string(), + full_score: z.number(), + module: recordId('module'), + name: z.string(), + programming_language: z.string(), + solution: z.string() +}).passthrough(); diff --git a/src/lib/surreal/_generated/evaluation/evaluationSchemaGen.ts b/src/lib/surreal/_generated/evaluation/evaluationSchemaGen.ts new file mode 100644 index 0000000000000000000000000000000000000000..00a609dfdb01515528c2a850a02317bf6b96d543 --- /dev/null +++ b/src/lib/surreal/_generated/evaluation/evaluationSchemaGen.ts @@ -0,0 +1,25 @@ +// ==================== +// DO NOT EDIT THIS FILE! +// This file is autogenerated and will be overwritten during generation! +// ==================== + +import { z } from "zod"; +import { recordId } from "../recordSchema.js" + +// the create schema for table evaluation +export const evaluationInputSchemaGen = z.object({ +annotations: z.object({}).array(), + final: z.boolean().optional(), + in: recordId('tutor'), + out: recordId('submission'), + score: z.number().optional() +}).passthrough(); + +// the select schema for table evaluation +export const evaluationOutputSchemaGen = z.object({ +annotations: z.object({}).array(), + final: z.boolean(), + in: recordId('tutor'), + out: recordId('submission'), + score: z.number().optional() +}).passthrough(); diff --git a/src/lib/surreal/_generated/exerciseGroup/exerciseGroupSchemaGen.ts b/src/lib/surreal/_generated/exerciseGroup/exerciseGroupSchemaGen.ts new file mode 100644 index 0000000000000000000000000000000000000000..9ef078064f6a4e62efaba83e0da4859d1a91af6a --- /dev/null +++ b/src/lib/surreal/_generated/exerciseGroup/exerciseGroupSchemaGen.ts @@ -0,0 +1,17 @@ +// ==================== +// DO NOT EDIT THIS FILE! +// This file is autogenerated and will be overwritten during generation! +// ==================== + +import { z } from "zod"; + + +// the create schema for table exercise_group +export const exerciseGroupInputSchemaGen = z.object({ + +}).passthrough(); + +// the select schema for table exercise_group +export const exerciseGroupOutputSchemaGen = z.object({ + +}).passthrough(); diff --git a/src/lib/surreal/_generated/hasAccount/hasAccountSchemaGen.ts b/src/lib/surreal/_generated/hasAccount/hasAccountSchemaGen.ts new file mode 100644 index 0000000000000000000000000000000000000000..c33d153abc681ca15ac11de2019853be3644c18f --- /dev/null +++ b/src/lib/surreal/_generated/hasAccount/hasAccountSchemaGen.ts @@ -0,0 +1,19 @@ +// ==================== +// DO NOT EDIT THIS FILE! +// This file is autogenerated and will be overwritten during generation! +// ==================== + +import { z } from "zod"; +import { recordId } from "../recordSchema.js" + +// the create schema for table has_account +export const hasAccountInputSchemaGen = z.object({ +in: recordId(), + out: recordId('user') +}).passthrough(); + +// the select schema for table has_account +export const hasAccountOutputSchemaGen = z.object({ +in: recordId(), + out: recordId('user') +}).passthrough(); diff --git a/src/lib/surreal/_generated/index.ts b/src/lib/surreal/_generated/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..5ec9dfd38dadfebfb9a4e756234fc30fe70e6892 --- /dev/null +++ b/src/lib/surreal/_generated/index.ts @@ -0,0 +1,12 @@ +export * from './assignment/assignmentSchemaGen.js'; +export * from './evaluation/evaluationSchemaGen.js'; +export * from './exerciseGroup/exerciseGroupSchemaGen.js'; +export * from './hasAccount/hasAccountSchemaGen.js'; +export * from './memberOf/memberOfSchemaGen.js'; +export * from './module/moduleSchemaGen.js'; +export * from './review/reviewSchemaGen.js'; +export * from './reviewer/reviewerSchemaGen.js'; +export * from './student/studentSchemaGen.js'; +export * from './submission/submissionSchemaGen.js'; +export * from './tutor/tutorSchemaGen.js'; +export * from './user/userSchemaGen.js'; \ No newline at end of file diff --git a/src/lib/surreal/_generated/memberOf/memberOfSchemaGen.ts b/src/lib/surreal/_generated/memberOf/memberOfSchemaGen.ts new file mode 100644 index 0000000000000000000000000000000000000000..961e750482dd9625df0ff429e603f4a9b634e4c1 --- /dev/null +++ b/src/lib/surreal/_generated/memberOf/memberOfSchemaGen.ts @@ -0,0 +1,19 @@ +// ==================== +// DO NOT EDIT THIS FILE! +// This file is autogenerated and will be overwritten during generation! +// ==================== + +import { z } from "zod"; +import { recordId } from "../recordSchema.js" + +// the create schema for table member_of +export const memberOfInputSchemaGen = z.object({ +in: recordId('student'), + out: recordId('exercise_group') +}); + +// the select schema for table member_of +export const memberOfOutputSchemaGen = z.object({ +in: recordId('student'), + out: recordId('exercise_group') +}); diff --git a/src/lib/surreal/_generated/module/moduleSchemaGen.ts b/src/lib/surreal/_generated/module/moduleSchemaGen.ts new file mode 100644 index 0000000000000000000000000000000000000000..cd1697160a068820e62dbdc96f089129e3cfdb23 --- /dev/null +++ b/src/lib/surreal/_generated/module/moduleSchemaGen.ts @@ -0,0 +1,23 @@ +// ==================== +// DO NOT EDIT THIS FILE! +// This file is autogenerated and will be overwritten during generation! +// ==================== + +import { z } from "zod"; + + +// the create schema for table module +export const moduleInputSchemaGen = z.object({ +pass_score: z.number(), + reference: z.string(), + total_score: z.number(), + ungraded: z.boolean().optional() +}).passthrough(); + +// the select schema for table module +export const moduleOutputSchemaGen = z.object({ +pass_score: z.number(), + reference: z.string(), + total_score: z.number(), + ungraded: z.boolean() +}).passthrough(); diff --git a/src/lib/surreal/_generated/recordSchema.ts b/src/lib/surreal/_generated/recordSchema.ts new file mode 100644 index 0000000000000000000000000000000000000000..39abab00f92d4ff8540ad04ac2dc52135cdac2cf --- /dev/null +++ b/src/lib/surreal/_generated/recordSchema.ts @@ -0,0 +1,65 @@ +import z from 'zod' +import { RecordId, StringRecordId } from 'surrealdb' + +const RecordIdValue = z.union([z.string(), z.number(), z.bigint(), z.record(z.unknown()), z.array(z.unknown())]) + +type RecordIdValue = z.infer<typeof RecordIdValue> + +export function recordId<Table extends string = string>(table?: Table) { + const tableRegex = table ? table : '[A-Za-z_][A-Za-z0-9_]*' + const idRegex = '[^:]+' + const fullRegex = new RegExp(`^${tableRegex}:${idRegex}$`) + + return z + .union([ + z + .custom<RecordId<string>>((val): val is RecordId<string> => val instanceof RecordId) + .refine((val): val is RecordId<Table> => !table || val.tb === table, { + message: table ? `RecordId must be of type '${table}'` : undefined, + }), + z + .custom<StringRecordId>((val): val is StringRecordId => val instanceof StringRecordId) + .refine(val => !table || val.rid.startsWith(`${table}:`), { + message: table ? `StringRecordId must start with '${table}:'` : undefined, + }), + z.string().regex(fullRegex, { + message: table + ? `Invalid record ID format. Must be '${table}:id'` + : "Invalid record ID format. Must be 'table:id'", + }), + z.object({ + rid: z.string().regex(fullRegex), + }), + z + .object({ + tb: z.string(), + id: z.union([z.string(), z.number(), z.record(z.unknown())]), + }) + .refine(val => !table || val.tb === table, { + message: table ? `RecordId must be of type '${table}'` : undefined, + }), + ]) + .transform((val): RecordId<Table> | StringRecordId => { + if (val instanceof RecordId) { + return val as RecordId<Table> + } + if (val instanceof StringRecordId) { + return val + } + if (typeof val === 'string') { + const [tb, ...idParts] = val.split(':') + const id = idParts.join(':') + if (!tb || !id) throw new Error('Invalid record ID string format') + return new StringRecordId(val) + } + if ('rid' in val) { + const [tb, ...idParts] = val.rid.split(':') + const id = idParts.join(':') + if (!tb || !id) throw new Error('Invalid rid object format') + return new StringRecordId(val.rid) + } + if ('tb' in val && 'id' in val) { + return new RecordId(val.tb, val.id) as RecordId<Table> + } + throw new Error('Invalid input for RecordId') + }) \ No newline at end of file diff --git a/src/lib/surreal/_generated/review/reviewSchemaGen.ts b/src/lib/surreal/_generated/review/reviewSchemaGen.ts new file mode 100644 index 0000000000000000000000000000000000000000..7ae0b31f55d88aea465ccf7f3f3ae77cce3dfb61 --- /dev/null +++ b/src/lib/surreal/_generated/review/reviewSchemaGen.ts @@ -0,0 +1,21 @@ +// ==================== +// DO NOT EDIT THIS FILE! +// This file is autogenerated and will be overwritten during generation! +// ==================== + +import { z } from "zod"; +import { recordId } from "../recordSchema.js" + +// the create schema for table review +export const reviewInputSchemaGen = z.object({ +approved: z.boolean(), + in: recordId('reviewer'), + out: recordId('evaluation') +}).passthrough(); + +// the select schema for table review +export const reviewOutputSchemaGen = z.object({ +approved: z.boolean(), + in: recordId('reviewer'), + out: recordId('evaluation') +}).passthrough(); diff --git a/src/lib/surreal/_generated/reviewer/reviewerSchemaGen.ts b/src/lib/surreal/_generated/reviewer/reviewerSchemaGen.ts new file mode 100644 index 0000000000000000000000000000000000000000..71146978a5a8e956677642f6529ec3ee97c6c133 --- /dev/null +++ b/src/lib/surreal/_generated/reviewer/reviewerSchemaGen.ts @@ -0,0 +1,17 @@ +// ==================== +// DO NOT EDIT THIS FILE! +// This file is autogenerated and will be overwritten during generation! +// ==================== + +import { z } from "zod"; + + +// the create schema for table reviewer +export const reviewerInputSchemaGen = z.object({ + +}).passthrough(); + +// the select schema for table reviewer +export const reviewerOutputSchemaGen = z.object({ + +}).passthrough(); diff --git a/src/lib/surreal/_generated/student/studentSchemaGen.ts b/src/lib/surreal/_generated/student/studentSchemaGen.ts new file mode 100644 index 0000000000000000000000000000000000000000..c3ba148718a922be52b588bd2d5f4465425d5c4f --- /dev/null +++ b/src/lib/surreal/_generated/student/studentSchemaGen.ts @@ -0,0 +1,17 @@ +// ==================== +// DO NOT EDIT THIS FILE! +// This file is autogenerated and will be overwritten during generation! +// ==================== + +import { z } from "zod"; + + +// the create schema for table student +export const studentInputSchemaGen = z.object({ +alias: z.string() +}).passthrough(); + +// the select schema for table student +export const studentOutputSchemaGen = z.object({ +alias: z.string() +}).passthrough(); diff --git a/src/lib/surreal/_generated/submission/submissionSchemaGen.ts b/src/lib/surreal/_generated/submission/submissionSchemaGen.ts new file mode 100644 index 0000000000000000000000000000000000000000..0b9f00686321278b274f663ff0f3c433712a9dae --- /dev/null +++ b/src/lib/surreal/_generated/submission/submissionSchemaGen.ts @@ -0,0 +1,35 @@ +// ==================== +// DO NOT EDIT THIS FILE! +// This file is autogenerated and will be overwritten during generation! +// ==================== + +import { z } from "zod"; +import { recordId } from "../recordSchema.js" + +// the create schema for table submission +export const submissionInputSchemaGen = z.object({ +code: z.string(), + in: recordId(), + out: recordId('assignment'), + source_code: z.string().optional(), + tests: z.object({ +annotation: z.string().optional(), + label: z.string(), + name: z.string() + }).array() +}).passthrough(); + +// the select schema for table submission +export const submissionOutputSchemaGen = z.object({ +code: z.string(), + in: recordId(), + out: recordId('assignment'), + score: z.unknown(), + source_code: z.string().optional(), + stage: z.unknown(), + tests: z.object({ +annotation: z.string().optional(), + label: z.string(), + name: z.string() + }).array() +}).passthrough(); diff --git a/src/lib/surreal/_generated/tutor/tutorSchemaGen.ts b/src/lib/surreal/_generated/tutor/tutorSchemaGen.ts new file mode 100644 index 0000000000000000000000000000000000000000..a98229c6645cc037ec611d0ec0a21ef062764761 --- /dev/null +++ b/src/lib/surreal/_generated/tutor/tutorSchemaGen.ts @@ -0,0 +1,17 @@ +// ==================== +// DO NOT EDIT THIS FILE! +// This file is autogenerated and will be overwritten during generation! +// ==================== + +import { z } from "zod"; + + +// the create schema for table tutor +export const tutorInputSchemaGen = z.object({ + +}).passthrough(); + +// the select schema for table tutor +export const tutorOutputSchemaGen = z.object({ + +}).passthrough(); diff --git a/src/lib/surreal/_generated/user/userSchemaGen.ts b/src/lib/surreal/_generated/user/userSchemaGen.ts new file mode 100644 index 0000000000000000000000000000000000000000..0a8464dd4fb0b6eb5c86844bb617b64aabf2175a --- /dev/null +++ b/src/lib/surreal/_generated/user/userSchemaGen.ts @@ -0,0 +1,29 @@ +// ==================== +// DO NOT EDIT THIS FILE! +// This file is autogenerated and will be overwritten during generation! +// ==================== + +import { z } from "zod"; + + +// the create schema for table user +export const userInputSchemaGen = z.object({ +activation_expires: z.string().datetime().optional(), + activation_token: z.string().optional(), + email: z.string().email(), + enabled: z.boolean(), + name: z.string(), + password_hash: z.string().optional(), + roles: z.unknown().array() +}); + +// the select schema for table user +export const userOutputSchemaGen = z.object({ +activation_expires: z.string().datetime(), + activation_token: z.string(), + email: z.string().email(), + enabled: z.boolean(), + name: z.string(), + password_hash: z.string(), + roles: z.unknown().array() +}); diff --git a/src/lib/surreal/schema/assignment/assignmentSchema.ts b/src/lib/surreal/schema/assignment/assignmentSchema.ts new file mode 100644 index 0000000000000000000000000000000000000000..2bc47745dc6a0019c5f40bf21f1d757cde6751bb --- /dev/null +++ b/src/lib/surreal/schema/assignment/assignmentSchema.ts @@ -0,0 +1,20 @@ +/* Place your custom changes here */ + +import { z } from "zod"; + +import { assignmentInputSchemaGen, assignmentOutputSchemaGen } from "../../_generated/index.js"; +import { recordId } from "../../_generated/recordSchema.js"; + +// payload schema for creating a new assignment entity +export const assignmentCreateSchema = assignmentInputSchemaGen.merge(z.object({ + id: recordId("assignment").optional() + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) + +// payload schema for fetching a assignment entity +export const assignmentSchema = assignmentOutputSchemaGen.merge(z.object({ + id: recordId("assignment"), + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) diff --git a/src/lib/surreal/schema/assignment/assignmentTypes.ts b/src/lib/surreal/schema/assignment/assignmentTypes.ts new file mode 100644 index 0000000000000000000000000000000000000000..5ebcdd574c68a2e1e3de6ad3e38bc8b6bb4199a8 --- /dev/null +++ b/src/lib/surreal/schema/assignment/assignmentTypes.ts @@ -0,0 +1,13 @@ +/* Place your custom changes here */ + +import { z } from "zod"; +import { type RecordId} from "surrealdb"; + +import { assignmentCreateSchema, assignmentSchema } from "./assignmentSchema.js"; + +// the create type for table assignment +export type AssignmentCreate = z.input<typeof assignmentCreateSchema> + +// the select type for table assignment +export type Assignment = z.output<typeof assignmentSchema> & {id: RecordId<string>} + \ No newline at end of file diff --git a/src/lib/surreal/schema/assignment/index.ts b/src/lib/surreal/schema/assignment/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..dbadad9018ca558c63f5404e8a67a2fe182e48c2 --- /dev/null +++ b/src/lib/surreal/schema/assignment/index.ts @@ -0,0 +1,2 @@ +export * from './assignmentSchema.js'; +export * from './assignmentTypes.js'; \ No newline at end of file diff --git a/src/lib/surreal/schema/evaluation/evaluationSchema.ts b/src/lib/surreal/schema/evaluation/evaluationSchema.ts new file mode 100644 index 0000000000000000000000000000000000000000..adbcb84392fc3bf0a39f7f7b12d750da8c78f8a6 --- /dev/null +++ b/src/lib/surreal/schema/evaluation/evaluationSchema.ts @@ -0,0 +1,20 @@ +/* Place your custom changes here */ + +import { z } from "zod"; + +import { evaluationInputSchemaGen, evaluationOutputSchemaGen } from "../../_generated/index.js"; +import { recordId } from "../../_generated/recordSchema.js"; + +// payload schema for creating a new evaluation entity +export const evaluationCreateSchema = evaluationInputSchemaGen.merge(z.object({ + id: recordId("evaluation").optional() + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) + +// payload schema for fetching a evaluation entity +export const evaluationSchema = evaluationOutputSchemaGen.merge(z.object({ + id: recordId("evaluation"), + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) diff --git a/src/lib/surreal/schema/evaluation/evaluationTypes.ts b/src/lib/surreal/schema/evaluation/evaluationTypes.ts new file mode 100644 index 0000000000000000000000000000000000000000..16e12153f1f09d600075b5d362b6391b0b83fb09 --- /dev/null +++ b/src/lib/surreal/schema/evaluation/evaluationTypes.ts @@ -0,0 +1,13 @@ +/* Place your custom changes here */ + +import { z } from "zod"; +import { type RecordId} from "surrealdb"; + +import { evaluationCreateSchema, evaluationSchema } from "./evaluationSchema.js"; + +// the create type for table evaluation +export type EvaluationCreate = z.input<typeof evaluationCreateSchema> + +// the select type for table evaluation +export type Evaluation = z.output<typeof evaluationSchema> & {id: RecordId<string>} + \ No newline at end of file diff --git a/src/lib/surreal/schema/evaluation/index.ts b/src/lib/surreal/schema/evaluation/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..099144dd7a8b7f3e0f09690325e79b64dcd7c5c3 --- /dev/null +++ b/src/lib/surreal/schema/evaluation/index.ts @@ -0,0 +1,2 @@ +export * from './evaluationSchema.js'; +export * from './evaluationTypes.js'; \ No newline at end of file diff --git a/src/lib/surreal/schema/exerciseGroup/exerciseGroupSchema.ts b/src/lib/surreal/schema/exerciseGroup/exerciseGroupSchema.ts new file mode 100644 index 0000000000000000000000000000000000000000..0fb12bce9111af44442acf6b9087e5674befc65c --- /dev/null +++ b/src/lib/surreal/schema/exerciseGroup/exerciseGroupSchema.ts @@ -0,0 +1,20 @@ +/* Place your custom changes here */ + +import { z } from "zod"; + +import { exerciseGroupInputSchemaGen, exerciseGroupOutputSchemaGen } from "../../_generated/index.js"; +import { recordId } from "../../_generated/recordSchema.js"; + +// payload schema for creating a new exercise_group entity +export const exerciseGroupCreateSchema = exerciseGroupInputSchemaGen.merge(z.object({ + id: recordId("exercise_group").optional() + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) + +// payload schema for fetching a exercise_group entity +export const exerciseGroupSchema = exerciseGroupOutputSchemaGen.merge(z.object({ + id: recordId("exercise_group"), + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) diff --git a/src/lib/surreal/schema/exerciseGroup/exerciseGroupTypes.ts b/src/lib/surreal/schema/exerciseGroup/exerciseGroupTypes.ts new file mode 100644 index 0000000000000000000000000000000000000000..588d61dd45464d0fd2e1594aa4cc56ed298371f7 --- /dev/null +++ b/src/lib/surreal/schema/exerciseGroup/exerciseGroupTypes.ts @@ -0,0 +1,13 @@ +/* Place your custom changes here */ + +import { z } from "zod"; +import { type RecordId} from "surrealdb"; + +import { exerciseGroupCreateSchema, exerciseGroupSchema } from "./exerciseGroupSchema.js"; + +// the create type for table exercise_group +export type ExerciseGroupCreate = z.input<typeof exerciseGroupCreateSchema> + +// the select type for table exercise_group +export type ExerciseGroup = z.output<typeof exerciseGroupSchema> & {id: RecordId<string>} + \ No newline at end of file diff --git a/src/lib/surreal/schema/exerciseGroup/index.ts b/src/lib/surreal/schema/exerciseGroup/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..4d82a37a6db83df5ee3518d13db39c549fbda24a --- /dev/null +++ b/src/lib/surreal/schema/exerciseGroup/index.ts @@ -0,0 +1,2 @@ +export * from './exerciseGroupSchema.js'; +export * from './exerciseGroupTypes.js'; \ No newline at end of file diff --git a/src/lib/surreal/schema/hasAccount/hasAccountSchema.ts b/src/lib/surreal/schema/hasAccount/hasAccountSchema.ts new file mode 100644 index 0000000000000000000000000000000000000000..e54b0ee72a32709971fc0eaa1ca47642667a608e --- /dev/null +++ b/src/lib/surreal/schema/hasAccount/hasAccountSchema.ts @@ -0,0 +1,20 @@ +/* Place your custom changes here */ + +import { z } from "zod"; + +import { hasAccountInputSchemaGen, hasAccountOutputSchemaGen } from "../../_generated/index.js"; +import { recordId } from "../../_generated/recordSchema.js"; + +// payload schema for creating a new has_account entity +export const hasAccountCreateSchema = hasAccountInputSchemaGen.merge(z.object({ + id: recordId("has_account").optional() + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) + +// payload schema for fetching a has_account entity +export const hasAccountSchema = hasAccountOutputSchemaGen.merge(z.object({ + id: recordId("has_account"), + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) diff --git a/src/lib/surreal/schema/hasAccount/hasAccountTypes.ts b/src/lib/surreal/schema/hasAccount/hasAccountTypes.ts new file mode 100644 index 0000000000000000000000000000000000000000..7369c9911baf43044b70a806d79146e42294a900 --- /dev/null +++ b/src/lib/surreal/schema/hasAccount/hasAccountTypes.ts @@ -0,0 +1,13 @@ +/* Place your custom changes here */ + +import { z } from "zod"; +import { type RecordId} from "surrealdb"; + +import { hasAccountCreateSchema, hasAccountSchema } from "./hasAccountSchema.js"; + +// the create type for table has_account +export type HasAccountCreate = z.input<typeof hasAccountCreateSchema> + +// the select type for table has_account +export type HasAccount = z.output<typeof hasAccountSchema> & {id: RecordId<string>} + \ No newline at end of file diff --git a/src/lib/surreal/schema/hasAccount/index.ts b/src/lib/surreal/schema/hasAccount/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..1b493655ac49ee24974dc7430c8cd01e7c478789 --- /dev/null +++ b/src/lib/surreal/schema/hasAccount/index.ts @@ -0,0 +1,2 @@ +export * from './hasAccountSchema.js'; +export * from './hasAccountTypes.js'; \ No newline at end of file diff --git a/src/lib/surreal/schema/index.ts b/src/lib/surreal/schema/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..3888b0bbf159ad67e14c8d3084b8007a09c9cc6e --- /dev/null +++ b/src/lib/surreal/schema/index.ts @@ -0,0 +1,12 @@ +export * from './assignment/index.js'; +export * from './evaluation/index.js'; +export * from './exerciseGroup/index.js'; +export * from './hasAccount/index.js'; +export * from './memberOf/index.js'; +export * from './module/index.js'; +export * from './review/index.js'; +export * from './reviewer/index.js'; +export * from './student/index.js'; +export * from './submission/index.js'; +export * from './tutor/index.js'; +export * from './user/index.js'; \ No newline at end of file diff --git a/src/lib/surreal/schema/memberOf/index.ts b/src/lib/surreal/schema/memberOf/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..c4e424f0ff4d47027ca1ba06776a01c0fbabaa19 --- /dev/null +++ b/src/lib/surreal/schema/memberOf/index.ts @@ -0,0 +1,2 @@ +export * from './memberOfSchema.js'; +export * from './memberOfTypes.js'; \ No newline at end of file diff --git a/src/lib/surreal/schema/memberOf/memberOfSchema.ts b/src/lib/surreal/schema/memberOf/memberOfSchema.ts new file mode 100644 index 0000000000000000000000000000000000000000..558d74f06b3c434169dccadbe7bf418b1c27f07b --- /dev/null +++ b/src/lib/surreal/schema/memberOf/memberOfSchema.ts @@ -0,0 +1,20 @@ +/* Place your custom changes here */ + +import { z } from "zod"; + +import { memberOfInputSchemaGen, memberOfOutputSchemaGen } from "../../_generated/index.js"; +import { recordId } from "../../_generated/recordSchema.js"; + +// payload schema for creating a new member_of entity +export const memberOfCreateSchema = memberOfInputSchemaGen.merge(z.object({ + id: recordId("member_of").optional() + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) + +// payload schema for fetching a member_of entity +export const memberOfSchema = memberOfOutputSchemaGen.merge(z.object({ + id: recordId("member_of"), + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) diff --git a/src/lib/surreal/schema/memberOf/memberOfTypes.ts b/src/lib/surreal/schema/memberOf/memberOfTypes.ts new file mode 100644 index 0000000000000000000000000000000000000000..ed35201d845b2f044fe969fe9dec683213d71f97 --- /dev/null +++ b/src/lib/surreal/schema/memberOf/memberOfTypes.ts @@ -0,0 +1,13 @@ +/* Place your custom changes here */ + +import { z } from "zod"; +import { type RecordId} from "surrealdb"; + +import { memberOfCreateSchema, memberOfSchema } from "./memberOfSchema.js"; + +// the create type for table member_of +export type MemberOfCreate = z.input<typeof memberOfCreateSchema> + +// the select type for table member_of +export type MemberOf = z.output<typeof memberOfSchema> & {id: RecordId<string>} + \ No newline at end of file diff --git a/src/lib/surreal/schema/module/index.ts b/src/lib/surreal/schema/module/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..3ab05bf91a7725d7cd61fccc5ac5978b7b5e4de9 --- /dev/null +++ b/src/lib/surreal/schema/module/index.ts @@ -0,0 +1,2 @@ +export * from './moduleSchema.js'; +export * from './moduleTypes.js'; \ No newline at end of file diff --git a/src/lib/surreal/schema/module/moduleSchema.ts b/src/lib/surreal/schema/module/moduleSchema.ts new file mode 100644 index 0000000000000000000000000000000000000000..3c400c00adfc96d4a1a59e179e7347b2d2c88bdc --- /dev/null +++ b/src/lib/surreal/schema/module/moduleSchema.ts @@ -0,0 +1,20 @@ +/* Place your custom changes here */ + +import { z } from "zod"; + +import { moduleInputSchemaGen, moduleOutputSchemaGen } from "../../_generated/index.js"; +import { recordId } from "../../_generated/recordSchema.js"; + +// payload schema for creating a new module entity +export const moduleCreateSchema = moduleInputSchemaGen.merge(z.object({ + id: recordId("module").optional() + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) + +// payload schema for fetching a module entity +export const moduleSchema = moduleOutputSchemaGen.merge(z.object({ + id: recordId("module"), + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) diff --git a/src/lib/surreal/schema/module/moduleTypes.ts b/src/lib/surreal/schema/module/moduleTypes.ts new file mode 100644 index 0000000000000000000000000000000000000000..ee2b7a5766919a6bc6f7dfe25510a9aa868f39fe --- /dev/null +++ b/src/lib/surreal/schema/module/moduleTypes.ts @@ -0,0 +1,13 @@ +/* Place your custom changes here */ + +import { z } from "zod"; +import { type RecordId} from "surrealdb"; + +import { moduleCreateSchema, moduleSchema } from "./moduleSchema.js"; + +// the create type for table module +export type ModuleCreate = z.input<typeof moduleCreateSchema> + +// the select type for table module +export type Module = z.output<typeof moduleSchema> & {id: RecordId<string>} + \ No newline at end of file diff --git a/src/lib/surreal/schema/review/index.ts b/src/lib/surreal/schema/review/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..339c9c7db20deda21e75905ee6dcef972ea01ba0 --- /dev/null +++ b/src/lib/surreal/schema/review/index.ts @@ -0,0 +1,2 @@ +export * from './reviewSchema.js'; +export * from './reviewTypes.js'; \ No newline at end of file diff --git a/src/lib/surreal/schema/review/reviewSchema.ts b/src/lib/surreal/schema/review/reviewSchema.ts new file mode 100644 index 0000000000000000000000000000000000000000..735e4410cf1daf51982a6c920593aefc9056757b --- /dev/null +++ b/src/lib/surreal/schema/review/reviewSchema.ts @@ -0,0 +1,20 @@ +/* Place your custom changes here */ + +import { z } from "zod"; + +import { reviewInputSchemaGen, reviewOutputSchemaGen } from "../../_generated/index.js"; +import { recordId } from "../../_generated/recordSchema.js"; + +// payload schema for creating a new review entity +export const reviewCreateSchema = reviewInputSchemaGen.merge(z.object({ + id: recordId("review").optional() + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) + +// payload schema for fetching a review entity +export const reviewSchema = reviewOutputSchemaGen.merge(z.object({ + id: recordId("review"), + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) diff --git a/src/lib/surreal/schema/review/reviewTypes.ts b/src/lib/surreal/schema/review/reviewTypes.ts new file mode 100644 index 0000000000000000000000000000000000000000..5aededc21deb7693b2edfeb13243bd3d5b0da5d5 --- /dev/null +++ b/src/lib/surreal/schema/review/reviewTypes.ts @@ -0,0 +1,13 @@ +/* Place your custom changes here */ + +import { z } from "zod"; +import { type RecordId} from "surrealdb"; + +import { reviewCreateSchema, reviewSchema } from "./reviewSchema.js"; + +// the create type for table review +export type ReviewCreate = z.input<typeof reviewCreateSchema> + +// the select type for table review +export type Review = z.output<typeof reviewSchema> & {id: RecordId<string>} + \ No newline at end of file diff --git a/src/lib/surreal/schema/reviewer/index.ts b/src/lib/surreal/schema/reviewer/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..0aafabd14b340d05e0a0c889553e52a4512b3bdf --- /dev/null +++ b/src/lib/surreal/schema/reviewer/index.ts @@ -0,0 +1,2 @@ +export * from './reviewerSchema.js'; +export * from './reviewerTypes.js'; \ No newline at end of file diff --git a/src/lib/surreal/schema/reviewer/reviewerSchema.ts b/src/lib/surreal/schema/reviewer/reviewerSchema.ts new file mode 100644 index 0000000000000000000000000000000000000000..2480f8766326563104e26a5f7bb6496deb5463c8 --- /dev/null +++ b/src/lib/surreal/schema/reviewer/reviewerSchema.ts @@ -0,0 +1,20 @@ +/* Place your custom changes here */ + +import { z } from "zod"; + +import { reviewerInputSchemaGen, reviewerOutputSchemaGen } from "../../_generated/index.js"; +import { recordId } from "../../_generated/recordSchema.js"; + +// payload schema for creating a new reviewer entity +export const reviewerCreateSchema = reviewerInputSchemaGen.merge(z.object({ + id: recordId("reviewer").optional() + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) + +// payload schema for fetching a reviewer entity +export const reviewerSchema = reviewerOutputSchemaGen.merge(z.object({ + id: recordId("reviewer"), + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) diff --git a/src/lib/surreal/schema/reviewer/reviewerTypes.ts b/src/lib/surreal/schema/reviewer/reviewerTypes.ts new file mode 100644 index 0000000000000000000000000000000000000000..25b9813f4be2acedb148204d046d2f5ef8dff326 --- /dev/null +++ b/src/lib/surreal/schema/reviewer/reviewerTypes.ts @@ -0,0 +1,13 @@ +/* Place your custom changes here */ + +import { z } from "zod"; +import { type RecordId} from "surrealdb"; + +import { reviewerCreateSchema, reviewerSchema } from "./reviewerSchema.js"; + +// the create type for table reviewer +export type ReviewerCreate = z.input<typeof reviewerCreateSchema> + +// the select type for table reviewer +export type Reviewer = z.output<typeof reviewerSchema> & {id: RecordId<string>} + \ No newline at end of file diff --git a/src/lib/surreal/schema/student/index.ts b/src/lib/surreal/schema/student/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..c0cda5e8d6ae0754c35426af331bb87987333e6a --- /dev/null +++ b/src/lib/surreal/schema/student/index.ts @@ -0,0 +1,2 @@ +export * from './studentSchema.js'; +export * from './studentTypes.js'; \ No newline at end of file diff --git a/src/lib/surreal/schema/student/studentSchema.ts b/src/lib/surreal/schema/student/studentSchema.ts new file mode 100644 index 0000000000000000000000000000000000000000..b093060d21ea21f6433f996b604923cef1dfe453 --- /dev/null +++ b/src/lib/surreal/schema/student/studentSchema.ts @@ -0,0 +1,20 @@ +/* Place your custom changes here */ + +import { z } from "zod"; + +import { studentInputSchemaGen, studentOutputSchemaGen } from "../../_generated/index.js"; +import { recordId } from "../../_generated/recordSchema.js"; + +// payload schema for creating a new student entity +export const studentCreateSchema = studentInputSchemaGen.merge(z.object({ + id: recordId("student").optional() + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) + +// payload schema for fetching a student entity +export const studentSchema = studentOutputSchemaGen.merge(z.object({ + id: recordId("student"), + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) diff --git a/src/lib/surreal/schema/student/studentTypes.ts b/src/lib/surreal/schema/student/studentTypes.ts new file mode 100644 index 0000000000000000000000000000000000000000..366b0528e999cf793f48c2c7fc3c0730a98e9c5b --- /dev/null +++ b/src/lib/surreal/schema/student/studentTypes.ts @@ -0,0 +1,13 @@ +/* Place your custom changes here */ + +import { z } from "zod"; +import { type RecordId} from "surrealdb"; + +import { studentCreateSchema, studentSchema } from "./studentSchema.js"; + +// the create type for table student +export type StudentCreate = z.input<typeof studentCreateSchema> + +// the select type for table student +export type Student = z.output<typeof studentSchema> & {id: RecordId<string>} + \ No newline at end of file diff --git a/src/lib/surreal/schema/submission/index.ts b/src/lib/surreal/schema/submission/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..448b2d9d80cd63b838dbcd2121ad26d56499148a --- /dev/null +++ b/src/lib/surreal/schema/submission/index.ts @@ -0,0 +1,2 @@ +export * from './submissionSchema.js'; +export * from './submissionTypes.js'; \ No newline at end of file diff --git a/src/lib/surreal/schema/submission/submissionSchema.ts b/src/lib/surreal/schema/submission/submissionSchema.ts new file mode 100644 index 0000000000000000000000000000000000000000..218544a35f8c4c839ad3c5b98e892ada5bf333b0 --- /dev/null +++ b/src/lib/surreal/schema/submission/submissionSchema.ts @@ -0,0 +1,20 @@ +/* Place your custom changes here */ + +import { z } from "zod"; + +import { submissionInputSchemaGen, submissionOutputSchemaGen } from "../../_generated/index.js"; +import { recordId } from "../../_generated/recordSchema.js"; + +// payload schema for creating a new submission entity +export const submissionCreateSchema = submissionInputSchemaGen.merge(z.object({ + id: recordId("submission").optional() + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) + +// payload schema for fetching a submission entity +export const submissionSchema = submissionOutputSchemaGen.merge(z.object({ + id: recordId("submission"), + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) diff --git a/src/lib/surreal/schema/submission/submissionTypes.ts b/src/lib/surreal/schema/submission/submissionTypes.ts new file mode 100644 index 0000000000000000000000000000000000000000..c2160586f4ad9293bec612a989547b2f9304f6aa --- /dev/null +++ b/src/lib/surreal/schema/submission/submissionTypes.ts @@ -0,0 +1,13 @@ +/* Place your custom changes here */ + +import { z } from "zod"; +import { type RecordId} from "surrealdb"; + +import { submissionCreateSchema, submissionSchema } from "./submissionSchema.js"; + +// the create type for table submission +export type SubmissionCreate = z.input<typeof submissionCreateSchema> + +// the select type for table submission +export type Submission = z.output<typeof submissionSchema> & {id: RecordId<string>} + \ No newline at end of file diff --git a/src/lib/surreal/schema/tutor/index.ts b/src/lib/surreal/schema/tutor/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..3fe38a7e8e68cde22dd6e5641313a18b9acf9e33 --- /dev/null +++ b/src/lib/surreal/schema/tutor/index.ts @@ -0,0 +1,2 @@ +export * from './tutorSchema.js'; +export * from './tutorTypes.js'; \ No newline at end of file diff --git a/src/lib/surreal/schema/tutor/tutorSchema.ts b/src/lib/surreal/schema/tutor/tutorSchema.ts new file mode 100644 index 0000000000000000000000000000000000000000..64712af4044a496f64f4b61c9703175ecc739bbf --- /dev/null +++ b/src/lib/surreal/schema/tutor/tutorSchema.ts @@ -0,0 +1,20 @@ +/* Place your custom changes here */ + +import { z } from "zod"; + +import { tutorInputSchemaGen, tutorOutputSchemaGen } from "../../_generated/index.js"; +import { recordId } from "../../_generated/recordSchema.js"; + +// payload schema for creating a new tutor entity +export const tutorCreateSchema = tutorInputSchemaGen.merge(z.object({ + id: recordId("tutor").optional() + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) + +// payload schema for fetching a tutor entity +export const tutorSchema = tutorOutputSchemaGen.merge(z.object({ + id: recordId("tutor"), + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) diff --git a/src/lib/surreal/schema/tutor/tutorTypes.ts b/src/lib/surreal/schema/tutor/tutorTypes.ts new file mode 100644 index 0000000000000000000000000000000000000000..7e97c486201ff9d928c45dca7deb32164a17c141 --- /dev/null +++ b/src/lib/surreal/schema/tutor/tutorTypes.ts @@ -0,0 +1,13 @@ +/* Place your custom changes here */ + +import { z } from "zod"; +import { type RecordId} from "surrealdb"; + +import { tutorCreateSchema, tutorSchema } from "./tutorSchema.js"; + +// the create type for table tutor +export type TutorCreate = z.input<typeof tutorCreateSchema> + +// the select type for table tutor +export type Tutor = z.output<typeof tutorSchema> & {id: RecordId<string>} + \ No newline at end of file diff --git a/src/lib/surreal/schema/user/index.ts b/src/lib/surreal/schema/user/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..62a250407e1e68571ceb254689952af98765b8a5 --- /dev/null +++ b/src/lib/surreal/schema/user/index.ts @@ -0,0 +1,2 @@ +export * from './userSchema.js'; +export * from './userTypes.js'; \ No newline at end of file diff --git a/src/lib/surreal/schema/user/userSchema.ts b/src/lib/surreal/schema/user/userSchema.ts new file mode 100644 index 0000000000000000000000000000000000000000..9171c945d51612239d6a98f16d33d292c2dbb3b6 --- /dev/null +++ b/src/lib/surreal/schema/user/userSchema.ts @@ -0,0 +1,20 @@ +/* Place your custom changes here */ + +import { z } from "zod"; + +import { userInputSchemaGen, userOutputSchemaGen } from "../../_generated/index.js"; +import { recordId } from "../../_generated/recordSchema.js"; + +// payload schema for creating a new user entity +export const userCreateSchema = userInputSchemaGen.merge(z.object({ + id: recordId("user").optional() + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) + +// payload schema for fetching a user entity +export const userSchema = userOutputSchemaGen.merge(z.object({ + id: recordId("user"), + // add your custom fields here, which are not part of SurrealDB table schema + // they are not overwritten by the next run + })) diff --git a/src/lib/surreal/schema/user/userTypes.ts b/src/lib/surreal/schema/user/userTypes.ts new file mode 100644 index 0000000000000000000000000000000000000000..c2c216dba87357bdc5e586af9519adfd10acaa9f --- /dev/null +++ b/src/lib/surreal/schema/user/userTypes.ts @@ -0,0 +1,13 @@ +/* Place your custom changes here */ + +import { z } from "zod"; +import { type RecordId} from "surrealdb"; + +import { userCreateSchema, userSchema } from "./userSchema.js"; + +// the create type for table user +export type UserCreate = z.input<typeof userCreateSchema> + +// the select type for table user +export type User = z.output<typeof userSchema> & {id: RecordId<string>} + \ No newline at end of file