refactor(schema): apply session review decisions (#35793)
This commit is contained in:
parent
d27746e5b3
commit
ed6ad272ec
142 changed files with 4239 additions and 3174 deletions
|
|
@ -1,13 +1,23 @@
|
|||
export * as FileDiff from "./file-diff.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { optional } from "./schema.js"
|
||||
import { NonNegativeInt, optional } from "./schema.js"
|
||||
|
||||
export const Info = Schema.Struct({
|
||||
file: optional(Schema.String),
|
||||
patch: optional(Schema.String),
|
||||
file: Schema.String,
|
||||
patch: Schema.String,
|
||||
additions: NonNegativeInt,
|
||||
deletions: NonNegativeInt,
|
||||
status: Schema.Literals(["added", "deleted", "modified"]),
|
||||
}).annotate({ identifier: "FileDiff.Info" })
|
||||
export interface Info extends Schema.Schema.Type<typeof Info> {}
|
||||
|
||||
/** V1 snapshot and persisted session diff shape. */
|
||||
export const LegacyInfo = Schema.Struct({
|
||||
file: Schema.String.pipe(optional),
|
||||
patch: Schema.String.pipe(optional),
|
||||
additions: Schema.Finite,
|
||||
deletions: Schema.Finite,
|
||||
status: optional(Schema.Literals(["added", "deleted", "modified"])),
|
||||
}).annotate({ identifier: "SnapshotFileDiff" })
|
||||
export interface Info extends Schema.Schema.Type<typeof Info> {}
|
||||
status: Schema.Literals(["added", "deleted", "modified"]).pipe(optional),
|
||||
}).annotate({ identifier: "FileDiff.LegacyInfo" })
|
||||
export interface LegacyInfo extends Schema.Schema.Type<typeof LegacyInfo> {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue