Radish alpha
r
rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5
Radicle web interface
Radicle
Git
Remove more unused patch and issue schemas
Sebastian Martinez committed 1 year ago
commit 1a5830b54a5a837b08785b80d156c76fe4bfdc72
parent c4aa4f0
2 files changed +1 -144
modified http-client/lib/project/issue.ts
@@ -1,6 +1,5 @@
-
import type { Embed } from "./comment.js";
import type { ZodSchema, z } from "zod";
-
import { array, boolean, literal, object, string, union } from "zod";
+
import { array, literal, object, string, union } from "zod";

import { commentSchema } from "./comment.js";
import { authorSchema } from "../shared.js";
@@ -29,42 +28,4 @@ export const issueSchema = object({

export type Issue = z.infer<typeof issueSchema>;

-
export interface IssueCreated {
-
  success: boolean;
-
  id: string;
-
}
-

-
export const issueCreatedSchema = object({
-
  success: boolean(),
-
  id: string(),
-
}) satisfies ZodSchema<IssueCreated>;
-

export const issuesSchema = array(issueSchema) satisfies ZodSchema<Issue[]>;
-

-
export type IssueUpdateAction =
-
  | { type: "edit"; title: string }
-
  | { type: "label"; labels: string[] }
-
  | {
-
      type: "assign";
-
      assignees: string[];
-
    }
-
  | { type: "lifecycle"; state: IssueState }
-
  | {
-
      type: "comment";
-
      body: string;
-
      embeds?: Embed[];
-
      replyTo?: string;
-
    }
-
  | {
-
      type: "comment.edit";
-
      id: string;
-
      body: string;
-
      embeds: Embed[];
-
    }
-
  | { type: "comment.redact"; id: string }
-
  | {
-
      type: "comment.react";
-
      id: string;
-
      reaction: string;
-
      active: boolean;
-
    };
modified http-client/lib/project/patch.ts
@@ -1,12 +1,9 @@
-
import type { Embed } from "./comment.js";
import type { ZodSchema, z } from "zod";
-
import type { CodeLocation } from "../shared.js";

import { commentSchema } from "./comment.js";

import {
  array,
-
  boolean,
  literal,
  number,
  optional,
@@ -107,104 +104,3 @@ export type LifecycleState =
  | { status: "draft" }
  | { status: "open" }
  | { status: "archived" };
-

-
export type PatchUpdateAction =
-
  | { type: "edit"; title: string; target: "delegates" }
-
  | { type: "label"; labels: string[] }
-
  | { type: "assign"; assignees: string[] }
-
  | { type: "merge"; revision: string; commit: string }
-
  | { type: "lifecycle"; state: LifecycleState }
-
  | {
-
      type: "review";
-
      revision: string;
-
      summary?: string;
-
      verdict?: Verdict | null;
-
    }
-
  | { type: "review.edit"; review: string; summary?: string }
-
  | { type: "review.redact"; review: string }
-
  | {
-
      type: "review.comment";
-
      review: string;
-
      body: string;
-
      location: CodeLocation;
-
      replyTo?: string;
-
      embeds?: Embed[];
-
    }
-
  | {
-
      type: "review.comment.edit";
-
      review: string;
-
      comment: string;
-
      body: string;
-
      embeds: Embed[];
-
    }
-
  | {
-
      type: "review.comment.redact";
-
      review: string;
-
      comment: string;
-
    }
-
  | {
-
      type: "review.comment.react";
-
      review: string;
-
      comment: string;
-
      reaction: string;
-
      active: boolean;
-
    }
-
  | { type: "revision"; description: string; base: string; oid: string }
-
  | {
-
      type: "revision.edit";
-
      revision: string;
-
      description: string;
-
      embeds?: Embed[];
-
    }
-
  | {
-
      type: "revision.react";
-
      revision: string;
-
      reaction: string;
-
      location?: CodeLocation;
-
      active: boolean;
-
    }
-
  | { type: "revision.redact"; revision: string }
-
  | {
-
      type: "revision.comment";
-
      revision: string;
-
      body: string;
-
      embeds?: Embed[];
-
      location?: CodeLocation;
-
      replyTo?: string;
-
    }
-
  | {
-
      type: "revision.comment.edit";
-
      revision: string;
-
      comment: string;
-
      body: string;
-
      embeds: Embed[];
-
    }
-
  | {
-
      type: "revision.comment.redact";
-
      revision: string;
-
      comment: string;
-
    }
-
  | {
-
      type: "revision.comment.react";
-
      revision: string;
-
      comment: string;
-
      reaction: string;
-
      active: boolean;
-
    };
-

-
export const patchCreateSchema = object({
-
  title: string(),
-
  description: string(),
-
  target: string(),
-
  oid: string(),
-
  labels: array(string()),
-
});
-

-
export type PatchCreate = z.infer<typeof patchCreateSchema>;
-

-
export const patchCreatedSchema = object({
-
  success: boolean(),
-
  id: string(),
-
});
-

-
export type PatchCreated = z.infer<typeof patchCreatedSchema>;