import type {} from "@atcute/lexicons";
import * as v from "@atcute/lexicons/validations";
import type {} from "@atcute/lexicons/ambient";

const _mainSchema = /*#__PURE__*/ v.query("sh.tangled.repo.getRepoByName", {
  params: /*#__PURE__*/ v.object({
    /**
     * Name of the repo as it appears in its url.
     */
    name: /*#__PURE__*/ v.string(),
    /**
     * DID of the account that owns the repo.
     */
    owner: /*#__PURE__*/ v.didString(),
  }),
  output: {
    type: "lex",
    schema: /*#__PURE__*/ v.object({
      cid: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.cidString()),
      uri: /*#__PURE__*/ v.resourceUriString(),
      /**
       * Embedded sh.tangled.repo record.
       */
      value: /*#__PURE__*/ v.unknown(),
    }),
  },
});

type main$schematype = typeof _mainSchema;

export interface mainSchema extends main$schematype {}

export const mainSchema = _mainSchema as mainSchema;

export interface $params extends v.InferInput<mainSchema["params"]> {}
export interface $output extends v.InferXRPCBodyInput<mainSchema["output"]> {}

declare module "@atcute/lexicons/ambient" {
  interface XRPCQueries {
    "sh.tangled.repo.getRepoByName": mainSchema;
  }
}
