38 lines · 1.2 KB · TypeScript
RawDownload
import * as Schema from "effect/Schema"; import { ThreadId, TrimmedNonEmptyString } from "./baseSchemas.ts"; const ASSET_PATH_MAX_LENGTH = 1024; export const AssetResource = Schema.Union([  Schema.TaggedStruct("workspace-file", {    threadId: ThreadId,    path: TrimmedNonEmptyString.check(Schema.isMaxLength(ASSET_PATH_MAX_LENGTH)),  }),  Schema.TaggedStruct("attachment", {    attachmentId: TrimmedNonEmptyString.check(Schema.isMaxLength(256)),  }),  Schema.TaggedStruct("project-favicon", {    cwd: TrimmedNonEmptyString.check(Schema.isMaxLength(ASSET_PATH_MAX_LENGTH)),  }),]);export type AssetResource = typeof AssetResource.Type; export const AssetCreateUrlInput = Schema.Struct({  resource: AssetResource,});export type AssetCreateUrlInput = typeof AssetCreateUrlInput.Type; export const AssetCreateUrlResult = Schema.Struct({  relativeUrl: TrimmedNonEmptyString.check(Schema.isMaxLength(4096)),  expiresAt: Schema.Number,});export type AssetCreateUrlResult = typeof AssetCreateUrlResult.Type; export class AssetAccessError extends Schema.TaggedErrorClass<AssetAccessError>()(  "AssetAccessError",  {    message: TrimmedNonEmptyString,    cause: Schema.optional(Schema.Defect()),  },) {}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t