From 21ba458082b5843214bfd47cd073bd98353ca6af Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Wed, 19 Aug 2026 19:01:25 +0900 Subject: [PATCH] web: codegen Signed-off-by: Seongmin Lee --- web/src/lib/api/lexicons/index.ts | 1 + .../types/sh/tangled/bobbin/awaitRecord.ts | 2 +- .../tangled/ci/describeWorkflowDefinition.ts | 61 +++++++++++++++++++ .../api/lexicons/types/sh/tangled/pipeline.ts | 3 + .../lexicons/types/sh/tangled/repo/delete.ts | 16 +++-- .../types/sh/tangled/repo/deleteBranch.ts | 5 +- .../types/sh/tangled/repo/forkStatus.ts | 57 ----------------- .../types/sh/tangled/repo/forkSync.ts | 16 ++--- .../types/sh/tangled/repo/hiddenRef.ts | 4 +- .../lexicons/types/sh/tangled/repo/merge.ts | 10 +-- .../types/sh/tangled/repo/mergeCheck.ts | 10 +-- .../types/sh/tangled/repo/setDefaultBranch.ts | 5 +- 12 files changed, 104 insertions(+), 86 deletions(-) create mode 100644 web/src/lib/api/lexicons/types/sh/tangled/ci/describeWorkflowDefinition.ts delete mode 100644 web/src/lib/api/lexicons/types/sh/tangled/repo/forkStatus.ts diff --git a/web/src/lib/api/lexicons/index.ts b/web/src/lib/api/lexicons/index.ts index 972a942a4..bbdcaddc5 100644 --- a/web/src/lib/api/lexicons/index.ts +++ b/web/src/lib/api/lexicons/index.ts @@ -5,6 +5,7 @@ export * as ShTangledActorGetTrending from "./types/sh/tangled/actor/getTrending export * as ShTangledActorProfile from "./types/sh/tangled/actor/profile.js"; export * as ShTangledBobbinAwaitRecord from "./types/sh/tangled/bobbin/awaitRecord.js"; export * as ShTangledCiCancelPipeline from "./types/sh/tangled/ci/cancelPipeline.js"; +export * as ShTangledCiDescribeWorkflowDefinition from "./types/sh/tangled/ci/describeWorkflowDefinition.js"; export * as ShTangledCiGetPipeline from "./types/sh/tangled/ci/getPipeline.js"; export * as ShTangledCiPipeline from "./types/sh/tangled/ci/pipeline.js"; export * as ShTangledCiQueryPipelines from "./types/sh/tangled/ci/queryPipelines.js"; diff --git a/web/src/lib/api/lexicons/types/sh/tangled/bobbin/awaitRecord.ts b/web/src/lib/api/lexicons/types/sh/tangled/bobbin/awaitRecord.ts index 242c977ad..9ca217552 100644 --- a/web/src/lib/api/lexicons/types/sh/tangled/bobbin/awaitRecord.ts +++ b/web/src/lib/api/lexicons/types/sh/tangled/bobbin/awaitRecord.ts @@ -5,7 +5,7 @@ import type {} from "@atcute/lexicons/ambient"; const _mainSchema = /*#__PURE__*/ v.query("sh.tangled.bobbin.awaitRecord", { params: /*#__PURE__*/ v.object({ /** - * CID of the revision that was written, as returned by createRecord, putRecord or applyWrites. Omit it only when awaiting a delete, which has no CID; any other omission answers with whatever revision of the record settles first. + * CID of the revision that was written, as returned by createRecord, putRecord or applyWrites. Omit it only when awaiting a delete, which has no CID. any other responds with whatever revision of the record settles first. */ cid: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.cidString()), /** diff --git a/web/src/lib/api/lexicons/types/sh/tangled/ci/describeWorkflowDefinition.ts b/web/src/lib/api/lexicons/types/sh/tangled/ci/describeWorkflowDefinition.ts new file mode 100644 index 000000000..052302c1b --- /dev/null +++ b/web/src/lib/api/lexicons/types/sh/tangled/ci/describeWorkflowDefinition.ts @@ -0,0 +1,61 @@ +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.ci.describeWorkflowDefinition", + { + params: /*#__PURE__*/ v.object({ + /** + * Target repository DID the workflow definition belongs to. + */ + repo: /*#__PURE__*/ v.didString(), + /** + * Commit SHA to resolve the workflow definition at + * @minLength 40 + * @maxLength 40 + */ + sha: /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.string(), [ + /*#__PURE__*/ v.stringLength(40, 40), + ]), + /** + * Repository DID to resolve workflow definitions from, if different from the target repo + */ + sourceRepo: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.didString()), + }), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + /** + * Whether the workflow definition is derived from this repository at all. When false, no commit-to-commit comparison is meaningful (e.g. definitions managed externally), and callers should not surface change warnings. + */ + derived: /*#__PURE__*/ v.boolean(), + /** + * Fingerprint of the workflow definition as resolved by the spindle. Absent when derived is false. + */ + hash: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + /** + * Names or paths of the effective workflow files that produced the hash. + */ + workflows: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.array(/*#__PURE__*/ v.string()), + ), + }), + }, + }, +); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "sh.tangled.ci.describeWorkflowDefinition": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/sh/tangled/pipeline.ts b/web/src/lib/api/lexicons/types/sh/tangled/pipeline.ts index b9c9d84db..ea0d633b3 100644 --- a/web/src/lib/api/lexicons/types/sh/tangled/pipeline.ts +++ b/web/src/lib/api/lexicons/types/sh/tangled/pipeline.ts @@ -145,6 +145,9 @@ const _workflowSchema = /*#__PURE__*/ v.object({ engine: /*#__PURE__*/ v.string(), name: /*#__PURE__*/ v.string(), raw: /*#__PURE__*/ v.string(), + runsOn: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.array(/*#__PURE__*/ v.string()), + ), }); type cloneOpts$schematype = typeof _cloneOptsSchema; diff --git a/web/src/lib/api/lexicons/types/sh/tangled/repo/delete.ts b/web/src/lib/api/lexicons/types/sh/tangled/repo/delete.ts index 938b9a35b..04734f2b1 100644 --- a/web/src/lib/api/lexicons/types/sh/tangled/repo/delete.ts +++ b/web/src/lib/api/lexicons/types/sh/tangled/repo/delete.ts @@ -8,21 +8,25 @@ const _mainSchema = /*#__PURE__*/ v.procedure("sh.tangled.repo.delete", { type: "lex", schema: /*#__PURE__*/ v.object({ /** - * DID of the repository owner + * DID of the repository owner. A knot without the repo-did-input capability reads this and name in place of repo. */ - did: /*#__PURE__*/ v.didString(), + did: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.didString()), /** * Admin-only. Delete even though the repository record still exists on the owner's PDS. */ force: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.boolean()), /** - * Name of the repository to delete + * Name of the repository to delete. A knot without the repo-did-input capability reads this and DID in place of repo. */ - name: /*#__PURE__*/ v.string(), + name: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), /** - * Rkey of the repository record + * DID of the repository to delete */ - rkey: /*#__PURE__*/ v.recordKeyString(), + repo: /*#__PURE__*/ v.didString(), + /** + * Rkey of the repository record. A knot without the repo-did-input capability checks this against the owner's PDS. + */ + rkey: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.recordKeyString()), }), }, output: null, diff --git a/web/src/lib/api/lexicons/types/sh/tangled/repo/deleteBranch.ts b/web/src/lib/api/lexicons/types/sh/tangled/repo/deleteBranch.ts index 713ef7acb..9129c04e0 100644 --- a/web/src/lib/api/lexicons/types/sh/tangled/repo/deleteBranch.ts +++ b/web/src/lib/api/lexicons/types/sh/tangled/repo/deleteBranch.ts @@ -8,7 +8,10 @@ const _mainSchema = /*#__PURE__*/ v.procedure("sh.tangled.repo.deleteBranch", { type: "lex", schema: /*#__PURE__*/ v.object({ branch: /*#__PURE__*/ v.string(), - repo: /*#__PURE__*/ v.resourceUriString(), + /** + * DID of the repository + */ + repo: /*#__PURE__*/ v.didString(), }), }, output: null, diff --git a/web/src/lib/api/lexicons/types/sh/tangled/repo/forkStatus.ts b/web/src/lib/api/lexicons/types/sh/tangled/repo/forkStatus.ts deleted file mode 100644 index cccdf408d..000000000 --- a/web/src/lib/api/lexicons/types/sh/tangled/repo/forkStatus.ts +++ /dev/null @@ -1,57 +0,0 @@ -import type {} from "@atcute/lexicons"; -import * as v from "@atcute/lexicons/validations"; -import type {} from "@atcute/lexicons/ambient"; - -const _mainSchema = /*#__PURE__*/ v.procedure("sh.tangled.repo.forkStatus", { - params: null, - input: { - type: "lex", - schema: /*#__PURE__*/ v.object({ - /** - * Branch to check status for - */ - branch: /*#__PURE__*/ v.string(), - /** - * DID of the fork owner - */ - did: /*#__PURE__*/ v.didString(), - /** - * Hidden ref to use for comparison - */ - hiddenRef: /*#__PURE__*/ v.string(), - /** - * Name of the forked repository - */ - name: /*#__PURE__*/ v.string(), - /** - * Source repository URL - */ - source: /*#__PURE__*/ v.string(), - }), - }, - output: { - type: "lex", - schema: /*#__PURE__*/ v.object({ - /** - * Fork status: 0=UpToDate, 1=FastForwardable, 2=Conflict, 3=MissingBranch - */ - status: /*#__PURE__*/ v.integer(), - }), - }, -}); - -type main$schematype = typeof _mainSchema; - -export interface mainSchema extends main$schematype {} - -export const mainSchema = _mainSchema as mainSchema; - -export interface $params {} -export interface $input extends v.InferXRPCBodyInput {} -export interface $output extends v.InferXRPCBodyInput {} - -declare module "@atcute/lexicons/ambient" { - interface XRPCProcedures { - "sh.tangled.repo.forkStatus": mainSchema; - } -} diff --git a/web/src/lib/api/lexicons/types/sh/tangled/repo/forkSync.ts b/web/src/lib/api/lexicons/types/sh/tangled/repo/forkSync.ts index 361aa4a1b..809885d58 100644 --- a/web/src/lib/api/lexicons/types/sh/tangled/repo/forkSync.ts +++ b/web/src/lib/api/lexicons/types/sh/tangled/repo/forkSync.ts @@ -12,21 +12,21 @@ const _mainSchema = /*#__PURE__*/ v.procedure("sh.tangled.repo.forkSync", { */ branch: /*#__PURE__*/ v.string(), /** - * DID of the fork owner + * DID of the fork owner. A knot without the repo-did-input capability reads this and name in place of repo. */ - did: /*#__PURE__*/ v.didString(), + did: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.didString()), /** - * Name of the forked repository + * Name of the forked repository. A knot without the repo-did-input capability reads this and DID in place of repo. */ - name: /*#__PURE__*/ v.string(), + name: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), /** - * DID of the repository + * DID of the fork to sync */ - repo: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.didString()), + repo: /*#__PURE__*/ v.didString(), /** - * AT-URI of the source repository + * AT-URI of the source repository. A knot without the repo-did-input capability requires this field without reading it. */ - source: /*#__PURE__*/ v.resourceUriString(), + source: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.resourceUriString()), }), }, output: null, diff --git a/web/src/lib/api/lexicons/types/sh/tangled/repo/hiddenRef.ts b/web/src/lib/api/lexicons/types/sh/tangled/repo/hiddenRef.ts index e2ba1111c..441c11db3 100644 --- a/web/src/lib/api/lexicons/types/sh/tangled/repo/hiddenRef.ts +++ b/web/src/lib/api/lexicons/types/sh/tangled/repo/hiddenRef.ts @@ -16,9 +16,9 @@ const _mainSchema = /*#__PURE__*/ v.procedure("sh.tangled.repo.hiddenRef", { */ remoteRef: /*#__PURE__*/ v.string(), /** - * AT-URI of the repository + * DID of the fork that the hidden ref belongs to */ - repo: /*#__PURE__*/ v.resourceUriString(), + repo: /*#__PURE__*/ v.didString(), }), }, output: { diff --git a/web/src/lib/api/lexicons/types/sh/tangled/repo/merge.ts b/web/src/lib/api/lexicons/types/sh/tangled/repo/merge.ts index 0ae78e58d..3cde4b938 100644 --- a/web/src/lib/api/lexicons/types/sh/tangled/repo/merge.ts +++ b/web/src/lib/api/lexicons/types/sh/tangled/repo/merge.ts @@ -28,13 +28,13 @@ const _mainSchema = /*#__PURE__*/ v.procedure("sh.tangled.repo.merge", { */ commitMessage: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), /** - * DID of the repository owner + * DID of the repository owner. A knot without the repo-did-input capability reads this and name in place of repo. */ - did: /*#__PURE__*/ v.didString(), + did: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.didString()), /** - * Name of the repository + * Name of the repository. A knot without the repo-did-input capability reads this and DID in place of repo. */ - name: /*#__PURE__*/ v.string(), + name: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), /** * Patch content to merge */ @@ -42,7 +42,7 @@ const _mainSchema = /*#__PURE__*/ v.procedure("sh.tangled.repo.merge", { /** * DID of the repository */ - repo: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.didString()), + repo: /*#__PURE__*/ v.didString(), }), }, output: null, diff --git a/web/src/lib/api/lexicons/types/sh/tangled/repo/mergeCheck.ts b/web/src/lib/api/lexicons/types/sh/tangled/repo/mergeCheck.ts index b3fad0250..fea5abaca 100644 --- a/web/src/lib/api/lexicons/types/sh/tangled/repo/mergeCheck.ts +++ b/web/src/lib/api/lexicons/types/sh/tangled/repo/mergeCheck.ts @@ -25,13 +25,13 @@ const _mainSchema = /*#__PURE__*/ v.procedure("sh.tangled.repo.mergeCheck", { */ branch: /*#__PURE__*/ v.string(), /** - * DID of the repository owner + * DID of the repository owner. A knot without the repo-did-input capability reads this and name in place of repo. */ - did: /*#__PURE__*/ v.didString(), + did: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.didString()), /** - * Name of the repository + * Name of the repository. A knot without the repo-did-input capability reads this and DID in place of repo. */ - name: /*#__PURE__*/ v.string(), + name: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), /** * Patch or pull request to check for merge conflicts */ @@ -39,7 +39,7 @@ const _mainSchema = /*#__PURE__*/ v.procedure("sh.tangled.repo.mergeCheck", { /** * DID of the repository */ - repo: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.didString()), + repo: /*#__PURE__*/ v.didString(), }), }, output: { diff --git a/web/src/lib/api/lexicons/types/sh/tangled/repo/setDefaultBranch.ts b/web/src/lib/api/lexicons/types/sh/tangled/repo/setDefaultBranch.ts index caee6521c..a70172ffb 100644 --- a/web/src/lib/api/lexicons/types/sh/tangled/repo/setDefaultBranch.ts +++ b/web/src/lib/api/lexicons/types/sh/tangled/repo/setDefaultBranch.ts @@ -10,7 +10,10 @@ const _mainSchema = /*#__PURE__*/ v.procedure( type: "lex", schema: /*#__PURE__*/ v.object({ defaultBranch: /*#__PURE__*/ v.string(), - repo: /*#__PURE__*/ v.resourceUriString(), + /** + * DID of the repository + */ + repo: /*#__PURE__*/ v.didString(), }), }, output: null, -- 2.51.2