This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script lang="ts" generics="V extends RemoteFormFieldValue"> | |
| import type { RemoteFormField, RemoteFormFieldValue } from "@sveltejs/kit"; | |
| import type { HTMLInputAttributes } from "svelte/elements"; | |
| import FieldMessage from "./field-message.svelte"; | |
| import InputWrapper from "./input-wrapper.svelte"; | |
| type InputTypeMap = | |
| | { | |
| type?: "text"; | |
| field: RemoteFormField<string>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default { | |
| meta: { | |
| type: "problem", | |
| docs: { | |
| description: | |
| "Enforce that exports in .remote.ts files use query(), command(), or form(), and only allow type exports", | |
| category: "Best Practices", | |
| recommended: true | |
| }, | |
| messages: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default { | |
| meta: { | |
| type: "problem", | |
| docs: { | |
| description: | |
| "Enforce that exports in .remote.ts files use guardedQuery(), guardedCommand(), or guardedForm(), and only allow type exports", | |
| category: "Best Practices", | |
| recommended: true | |
| }, | |
| messages: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { command, form, getRequestEvent, query } from "$app/server"; | |
| import type { StandardSchemaV1 } from "@standard-schema/spec"; | |
| import { | |
| redirect, | |
| type Invalid, | |
| type RemoteCommand, | |
| type RemoteFormFactory, | |
| type RemoteFormInput, | |
| type RemoteQueryFunction, | |
| type RequestEvent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script lang="ts" generics="V extends RemoteFormFieldValue"> | |
| import type { RemoteFormField, RemoteFormFieldType, RemoteFormFieldValue } from "@sveltejs/kit"; | |
| import type { HTMLInputAttributes } from "svelte/elements"; | |
| type Props = { | |
| label?: string; | |
| field: RemoteFormField<V>; | |
| description?: string; | |
| warning?: string; | |
| hidden?: boolean; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script lang="ts"> | |
| import Breadcrumbs from "$lib/components/Breadcrumbs.svelte"; | |
| import Control from "$lib/components/forms/Control.svelte"; | |
| import Input from "$lib/components/forms/Input.svelte"; | |
| import Submit from "$lib/components/forms/Submit.svelte"; | |
| import SuperForm from "$lib/components/forms/SuperForm.svelte"; | |
| import { valibotForm } from "$lib/factories.svelte.js"; | |
| import DMsAPI from "$lib/remote/dms"; | |
| import { dungeonMasterSchema } from "$lib/schemas"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import type { StandardSchemaV1 } from "@standard-schema/spec"; | |
| type Context<TType> = { | |
| parsed: TType; | |
| issues: StandardSchemaV1.Issue[]; | |
| }; | |
| // Transform functions interface | |
| interface CodecTransforms<TInputIn, TInputOut, TOutputIn, TOutputOut> { | |
| decode: (input: TInputIn, context?: Context<TInputOut>) => TOutputIn; // forward transform (input -> output) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { dev } from "$app/environment"; | |
| import { getRequestEvent } from "$app/server"; | |
| import { privateEnv } from "$lib/env/private"; | |
| import type { AppLogSchema, UserId } from "$lib/schemas"; | |
| import { db, runQuery } from "$lib/server/db"; | |
| import { appLogs } from "$lib/server/db/schema"; | |
| import { removeTrace } from "$lib/util"; | |
| import { isInstanceOfClass } from "@sillvva/utils"; | |
| import { error, isHttpError, isRedirect, type NumericRange } from "@sveltejs/kit"; | |
| import { Cause, Effect, Exit, HashMap, Layer, Logger } from "effect"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default function createSocket<T>( | |
| url: string | URL, | |
| options?: { | |
| name?: string; | |
| protocols?: string | string[]; | |
| onOpen?: (event: Event) => void; | |
| onError?: (error: Event) => void; | |
| onMessage?: (data: T, requests: T[], event: Event) => void; | |
| } | |
| ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import qs from "qs"; | |
| import { z, ZodSchema } from "zod"; | |
| import dayjs from "dayjs"; | |
| import duration from "dayjs/plugin/duration"; | |
| import { useEffect, useRef, useState } from "react"; | |
| dayjs.extend(duration); | |
| const parseObjectPrimitives = (obj: Record<string, any>): any => { | |
| return Object.fromEntries( | |
| Object.entries(obj).map(([k, v]) => { |
NewerOlder