WIP: A simple cli for daily tangled use cases and AI integration. This is for my personal use right now, but happy if others get mileage from it! :)

Generate TypeScript types from Tangled lexicons

Generated type-safe client code from vendored lexicons using @atproto/lex-cli.
Includes type definitions for:
- Issue management (sh.tangled.repo.issue)
- Pull requests (sh.tangled.repo.pull)
- Repository operations
- All Tangled-specific record types

Note: Generated code committed to version control for:
- Reviewability in PRs
- No build step required for type checking
- Offline development support

We'll use the type definitions (interfaces) for type safety while calling
AT Protocol APIs directly via @atproto/api to avoid module resolution issues
with the generated client methods.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

markbennett.ca f7699e8b bc2a27fd

verified
+8666
+2476
src/lexicon/index.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { 5 + XrpcClient, 6 + type FetchHandler, 7 + type FetchHandlerOptions, 8 + } from '@atproto/xrpc' 9 + import { schemas } from './lexicons.js' 10 + import { CID } from 'multiformats/cid' 11 + import { type OmitKey, type Un$Typed } from './util.js' 12 + import * as ShTangledActorProfile from './types/sh/tangled/actor/profile.js' 13 + import * as ShTangledFeedReaction from './types/sh/tangled/feed/reaction.js' 14 + import * as ShTangledFeedStar from './types/sh/tangled/feed/star.js' 15 + import * as ShTangledGitRefUpdate from './types/sh/tangled/git/refUpdate.js' 16 + import * as ShTangledGraphFollow from './types/sh/tangled/graph/follow.js' 17 + import * as ShTangledRepoIssueStateClosed from './types/sh/tangled/repo/issue/state/closed.js' 18 + import * as ShTangledRepoIssueComment from './types/sh/tangled/repo/issue/comment.js' 19 + import * as ShTangledRepoIssue from './types/sh/tangled/repo/issue.js' 20 + import * as ShTangledRepoIssueStateOpen from './types/sh/tangled/repo/issue/state/open.js' 21 + import * as ShTangledRepoIssueState from './types/sh/tangled/repo/issue/state.js' 22 + import * as ShTangledKnot from './types/sh/tangled/knot.js' 23 + import * as ShTangledKnotListKeys from './types/sh/tangled/knot/listKeys.js' 24 + import * as ShTangledKnotMember from './types/sh/tangled/knot/member.js' 25 + import * as ShTangledKnotVersion from './types/sh/tangled/knot/version.js' 26 + import * as ShTangledLabelDefinition from './types/sh/tangled/label/definition.js' 27 + import * as ShTangledLabelOp from './types/sh/tangled/label/op.js' 28 + import * as ShTangledPipelineCancelPipeline from './types/sh/tangled/pipeline/cancelPipeline.js' 29 + import * as ShTangledPipeline from './types/sh/tangled/pipeline.js' 30 + import * as ShTangledPipelineStatus from './types/sh/tangled/pipeline/status.js' 31 + import * as ShTangledRepoPullStatusClosed from './types/sh/tangled/repo/pull/status/closed.js' 32 + import * as ShTangledRepoPullComment from './types/sh/tangled/repo/pull/comment.js' 33 + import * as ShTangledRepoPullStatusMerged from './types/sh/tangled/repo/pull/status/merged.js' 34 + import * as ShTangledRepoPullStatusOpen from './types/sh/tangled/repo/pull/status/open.js' 35 + import * as ShTangledRepoPull from './types/sh/tangled/repo/pull.js' 36 + import * as ShTangledRepoPullStatus from './types/sh/tangled/repo/pull/status.js' 37 + import * as ShTangledRepoAddSecret from './types/sh/tangled/repo/addSecret.js' 38 + import * as ShTangledRepoArchive from './types/sh/tangled/repo/archive.js' 39 + import * as ShTangledRepoArtifact from './types/sh/tangled/repo/artifact.js' 40 + import * as ShTangledRepoBlob from './types/sh/tangled/repo/blob.js' 41 + import * as ShTangledRepoBranch from './types/sh/tangled/repo/branch.js' 42 + import * as ShTangledRepoBranches from './types/sh/tangled/repo/branches.js' 43 + import * as ShTangledRepoCollaborator from './types/sh/tangled/repo/collaborator.js' 44 + import * as ShTangledRepoCompare from './types/sh/tangled/repo/compare.js' 45 + import * as ShTangledRepoCreate from './types/sh/tangled/repo/create.js' 46 + import * as ShTangledRepoSetDefaultBranch from './types/sh/tangled/repo/setDefaultBranch.js' 47 + import * as ShTangledRepoDelete from './types/sh/tangled/repo/delete.js' 48 + import * as ShTangledRepoDeleteBranch from './types/sh/tangled/repo/deleteBranch.js' 49 + import * as ShTangledRepoDiff from './types/sh/tangled/repo/diff.js' 50 + import * as ShTangledRepoForkStatus from './types/sh/tangled/repo/forkStatus.js' 51 + import * as ShTangledRepoForkSync from './types/sh/tangled/repo/forkSync.js' 52 + import * as ShTangledRepoGetDefaultBranch from './types/sh/tangled/repo/getDefaultBranch.js' 53 + import * as ShTangledRepoHiddenRef from './types/sh/tangled/repo/hiddenRef.js' 54 + import * as ShTangledRepoLanguages from './types/sh/tangled/repo/languages.js' 55 + import * as ShTangledRepoListSecrets from './types/sh/tangled/repo/listSecrets.js' 56 + import * as ShTangledRepoLog from './types/sh/tangled/repo/log.js' 57 + import * as ShTangledRepoMerge from './types/sh/tangled/repo/merge.js' 58 + import * as ShTangledRepoMergeCheck from './types/sh/tangled/repo/mergeCheck.js' 59 + import * as ShTangledRepoRemoveSecret from './types/sh/tangled/repo/removeSecret.js' 60 + import * as ShTangledRepo from './types/sh/tangled/repo.js' 61 + import * as ShTangledRepoTag from './types/sh/tangled/repo/tag.js' 62 + import * as ShTangledRepoTags from './types/sh/tangled/repo/tags.js' 63 + import * as ShTangledRepoTree from './types/sh/tangled/repo/tree.js' 64 + import * as ShTangledSpindleMember from './types/sh/tangled/spindle/member.js' 65 + import * as ShTangledSpindle from './types/sh/tangled/spindle.js' 66 + import * as ShTangledString from './types/sh/tangled/string.js' 67 + 68 + export * as ShTangledActorProfile from './types/sh/tangled/actor/profile.js' 69 + export * as ShTangledFeedReaction from './types/sh/tangled/feed/reaction.js' 70 + export * as ShTangledFeedStar from './types/sh/tangled/feed/star.js' 71 + export * as ShTangledGitRefUpdate from './types/sh/tangled/git/refUpdate.js' 72 + export * as ShTangledGraphFollow from './types/sh/tangled/graph/follow.js' 73 + export * as ShTangledRepoIssueStateClosed from './types/sh/tangled/repo/issue/state/closed.js' 74 + export * as ShTangledRepoIssueComment from './types/sh/tangled/repo/issue/comment.js' 75 + export * as ShTangledRepoIssue from './types/sh/tangled/repo/issue.js' 76 + export * as ShTangledRepoIssueStateOpen from './types/sh/tangled/repo/issue/state/open.js' 77 + export * as ShTangledRepoIssueState from './types/sh/tangled/repo/issue/state.js' 78 + export * as ShTangledKnot from './types/sh/tangled/knot.js' 79 + export * as ShTangledKnotListKeys from './types/sh/tangled/knot/listKeys.js' 80 + export * as ShTangledKnotMember from './types/sh/tangled/knot/member.js' 81 + export * as ShTangledKnotVersion from './types/sh/tangled/knot/version.js' 82 + export * as ShTangledLabelDefinition from './types/sh/tangled/label/definition.js' 83 + export * as ShTangledLabelOp from './types/sh/tangled/label/op.js' 84 + export * as ShTangledPipelineCancelPipeline from './types/sh/tangled/pipeline/cancelPipeline.js' 85 + export * as ShTangledPipeline from './types/sh/tangled/pipeline.js' 86 + export * as ShTangledPipelineStatus from './types/sh/tangled/pipeline/status.js' 87 + export * as ShTangledRepoPullStatusClosed from './types/sh/tangled/repo/pull/status/closed.js' 88 + export * as ShTangledRepoPullComment from './types/sh/tangled/repo/pull/comment.js' 89 + export * as ShTangledRepoPullStatusMerged from './types/sh/tangled/repo/pull/status/merged.js' 90 + export * as ShTangledRepoPullStatusOpen from './types/sh/tangled/repo/pull/status/open.js' 91 + export * as ShTangledRepoPull from './types/sh/tangled/repo/pull.js' 92 + export * as ShTangledRepoPullStatus from './types/sh/tangled/repo/pull/status.js' 93 + export * as ShTangledRepoAddSecret from './types/sh/tangled/repo/addSecret.js' 94 + export * as ShTangledRepoArchive from './types/sh/tangled/repo/archive.js' 95 + export * as ShTangledRepoArtifact from './types/sh/tangled/repo/artifact.js' 96 + export * as ShTangledRepoBlob from './types/sh/tangled/repo/blob.js' 97 + export * as ShTangledRepoBranch from './types/sh/tangled/repo/branch.js' 98 + export * as ShTangledRepoBranches from './types/sh/tangled/repo/branches.js' 99 + export * as ShTangledRepoCollaborator from './types/sh/tangled/repo/collaborator.js' 100 + export * as ShTangledRepoCompare from './types/sh/tangled/repo/compare.js' 101 + export * as ShTangledRepoCreate from './types/sh/tangled/repo/create.js' 102 + export * as ShTangledRepoSetDefaultBranch from './types/sh/tangled/repo/setDefaultBranch.js' 103 + export * as ShTangledRepoDelete from './types/sh/tangled/repo/delete.js' 104 + export * as ShTangledRepoDeleteBranch from './types/sh/tangled/repo/deleteBranch.js' 105 + export * as ShTangledRepoDiff from './types/sh/tangled/repo/diff.js' 106 + export * as ShTangledRepoForkStatus from './types/sh/tangled/repo/forkStatus.js' 107 + export * as ShTangledRepoForkSync from './types/sh/tangled/repo/forkSync.js' 108 + export * as ShTangledRepoGetDefaultBranch from './types/sh/tangled/repo/getDefaultBranch.js' 109 + export * as ShTangledRepoHiddenRef from './types/sh/tangled/repo/hiddenRef.js' 110 + export * as ShTangledRepoLanguages from './types/sh/tangled/repo/languages.js' 111 + export * as ShTangledRepoListSecrets from './types/sh/tangled/repo/listSecrets.js' 112 + export * as ShTangledRepoLog from './types/sh/tangled/repo/log.js' 113 + export * as ShTangledRepoMerge from './types/sh/tangled/repo/merge.js' 114 + export * as ShTangledRepoMergeCheck from './types/sh/tangled/repo/mergeCheck.js' 115 + export * as ShTangledRepoRemoveSecret from './types/sh/tangled/repo/removeSecret.js' 116 + export * as ShTangledRepo from './types/sh/tangled/repo.js' 117 + export * as ShTangledRepoTag from './types/sh/tangled/repo/tag.js' 118 + export * as ShTangledRepoTags from './types/sh/tangled/repo/tags.js' 119 + export * as ShTangledRepoTree from './types/sh/tangled/repo/tree.js' 120 + export * as ShTangledSpindleMember from './types/sh/tangled/spindle/member.js' 121 + export * as ShTangledSpindle from './types/sh/tangled/spindle.js' 122 + export * as ShTangledString from './types/sh/tangled/string.js' 123 + 124 + export const SH_TANGLED_REPO_ISSUE_STATE = { 125 + Closed: 'sh.tangled.repo.issue.state.closed', 126 + Open: 'sh.tangled.repo.issue.state.open', 127 + } 128 + export const SH_TANGLED_REPO_PULL_STATUS = { 129 + Closed: 'sh.tangled.repo.pull.status.closed', 130 + Merged: 'sh.tangled.repo.pull.status.merged', 131 + Open: 'sh.tangled.repo.pull.status.open', 132 + } 133 + 134 + export class AtpBaseClient extends XrpcClient { 135 + sh: ShNS 136 + 137 + constructor(options: FetchHandler | FetchHandlerOptions) { 138 + super(options, schemas) 139 + this.sh = new ShNS(this) 140 + } 141 + 142 + /** @deprecated use `this` instead */ 143 + get xrpc(): XrpcClient { 144 + return this 145 + } 146 + } 147 + 148 + export class ShNS { 149 + _client: XrpcClient 150 + tangled: ShTangledNS 151 + 152 + constructor(client: XrpcClient) { 153 + this._client = client 154 + this.tangled = new ShTangledNS(client) 155 + } 156 + } 157 + 158 + export class ShTangledNS { 159 + _client: XrpcClient 160 + knot: ShTangledKnotRecord 161 + pipeline: ShTangledPipelineRecord 162 + repo: ShTangledRepoRecord 163 + spindle: ShTangledSpindleRecord 164 + string: ShTangledStringRecord 165 + actor: ShTangledActorNS 166 + feed: ShTangledFeedNS 167 + git: ShTangledGitNS 168 + graph: ShTangledGraphNS 169 + repo: ShTangledRepoNS 170 + knot: ShTangledKnotNS 171 + label: ShTangledLabelNS 172 + pipeline: ShTangledPipelineNS 173 + spindle: ShTangledSpindleNS 174 + 175 + constructor(client: XrpcClient) { 176 + this._client = client 177 + this.actor = new ShTangledActorNS(client) 178 + this.feed = new ShTangledFeedNS(client) 179 + this.git = new ShTangledGitNS(client) 180 + this.graph = new ShTangledGraphNS(client) 181 + this.repo = new ShTangledRepoNS(client) 182 + this.knot = new ShTangledKnotNS(client) 183 + this.label = new ShTangledLabelNS(client) 184 + this.pipeline = new ShTangledPipelineNS(client) 185 + this.spindle = new ShTangledSpindleNS(client) 186 + this.knot = new ShTangledKnotRecord(client) 187 + this.pipeline = new ShTangledPipelineRecord(client) 188 + this.repo = new ShTangledRepoRecord(client) 189 + this.spindle = new ShTangledSpindleRecord(client) 190 + this.string = new ShTangledStringRecord(client) 191 + } 192 + } 193 + 194 + export class ShTangledActorNS { 195 + _client: XrpcClient 196 + profile: ShTangledActorProfileRecord 197 + 198 + constructor(client: XrpcClient) { 199 + this._client = client 200 + this.profile = new ShTangledActorProfileRecord(client) 201 + } 202 + } 203 + 204 + export class ShTangledActorProfileRecord { 205 + _client: XrpcClient 206 + 207 + constructor(client: XrpcClient) { 208 + this._client = client 209 + } 210 + 211 + async list( 212 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 213 + ): Promise<{ 214 + cursor?: string 215 + records: { uri: string; value: ShTangledActorProfile.Record }[] 216 + }> { 217 + const res = await this._client.call('com.atproto.repo.listRecords', { 218 + collection: 'sh.tangled.actor.profile', 219 + ...params, 220 + }) 221 + return res.data 222 + } 223 + 224 + async get( 225 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 226 + ): Promise<{ 227 + uri: string 228 + cid: string 229 + value: ShTangledActorProfile.Record 230 + }> { 231 + const res = await this._client.call('com.atproto.repo.getRecord', { 232 + collection: 'sh.tangled.actor.profile', 233 + ...params, 234 + }) 235 + return res.data 236 + } 237 + 238 + async create( 239 + params: OmitKey< 240 + ComAtprotoRepoCreateRecord.InputSchema, 241 + 'collection' | 'record' 242 + >, 243 + record: Un$Typed<ShTangledActorProfile.Record>, 244 + headers?: Record<string, string>, 245 + ): Promise<{ uri: string; cid: string }> { 246 + const collection = 'sh.tangled.actor.profile' 247 + const res = await this._client.call( 248 + 'com.atproto.repo.createRecord', 249 + undefined, 250 + { 251 + collection, 252 + rkey: 'self', 253 + ...params, 254 + record: { ...record, $type: collection }, 255 + }, 256 + { encoding: 'application/json', headers }, 257 + ) 258 + return res.data 259 + } 260 + 261 + async put( 262 + params: OmitKey< 263 + ComAtprotoRepoPutRecord.InputSchema, 264 + 'collection' | 'record' 265 + >, 266 + record: Un$Typed<ShTangledActorProfile.Record>, 267 + headers?: Record<string, string>, 268 + ): Promise<{ uri: string; cid: string }> { 269 + const collection = 'sh.tangled.actor.profile' 270 + const res = await this._client.call( 271 + 'com.atproto.repo.putRecord', 272 + undefined, 273 + { collection, ...params, record: { ...record, $type: collection } }, 274 + { encoding: 'application/json', headers }, 275 + ) 276 + return res.data 277 + } 278 + 279 + async delete( 280 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 281 + headers?: Record<string, string>, 282 + ): Promise<void> { 283 + await this._client.call( 284 + 'com.atproto.repo.deleteRecord', 285 + undefined, 286 + { collection: 'sh.tangled.actor.profile', ...params }, 287 + { headers }, 288 + ) 289 + } 290 + } 291 + 292 + export class ShTangledFeedNS { 293 + _client: XrpcClient 294 + reaction: ShTangledFeedReactionRecord 295 + star: ShTangledFeedStarRecord 296 + 297 + constructor(client: XrpcClient) { 298 + this._client = client 299 + this.reaction = new ShTangledFeedReactionRecord(client) 300 + this.star = new ShTangledFeedStarRecord(client) 301 + } 302 + } 303 + 304 + export class ShTangledFeedReactionRecord { 305 + _client: XrpcClient 306 + 307 + constructor(client: XrpcClient) { 308 + this._client = client 309 + } 310 + 311 + async list( 312 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 313 + ): Promise<{ 314 + cursor?: string 315 + records: { uri: string; value: ShTangledFeedReaction.Record }[] 316 + }> { 317 + const res = await this._client.call('com.atproto.repo.listRecords', { 318 + collection: 'sh.tangled.feed.reaction', 319 + ...params, 320 + }) 321 + return res.data 322 + } 323 + 324 + async get( 325 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 326 + ): Promise<{ 327 + uri: string 328 + cid: string 329 + value: ShTangledFeedReaction.Record 330 + }> { 331 + const res = await this._client.call('com.atproto.repo.getRecord', { 332 + collection: 'sh.tangled.feed.reaction', 333 + ...params, 334 + }) 335 + return res.data 336 + } 337 + 338 + async create( 339 + params: OmitKey< 340 + ComAtprotoRepoCreateRecord.InputSchema, 341 + 'collection' | 'record' 342 + >, 343 + record: Un$Typed<ShTangledFeedReaction.Record>, 344 + headers?: Record<string, string>, 345 + ): Promise<{ uri: string; cid: string }> { 346 + const collection = 'sh.tangled.feed.reaction' 347 + const res = await this._client.call( 348 + 'com.atproto.repo.createRecord', 349 + undefined, 350 + { collection, ...params, record: { ...record, $type: collection } }, 351 + { encoding: 'application/json', headers }, 352 + ) 353 + return res.data 354 + } 355 + 356 + async put( 357 + params: OmitKey< 358 + ComAtprotoRepoPutRecord.InputSchema, 359 + 'collection' | 'record' 360 + >, 361 + record: Un$Typed<ShTangledFeedReaction.Record>, 362 + headers?: Record<string, string>, 363 + ): Promise<{ uri: string; cid: string }> { 364 + const collection = 'sh.tangled.feed.reaction' 365 + const res = await this._client.call( 366 + 'com.atproto.repo.putRecord', 367 + undefined, 368 + { collection, ...params, record: { ...record, $type: collection } }, 369 + { encoding: 'application/json', headers }, 370 + ) 371 + return res.data 372 + } 373 + 374 + async delete( 375 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 376 + headers?: Record<string, string>, 377 + ): Promise<void> { 378 + await this._client.call( 379 + 'com.atproto.repo.deleteRecord', 380 + undefined, 381 + { collection: 'sh.tangled.feed.reaction', ...params }, 382 + { headers }, 383 + ) 384 + } 385 + } 386 + 387 + export class ShTangledFeedStarRecord { 388 + _client: XrpcClient 389 + 390 + constructor(client: XrpcClient) { 391 + this._client = client 392 + } 393 + 394 + async list( 395 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 396 + ): Promise<{ 397 + cursor?: string 398 + records: { uri: string; value: ShTangledFeedStar.Record }[] 399 + }> { 400 + const res = await this._client.call('com.atproto.repo.listRecords', { 401 + collection: 'sh.tangled.feed.star', 402 + ...params, 403 + }) 404 + return res.data 405 + } 406 + 407 + async get( 408 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 409 + ): Promise<{ uri: string; cid: string; value: ShTangledFeedStar.Record }> { 410 + const res = await this._client.call('com.atproto.repo.getRecord', { 411 + collection: 'sh.tangled.feed.star', 412 + ...params, 413 + }) 414 + return res.data 415 + } 416 + 417 + async create( 418 + params: OmitKey< 419 + ComAtprotoRepoCreateRecord.InputSchema, 420 + 'collection' | 'record' 421 + >, 422 + record: Un$Typed<ShTangledFeedStar.Record>, 423 + headers?: Record<string, string>, 424 + ): Promise<{ uri: string; cid: string }> { 425 + const collection = 'sh.tangled.feed.star' 426 + const res = await this._client.call( 427 + 'com.atproto.repo.createRecord', 428 + undefined, 429 + { collection, ...params, record: { ...record, $type: collection } }, 430 + { encoding: 'application/json', headers }, 431 + ) 432 + return res.data 433 + } 434 + 435 + async put( 436 + params: OmitKey< 437 + ComAtprotoRepoPutRecord.InputSchema, 438 + 'collection' | 'record' 439 + >, 440 + record: Un$Typed<ShTangledFeedStar.Record>, 441 + headers?: Record<string, string>, 442 + ): Promise<{ uri: string; cid: string }> { 443 + const collection = 'sh.tangled.feed.star' 444 + const res = await this._client.call( 445 + 'com.atproto.repo.putRecord', 446 + undefined, 447 + { collection, ...params, record: { ...record, $type: collection } }, 448 + { encoding: 'application/json', headers }, 449 + ) 450 + return res.data 451 + } 452 + 453 + async delete( 454 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 455 + headers?: Record<string, string>, 456 + ): Promise<void> { 457 + await this._client.call( 458 + 'com.atproto.repo.deleteRecord', 459 + undefined, 460 + { collection: 'sh.tangled.feed.star', ...params }, 461 + { headers }, 462 + ) 463 + } 464 + } 465 + 466 + export class ShTangledGitNS { 467 + _client: XrpcClient 468 + refUpdate: ShTangledGitRefUpdateRecord 469 + 470 + constructor(client: XrpcClient) { 471 + this._client = client 472 + this.refUpdate = new ShTangledGitRefUpdateRecord(client) 473 + } 474 + } 475 + 476 + export class ShTangledGitRefUpdateRecord { 477 + _client: XrpcClient 478 + 479 + constructor(client: XrpcClient) { 480 + this._client = client 481 + } 482 + 483 + async list( 484 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 485 + ): Promise<{ 486 + cursor?: string 487 + records: { uri: string; value: ShTangledGitRefUpdate.Record }[] 488 + }> { 489 + const res = await this._client.call('com.atproto.repo.listRecords', { 490 + collection: 'sh.tangled.git.refUpdate', 491 + ...params, 492 + }) 493 + return res.data 494 + } 495 + 496 + async get( 497 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 498 + ): Promise<{ 499 + uri: string 500 + cid: string 501 + value: ShTangledGitRefUpdate.Record 502 + }> { 503 + const res = await this._client.call('com.atproto.repo.getRecord', { 504 + collection: 'sh.tangled.git.refUpdate', 505 + ...params, 506 + }) 507 + return res.data 508 + } 509 + 510 + async create( 511 + params: OmitKey< 512 + ComAtprotoRepoCreateRecord.InputSchema, 513 + 'collection' | 'record' 514 + >, 515 + record: Un$Typed<ShTangledGitRefUpdate.Record>, 516 + headers?: Record<string, string>, 517 + ): Promise<{ uri: string; cid: string }> { 518 + const collection = 'sh.tangled.git.refUpdate' 519 + const res = await this._client.call( 520 + 'com.atproto.repo.createRecord', 521 + undefined, 522 + { collection, ...params, record: { ...record, $type: collection } }, 523 + { encoding: 'application/json', headers }, 524 + ) 525 + return res.data 526 + } 527 + 528 + async put( 529 + params: OmitKey< 530 + ComAtprotoRepoPutRecord.InputSchema, 531 + 'collection' | 'record' 532 + >, 533 + record: Un$Typed<ShTangledGitRefUpdate.Record>, 534 + headers?: Record<string, string>, 535 + ): Promise<{ uri: string; cid: string }> { 536 + const collection = 'sh.tangled.git.refUpdate' 537 + const res = await this._client.call( 538 + 'com.atproto.repo.putRecord', 539 + undefined, 540 + { collection, ...params, record: { ...record, $type: collection } }, 541 + { encoding: 'application/json', headers }, 542 + ) 543 + return res.data 544 + } 545 + 546 + async delete( 547 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 548 + headers?: Record<string, string>, 549 + ): Promise<void> { 550 + await this._client.call( 551 + 'com.atproto.repo.deleteRecord', 552 + undefined, 553 + { collection: 'sh.tangled.git.refUpdate', ...params }, 554 + { headers }, 555 + ) 556 + } 557 + } 558 + 559 + export class ShTangledGraphNS { 560 + _client: XrpcClient 561 + follow: ShTangledGraphFollowRecord 562 + 563 + constructor(client: XrpcClient) { 564 + this._client = client 565 + this.follow = new ShTangledGraphFollowRecord(client) 566 + } 567 + } 568 + 569 + export class ShTangledGraphFollowRecord { 570 + _client: XrpcClient 571 + 572 + constructor(client: XrpcClient) { 573 + this._client = client 574 + } 575 + 576 + async list( 577 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 578 + ): Promise<{ 579 + cursor?: string 580 + records: { uri: string; value: ShTangledGraphFollow.Record }[] 581 + }> { 582 + const res = await this._client.call('com.atproto.repo.listRecords', { 583 + collection: 'sh.tangled.graph.follow', 584 + ...params, 585 + }) 586 + return res.data 587 + } 588 + 589 + async get( 590 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 591 + ): Promise<{ uri: string; cid: string; value: ShTangledGraphFollow.Record }> { 592 + const res = await this._client.call('com.atproto.repo.getRecord', { 593 + collection: 'sh.tangled.graph.follow', 594 + ...params, 595 + }) 596 + return res.data 597 + } 598 + 599 + async create( 600 + params: OmitKey< 601 + ComAtprotoRepoCreateRecord.InputSchema, 602 + 'collection' | 'record' 603 + >, 604 + record: Un$Typed<ShTangledGraphFollow.Record>, 605 + headers?: Record<string, string>, 606 + ): Promise<{ uri: string; cid: string }> { 607 + const collection = 'sh.tangled.graph.follow' 608 + const res = await this._client.call( 609 + 'com.atproto.repo.createRecord', 610 + undefined, 611 + { collection, ...params, record: { ...record, $type: collection } }, 612 + { encoding: 'application/json', headers }, 613 + ) 614 + return res.data 615 + } 616 + 617 + async put( 618 + params: OmitKey< 619 + ComAtprotoRepoPutRecord.InputSchema, 620 + 'collection' | 'record' 621 + >, 622 + record: Un$Typed<ShTangledGraphFollow.Record>, 623 + headers?: Record<string, string>, 624 + ): Promise<{ uri: string; cid: string }> { 625 + const collection = 'sh.tangled.graph.follow' 626 + const res = await this._client.call( 627 + 'com.atproto.repo.putRecord', 628 + undefined, 629 + { collection, ...params, record: { ...record, $type: collection } }, 630 + { encoding: 'application/json', headers }, 631 + ) 632 + return res.data 633 + } 634 + 635 + async delete( 636 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 637 + headers?: Record<string, string>, 638 + ): Promise<void> { 639 + await this._client.call( 640 + 'com.atproto.repo.deleteRecord', 641 + undefined, 642 + { collection: 'sh.tangled.graph.follow', ...params }, 643 + { headers }, 644 + ) 645 + } 646 + } 647 + 648 + export class ShTangledRepoNS { 649 + _client: XrpcClient 650 + issue: ShTangledRepoIssueRecord 651 + pull: ShTangledRepoPullRecord 652 + artifact: ShTangledRepoArtifactRecord 653 + collaborator: ShTangledRepoCollaboratorRecord 654 + issue: ShTangledRepoIssueNS 655 + pull: ShTangledRepoPullNS 656 + 657 + constructor(client: XrpcClient) { 658 + this._client = client 659 + this.issue = new ShTangledRepoIssueNS(client) 660 + this.pull = new ShTangledRepoPullNS(client) 661 + this.issue = new ShTangledRepoIssueRecord(client) 662 + this.pull = new ShTangledRepoPullRecord(client) 663 + this.artifact = new ShTangledRepoArtifactRecord(client) 664 + this.collaborator = new ShTangledRepoCollaboratorRecord(client) 665 + } 666 + 667 + addSecret( 668 + data?: ShTangledRepoAddSecret.InputSchema, 669 + opts?: ShTangledRepoAddSecret.CallOptions, 670 + ): Promise<ShTangledRepoAddSecret.Response> { 671 + return this._client.call('sh.tangled.repo.addSecret', opts?.qp, data, opts) 672 + } 673 + 674 + archive( 675 + params?: ShTangledRepoArchive.QueryParams, 676 + opts?: ShTangledRepoArchive.CallOptions, 677 + ): Promise<ShTangledRepoArchive.Response> { 678 + return this._client 679 + .call('sh.tangled.repo.archive', params, undefined, opts) 680 + .catch((e) => { 681 + throw ShTangledRepoArchive.toKnownErr(e) 682 + }) 683 + } 684 + 685 + blob( 686 + params?: ShTangledRepoBlob.QueryParams, 687 + opts?: ShTangledRepoBlob.CallOptions, 688 + ): Promise<ShTangledRepoBlob.Response> { 689 + return this._client 690 + .call('sh.tangled.repo.blob', params, undefined, opts) 691 + .catch((e) => { 692 + throw ShTangledRepoBlob.toKnownErr(e) 693 + }) 694 + } 695 + 696 + branch( 697 + params?: ShTangledRepoBranch.QueryParams, 698 + opts?: ShTangledRepoBranch.CallOptions, 699 + ): Promise<ShTangledRepoBranch.Response> { 700 + return this._client 701 + .call('sh.tangled.repo.branch', params, undefined, opts) 702 + .catch((e) => { 703 + throw ShTangledRepoBranch.toKnownErr(e) 704 + }) 705 + } 706 + 707 + branches( 708 + params?: ShTangledRepoBranches.QueryParams, 709 + opts?: ShTangledRepoBranches.CallOptions, 710 + ): Promise<ShTangledRepoBranches.Response> { 711 + return this._client 712 + .call('sh.tangled.repo.branches', params, undefined, opts) 713 + .catch((e) => { 714 + throw ShTangledRepoBranches.toKnownErr(e) 715 + }) 716 + } 717 + 718 + compare( 719 + params?: ShTangledRepoCompare.QueryParams, 720 + opts?: ShTangledRepoCompare.CallOptions, 721 + ): Promise<ShTangledRepoCompare.Response> { 722 + return this._client 723 + .call('sh.tangled.repo.compare', params, undefined, opts) 724 + .catch((e) => { 725 + throw ShTangledRepoCompare.toKnownErr(e) 726 + }) 727 + } 728 + 729 + create( 730 + data?: ShTangledRepoCreate.InputSchema, 731 + opts?: ShTangledRepoCreate.CallOptions, 732 + ): Promise<ShTangledRepoCreate.Response> { 733 + return this._client.call('sh.tangled.repo.create', opts?.qp, data, opts) 734 + } 735 + 736 + setDefaultBranch( 737 + data?: ShTangledRepoSetDefaultBranch.InputSchema, 738 + opts?: ShTangledRepoSetDefaultBranch.CallOptions, 739 + ): Promise<ShTangledRepoSetDefaultBranch.Response> { 740 + return this._client.call( 741 + 'sh.tangled.repo.setDefaultBranch', 742 + opts?.qp, 743 + data, 744 + opts, 745 + ) 746 + } 747 + 748 + delete( 749 + data?: ShTangledRepoDelete.InputSchema, 750 + opts?: ShTangledRepoDelete.CallOptions, 751 + ): Promise<ShTangledRepoDelete.Response> { 752 + return this._client.call('sh.tangled.repo.delete', opts?.qp, data, opts) 753 + } 754 + 755 + deleteBranch( 756 + data?: ShTangledRepoDeleteBranch.InputSchema, 757 + opts?: ShTangledRepoDeleteBranch.CallOptions, 758 + ): Promise<ShTangledRepoDeleteBranch.Response> { 759 + return this._client.call( 760 + 'sh.tangled.repo.deleteBranch', 761 + opts?.qp, 762 + data, 763 + opts, 764 + ) 765 + } 766 + 767 + diff( 768 + params?: ShTangledRepoDiff.QueryParams, 769 + opts?: ShTangledRepoDiff.CallOptions, 770 + ): Promise<ShTangledRepoDiff.Response> { 771 + return this._client 772 + .call('sh.tangled.repo.diff', params, undefined, opts) 773 + .catch((e) => { 774 + throw ShTangledRepoDiff.toKnownErr(e) 775 + }) 776 + } 777 + 778 + forkStatus( 779 + data?: ShTangledRepoForkStatus.InputSchema, 780 + opts?: ShTangledRepoForkStatus.CallOptions, 781 + ): Promise<ShTangledRepoForkStatus.Response> { 782 + return this._client.call('sh.tangled.repo.forkStatus', opts?.qp, data, opts) 783 + } 784 + 785 + forkSync( 786 + data?: ShTangledRepoForkSync.InputSchema, 787 + opts?: ShTangledRepoForkSync.CallOptions, 788 + ): Promise<ShTangledRepoForkSync.Response> { 789 + return this._client.call('sh.tangled.repo.forkSync', opts?.qp, data, opts) 790 + } 791 + 792 + getDefaultBranch( 793 + params?: ShTangledRepoGetDefaultBranch.QueryParams, 794 + opts?: ShTangledRepoGetDefaultBranch.CallOptions, 795 + ): Promise<ShTangledRepoGetDefaultBranch.Response> { 796 + return this._client 797 + .call('sh.tangled.repo.getDefaultBranch', params, undefined, opts) 798 + .catch((e) => { 799 + throw ShTangledRepoGetDefaultBranch.toKnownErr(e) 800 + }) 801 + } 802 + 803 + hiddenRef( 804 + data?: ShTangledRepoHiddenRef.InputSchema, 805 + opts?: ShTangledRepoHiddenRef.CallOptions, 806 + ): Promise<ShTangledRepoHiddenRef.Response> { 807 + return this._client.call('sh.tangled.repo.hiddenRef', opts?.qp, data, opts) 808 + } 809 + 810 + languages( 811 + params?: ShTangledRepoLanguages.QueryParams, 812 + opts?: ShTangledRepoLanguages.CallOptions, 813 + ): Promise<ShTangledRepoLanguages.Response> { 814 + return this._client 815 + .call('sh.tangled.repo.languages', params, undefined, opts) 816 + .catch((e) => { 817 + throw ShTangledRepoLanguages.toKnownErr(e) 818 + }) 819 + } 820 + 821 + listSecrets( 822 + params?: ShTangledRepoListSecrets.QueryParams, 823 + opts?: ShTangledRepoListSecrets.CallOptions, 824 + ): Promise<ShTangledRepoListSecrets.Response> { 825 + return this._client.call( 826 + 'sh.tangled.repo.listSecrets', 827 + params, 828 + undefined, 829 + opts, 830 + ) 831 + } 832 + 833 + log( 834 + params?: ShTangledRepoLog.QueryParams, 835 + opts?: ShTangledRepoLog.CallOptions, 836 + ): Promise<ShTangledRepoLog.Response> { 837 + return this._client 838 + .call('sh.tangled.repo.log', params, undefined, opts) 839 + .catch((e) => { 840 + throw ShTangledRepoLog.toKnownErr(e) 841 + }) 842 + } 843 + 844 + merge( 845 + data?: ShTangledRepoMerge.InputSchema, 846 + opts?: ShTangledRepoMerge.CallOptions, 847 + ): Promise<ShTangledRepoMerge.Response> { 848 + return this._client.call('sh.tangled.repo.merge', opts?.qp, data, opts) 849 + } 850 + 851 + mergeCheck( 852 + data?: ShTangledRepoMergeCheck.InputSchema, 853 + opts?: ShTangledRepoMergeCheck.CallOptions, 854 + ): Promise<ShTangledRepoMergeCheck.Response> { 855 + return this._client.call('sh.tangled.repo.mergeCheck', opts?.qp, data, opts) 856 + } 857 + 858 + removeSecret( 859 + data?: ShTangledRepoRemoveSecret.InputSchema, 860 + opts?: ShTangledRepoRemoveSecret.CallOptions, 861 + ): Promise<ShTangledRepoRemoveSecret.Response> { 862 + return this._client.call( 863 + 'sh.tangled.repo.removeSecret', 864 + opts?.qp, 865 + data, 866 + opts, 867 + ) 868 + } 869 + 870 + tag( 871 + params?: ShTangledRepoTag.QueryParams, 872 + opts?: ShTangledRepoTag.CallOptions, 873 + ): Promise<ShTangledRepoTag.Response> { 874 + return this._client 875 + .call('sh.tangled.repo.tag', params, undefined, opts) 876 + .catch((e) => { 877 + throw ShTangledRepoTag.toKnownErr(e) 878 + }) 879 + } 880 + 881 + tags( 882 + params?: ShTangledRepoTags.QueryParams, 883 + opts?: ShTangledRepoTags.CallOptions, 884 + ): Promise<ShTangledRepoTags.Response> { 885 + return this._client 886 + .call('sh.tangled.repo.tags', params, undefined, opts) 887 + .catch((e) => { 888 + throw ShTangledRepoTags.toKnownErr(e) 889 + }) 890 + } 891 + 892 + tree( 893 + params?: ShTangledRepoTree.QueryParams, 894 + opts?: ShTangledRepoTree.CallOptions, 895 + ): Promise<ShTangledRepoTree.Response> { 896 + return this._client 897 + .call('sh.tangled.repo.tree', params, undefined, opts) 898 + .catch((e) => { 899 + throw ShTangledRepoTree.toKnownErr(e) 900 + }) 901 + } 902 + } 903 + 904 + export class ShTangledRepoIssueNS { 905 + _client: XrpcClient 906 + comment: ShTangledRepoIssueCommentRecord 907 + state: ShTangledRepoIssueStateRecord 908 + state: ShTangledRepoIssueStateNS 909 + 910 + constructor(client: XrpcClient) { 911 + this._client = client 912 + this.state = new ShTangledRepoIssueStateNS(client) 913 + this.comment = new ShTangledRepoIssueCommentRecord(client) 914 + this.state = new ShTangledRepoIssueStateRecord(client) 915 + } 916 + } 917 + 918 + export class ShTangledRepoIssueStateNS { 919 + _client: XrpcClient 920 + 921 + constructor(client: XrpcClient) { 922 + this._client = client 923 + } 924 + } 925 + 926 + export class ShTangledRepoIssueCommentRecord { 927 + _client: XrpcClient 928 + 929 + constructor(client: XrpcClient) { 930 + this._client = client 931 + } 932 + 933 + async list( 934 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 935 + ): Promise<{ 936 + cursor?: string 937 + records: { uri: string; value: ShTangledRepoIssueComment.Record }[] 938 + }> { 939 + const res = await this._client.call('com.atproto.repo.listRecords', { 940 + collection: 'sh.tangled.repo.issue.comment', 941 + ...params, 942 + }) 943 + return res.data 944 + } 945 + 946 + async get( 947 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 948 + ): Promise<{ 949 + uri: string 950 + cid: string 951 + value: ShTangledRepoIssueComment.Record 952 + }> { 953 + const res = await this._client.call('com.atproto.repo.getRecord', { 954 + collection: 'sh.tangled.repo.issue.comment', 955 + ...params, 956 + }) 957 + return res.data 958 + } 959 + 960 + async create( 961 + params: OmitKey< 962 + ComAtprotoRepoCreateRecord.InputSchema, 963 + 'collection' | 'record' 964 + >, 965 + record: Un$Typed<ShTangledRepoIssueComment.Record>, 966 + headers?: Record<string, string>, 967 + ): Promise<{ uri: string; cid: string }> { 968 + const collection = 'sh.tangled.repo.issue.comment' 969 + const res = await this._client.call( 970 + 'com.atproto.repo.createRecord', 971 + undefined, 972 + { collection, ...params, record: { ...record, $type: collection } }, 973 + { encoding: 'application/json', headers }, 974 + ) 975 + return res.data 976 + } 977 + 978 + async put( 979 + params: OmitKey< 980 + ComAtprotoRepoPutRecord.InputSchema, 981 + 'collection' | 'record' 982 + >, 983 + record: Un$Typed<ShTangledRepoIssueComment.Record>, 984 + headers?: Record<string, string>, 985 + ): Promise<{ uri: string; cid: string }> { 986 + const collection = 'sh.tangled.repo.issue.comment' 987 + const res = await this._client.call( 988 + 'com.atproto.repo.putRecord', 989 + undefined, 990 + { collection, ...params, record: { ...record, $type: collection } }, 991 + { encoding: 'application/json', headers }, 992 + ) 993 + return res.data 994 + } 995 + 996 + async delete( 997 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 998 + headers?: Record<string, string>, 999 + ): Promise<void> { 1000 + await this._client.call( 1001 + 'com.atproto.repo.deleteRecord', 1002 + undefined, 1003 + { collection: 'sh.tangled.repo.issue.comment', ...params }, 1004 + { headers }, 1005 + ) 1006 + } 1007 + } 1008 + 1009 + export class ShTangledRepoIssueStateRecord { 1010 + _client: XrpcClient 1011 + 1012 + constructor(client: XrpcClient) { 1013 + this._client = client 1014 + } 1015 + 1016 + async list( 1017 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 1018 + ): Promise<{ 1019 + cursor?: string 1020 + records: { uri: string; value: ShTangledRepoIssueState.Record }[] 1021 + }> { 1022 + const res = await this._client.call('com.atproto.repo.listRecords', { 1023 + collection: 'sh.tangled.repo.issue.state', 1024 + ...params, 1025 + }) 1026 + return res.data 1027 + } 1028 + 1029 + async get( 1030 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 1031 + ): Promise<{ 1032 + uri: string 1033 + cid: string 1034 + value: ShTangledRepoIssueState.Record 1035 + }> { 1036 + const res = await this._client.call('com.atproto.repo.getRecord', { 1037 + collection: 'sh.tangled.repo.issue.state', 1038 + ...params, 1039 + }) 1040 + return res.data 1041 + } 1042 + 1043 + async create( 1044 + params: OmitKey< 1045 + ComAtprotoRepoCreateRecord.InputSchema, 1046 + 'collection' | 'record' 1047 + >, 1048 + record: Un$Typed<ShTangledRepoIssueState.Record>, 1049 + headers?: Record<string, string>, 1050 + ): Promise<{ uri: string; cid: string }> { 1051 + const collection = 'sh.tangled.repo.issue.state' 1052 + const res = await this._client.call( 1053 + 'com.atproto.repo.createRecord', 1054 + undefined, 1055 + { collection, ...params, record: { ...record, $type: collection } }, 1056 + { encoding: 'application/json', headers }, 1057 + ) 1058 + return res.data 1059 + } 1060 + 1061 + async put( 1062 + params: OmitKey< 1063 + ComAtprotoRepoPutRecord.InputSchema, 1064 + 'collection' | 'record' 1065 + >, 1066 + record: Un$Typed<ShTangledRepoIssueState.Record>, 1067 + headers?: Record<string, string>, 1068 + ): Promise<{ uri: string; cid: string }> { 1069 + const collection = 'sh.tangled.repo.issue.state' 1070 + const res = await this._client.call( 1071 + 'com.atproto.repo.putRecord', 1072 + undefined, 1073 + { collection, ...params, record: { ...record, $type: collection } }, 1074 + { encoding: 'application/json', headers }, 1075 + ) 1076 + return res.data 1077 + } 1078 + 1079 + async delete( 1080 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 1081 + headers?: Record<string, string>, 1082 + ): Promise<void> { 1083 + await this._client.call( 1084 + 'com.atproto.repo.deleteRecord', 1085 + undefined, 1086 + { collection: 'sh.tangled.repo.issue.state', ...params }, 1087 + { headers }, 1088 + ) 1089 + } 1090 + } 1091 + 1092 + export class ShTangledRepoPullNS { 1093 + _client: XrpcClient 1094 + comment: ShTangledRepoPullCommentRecord 1095 + status: ShTangledRepoPullStatusRecord 1096 + status: ShTangledRepoPullStatusNS 1097 + 1098 + constructor(client: XrpcClient) { 1099 + this._client = client 1100 + this.status = new ShTangledRepoPullStatusNS(client) 1101 + this.comment = new ShTangledRepoPullCommentRecord(client) 1102 + this.status = new ShTangledRepoPullStatusRecord(client) 1103 + } 1104 + } 1105 + 1106 + export class ShTangledRepoPullStatusNS { 1107 + _client: XrpcClient 1108 + 1109 + constructor(client: XrpcClient) { 1110 + this._client = client 1111 + } 1112 + } 1113 + 1114 + export class ShTangledRepoPullCommentRecord { 1115 + _client: XrpcClient 1116 + 1117 + constructor(client: XrpcClient) { 1118 + this._client = client 1119 + } 1120 + 1121 + async list( 1122 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 1123 + ): Promise<{ 1124 + cursor?: string 1125 + records: { uri: string; value: ShTangledRepoPullComment.Record }[] 1126 + }> { 1127 + const res = await this._client.call('com.atproto.repo.listRecords', { 1128 + collection: 'sh.tangled.repo.pull.comment', 1129 + ...params, 1130 + }) 1131 + return res.data 1132 + } 1133 + 1134 + async get( 1135 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 1136 + ): Promise<{ 1137 + uri: string 1138 + cid: string 1139 + value: ShTangledRepoPullComment.Record 1140 + }> { 1141 + const res = await this._client.call('com.atproto.repo.getRecord', { 1142 + collection: 'sh.tangled.repo.pull.comment', 1143 + ...params, 1144 + }) 1145 + return res.data 1146 + } 1147 + 1148 + async create( 1149 + params: OmitKey< 1150 + ComAtprotoRepoCreateRecord.InputSchema, 1151 + 'collection' | 'record' 1152 + >, 1153 + record: Un$Typed<ShTangledRepoPullComment.Record>, 1154 + headers?: Record<string, string>, 1155 + ): Promise<{ uri: string; cid: string }> { 1156 + const collection = 'sh.tangled.repo.pull.comment' 1157 + const res = await this._client.call( 1158 + 'com.atproto.repo.createRecord', 1159 + undefined, 1160 + { collection, ...params, record: { ...record, $type: collection } }, 1161 + { encoding: 'application/json', headers }, 1162 + ) 1163 + return res.data 1164 + } 1165 + 1166 + async put( 1167 + params: OmitKey< 1168 + ComAtprotoRepoPutRecord.InputSchema, 1169 + 'collection' | 'record' 1170 + >, 1171 + record: Un$Typed<ShTangledRepoPullComment.Record>, 1172 + headers?: Record<string, string>, 1173 + ): Promise<{ uri: string; cid: string }> { 1174 + const collection = 'sh.tangled.repo.pull.comment' 1175 + const res = await this._client.call( 1176 + 'com.atproto.repo.putRecord', 1177 + undefined, 1178 + { collection, ...params, record: { ...record, $type: collection } }, 1179 + { encoding: 'application/json', headers }, 1180 + ) 1181 + return res.data 1182 + } 1183 + 1184 + async delete( 1185 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 1186 + headers?: Record<string, string>, 1187 + ): Promise<void> { 1188 + await this._client.call( 1189 + 'com.atproto.repo.deleteRecord', 1190 + undefined, 1191 + { collection: 'sh.tangled.repo.pull.comment', ...params }, 1192 + { headers }, 1193 + ) 1194 + } 1195 + } 1196 + 1197 + export class ShTangledRepoPullStatusRecord { 1198 + _client: XrpcClient 1199 + 1200 + constructor(client: XrpcClient) { 1201 + this._client = client 1202 + } 1203 + 1204 + async list( 1205 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 1206 + ): Promise<{ 1207 + cursor?: string 1208 + records: { uri: string; value: ShTangledRepoPullStatus.Record }[] 1209 + }> { 1210 + const res = await this._client.call('com.atproto.repo.listRecords', { 1211 + collection: 'sh.tangled.repo.pull.status', 1212 + ...params, 1213 + }) 1214 + return res.data 1215 + } 1216 + 1217 + async get( 1218 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 1219 + ): Promise<{ 1220 + uri: string 1221 + cid: string 1222 + value: ShTangledRepoPullStatus.Record 1223 + }> { 1224 + const res = await this._client.call('com.atproto.repo.getRecord', { 1225 + collection: 'sh.tangled.repo.pull.status', 1226 + ...params, 1227 + }) 1228 + return res.data 1229 + } 1230 + 1231 + async create( 1232 + params: OmitKey< 1233 + ComAtprotoRepoCreateRecord.InputSchema, 1234 + 'collection' | 'record' 1235 + >, 1236 + record: Un$Typed<ShTangledRepoPullStatus.Record>, 1237 + headers?: Record<string, string>, 1238 + ): Promise<{ uri: string; cid: string }> { 1239 + const collection = 'sh.tangled.repo.pull.status' 1240 + const res = await this._client.call( 1241 + 'com.atproto.repo.createRecord', 1242 + undefined, 1243 + { collection, ...params, record: { ...record, $type: collection } }, 1244 + { encoding: 'application/json', headers }, 1245 + ) 1246 + return res.data 1247 + } 1248 + 1249 + async put( 1250 + params: OmitKey< 1251 + ComAtprotoRepoPutRecord.InputSchema, 1252 + 'collection' | 'record' 1253 + >, 1254 + record: Un$Typed<ShTangledRepoPullStatus.Record>, 1255 + headers?: Record<string, string>, 1256 + ): Promise<{ uri: string; cid: string }> { 1257 + const collection = 'sh.tangled.repo.pull.status' 1258 + const res = await this._client.call( 1259 + 'com.atproto.repo.putRecord', 1260 + undefined, 1261 + { collection, ...params, record: { ...record, $type: collection } }, 1262 + { encoding: 'application/json', headers }, 1263 + ) 1264 + return res.data 1265 + } 1266 + 1267 + async delete( 1268 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 1269 + headers?: Record<string, string>, 1270 + ): Promise<void> { 1271 + await this._client.call( 1272 + 'com.atproto.repo.deleteRecord', 1273 + undefined, 1274 + { collection: 'sh.tangled.repo.pull.status', ...params }, 1275 + { headers }, 1276 + ) 1277 + } 1278 + } 1279 + 1280 + export class ShTangledRepoIssueRecord { 1281 + _client: XrpcClient 1282 + 1283 + constructor(client: XrpcClient) { 1284 + this._client = client 1285 + } 1286 + 1287 + async list( 1288 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 1289 + ): Promise<{ 1290 + cursor?: string 1291 + records: { uri: string; value: ShTangledRepoIssue.Record }[] 1292 + }> { 1293 + const res = await this._client.call('com.atproto.repo.listRecords', { 1294 + collection: 'sh.tangled.repo.issue', 1295 + ...params, 1296 + }) 1297 + return res.data 1298 + } 1299 + 1300 + async get( 1301 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 1302 + ): Promise<{ uri: string; cid: string; value: ShTangledRepoIssue.Record }> { 1303 + const res = await this._client.call('com.atproto.repo.getRecord', { 1304 + collection: 'sh.tangled.repo.issue', 1305 + ...params, 1306 + }) 1307 + return res.data 1308 + } 1309 + 1310 + async create( 1311 + params: OmitKey< 1312 + ComAtprotoRepoCreateRecord.InputSchema, 1313 + 'collection' | 'record' 1314 + >, 1315 + record: Un$Typed<ShTangledRepoIssue.Record>, 1316 + headers?: Record<string, string>, 1317 + ): Promise<{ uri: string; cid: string }> { 1318 + const collection = 'sh.tangled.repo.issue' 1319 + const res = await this._client.call( 1320 + 'com.atproto.repo.createRecord', 1321 + undefined, 1322 + { collection, ...params, record: { ...record, $type: collection } }, 1323 + { encoding: 'application/json', headers }, 1324 + ) 1325 + return res.data 1326 + } 1327 + 1328 + async put( 1329 + params: OmitKey< 1330 + ComAtprotoRepoPutRecord.InputSchema, 1331 + 'collection' | 'record' 1332 + >, 1333 + record: Un$Typed<ShTangledRepoIssue.Record>, 1334 + headers?: Record<string, string>, 1335 + ): Promise<{ uri: string; cid: string }> { 1336 + const collection = 'sh.tangled.repo.issue' 1337 + const res = await this._client.call( 1338 + 'com.atproto.repo.putRecord', 1339 + undefined, 1340 + { collection, ...params, record: { ...record, $type: collection } }, 1341 + { encoding: 'application/json', headers }, 1342 + ) 1343 + return res.data 1344 + } 1345 + 1346 + async delete( 1347 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 1348 + headers?: Record<string, string>, 1349 + ): Promise<void> { 1350 + await this._client.call( 1351 + 'com.atproto.repo.deleteRecord', 1352 + undefined, 1353 + { collection: 'sh.tangled.repo.issue', ...params }, 1354 + { headers }, 1355 + ) 1356 + } 1357 + } 1358 + 1359 + export class ShTangledRepoPullRecord { 1360 + _client: XrpcClient 1361 + 1362 + constructor(client: XrpcClient) { 1363 + this._client = client 1364 + } 1365 + 1366 + async list( 1367 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 1368 + ): Promise<{ 1369 + cursor?: string 1370 + records: { uri: string; value: ShTangledRepoPull.Record }[] 1371 + }> { 1372 + const res = await this._client.call('com.atproto.repo.listRecords', { 1373 + collection: 'sh.tangled.repo.pull', 1374 + ...params, 1375 + }) 1376 + return res.data 1377 + } 1378 + 1379 + async get( 1380 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 1381 + ): Promise<{ uri: string; cid: string; value: ShTangledRepoPull.Record }> { 1382 + const res = await this._client.call('com.atproto.repo.getRecord', { 1383 + collection: 'sh.tangled.repo.pull', 1384 + ...params, 1385 + }) 1386 + return res.data 1387 + } 1388 + 1389 + async create( 1390 + params: OmitKey< 1391 + ComAtprotoRepoCreateRecord.InputSchema, 1392 + 'collection' | 'record' 1393 + >, 1394 + record: Un$Typed<ShTangledRepoPull.Record>, 1395 + headers?: Record<string, string>, 1396 + ): Promise<{ uri: string; cid: string }> { 1397 + const collection = 'sh.tangled.repo.pull' 1398 + const res = await this._client.call( 1399 + 'com.atproto.repo.createRecord', 1400 + undefined, 1401 + { collection, ...params, record: { ...record, $type: collection } }, 1402 + { encoding: 'application/json', headers }, 1403 + ) 1404 + return res.data 1405 + } 1406 + 1407 + async put( 1408 + params: OmitKey< 1409 + ComAtprotoRepoPutRecord.InputSchema, 1410 + 'collection' | 'record' 1411 + >, 1412 + record: Un$Typed<ShTangledRepoPull.Record>, 1413 + headers?: Record<string, string>, 1414 + ): Promise<{ uri: string; cid: string }> { 1415 + const collection = 'sh.tangled.repo.pull' 1416 + const res = await this._client.call( 1417 + 'com.atproto.repo.putRecord', 1418 + undefined, 1419 + { collection, ...params, record: { ...record, $type: collection } }, 1420 + { encoding: 'application/json', headers }, 1421 + ) 1422 + return res.data 1423 + } 1424 + 1425 + async delete( 1426 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 1427 + headers?: Record<string, string>, 1428 + ): Promise<void> { 1429 + await this._client.call( 1430 + 'com.atproto.repo.deleteRecord', 1431 + undefined, 1432 + { collection: 'sh.tangled.repo.pull', ...params }, 1433 + { headers }, 1434 + ) 1435 + } 1436 + } 1437 + 1438 + export class ShTangledRepoArtifactRecord { 1439 + _client: XrpcClient 1440 + 1441 + constructor(client: XrpcClient) { 1442 + this._client = client 1443 + } 1444 + 1445 + async list( 1446 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 1447 + ): Promise<{ 1448 + cursor?: string 1449 + records: { uri: string; value: ShTangledRepoArtifact.Record }[] 1450 + }> { 1451 + const res = await this._client.call('com.atproto.repo.listRecords', { 1452 + collection: 'sh.tangled.repo.artifact', 1453 + ...params, 1454 + }) 1455 + return res.data 1456 + } 1457 + 1458 + async get( 1459 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 1460 + ): Promise<{ 1461 + uri: string 1462 + cid: string 1463 + value: ShTangledRepoArtifact.Record 1464 + }> { 1465 + const res = await this._client.call('com.atproto.repo.getRecord', { 1466 + collection: 'sh.tangled.repo.artifact', 1467 + ...params, 1468 + }) 1469 + return res.data 1470 + } 1471 + 1472 + async create( 1473 + params: OmitKey< 1474 + ComAtprotoRepoCreateRecord.InputSchema, 1475 + 'collection' | 'record' 1476 + >, 1477 + record: Un$Typed<ShTangledRepoArtifact.Record>, 1478 + headers?: Record<string, string>, 1479 + ): Promise<{ uri: string; cid: string }> { 1480 + const collection = 'sh.tangled.repo.artifact' 1481 + const res = await this._client.call( 1482 + 'com.atproto.repo.createRecord', 1483 + undefined, 1484 + { collection, ...params, record: { ...record, $type: collection } }, 1485 + { encoding: 'application/json', headers }, 1486 + ) 1487 + return res.data 1488 + } 1489 + 1490 + async put( 1491 + params: OmitKey< 1492 + ComAtprotoRepoPutRecord.InputSchema, 1493 + 'collection' | 'record' 1494 + >, 1495 + record: Un$Typed<ShTangledRepoArtifact.Record>, 1496 + headers?: Record<string, string>, 1497 + ): Promise<{ uri: string; cid: string }> { 1498 + const collection = 'sh.tangled.repo.artifact' 1499 + const res = await this._client.call( 1500 + 'com.atproto.repo.putRecord', 1501 + undefined, 1502 + { collection, ...params, record: { ...record, $type: collection } }, 1503 + { encoding: 'application/json', headers }, 1504 + ) 1505 + return res.data 1506 + } 1507 + 1508 + async delete( 1509 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 1510 + headers?: Record<string, string>, 1511 + ): Promise<void> { 1512 + await this._client.call( 1513 + 'com.atproto.repo.deleteRecord', 1514 + undefined, 1515 + { collection: 'sh.tangled.repo.artifact', ...params }, 1516 + { headers }, 1517 + ) 1518 + } 1519 + } 1520 + 1521 + export class ShTangledRepoCollaboratorRecord { 1522 + _client: XrpcClient 1523 + 1524 + constructor(client: XrpcClient) { 1525 + this._client = client 1526 + } 1527 + 1528 + async list( 1529 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 1530 + ): Promise<{ 1531 + cursor?: string 1532 + records: { uri: string; value: ShTangledRepoCollaborator.Record }[] 1533 + }> { 1534 + const res = await this._client.call('com.atproto.repo.listRecords', { 1535 + collection: 'sh.tangled.repo.collaborator', 1536 + ...params, 1537 + }) 1538 + return res.data 1539 + } 1540 + 1541 + async get( 1542 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 1543 + ): Promise<{ 1544 + uri: string 1545 + cid: string 1546 + value: ShTangledRepoCollaborator.Record 1547 + }> { 1548 + const res = await this._client.call('com.atproto.repo.getRecord', { 1549 + collection: 'sh.tangled.repo.collaborator', 1550 + ...params, 1551 + }) 1552 + return res.data 1553 + } 1554 + 1555 + async create( 1556 + params: OmitKey< 1557 + ComAtprotoRepoCreateRecord.InputSchema, 1558 + 'collection' | 'record' 1559 + >, 1560 + record: Un$Typed<ShTangledRepoCollaborator.Record>, 1561 + headers?: Record<string, string>, 1562 + ): Promise<{ uri: string; cid: string }> { 1563 + const collection = 'sh.tangled.repo.collaborator' 1564 + const res = await this._client.call( 1565 + 'com.atproto.repo.createRecord', 1566 + undefined, 1567 + { collection, ...params, record: { ...record, $type: collection } }, 1568 + { encoding: 'application/json', headers }, 1569 + ) 1570 + return res.data 1571 + } 1572 + 1573 + async put( 1574 + params: OmitKey< 1575 + ComAtprotoRepoPutRecord.InputSchema, 1576 + 'collection' | 'record' 1577 + >, 1578 + record: Un$Typed<ShTangledRepoCollaborator.Record>, 1579 + headers?: Record<string, string>, 1580 + ): Promise<{ uri: string; cid: string }> { 1581 + const collection = 'sh.tangled.repo.collaborator' 1582 + const res = await this._client.call( 1583 + 'com.atproto.repo.putRecord', 1584 + undefined, 1585 + { collection, ...params, record: { ...record, $type: collection } }, 1586 + { encoding: 'application/json', headers }, 1587 + ) 1588 + return res.data 1589 + } 1590 + 1591 + async delete( 1592 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 1593 + headers?: Record<string, string>, 1594 + ): Promise<void> { 1595 + await this._client.call( 1596 + 'com.atproto.repo.deleteRecord', 1597 + undefined, 1598 + { collection: 'sh.tangled.repo.collaborator', ...params }, 1599 + { headers }, 1600 + ) 1601 + } 1602 + } 1603 + 1604 + export class ShTangledKnotNS { 1605 + _client: XrpcClient 1606 + member: ShTangledKnotMemberRecord 1607 + 1608 + constructor(client: XrpcClient) { 1609 + this._client = client 1610 + this.member = new ShTangledKnotMemberRecord(client) 1611 + } 1612 + 1613 + listKeys( 1614 + params?: ShTangledKnotListKeys.QueryParams, 1615 + opts?: ShTangledKnotListKeys.CallOptions, 1616 + ): Promise<ShTangledKnotListKeys.Response> { 1617 + return this._client 1618 + .call('sh.tangled.knot.listKeys', params, undefined, opts) 1619 + .catch((e) => { 1620 + throw ShTangledKnotListKeys.toKnownErr(e) 1621 + }) 1622 + } 1623 + 1624 + version( 1625 + params?: ShTangledKnotVersion.QueryParams, 1626 + opts?: ShTangledKnotVersion.CallOptions, 1627 + ): Promise<ShTangledKnotVersion.Response> { 1628 + return this._client.call('sh.tangled.knot.version', params, undefined, opts) 1629 + } 1630 + } 1631 + 1632 + export class ShTangledKnotMemberRecord { 1633 + _client: XrpcClient 1634 + 1635 + constructor(client: XrpcClient) { 1636 + this._client = client 1637 + } 1638 + 1639 + async list( 1640 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 1641 + ): Promise<{ 1642 + cursor?: string 1643 + records: { uri: string; value: ShTangledKnotMember.Record }[] 1644 + }> { 1645 + const res = await this._client.call('com.atproto.repo.listRecords', { 1646 + collection: 'sh.tangled.knot.member', 1647 + ...params, 1648 + }) 1649 + return res.data 1650 + } 1651 + 1652 + async get( 1653 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 1654 + ): Promise<{ uri: string; cid: string; value: ShTangledKnotMember.Record }> { 1655 + const res = await this._client.call('com.atproto.repo.getRecord', { 1656 + collection: 'sh.tangled.knot.member', 1657 + ...params, 1658 + }) 1659 + return res.data 1660 + } 1661 + 1662 + async create( 1663 + params: OmitKey< 1664 + ComAtprotoRepoCreateRecord.InputSchema, 1665 + 'collection' | 'record' 1666 + >, 1667 + record: Un$Typed<ShTangledKnotMember.Record>, 1668 + headers?: Record<string, string>, 1669 + ): Promise<{ uri: string; cid: string }> { 1670 + const collection = 'sh.tangled.knot.member' 1671 + const res = await this._client.call( 1672 + 'com.atproto.repo.createRecord', 1673 + undefined, 1674 + { collection, ...params, record: { ...record, $type: collection } }, 1675 + { encoding: 'application/json', headers }, 1676 + ) 1677 + return res.data 1678 + } 1679 + 1680 + async put( 1681 + params: OmitKey< 1682 + ComAtprotoRepoPutRecord.InputSchema, 1683 + 'collection' | 'record' 1684 + >, 1685 + record: Un$Typed<ShTangledKnotMember.Record>, 1686 + headers?: Record<string, string>, 1687 + ): Promise<{ uri: string; cid: string }> { 1688 + const collection = 'sh.tangled.knot.member' 1689 + const res = await this._client.call( 1690 + 'com.atproto.repo.putRecord', 1691 + undefined, 1692 + { collection, ...params, record: { ...record, $type: collection } }, 1693 + { encoding: 'application/json', headers }, 1694 + ) 1695 + return res.data 1696 + } 1697 + 1698 + async delete( 1699 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 1700 + headers?: Record<string, string>, 1701 + ): Promise<void> { 1702 + await this._client.call( 1703 + 'com.atproto.repo.deleteRecord', 1704 + undefined, 1705 + { collection: 'sh.tangled.knot.member', ...params }, 1706 + { headers }, 1707 + ) 1708 + } 1709 + } 1710 + 1711 + export class ShTangledLabelNS { 1712 + _client: XrpcClient 1713 + definition: ShTangledLabelDefinitionRecord 1714 + op: ShTangledLabelOpRecord 1715 + 1716 + constructor(client: XrpcClient) { 1717 + this._client = client 1718 + this.definition = new ShTangledLabelDefinitionRecord(client) 1719 + this.op = new ShTangledLabelOpRecord(client) 1720 + } 1721 + } 1722 + 1723 + export class ShTangledLabelDefinitionRecord { 1724 + _client: XrpcClient 1725 + 1726 + constructor(client: XrpcClient) { 1727 + this._client = client 1728 + } 1729 + 1730 + async list( 1731 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 1732 + ): Promise<{ 1733 + cursor?: string 1734 + records: { uri: string; value: ShTangledLabelDefinition.Record }[] 1735 + }> { 1736 + const res = await this._client.call('com.atproto.repo.listRecords', { 1737 + collection: 'sh.tangled.label.definition', 1738 + ...params, 1739 + }) 1740 + return res.data 1741 + } 1742 + 1743 + async get( 1744 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 1745 + ): Promise<{ 1746 + uri: string 1747 + cid: string 1748 + value: ShTangledLabelDefinition.Record 1749 + }> { 1750 + const res = await this._client.call('com.atproto.repo.getRecord', { 1751 + collection: 'sh.tangled.label.definition', 1752 + ...params, 1753 + }) 1754 + return res.data 1755 + } 1756 + 1757 + async create( 1758 + params: OmitKey< 1759 + ComAtprotoRepoCreateRecord.InputSchema, 1760 + 'collection' | 'record' 1761 + >, 1762 + record: Un$Typed<ShTangledLabelDefinition.Record>, 1763 + headers?: Record<string, string>, 1764 + ): Promise<{ uri: string; cid: string }> { 1765 + const collection = 'sh.tangled.label.definition' 1766 + const res = await this._client.call( 1767 + 'com.atproto.repo.createRecord', 1768 + undefined, 1769 + { collection, ...params, record: { ...record, $type: collection } }, 1770 + { encoding: 'application/json', headers }, 1771 + ) 1772 + return res.data 1773 + } 1774 + 1775 + async put( 1776 + params: OmitKey< 1777 + ComAtprotoRepoPutRecord.InputSchema, 1778 + 'collection' | 'record' 1779 + >, 1780 + record: Un$Typed<ShTangledLabelDefinition.Record>, 1781 + headers?: Record<string, string>, 1782 + ): Promise<{ uri: string; cid: string }> { 1783 + const collection = 'sh.tangled.label.definition' 1784 + const res = await this._client.call( 1785 + 'com.atproto.repo.putRecord', 1786 + undefined, 1787 + { collection, ...params, record: { ...record, $type: collection } }, 1788 + { encoding: 'application/json', headers }, 1789 + ) 1790 + return res.data 1791 + } 1792 + 1793 + async delete( 1794 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 1795 + headers?: Record<string, string>, 1796 + ): Promise<void> { 1797 + await this._client.call( 1798 + 'com.atproto.repo.deleteRecord', 1799 + undefined, 1800 + { collection: 'sh.tangled.label.definition', ...params }, 1801 + { headers }, 1802 + ) 1803 + } 1804 + } 1805 + 1806 + export class ShTangledLabelOpRecord { 1807 + _client: XrpcClient 1808 + 1809 + constructor(client: XrpcClient) { 1810 + this._client = client 1811 + } 1812 + 1813 + async list( 1814 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 1815 + ): Promise<{ 1816 + cursor?: string 1817 + records: { uri: string; value: ShTangledLabelOp.Record }[] 1818 + }> { 1819 + const res = await this._client.call('com.atproto.repo.listRecords', { 1820 + collection: 'sh.tangled.label.op', 1821 + ...params, 1822 + }) 1823 + return res.data 1824 + } 1825 + 1826 + async get( 1827 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 1828 + ): Promise<{ uri: string; cid: string; value: ShTangledLabelOp.Record }> { 1829 + const res = await this._client.call('com.atproto.repo.getRecord', { 1830 + collection: 'sh.tangled.label.op', 1831 + ...params, 1832 + }) 1833 + return res.data 1834 + } 1835 + 1836 + async create( 1837 + params: OmitKey< 1838 + ComAtprotoRepoCreateRecord.InputSchema, 1839 + 'collection' | 'record' 1840 + >, 1841 + record: Un$Typed<ShTangledLabelOp.Record>, 1842 + headers?: Record<string, string>, 1843 + ): Promise<{ uri: string; cid: string }> { 1844 + const collection = 'sh.tangled.label.op' 1845 + const res = await this._client.call( 1846 + 'com.atproto.repo.createRecord', 1847 + undefined, 1848 + { collection, ...params, record: { ...record, $type: collection } }, 1849 + { encoding: 'application/json', headers }, 1850 + ) 1851 + return res.data 1852 + } 1853 + 1854 + async put( 1855 + params: OmitKey< 1856 + ComAtprotoRepoPutRecord.InputSchema, 1857 + 'collection' | 'record' 1858 + >, 1859 + record: Un$Typed<ShTangledLabelOp.Record>, 1860 + headers?: Record<string, string>, 1861 + ): Promise<{ uri: string; cid: string }> { 1862 + const collection = 'sh.tangled.label.op' 1863 + const res = await this._client.call( 1864 + 'com.atproto.repo.putRecord', 1865 + undefined, 1866 + { collection, ...params, record: { ...record, $type: collection } }, 1867 + { encoding: 'application/json', headers }, 1868 + ) 1869 + return res.data 1870 + } 1871 + 1872 + async delete( 1873 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 1874 + headers?: Record<string, string>, 1875 + ): Promise<void> { 1876 + await this._client.call( 1877 + 'com.atproto.repo.deleteRecord', 1878 + undefined, 1879 + { collection: 'sh.tangled.label.op', ...params }, 1880 + { headers }, 1881 + ) 1882 + } 1883 + } 1884 + 1885 + export class ShTangledPipelineNS { 1886 + _client: XrpcClient 1887 + status: ShTangledPipelineStatusRecord 1888 + 1889 + constructor(client: XrpcClient) { 1890 + this._client = client 1891 + this.status = new ShTangledPipelineStatusRecord(client) 1892 + } 1893 + 1894 + cancelPipeline( 1895 + data?: ShTangledPipelineCancelPipeline.InputSchema, 1896 + opts?: ShTangledPipelineCancelPipeline.CallOptions, 1897 + ): Promise<ShTangledPipelineCancelPipeline.Response> { 1898 + return this._client.call( 1899 + 'sh.tangled.pipeline.cancelPipeline', 1900 + opts?.qp, 1901 + data, 1902 + opts, 1903 + ) 1904 + } 1905 + } 1906 + 1907 + export class ShTangledPipelineStatusRecord { 1908 + _client: XrpcClient 1909 + 1910 + constructor(client: XrpcClient) { 1911 + this._client = client 1912 + } 1913 + 1914 + async list( 1915 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 1916 + ): Promise<{ 1917 + cursor?: string 1918 + records: { uri: string; value: ShTangledPipelineStatus.Record }[] 1919 + }> { 1920 + const res = await this._client.call('com.atproto.repo.listRecords', { 1921 + collection: 'sh.tangled.pipeline.status', 1922 + ...params, 1923 + }) 1924 + return res.data 1925 + } 1926 + 1927 + async get( 1928 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 1929 + ): Promise<{ 1930 + uri: string 1931 + cid: string 1932 + value: ShTangledPipelineStatus.Record 1933 + }> { 1934 + const res = await this._client.call('com.atproto.repo.getRecord', { 1935 + collection: 'sh.tangled.pipeline.status', 1936 + ...params, 1937 + }) 1938 + return res.data 1939 + } 1940 + 1941 + async create( 1942 + params: OmitKey< 1943 + ComAtprotoRepoCreateRecord.InputSchema, 1944 + 'collection' | 'record' 1945 + >, 1946 + record: Un$Typed<ShTangledPipelineStatus.Record>, 1947 + headers?: Record<string, string>, 1948 + ): Promise<{ uri: string; cid: string }> { 1949 + const collection = 'sh.tangled.pipeline.status' 1950 + const res = await this._client.call( 1951 + 'com.atproto.repo.createRecord', 1952 + undefined, 1953 + { collection, ...params, record: { ...record, $type: collection } }, 1954 + { encoding: 'application/json', headers }, 1955 + ) 1956 + return res.data 1957 + } 1958 + 1959 + async put( 1960 + params: OmitKey< 1961 + ComAtprotoRepoPutRecord.InputSchema, 1962 + 'collection' | 'record' 1963 + >, 1964 + record: Un$Typed<ShTangledPipelineStatus.Record>, 1965 + headers?: Record<string, string>, 1966 + ): Promise<{ uri: string; cid: string }> { 1967 + const collection = 'sh.tangled.pipeline.status' 1968 + const res = await this._client.call( 1969 + 'com.atproto.repo.putRecord', 1970 + undefined, 1971 + { collection, ...params, record: { ...record, $type: collection } }, 1972 + { encoding: 'application/json', headers }, 1973 + ) 1974 + return res.data 1975 + } 1976 + 1977 + async delete( 1978 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 1979 + headers?: Record<string, string>, 1980 + ): Promise<void> { 1981 + await this._client.call( 1982 + 'com.atproto.repo.deleteRecord', 1983 + undefined, 1984 + { collection: 'sh.tangled.pipeline.status', ...params }, 1985 + { headers }, 1986 + ) 1987 + } 1988 + } 1989 + 1990 + export class ShTangledSpindleNS { 1991 + _client: XrpcClient 1992 + member: ShTangledSpindleMemberRecord 1993 + 1994 + constructor(client: XrpcClient) { 1995 + this._client = client 1996 + this.member = new ShTangledSpindleMemberRecord(client) 1997 + } 1998 + } 1999 + 2000 + export class ShTangledSpindleMemberRecord { 2001 + _client: XrpcClient 2002 + 2003 + constructor(client: XrpcClient) { 2004 + this._client = client 2005 + } 2006 + 2007 + async list( 2008 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 2009 + ): Promise<{ 2010 + cursor?: string 2011 + records: { uri: string; value: ShTangledSpindleMember.Record }[] 2012 + }> { 2013 + const res = await this._client.call('com.atproto.repo.listRecords', { 2014 + collection: 'sh.tangled.spindle.member', 2015 + ...params, 2016 + }) 2017 + return res.data 2018 + } 2019 + 2020 + async get( 2021 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 2022 + ): Promise<{ 2023 + uri: string 2024 + cid: string 2025 + value: ShTangledSpindleMember.Record 2026 + }> { 2027 + const res = await this._client.call('com.atproto.repo.getRecord', { 2028 + collection: 'sh.tangled.spindle.member', 2029 + ...params, 2030 + }) 2031 + return res.data 2032 + } 2033 + 2034 + async create( 2035 + params: OmitKey< 2036 + ComAtprotoRepoCreateRecord.InputSchema, 2037 + 'collection' | 'record' 2038 + >, 2039 + record: Un$Typed<ShTangledSpindleMember.Record>, 2040 + headers?: Record<string, string>, 2041 + ): Promise<{ uri: string; cid: string }> { 2042 + const collection = 'sh.tangled.spindle.member' 2043 + const res = await this._client.call( 2044 + 'com.atproto.repo.createRecord', 2045 + undefined, 2046 + { collection, ...params, record: { ...record, $type: collection } }, 2047 + { encoding: 'application/json', headers }, 2048 + ) 2049 + return res.data 2050 + } 2051 + 2052 + async put( 2053 + params: OmitKey< 2054 + ComAtprotoRepoPutRecord.InputSchema, 2055 + 'collection' | 'record' 2056 + >, 2057 + record: Un$Typed<ShTangledSpindleMember.Record>, 2058 + headers?: Record<string, string>, 2059 + ): Promise<{ uri: string; cid: string }> { 2060 + const collection = 'sh.tangled.spindle.member' 2061 + const res = await this._client.call( 2062 + 'com.atproto.repo.putRecord', 2063 + undefined, 2064 + { collection, ...params, record: { ...record, $type: collection } }, 2065 + { encoding: 'application/json', headers }, 2066 + ) 2067 + return res.data 2068 + } 2069 + 2070 + async delete( 2071 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 2072 + headers?: Record<string, string>, 2073 + ): Promise<void> { 2074 + await this._client.call( 2075 + 'com.atproto.repo.deleteRecord', 2076 + undefined, 2077 + { collection: 'sh.tangled.spindle.member', ...params }, 2078 + { headers }, 2079 + ) 2080 + } 2081 + } 2082 + 2083 + export class ShTangledKnotRecord { 2084 + _client: XrpcClient 2085 + 2086 + constructor(client: XrpcClient) { 2087 + this._client = client 2088 + } 2089 + 2090 + async list( 2091 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 2092 + ): Promise<{ 2093 + cursor?: string 2094 + records: { uri: string; value: ShTangledKnot.Record }[] 2095 + }> { 2096 + const res = await this._client.call('com.atproto.repo.listRecords', { 2097 + collection: 'sh.tangled.knot', 2098 + ...params, 2099 + }) 2100 + return res.data 2101 + } 2102 + 2103 + async get( 2104 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 2105 + ): Promise<{ uri: string; cid: string; value: ShTangledKnot.Record }> { 2106 + const res = await this._client.call('com.atproto.repo.getRecord', { 2107 + collection: 'sh.tangled.knot', 2108 + ...params, 2109 + }) 2110 + return res.data 2111 + } 2112 + 2113 + async create( 2114 + params: OmitKey< 2115 + ComAtprotoRepoCreateRecord.InputSchema, 2116 + 'collection' | 'record' 2117 + >, 2118 + record: Un$Typed<ShTangledKnot.Record>, 2119 + headers?: Record<string, string>, 2120 + ): Promise<{ uri: string; cid: string }> { 2121 + const collection = 'sh.tangled.knot' 2122 + const res = await this._client.call( 2123 + 'com.atproto.repo.createRecord', 2124 + undefined, 2125 + { collection, ...params, record: { ...record, $type: collection } }, 2126 + { encoding: 'application/json', headers }, 2127 + ) 2128 + return res.data 2129 + } 2130 + 2131 + async put( 2132 + params: OmitKey< 2133 + ComAtprotoRepoPutRecord.InputSchema, 2134 + 'collection' | 'record' 2135 + >, 2136 + record: Un$Typed<ShTangledKnot.Record>, 2137 + headers?: Record<string, string>, 2138 + ): Promise<{ uri: string; cid: string }> { 2139 + const collection = 'sh.tangled.knot' 2140 + const res = await this._client.call( 2141 + 'com.atproto.repo.putRecord', 2142 + undefined, 2143 + { collection, ...params, record: { ...record, $type: collection } }, 2144 + { encoding: 'application/json', headers }, 2145 + ) 2146 + return res.data 2147 + } 2148 + 2149 + async delete( 2150 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 2151 + headers?: Record<string, string>, 2152 + ): Promise<void> { 2153 + await this._client.call( 2154 + 'com.atproto.repo.deleteRecord', 2155 + undefined, 2156 + { collection: 'sh.tangled.knot', ...params }, 2157 + { headers }, 2158 + ) 2159 + } 2160 + } 2161 + 2162 + export class ShTangledPipelineRecord { 2163 + _client: XrpcClient 2164 + 2165 + constructor(client: XrpcClient) { 2166 + this._client = client 2167 + } 2168 + 2169 + async list( 2170 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 2171 + ): Promise<{ 2172 + cursor?: string 2173 + records: { uri: string; value: ShTangledPipeline.Record }[] 2174 + }> { 2175 + const res = await this._client.call('com.atproto.repo.listRecords', { 2176 + collection: 'sh.tangled.pipeline', 2177 + ...params, 2178 + }) 2179 + return res.data 2180 + } 2181 + 2182 + async get( 2183 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 2184 + ): Promise<{ uri: string; cid: string; value: ShTangledPipeline.Record }> { 2185 + const res = await this._client.call('com.atproto.repo.getRecord', { 2186 + collection: 'sh.tangled.pipeline', 2187 + ...params, 2188 + }) 2189 + return res.data 2190 + } 2191 + 2192 + async create( 2193 + params: OmitKey< 2194 + ComAtprotoRepoCreateRecord.InputSchema, 2195 + 'collection' | 'record' 2196 + >, 2197 + record: Un$Typed<ShTangledPipeline.Record>, 2198 + headers?: Record<string, string>, 2199 + ): Promise<{ uri: string; cid: string }> { 2200 + const collection = 'sh.tangled.pipeline' 2201 + const res = await this._client.call( 2202 + 'com.atproto.repo.createRecord', 2203 + undefined, 2204 + { collection, ...params, record: { ...record, $type: collection } }, 2205 + { encoding: 'application/json', headers }, 2206 + ) 2207 + return res.data 2208 + } 2209 + 2210 + async put( 2211 + params: OmitKey< 2212 + ComAtprotoRepoPutRecord.InputSchema, 2213 + 'collection' | 'record' 2214 + >, 2215 + record: Un$Typed<ShTangledPipeline.Record>, 2216 + headers?: Record<string, string>, 2217 + ): Promise<{ uri: string; cid: string }> { 2218 + const collection = 'sh.tangled.pipeline' 2219 + const res = await this._client.call( 2220 + 'com.atproto.repo.putRecord', 2221 + undefined, 2222 + { collection, ...params, record: { ...record, $type: collection } }, 2223 + { encoding: 'application/json', headers }, 2224 + ) 2225 + return res.data 2226 + } 2227 + 2228 + async delete( 2229 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 2230 + headers?: Record<string, string>, 2231 + ): Promise<void> { 2232 + await this._client.call( 2233 + 'com.atproto.repo.deleteRecord', 2234 + undefined, 2235 + { collection: 'sh.tangled.pipeline', ...params }, 2236 + { headers }, 2237 + ) 2238 + } 2239 + } 2240 + 2241 + export class ShTangledRepoRecord { 2242 + _client: XrpcClient 2243 + 2244 + constructor(client: XrpcClient) { 2245 + this._client = client 2246 + } 2247 + 2248 + async list( 2249 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 2250 + ): Promise<{ 2251 + cursor?: string 2252 + records: { uri: string; value: ShTangledRepo.Record }[] 2253 + }> { 2254 + const res = await this._client.call('com.atproto.repo.listRecords', { 2255 + collection: 'sh.tangled.repo', 2256 + ...params, 2257 + }) 2258 + return res.data 2259 + } 2260 + 2261 + async get( 2262 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 2263 + ): Promise<{ uri: string; cid: string; value: ShTangledRepo.Record }> { 2264 + const res = await this._client.call('com.atproto.repo.getRecord', { 2265 + collection: 'sh.tangled.repo', 2266 + ...params, 2267 + }) 2268 + return res.data 2269 + } 2270 + 2271 + async create( 2272 + params: OmitKey< 2273 + ComAtprotoRepoCreateRecord.InputSchema, 2274 + 'collection' | 'record' 2275 + >, 2276 + record: Un$Typed<ShTangledRepo.Record>, 2277 + headers?: Record<string, string>, 2278 + ): Promise<{ uri: string; cid: string }> { 2279 + const collection = 'sh.tangled.repo' 2280 + const res = await this._client.call( 2281 + 'com.atproto.repo.createRecord', 2282 + undefined, 2283 + { collection, ...params, record: { ...record, $type: collection } }, 2284 + { encoding: 'application/json', headers }, 2285 + ) 2286 + return res.data 2287 + } 2288 + 2289 + async put( 2290 + params: OmitKey< 2291 + ComAtprotoRepoPutRecord.InputSchema, 2292 + 'collection' | 'record' 2293 + >, 2294 + record: Un$Typed<ShTangledRepo.Record>, 2295 + headers?: Record<string, string>, 2296 + ): Promise<{ uri: string; cid: string }> { 2297 + const collection = 'sh.tangled.repo' 2298 + const res = await this._client.call( 2299 + 'com.atproto.repo.putRecord', 2300 + undefined, 2301 + { collection, ...params, record: { ...record, $type: collection } }, 2302 + { encoding: 'application/json', headers }, 2303 + ) 2304 + return res.data 2305 + } 2306 + 2307 + async delete( 2308 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 2309 + headers?: Record<string, string>, 2310 + ): Promise<void> { 2311 + await this._client.call( 2312 + 'com.atproto.repo.deleteRecord', 2313 + undefined, 2314 + { collection: 'sh.tangled.repo', ...params }, 2315 + { headers }, 2316 + ) 2317 + } 2318 + } 2319 + 2320 + export class ShTangledSpindleRecord { 2321 + _client: XrpcClient 2322 + 2323 + constructor(client: XrpcClient) { 2324 + this._client = client 2325 + } 2326 + 2327 + async list( 2328 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 2329 + ): Promise<{ 2330 + cursor?: string 2331 + records: { uri: string; value: ShTangledSpindle.Record }[] 2332 + }> { 2333 + const res = await this._client.call('com.atproto.repo.listRecords', { 2334 + collection: 'sh.tangled.spindle', 2335 + ...params, 2336 + }) 2337 + return res.data 2338 + } 2339 + 2340 + async get( 2341 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 2342 + ): Promise<{ uri: string; cid: string; value: ShTangledSpindle.Record }> { 2343 + const res = await this._client.call('com.atproto.repo.getRecord', { 2344 + collection: 'sh.tangled.spindle', 2345 + ...params, 2346 + }) 2347 + return res.data 2348 + } 2349 + 2350 + async create( 2351 + params: OmitKey< 2352 + ComAtprotoRepoCreateRecord.InputSchema, 2353 + 'collection' | 'record' 2354 + >, 2355 + record: Un$Typed<ShTangledSpindle.Record>, 2356 + headers?: Record<string, string>, 2357 + ): Promise<{ uri: string; cid: string }> { 2358 + const collection = 'sh.tangled.spindle' 2359 + const res = await this._client.call( 2360 + 'com.atproto.repo.createRecord', 2361 + undefined, 2362 + { collection, ...params, record: { ...record, $type: collection } }, 2363 + { encoding: 'application/json', headers }, 2364 + ) 2365 + return res.data 2366 + } 2367 + 2368 + async put( 2369 + params: OmitKey< 2370 + ComAtprotoRepoPutRecord.InputSchema, 2371 + 'collection' | 'record' 2372 + >, 2373 + record: Un$Typed<ShTangledSpindle.Record>, 2374 + headers?: Record<string, string>, 2375 + ): Promise<{ uri: string; cid: string }> { 2376 + const collection = 'sh.tangled.spindle' 2377 + const res = await this._client.call( 2378 + 'com.atproto.repo.putRecord', 2379 + undefined, 2380 + { collection, ...params, record: { ...record, $type: collection } }, 2381 + { encoding: 'application/json', headers }, 2382 + ) 2383 + return res.data 2384 + } 2385 + 2386 + async delete( 2387 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 2388 + headers?: Record<string, string>, 2389 + ): Promise<void> { 2390 + await this._client.call( 2391 + 'com.atproto.repo.deleteRecord', 2392 + undefined, 2393 + { collection: 'sh.tangled.spindle', ...params }, 2394 + { headers }, 2395 + ) 2396 + } 2397 + } 2398 + 2399 + export class ShTangledStringRecord { 2400 + _client: XrpcClient 2401 + 2402 + constructor(client: XrpcClient) { 2403 + this._client = client 2404 + } 2405 + 2406 + async list( 2407 + params: OmitKey<ComAtprotoRepoListRecords.QueryParams, 'collection'>, 2408 + ): Promise<{ 2409 + cursor?: string 2410 + records: { uri: string; value: ShTangledString.Record }[] 2411 + }> { 2412 + const res = await this._client.call('com.atproto.repo.listRecords', { 2413 + collection: 'sh.tangled.string', 2414 + ...params, 2415 + }) 2416 + return res.data 2417 + } 2418 + 2419 + async get( 2420 + params: OmitKey<ComAtprotoRepoGetRecord.QueryParams, 'collection'>, 2421 + ): Promise<{ uri: string; cid: string; value: ShTangledString.Record }> { 2422 + const res = await this._client.call('com.atproto.repo.getRecord', { 2423 + collection: 'sh.tangled.string', 2424 + ...params, 2425 + }) 2426 + return res.data 2427 + } 2428 + 2429 + async create( 2430 + params: OmitKey< 2431 + ComAtprotoRepoCreateRecord.InputSchema, 2432 + 'collection' | 'record' 2433 + >, 2434 + record: Un$Typed<ShTangledString.Record>, 2435 + headers?: Record<string, string>, 2436 + ): Promise<{ uri: string; cid: string }> { 2437 + const collection = 'sh.tangled.string' 2438 + const res = await this._client.call( 2439 + 'com.atproto.repo.createRecord', 2440 + undefined, 2441 + { collection, ...params, record: { ...record, $type: collection } }, 2442 + { encoding: 'application/json', headers }, 2443 + ) 2444 + return res.data 2445 + } 2446 + 2447 + async put( 2448 + params: OmitKey< 2449 + ComAtprotoRepoPutRecord.InputSchema, 2450 + 'collection' | 'record' 2451 + >, 2452 + record: Un$Typed<ShTangledString.Record>, 2453 + headers?: Record<string, string>, 2454 + ): Promise<{ uri: string; cid: string }> { 2455 + const collection = 'sh.tangled.string' 2456 + const res = await this._client.call( 2457 + 'com.atproto.repo.putRecord', 2458 + undefined, 2459 + { collection, ...params, record: { ...record, $type: collection } }, 2460 + { encoding: 'application/json', headers }, 2461 + ) 2462 + return res.data 2463 + } 2464 + 2465 + async delete( 2466 + params: OmitKey<ComAtprotoRepoDeleteRecord.InputSchema, 'collection'>, 2467 + headers?: Record<string, string>, 2468 + ): Promise<void> { 2469 + await this._client.call( 2470 + 'com.atproto.repo.deleteRecord', 2471 + undefined, 2472 + { collection: 'sh.tangled.string', ...params }, 2473 + { headers }, 2474 + ) 2475 + } 2476 + }
+2963
src/lexicon/lexicons.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { 5 + type LexiconDoc, 6 + Lexicons, 7 + ValidationError, 8 + type ValidationResult, 9 + } from '@atproto/lexicon' 10 + import { type $Typed, is$typed, maybe$typed } from './util.js' 11 + 12 + export const schemaDict = { 13 + ShTangledActorProfile: { 14 + lexicon: 1, 15 + id: 'sh.tangled.actor.profile', 16 + defs: { 17 + main: { 18 + type: 'record', 19 + description: 'A declaration of a Tangled account profile.', 20 + key: 'literal:self', 21 + record: { 22 + type: 'object', 23 + required: ['bluesky'], 24 + properties: { 25 + avatar: { 26 + type: 'blob', 27 + description: 28 + "Small image to be displayed next to posts from account. AKA, 'profile picture'", 29 + accept: ['image/png', 'image/jpeg'], 30 + maxSize: 1000000, 31 + }, 32 + description: { 33 + type: 'string', 34 + description: 'Free-form profile description text.', 35 + maxGraphemes: 256, 36 + maxLength: 2560, 37 + }, 38 + links: { 39 + type: 'array', 40 + minLength: 0, 41 + maxLength: 5, 42 + items: { 43 + type: 'string', 44 + description: 45 + 'Any URI, intended for social profiles or websites, can be used to link DIDs/AT-URIs too.', 46 + format: 'uri', 47 + }, 48 + }, 49 + stats: { 50 + type: 'array', 51 + minLength: 0, 52 + maxLength: 2, 53 + items: { 54 + type: 'string', 55 + description: 'Vanity stats.', 56 + enum: [ 57 + 'merged-pull-request-count', 58 + 'closed-pull-request-count', 59 + 'open-pull-request-count', 60 + 'open-issue-count', 61 + 'closed-issue-count', 62 + 'repository-count', 63 + 'star-count', 64 + ], 65 + }, 66 + }, 67 + bluesky: { 68 + type: 'boolean', 69 + description: 'Include link to this account on Bluesky.', 70 + }, 71 + location: { 72 + type: 'string', 73 + description: 'Free-form location text.', 74 + maxGraphemes: 40, 75 + maxLength: 400, 76 + }, 77 + pinnedRepositories: { 78 + type: 'array', 79 + description: 80 + 'Any ATURI, it is up to appviews to validate these fields.', 81 + minLength: 0, 82 + maxLength: 6, 83 + items: { 84 + type: 'string', 85 + format: 'at-uri', 86 + }, 87 + }, 88 + pronouns: { 89 + type: 'string', 90 + description: 'Preferred gender pronouns.', 91 + maxLength: 40, 92 + }, 93 + }, 94 + }, 95 + }, 96 + }, 97 + }, 98 + ShTangledFeedReaction: { 99 + lexicon: 1, 100 + id: 'sh.tangled.feed.reaction', 101 + needsCbor: true, 102 + needsType: true, 103 + defs: { 104 + main: { 105 + type: 'record', 106 + key: 'tid', 107 + record: { 108 + type: 'object', 109 + required: ['subject', 'reaction', 'createdAt'], 110 + properties: { 111 + subject: { 112 + type: 'string', 113 + format: 'at-uri', 114 + }, 115 + reaction: { 116 + type: 'string', 117 + enum: ['👍', '👎', '😆', '🎉', '🫤', '❤️', '🚀', '👀'], 118 + }, 119 + createdAt: { 120 + type: 'string', 121 + format: 'datetime', 122 + }, 123 + }, 124 + }, 125 + }, 126 + }, 127 + }, 128 + ShTangledFeedStar: { 129 + lexicon: 1, 130 + id: 'sh.tangled.feed.star', 131 + needsCbor: true, 132 + needsType: true, 133 + defs: { 134 + main: { 135 + type: 'record', 136 + key: 'tid', 137 + record: { 138 + type: 'object', 139 + required: ['subject', 'createdAt'], 140 + properties: { 141 + subject: { 142 + type: 'string', 143 + format: 'at-uri', 144 + }, 145 + createdAt: { 146 + type: 'string', 147 + format: 'datetime', 148 + }, 149 + }, 150 + }, 151 + }, 152 + }, 153 + }, 154 + ShTangledGitRefUpdate: { 155 + lexicon: 1, 156 + id: 'sh.tangled.git.refUpdate', 157 + defs: { 158 + main: { 159 + type: 'record', 160 + description: 'An update to a git repository, emitted by knots.', 161 + key: 'tid', 162 + record: { 163 + type: 'object', 164 + required: [ 165 + 'ref', 166 + 'committerDid', 167 + 'repoDid', 168 + 'repoName', 169 + 'oldSha', 170 + 'newSha', 171 + 'meta', 172 + ], 173 + properties: { 174 + ref: { 175 + type: 'string', 176 + description: 'Ref being updated', 177 + maxGraphemes: 256, 178 + maxLength: 2560, 179 + }, 180 + committerDid: { 181 + type: 'string', 182 + description: 'did of the user that pushed this ref', 183 + format: 'did', 184 + }, 185 + repoDid: { 186 + type: 'string', 187 + description: 'did of the owner of the repo', 188 + format: 'did', 189 + }, 190 + repoName: { 191 + type: 'string', 192 + description: 'name of the repo', 193 + }, 194 + oldSha: { 195 + type: 'string', 196 + description: 'old SHA of this ref', 197 + minLength: 40, 198 + maxLength: 40, 199 + }, 200 + newSha: { 201 + type: 'string', 202 + description: 'new SHA of this ref', 203 + minLength: 40, 204 + maxLength: 40, 205 + }, 206 + meta: { 207 + type: 'ref', 208 + ref: 'lex:sh.tangled.git.refUpdate#meta', 209 + }, 210 + }, 211 + }, 212 + }, 213 + meta: { 214 + type: 'object', 215 + required: ['isDefaultRef', 'commitCount'], 216 + properties: { 217 + isDefaultRef: { 218 + type: 'boolean', 219 + default: false, 220 + }, 221 + langBreakdown: { 222 + type: 'ref', 223 + ref: 'lex:sh.tangled.git.refUpdate#langBreakdown', 224 + }, 225 + commitCount: { 226 + type: 'ref', 227 + ref: 'lex:sh.tangled.git.refUpdate#commitCountBreakdown', 228 + }, 229 + }, 230 + }, 231 + langBreakdown: { 232 + type: 'object', 233 + properties: { 234 + inputs: { 235 + type: 'array', 236 + items: { 237 + type: 'ref', 238 + ref: 'lex:sh.tangled.git.refUpdate#individualLanguageSize', 239 + }, 240 + }, 241 + }, 242 + }, 243 + individualLanguageSize: { 244 + type: 'object', 245 + required: ['lang', 'size'], 246 + properties: { 247 + lang: { 248 + type: 'string', 249 + }, 250 + size: { 251 + type: 'integer', 252 + }, 253 + }, 254 + }, 255 + commitCountBreakdown: { 256 + type: 'object', 257 + required: [], 258 + properties: { 259 + byEmail: { 260 + type: 'array', 261 + items: { 262 + type: 'ref', 263 + ref: 'lex:sh.tangled.git.refUpdate#individualEmailCommitCount', 264 + }, 265 + }, 266 + }, 267 + }, 268 + individualEmailCommitCount: { 269 + type: 'object', 270 + required: ['email', 'count'], 271 + properties: { 272 + email: { 273 + type: 'string', 274 + }, 275 + count: { 276 + type: 'integer', 277 + }, 278 + }, 279 + }, 280 + }, 281 + }, 282 + ShTangledGraphFollow: { 283 + lexicon: 1, 284 + id: 'sh.tangled.graph.follow', 285 + needsCbor: true, 286 + needsType: true, 287 + defs: { 288 + main: { 289 + type: 'record', 290 + key: 'tid', 291 + record: { 292 + type: 'object', 293 + required: ['subject', 'createdAt'], 294 + properties: { 295 + subject: { 296 + type: 'string', 297 + format: 'did', 298 + }, 299 + createdAt: { 300 + type: 'string', 301 + format: 'datetime', 302 + }, 303 + }, 304 + }, 305 + }, 306 + }, 307 + }, 308 + ShTangledRepoIssueStateClosed: { 309 + lexicon: 1, 310 + id: 'sh.tangled.repo.issue.state.closed', 311 + needsCbor: true, 312 + needsType: true, 313 + defs: { 314 + main: { 315 + type: 'token', 316 + description: 'closed issue', 317 + }, 318 + }, 319 + }, 320 + ShTangledRepoIssueComment: { 321 + lexicon: 1, 322 + id: 'sh.tangled.repo.issue.comment', 323 + needsCbor: true, 324 + needsType: true, 325 + defs: { 326 + main: { 327 + type: 'record', 328 + key: 'tid', 329 + record: { 330 + type: 'object', 331 + required: ['issue', 'body', 'createdAt'], 332 + properties: { 333 + issue: { 334 + type: 'string', 335 + format: 'at-uri', 336 + }, 337 + body: { 338 + type: 'string', 339 + }, 340 + createdAt: { 341 + type: 'string', 342 + format: 'datetime', 343 + }, 344 + replyTo: { 345 + type: 'string', 346 + format: 'at-uri', 347 + }, 348 + mentions: { 349 + type: 'array', 350 + items: { 351 + type: 'string', 352 + format: 'did', 353 + }, 354 + }, 355 + references: { 356 + type: 'array', 357 + items: { 358 + type: 'string', 359 + format: 'at-uri', 360 + }, 361 + }, 362 + }, 363 + }, 364 + }, 365 + }, 366 + }, 367 + ShTangledRepoIssue: { 368 + lexicon: 1, 369 + id: 'sh.tangled.repo.issue', 370 + needsCbor: true, 371 + needsType: true, 372 + defs: { 373 + main: { 374 + type: 'record', 375 + key: 'tid', 376 + record: { 377 + type: 'object', 378 + required: ['repo', 'title', 'createdAt'], 379 + properties: { 380 + repo: { 381 + type: 'string', 382 + format: 'at-uri', 383 + }, 384 + title: { 385 + type: 'string', 386 + }, 387 + body: { 388 + type: 'string', 389 + }, 390 + createdAt: { 391 + type: 'string', 392 + format: 'datetime', 393 + }, 394 + mentions: { 395 + type: 'array', 396 + items: { 397 + type: 'string', 398 + format: 'did', 399 + }, 400 + }, 401 + references: { 402 + type: 'array', 403 + items: { 404 + type: 'string', 405 + format: 'at-uri', 406 + }, 407 + }, 408 + }, 409 + }, 410 + }, 411 + }, 412 + }, 413 + ShTangledRepoIssueStateOpen: { 414 + lexicon: 1, 415 + id: 'sh.tangled.repo.issue.state.open', 416 + needsCbor: true, 417 + needsType: true, 418 + defs: { 419 + main: { 420 + type: 'token', 421 + description: 'open issue', 422 + }, 423 + }, 424 + }, 425 + ShTangledRepoIssueState: { 426 + lexicon: 1, 427 + id: 'sh.tangled.repo.issue.state', 428 + needsCbor: true, 429 + needsType: true, 430 + defs: { 431 + main: { 432 + type: 'record', 433 + key: 'tid', 434 + record: { 435 + type: 'object', 436 + required: ['issue', 'state'], 437 + properties: { 438 + issue: { 439 + type: 'string', 440 + format: 'at-uri', 441 + }, 442 + state: { 443 + type: 'string', 444 + description: 'state of the issue', 445 + knownValues: [ 446 + 'sh.tangled.repo.issue.state.open', 447 + 'sh.tangled.repo.issue.state.closed', 448 + ], 449 + default: 'sh.tangled.repo.issue.state.open', 450 + }, 451 + }, 452 + }, 453 + }, 454 + }, 455 + }, 456 + ShTangledKnot: { 457 + lexicon: 1, 458 + id: 'sh.tangled.knot', 459 + needsCbor: true, 460 + needsType: true, 461 + defs: { 462 + main: { 463 + type: 'record', 464 + key: 'any', 465 + record: { 466 + type: 'object', 467 + required: ['createdAt'], 468 + properties: { 469 + createdAt: { 470 + type: 'string', 471 + format: 'datetime', 472 + }, 473 + }, 474 + }, 475 + }, 476 + }, 477 + }, 478 + ShTangledKnotListKeys: { 479 + lexicon: 1, 480 + id: 'sh.tangled.knot.listKeys', 481 + defs: { 482 + main: { 483 + type: 'query', 484 + description: 'List all public keys stored in the knot server', 485 + parameters: { 486 + type: 'params', 487 + properties: { 488 + limit: { 489 + type: 'integer', 490 + description: 'Maximum number of keys to return', 491 + minimum: 1, 492 + maximum: 1000, 493 + default: 100, 494 + }, 495 + cursor: { 496 + type: 'string', 497 + description: 'Pagination cursor', 498 + }, 499 + }, 500 + }, 501 + output: { 502 + encoding: 'application/json', 503 + schema: { 504 + type: 'object', 505 + required: ['keys'], 506 + properties: { 507 + keys: { 508 + type: 'array', 509 + items: { 510 + type: 'ref', 511 + ref: 'lex:sh.tangled.knot.listKeys#publicKey', 512 + }, 513 + }, 514 + cursor: { 515 + type: 'string', 516 + description: 'Pagination cursor for next page', 517 + }, 518 + }, 519 + }, 520 + }, 521 + errors: [ 522 + { 523 + name: 'InternalServerError', 524 + description: 'Failed to retrieve public keys', 525 + }, 526 + ], 527 + }, 528 + publicKey: { 529 + type: 'object', 530 + required: ['did', 'key', 'createdAt'], 531 + properties: { 532 + did: { 533 + type: 'string', 534 + format: 'did', 535 + description: 'DID associated with the public key', 536 + }, 537 + key: { 538 + type: 'string', 539 + maxLength: 4096, 540 + description: 'Public key contents', 541 + }, 542 + createdAt: { 543 + type: 'string', 544 + format: 'datetime', 545 + description: 'Key upload timestamp', 546 + }, 547 + }, 548 + }, 549 + }, 550 + }, 551 + ShTangledKnotMember: { 552 + lexicon: 1, 553 + id: 'sh.tangled.knot.member', 554 + needsCbor: true, 555 + needsType: true, 556 + defs: { 557 + main: { 558 + type: 'record', 559 + key: 'tid', 560 + record: { 561 + type: 'object', 562 + required: ['subject', 'domain', 'createdAt'], 563 + properties: { 564 + subject: { 565 + type: 'string', 566 + format: 'did', 567 + }, 568 + domain: { 569 + type: 'string', 570 + description: 'domain that this member now belongs to', 571 + }, 572 + createdAt: { 573 + type: 'string', 574 + format: 'datetime', 575 + }, 576 + }, 577 + }, 578 + }, 579 + }, 580 + }, 581 + ShTangledKnotVersion: { 582 + lexicon: 1, 583 + id: 'sh.tangled.knot.version', 584 + defs: { 585 + main: { 586 + type: 'query', 587 + description: 'Get the version of a knot', 588 + output: { 589 + encoding: 'application/json', 590 + schema: { 591 + type: 'object', 592 + required: ['version'], 593 + properties: { 594 + version: { 595 + type: 'string', 596 + }, 597 + }, 598 + }, 599 + }, 600 + errors: [], 601 + }, 602 + }, 603 + }, 604 + ShTangledLabelDefinition: { 605 + lexicon: 1, 606 + id: 'sh.tangled.label.definition', 607 + needsCbor: true, 608 + needsType: true, 609 + defs: { 610 + main: { 611 + type: 'record', 612 + key: 'any', 613 + record: { 614 + type: 'object', 615 + required: ['name', 'valueType', 'scope', 'createdAt'], 616 + properties: { 617 + name: { 618 + type: 'string', 619 + description: 'The display name of this label.', 620 + minGraphemes: 1, 621 + maxGraphemes: 40, 622 + }, 623 + valueType: { 624 + type: 'ref', 625 + ref: 'lex:sh.tangled.label.definition#valueType', 626 + description: 627 + 'The type definition of this label. Appviews may allow sorting for certain types.', 628 + }, 629 + scope: { 630 + type: 'array', 631 + description: 632 + 'The areas of the repo this label may apply to, eg.: sh.tangled.repo.issue. Appviews may choose to respect this.', 633 + items: { 634 + type: 'string', 635 + format: 'nsid', 636 + }, 637 + }, 638 + color: { 639 + type: 'string', 640 + description: 641 + 'The hex value for the background color for the label. Appviews may choose to respect this.', 642 + }, 643 + createdAt: { 644 + type: 'string', 645 + format: 'datetime', 646 + }, 647 + multiple: { 648 + type: 'boolean', 649 + description: 650 + 'Whether this label can be repeated for a given entity, eg.: [reviewer:foo, reviewer:bar]', 651 + }, 652 + }, 653 + }, 654 + }, 655 + valueType: { 656 + type: 'object', 657 + required: ['type', 'format'], 658 + properties: { 659 + type: { 660 + type: 'string', 661 + enum: ['null', 'boolean', 'integer', 'string'], 662 + description: "The concrete type of this label's value.", 663 + }, 664 + format: { 665 + type: 'string', 666 + enum: ['any', 'did', 'nsid'], 667 + description: 668 + 'An optional constraint that can be applied on string concrete types.', 669 + }, 670 + enum: { 671 + type: 'array', 672 + description: 'Closed set of values that this label can take.', 673 + items: { 674 + type: 'string', 675 + }, 676 + }, 677 + }, 678 + }, 679 + }, 680 + }, 681 + ShTangledLabelOp: { 682 + lexicon: 1, 683 + id: 'sh.tangled.label.op', 684 + needsCbor: true, 685 + needsType: true, 686 + defs: { 687 + main: { 688 + type: 'record', 689 + key: 'tid', 690 + record: { 691 + type: 'object', 692 + required: ['subject', 'add', 'delete', 'performedAt'], 693 + properties: { 694 + subject: { 695 + type: 'string', 696 + format: 'at-uri', 697 + description: 698 + 'The subject (task, pull or discussion) of this label. Appviews may apply a `scope` check and refuse this op.', 699 + }, 700 + performedAt: { 701 + type: 'string', 702 + format: 'datetime', 703 + }, 704 + add: { 705 + type: 'array', 706 + items: { 707 + type: 'ref', 708 + ref: 'lex:sh.tangled.label.op#operand', 709 + }, 710 + }, 711 + delete: { 712 + type: 'array', 713 + items: { 714 + type: 'ref', 715 + ref: 'lex:sh.tangled.label.op#operand', 716 + }, 717 + }, 718 + }, 719 + }, 720 + }, 721 + operand: { 722 + type: 'object', 723 + required: ['key', 'value'], 724 + properties: { 725 + key: { 726 + type: 'string', 727 + format: 'at-uri', 728 + description: 'ATURI to the label definition', 729 + }, 730 + value: { 731 + type: 'string', 732 + description: 733 + 'Stringified value of the label. This is first unstringed by appviews and then interpreted as a concrete value.', 734 + }, 735 + }, 736 + }, 737 + }, 738 + }, 739 + ShTangledPipelineCancelPipeline: { 740 + lexicon: 1, 741 + id: 'sh.tangled.pipeline.cancelPipeline', 742 + defs: { 743 + main: { 744 + type: 'procedure', 745 + description: 'Cancel a running pipeline', 746 + input: { 747 + encoding: 'application/json', 748 + schema: { 749 + type: 'object', 750 + required: ['repo', 'pipeline', 'workflow'], 751 + properties: { 752 + repo: { 753 + type: 'string', 754 + format: 'at-uri', 755 + description: 756 + "repo at-uri, spindle can't resolve repo from pipeline at-uri yet", 757 + }, 758 + pipeline: { 759 + type: 'string', 760 + format: 'at-uri', 761 + description: 'pipeline at-uri', 762 + }, 763 + workflow: { 764 + type: 'string', 765 + description: 'workflow name', 766 + }, 767 + }, 768 + }, 769 + }, 770 + }, 771 + }, 772 + }, 773 + ShTangledPipeline: { 774 + lexicon: 1, 775 + id: 'sh.tangled.pipeline', 776 + needsCbor: true, 777 + needsType: true, 778 + defs: { 779 + main: { 780 + type: 'record', 781 + key: 'tid', 782 + record: { 783 + type: 'object', 784 + required: ['triggerMetadata', 'workflows'], 785 + properties: { 786 + triggerMetadata: { 787 + type: 'ref', 788 + ref: 'lex:sh.tangled.pipeline#triggerMetadata', 789 + }, 790 + workflows: { 791 + type: 'array', 792 + items: { 793 + type: 'ref', 794 + ref: 'lex:sh.tangled.pipeline#workflow', 795 + }, 796 + }, 797 + }, 798 + }, 799 + }, 800 + triggerMetadata: { 801 + type: 'object', 802 + required: ['kind', 'repo'], 803 + properties: { 804 + kind: { 805 + type: 'string', 806 + enum: ['push', 'pull_request', 'manual'], 807 + }, 808 + repo: { 809 + type: 'ref', 810 + ref: 'lex:sh.tangled.pipeline#triggerRepo', 811 + }, 812 + push: { 813 + type: 'ref', 814 + ref: 'lex:sh.tangled.pipeline#pushTriggerData', 815 + }, 816 + pullRequest: { 817 + type: 'ref', 818 + ref: 'lex:sh.tangled.pipeline#pullRequestTriggerData', 819 + }, 820 + manual: { 821 + type: 'ref', 822 + ref: 'lex:sh.tangled.pipeline#manualTriggerData', 823 + }, 824 + }, 825 + }, 826 + triggerRepo: { 827 + type: 'object', 828 + required: ['knot', 'did', 'repo', 'defaultBranch'], 829 + properties: { 830 + knot: { 831 + type: 'string', 832 + }, 833 + did: { 834 + type: 'string', 835 + format: 'did', 836 + }, 837 + repo: { 838 + type: 'string', 839 + }, 840 + defaultBranch: { 841 + type: 'string', 842 + }, 843 + }, 844 + }, 845 + pushTriggerData: { 846 + type: 'object', 847 + required: ['ref', 'newSha', 'oldSha'], 848 + properties: { 849 + ref: { 850 + type: 'string', 851 + }, 852 + newSha: { 853 + type: 'string', 854 + minLength: 40, 855 + maxLength: 40, 856 + }, 857 + oldSha: { 858 + type: 'string', 859 + minLength: 40, 860 + maxLength: 40, 861 + }, 862 + }, 863 + }, 864 + pullRequestTriggerData: { 865 + type: 'object', 866 + required: ['sourceBranch', 'targetBranch', 'sourceSha', 'action'], 867 + properties: { 868 + sourceBranch: { 869 + type: 'string', 870 + }, 871 + targetBranch: { 872 + type: 'string', 873 + }, 874 + sourceSha: { 875 + type: 'string', 876 + minLength: 40, 877 + maxLength: 40, 878 + }, 879 + action: { 880 + type: 'string', 881 + }, 882 + }, 883 + }, 884 + manualTriggerData: { 885 + type: 'object', 886 + properties: { 887 + inputs: { 888 + type: 'array', 889 + items: { 890 + type: 'ref', 891 + ref: 'lex:sh.tangled.pipeline#pair', 892 + }, 893 + }, 894 + }, 895 + }, 896 + workflow: { 897 + type: 'object', 898 + required: ['name', 'engine', 'clone', 'raw'], 899 + properties: { 900 + name: { 901 + type: 'string', 902 + }, 903 + engine: { 904 + type: 'string', 905 + }, 906 + clone: { 907 + type: 'ref', 908 + ref: 'lex:sh.tangled.pipeline#cloneOpts', 909 + }, 910 + raw: { 911 + type: 'string', 912 + }, 913 + }, 914 + }, 915 + cloneOpts: { 916 + type: 'object', 917 + required: ['skip', 'depth', 'submodules'], 918 + properties: { 919 + skip: { 920 + type: 'boolean', 921 + }, 922 + depth: { 923 + type: 'integer', 924 + }, 925 + submodules: { 926 + type: 'boolean', 927 + }, 928 + }, 929 + }, 930 + pair: { 931 + type: 'object', 932 + required: ['key', 'value'], 933 + properties: { 934 + key: { 935 + type: 'string', 936 + }, 937 + value: { 938 + type: 'string', 939 + }, 940 + }, 941 + }, 942 + }, 943 + }, 944 + ShTangledPipelineStatus: { 945 + lexicon: 1, 946 + id: 'sh.tangled.pipeline.status', 947 + needsCbor: true, 948 + needsType: true, 949 + defs: { 950 + main: { 951 + type: 'record', 952 + key: 'tid', 953 + record: { 954 + type: 'object', 955 + required: ['pipeline', 'workflow', 'status', 'createdAt'], 956 + properties: { 957 + pipeline: { 958 + type: 'string', 959 + format: 'at-uri', 960 + description: 'ATURI of the pipeline', 961 + }, 962 + workflow: { 963 + type: 'string', 964 + format: 'at-uri', 965 + description: 'name of the workflow within this pipeline', 966 + }, 967 + status: { 968 + type: 'string', 969 + description: 'status of the workflow', 970 + enum: [ 971 + 'pending', 972 + 'running', 973 + 'failed', 974 + 'timeout', 975 + 'cancelled', 976 + 'success', 977 + ], 978 + }, 979 + createdAt: { 980 + type: 'string', 981 + format: 'datetime', 982 + description: 'time of creation of this status update', 983 + }, 984 + error: { 985 + type: 'string', 986 + description: 'error message if failed', 987 + }, 988 + exitCode: { 989 + type: 'integer', 990 + description: 'exit code if failed', 991 + }, 992 + }, 993 + }, 994 + }, 995 + }, 996 + }, 997 + ShTangledRepoPullStatusClosed: { 998 + lexicon: 1, 999 + id: 'sh.tangled.repo.pull.status.closed', 1000 + needsCbor: true, 1001 + needsType: true, 1002 + defs: { 1003 + main: { 1004 + type: 'token', 1005 + description: 'closed pull request', 1006 + }, 1007 + }, 1008 + }, 1009 + ShTangledRepoPullComment: { 1010 + lexicon: 1, 1011 + id: 'sh.tangled.repo.pull.comment', 1012 + needsCbor: true, 1013 + needsType: true, 1014 + defs: { 1015 + main: { 1016 + type: 'record', 1017 + key: 'tid', 1018 + record: { 1019 + type: 'object', 1020 + required: ['pull', 'body', 'createdAt'], 1021 + properties: { 1022 + pull: { 1023 + type: 'string', 1024 + format: 'at-uri', 1025 + }, 1026 + body: { 1027 + type: 'string', 1028 + }, 1029 + createdAt: { 1030 + type: 'string', 1031 + format: 'datetime', 1032 + }, 1033 + mentions: { 1034 + type: 'array', 1035 + items: { 1036 + type: 'string', 1037 + format: 'did', 1038 + }, 1039 + }, 1040 + references: { 1041 + type: 'array', 1042 + items: { 1043 + type: 'string', 1044 + format: 'at-uri', 1045 + }, 1046 + }, 1047 + }, 1048 + }, 1049 + }, 1050 + }, 1051 + }, 1052 + ShTangledRepoPullStatusMerged: { 1053 + lexicon: 1, 1054 + id: 'sh.tangled.repo.pull.status.merged', 1055 + needsCbor: true, 1056 + needsType: true, 1057 + defs: { 1058 + main: { 1059 + type: 'token', 1060 + description: 'merged pull request', 1061 + }, 1062 + }, 1063 + }, 1064 + ShTangledRepoPullStatusOpen: { 1065 + lexicon: 1, 1066 + id: 'sh.tangled.repo.pull.status.open', 1067 + needsCbor: true, 1068 + needsType: true, 1069 + defs: { 1070 + main: { 1071 + type: 'token', 1072 + description: 'open pull request', 1073 + }, 1074 + }, 1075 + }, 1076 + ShTangledRepoPull: { 1077 + lexicon: 1, 1078 + id: 'sh.tangled.repo.pull', 1079 + needsCbor: true, 1080 + needsType: true, 1081 + defs: { 1082 + main: { 1083 + type: 'record', 1084 + key: 'tid', 1085 + record: { 1086 + type: 'object', 1087 + required: ['target', 'title', 'patchBlob', 'createdAt'], 1088 + properties: { 1089 + target: { 1090 + type: 'ref', 1091 + ref: 'lex:sh.tangled.repo.pull#target', 1092 + }, 1093 + title: { 1094 + type: 'string', 1095 + }, 1096 + body: { 1097 + type: 'string', 1098 + }, 1099 + patch: { 1100 + type: 'string', 1101 + description: '(deprecated) use patchBlob instead', 1102 + }, 1103 + patchBlob: { 1104 + type: 'blob', 1105 + accept: ['text/x-patch'], 1106 + description: 'patch content', 1107 + }, 1108 + source: { 1109 + type: 'ref', 1110 + ref: 'lex:sh.tangled.repo.pull#source', 1111 + }, 1112 + createdAt: { 1113 + type: 'string', 1114 + format: 'datetime', 1115 + }, 1116 + mentions: { 1117 + type: 'array', 1118 + items: { 1119 + type: 'string', 1120 + format: 'did', 1121 + }, 1122 + }, 1123 + references: { 1124 + type: 'array', 1125 + items: { 1126 + type: 'string', 1127 + format: 'at-uri', 1128 + }, 1129 + }, 1130 + }, 1131 + }, 1132 + }, 1133 + target: { 1134 + type: 'object', 1135 + required: ['repo', 'branch'], 1136 + properties: { 1137 + repo: { 1138 + type: 'string', 1139 + format: 'at-uri', 1140 + }, 1141 + branch: { 1142 + type: 'string', 1143 + }, 1144 + }, 1145 + }, 1146 + source: { 1147 + type: 'object', 1148 + required: ['branch', 'sha'], 1149 + properties: { 1150 + branch: { 1151 + type: 'string', 1152 + }, 1153 + sha: { 1154 + type: 'string', 1155 + minLength: 40, 1156 + maxLength: 40, 1157 + }, 1158 + repo: { 1159 + type: 'string', 1160 + format: 'at-uri', 1161 + }, 1162 + }, 1163 + }, 1164 + }, 1165 + }, 1166 + ShTangledRepoPullStatus: { 1167 + lexicon: 1, 1168 + id: 'sh.tangled.repo.pull.status', 1169 + needsCbor: true, 1170 + needsType: true, 1171 + defs: { 1172 + main: { 1173 + type: 'record', 1174 + key: 'tid', 1175 + record: { 1176 + type: 'object', 1177 + required: ['pull', 'status'], 1178 + properties: { 1179 + pull: { 1180 + type: 'string', 1181 + format: 'at-uri', 1182 + }, 1183 + status: { 1184 + type: 'string', 1185 + description: 'status of the pull request', 1186 + knownValues: [ 1187 + 'sh.tangled.repo.pull.status.open', 1188 + 'sh.tangled.repo.pull.status.closed', 1189 + 'sh.tangled.repo.pull.status.merged', 1190 + ], 1191 + default: 'sh.tangled.repo.pull.status.open', 1192 + }, 1193 + }, 1194 + }, 1195 + }, 1196 + }, 1197 + }, 1198 + ShTangledRepoAddSecret: { 1199 + lexicon: 1, 1200 + id: 'sh.tangled.repo.addSecret', 1201 + defs: { 1202 + main: { 1203 + type: 'procedure', 1204 + description: 'Add a CI secret', 1205 + input: { 1206 + encoding: 'application/json', 1207 + schema: { 1208 + type: 'object', 1209 + required: ['repo', 'key', 'value'], 1210 + properties: { 1211 + repo: { 1212 + type: 'string', 1213 + format: 'at-uri', 1214 + }, 1215 + key: { 1216 + type: 'string', 1217 + maxLength: 50, 1218 + minLength: 1, 1219 + }, 1220 + value: { 1221 + type: 'string', 1222 + maxLength: 200, 1223 + minLength: 1, 1224 + }, 1225 + }, 1226 + }, 1227 + }, 1228 + }, 1229 + }, 1230 + }, 1231 + ShTangledRepoArchive: { 1232 + lexicon: 1, 1233 + id: 'sh.tangled.repo.archive', 1234 + defs: { 1235 + main: { 1236 + type: 'query', 1237 + parameters: { 1238 + type: 'params', 1239 + required: ['repo', 'ref'], 1240 + properties: { 1241 + repo: { 1242 + type: 'string', 1243 + description: 1244 + "Repository identifier in format 'did:plc:.../repoName'", 1245 + }, 1246 + ref: { 1247 + type: 'string', 1248 + description: 'Git reference (branch, tag, or commit SHA)', 1249 + }, 1250 + format: { 1251 + type: 'string', 1252 + description: 'Archive format', 1253 + enum: ['tar', 'zip', 'tar.gz', 'tar.bz2', 'tar.xz'], 1254 + default: 'tar.gz', 1255 + }, 1256 + prefix: { 1257 + type: 'string', 1258 + description: 'Prefix for files in the archive', 1259 + }, 1260 + }, 1261 + }, 1262 + output: { 1263 + encoding: '*/*', 1264 + description: 'Binary archive data', 1265 + }, 1266 + errors: [ 1267 + { 1268 + name: 'RepoNotFound', 1269 + description: 'Repository not found or access denied', 1270 + }, 1271 + { 1272 + name: 'RefNotFound', 1273 + description: 'Git reference not found', 1274 + }, 1275 + { 1276 + name: 'InvalidRequest', 1277 + description: 'Invalid request parameters', 1278 + }, 1279 + { 1280 + name: 'ArchiveError', 1281 + description: 'Failed to create archive', 1282 + }, 1283 + ], 1284 + }, 1285 + }, 1286 + }, 1287 + ShTangledRepoArtifact: { 1288 + lexicon: 1, 1289 + id: 'sh.tangled.repo.artifact', 1290 + needsCbor: true, 1291 + needsType: true, 1292 + defs: { 1293 + main: { 1294 + type: 'record', 1295 + key: 'tid', 1296 + record: { 1297 + type: 'object', 1298 + required: ['name', 'repo', 'tag', 'createdAt', 'artifact'], 1299 + properties: { 1300 + name: { 1301 + type: 'string', 1302 + description: 'name of the artifact', 1303 + }, 1304 + repo: { 1305 + type: 'string', 1306 + format: 'at-uri', 1307 + description: 'repo that this artifact is being uploaded to', 1308 + }, 1309 + tag: { 1310 + type: 'bytes', 1311 + description: 1312 + 'hash of the tag object that this artifact is attached to (only annotated tags are supported)', 1313 + minLength: 20, 1314 + maxLength: 20, 1315 + }, 1316 + createdAt: { 1317 + type: 'string', 1318 + format: 'datetime', 1319 + description: 'time of creation of this artifact', 1320 + }, 1321 + artifact: { 1322 + type: 'blob', 1323 + description: 'the artifact', 1324 + accept: ['*/*'], 1325 + maxSize: 52428800, 1326 + }, 1327 + }, 1328 + }, 1329 + }, 1330 + }, 1331 + }, 1332 + ShTangledRepoBlob: { 1333 + lexicon: 1, 1334 + id: 'sh.tangled.repo.blob', 1335 + defs: { 1336 + main: { 1337 + type: 'query', 1338 + parameters: { 1339 + type: 'params', 1340 + required: ['repo', 'ref', 'path'], 1341 + properties: { 1342 + repo: { 1343 + type: 'string', 1344 + description: 1345 + "Repository identifier in format 'did:plc:.../repoName'", 1346 + }, 1347 + ref: { 1348 + type: 'string', 1349 + description: 'Git reference (branch, tag, or commit SHA)', 1350 + }, 1351 + path: { 1352 + type: 'string', 1353 + description: 'Path to the file within the repository', 1354 + }, 1355 + raw: { 1356 + type: 'boolean', 1357 + description: 'Return raw file content instead of JSON response', 1358 + default: false, 1359 + }, 1360 + }, 1361 + }, 1362 + output: { 1363 + encoding: 'application/json', 1364 + schema: { 1365 + type: 'object', 1366 + required: ['ref', 'path'], 1367 + properties: { 1368 + ref: { 1369 + type: 'string', 1370 + description: 'The git reference used', 1371 + }, 1372 + path: { 1373 + type: 'string', 1374 + description: 'The file path', 1375 + }, 1376 + content: { 1377 + type: 'string', 1378 + description: 'File content (base64 encoded for binary files)', 1379 + }, 1380 + encoding: { 1381 + type: 'string', 1382 + description: 'Content encoding', 1383 + enum: ['utf-8', 'base64'], 1384 + }, 1385 + size: { 1386 + type: 'integer', 1387 + description: 'File size in bytes', 1388 + }, 1389 + isBinary: { 1390 + type: 'boolean', 1391 + description: 'Whether the file is binary', 1392 + }, 1393 + mimeType: { 1394 + type: 'string', 1395 + description: 'MIME type of the file', 1396 + }, 1397 + submodule: { 1398 + type: 'ref', 1399 + ref: 'lex:sh.tangled.repo.blob#submodule', 1400 + description: 'Submodule information if path is a submodule', 1401 + }, 1402 + lastCommit: { 1403 + type: 'ref', 1404 + ref: 'lex:sh.tangled.repo.blob#lastCommit', 1405 + }, 1406 + }, 1407 + }, 1408 + }, 1409 + errors: [ 1410 + { 1411 + name: 'RepoNotFound', 1412 + description: 'Repository not found or access denied', 1413 + }, 1414 + { 1415 + name: 'RefNotFound', 1416 + description: 'Git reference not found', 1417 + }, 1418 + { 1419 + name: 'FileNotFound', 1420 + description: 'File not found at the specified path', 1421 + }, 1422 + { 1423 + name: 'InvalidRequest', 1424 + description: 'Invalid request parameters', 1425 + }, 1426 + ], 1427 + }, 1428 + lastCommit: { 1429 + type: 'object', 1430 + required: ['hash', 'message', 'when'], 1431 + properties: { 1432 + hash: { 1433 + type: 'string', 1434 + description: 'Commit hash', 1435 + }, 1436 + message: { 1437 + type: 'string', 1438 + description: 'Commit message', 1439 + }, 1440 + author: { 1441 + type: 'ref', 1442 + ref: 'lex:sh.tangled.repo.blob#signature', 1443 + }, 1444 + when: { 1445 + type: 'string', 1446 + format: 'datetime', 1447 + description: 'Commit timestamp', 1448 + }, 1449 + }, 1450 + }, 1451 + signature: { 1452 + type: 'object', 1453 + required: ['name', 'email', 'when'], 1454 + properties: { 1455 + name: { 1456 + type: 'string', 1457 + description: 'Author name', 1458 + }, 1459 + email: { 1460 + type: 'string', 1461 + description: 'Author email', 1462 + }, 1463 + when: { 1464 + type: 'string', 1465 + format: 'datetime', 1466 + description: 'Author timestamp', 1467 + }, 1468 + }, 1469 + }, 1470 + submodule: { 1471 + type: 'object', 1472 + required: ['name', 'url'], 1473 + properties: { 1474 + name: { 1475 + type: 'string', 1476 + description: 'Submodule name', 1477 + }, 1478 + url: { 1479 + type: 'string', 1480 + description: 'Submodule repository URL', 1481 + }, 1482 + branch: { 1483 + type: 'string', 1484 + description: 'Branch to track in the submodule', 1485 + }, 1486 + }, 1487 + }, 1488 + }, 1489 + }, 1490 + ShTangledRepoBranch: { 1491 + lexicon: 1, 1492 + id: 'sh.tangled.repo.branch', 1493 + defs: { 1494 + main: { 1495 + type: 'query', 1496 + parameters: { 1497 + type: 'params', 1498 + required: ['repo', 'name'], 1499 + properties: { 1500 + repo: { 1501 + type: 'string', 1502 + description: 1503 + "Repository identifier in format 'did:plc:.../repoName'", 1504 + }, 1505 + name: { 1506 + type: 'string', 1507 + description: 'Branch name to get information for', 1508 + }, 1509 + }, 1510 + }, 1511 + output: { 1512 + encoding: 'application/json', 1513 + schema: { 1514 + type: 'object', 1515 + required: ['name', 'hash', 'when'], 1516 + properties: { 1517 + name: { 1518 + type: 'string', 1519 + description: 'Branch name', 1520 + }, 1521 + hash: { 1522 + type: 'string', 1523 + description: 'Latest commit hash on this branch', 1524 + }, 1525 + shortHash: { 1526 + type: 'string', 1527 + description: 'Short commit hash', 1528 + }, 1529 + when: { 1530 + type: 'string', 1531 + format: 'datetime', 1532 + description: 'Timestamp of latest commit', 1533 + }, 1534 + message: { 1535 + type: 'string', 1536 + description: 'Latest commit message', 1537 + }, 1538 + author: { 1539 + type: 'ref', 1540 + ref: 'lex:sh.tangled.repo.branch#signature', 1541 + }, 1542 + isDefault: { 1543 + type: 'boolean', 1544 + description: 'Whether this is the default branch', 1545 + }, 1546 + }, 1547 + }, 1548 + }, 1549 + errors: [ 1550 + { 1551 + name: 'RepoNotFound', 1552 + description: 'Repository not found or access denied', 1553 + }, 1554 + { 1555 + name: 'BranchNotFound', 1556 + description: 'Branch not found', 1557 + }, 1558 + { 1559 + name: 'InvalidRequest', 1560 + description: 'Invalid request parameters', 1561 + }, 1562 + ], 1563 + }, 1564 + signature: { 1565 + type: 'object', 1566 + required: ['name', 'email', 'when'], 1567 + properties: { 1568 + name: { 1569 + type: 'string', 1570 + description: 'Author name', 1571 + }, 1572 + email: { 1573 + type: 'string', 1574 + description: 'Author email', 1575 + }, 1576 + when: { 1577 + type: 'string', 1578 + format: 'datetime', 1579 + description: 'Author timestamp', 1580 + }, 1581 + }, 1582 + }, 1583 + }, 1584 + }, 1585 + ShTangledRepoBranches: { 1586 + lexicon: 1, 1587 + id: 'sh.tangled.repo.branches', 1588 + defs: { 1589 + main: { 1590 + type: 'query', 1591 + parameters: { 1592 + type: 'params', 1593 + required: ['repo'], 1594 + properties: { 1595 + repo: { 1596 + type: 'string', 1597 + description: 1598 + "Repository identifier in format 'did:plc:.../repoName'", 1599 + }, 1600 + limit: { 1601 + type: 'integer', 1602 + description: 'Maximum number of branches to return', 1603 + minimum: 1, 1604 + maximum: 100, 1605 + default: 50, 1606 + }, 1607 + cursor: { 1608 + type: 'string', 1609 + description: 'Pagination cursor', 1610 + }, 1611 + }, 1612 + }, 1613 + output: { 1614 + encoding: '*/*', 1615 + }, 1616 + errors: [ 1617 + { 1618 + name: 'RepoNotFound', 1619 + description: 'Repository not found or access denied', 1620 + }, 1621 + { 1622 + name: 'InvalidRequest', 1623 + description: 'Invalid request parameters', 1624 + }, 1625 + ], 1626 + }, 1627 + }, 1628 + }, 1629 + ShTangledRepoCollaborator: { 1630 + lexicon: 1, 1631 + id: 'sh.tangled.repo.collaborator', 1632 + needsCbor: true, 1633 + needsType: true, 1634 + defs: { 1635 + main: { 1636 + type: 'record', 1637 + key: 'tid', 1638 + record: { 1639 + type: 'object', 1640 + required: ['subject', 'repo', 'createdAt'], 1641 + properties: { 1642 + subject: { 1643 + type: 'string', 1644 + format: 'did', 1645 + }, 1646 + repo: { 1647 + type: 'string', 1648 + description: 'repo to add this user to', 1649 + format: 'at-uri', 1650 + }, 1651 + createdAt: { 1652 + type: 'string', 1653 + format: 'datetime', 1654 + }, 1655 + }, 1656 + }, 1657 + }, 1658 + }, 1659 + }, 1660 + ShTangledRepoCompare: { 1661 + lexicon: 1, 1662 + id: 'sh.tangled.repo.compare', 1663 + defs: { 1664 + main: { 1665 + type: 'query', 1666 + parameters: { 1667 + type: 'params', 1668 + required: ['repo', 'rev1', 'rev2'], 1669 + properties: { 1670 + repo: { 1671 + type: 'string', 1672 + description: 1673 + "Repository identifier in format 'did:plc:.../repoName'", 1674 + }, 1675 + rev1: { 1676 + type: 'string', 1677 + description: 'First revision (commit, branch, or tag)', 1678 + }, 1679 + rev2: { 1680 + type: 'string', 1681 + description: 'Second revision (commit, branch, or tag)', 1682 + }, 1683 + }, 1684 + }, 1685 + output: { 1686 + encoding: '*/*', 1687 + description: 'Compare output in application/json', 1688 + }, 1689 + errors: [ 1690 + { 1691 + name: 'RepoNotFound', 1692 + description: 'Repository not found or access denied', 1693 + }, 1694 + { 1695 + name: 'RevisionNotFound', 1696 + description: 'One or both revisions not found', 1697 + }, 1698 + { 1699 + name: 'InvalidRequest', 1700 + description: 'Invalid request parameters', 1701 + }, 1702 + { 1703 + name: 'CompareError', 1704 + description: 'Failed to compare revisions', 1705 + }, 1706 + ], 1707 + }, 1708 + }, 1709 + }, 1710 + ShTangledRepoCreate: { 1711 + lexicon: 1, 1712 + id: 'sh.tangled.repo.create', 1713 + defs: { 1714 + main: { 1715 + type: 'procedure', 1716 + description: 'Create a new repository', 1717 + input: { 1718 + encoding: 'application/json', 1719 + schema: { 1720 + type: 'object', 1721 + required: ['rkey'], 1722 + properties: { 1723 + rkey: { 1724 + type: 'string', 1725 + description: 'Rkey of the repository record', 1726 + }, 1727 + defaultBranch: { 1728 + type: 'string', 1729 + description: 'Default branch to push to', 1730 + }, 1731 + source: { 1732 + type: 'string', 1733 + description: 1734 + 'A source URL to clone from, populate this when forking or importing a repository.', 1735 + }, 1736 + }, 1737 + }, 1738 + }, 1739 + }, 1740 + }, 1741 + }, 1742 + ShTangledRepoSetDefaultBranch: { 1743 + lexicon: 1, 1744 + id: 'sh.tangled.repo.setDefaultBranch', 1745 + defs: { 1746 + main: { 1747 + type: 'procedure', 1748 + description: 'Set the default branch for a repository', 1749 + input: { 1750 + encoding: 'application/json', 1751 + schema: { 1752 + type: 'object', 1753 + required: ['repo', 'defaultBranch'], 1754 + properties: { 1755 + repo: { 1756 + type: 'string', 1757 + format: 'at-uri', 1758 + }, 1759 + defaultBranch: { 1760 + type: 'string', 1761 + }, 1762 + }, 1763 + }, 1764 + }, 1765 + }, 1766 + }, 1767 + }, 1768 + ShTangledRepoDelete: { 1769 + lexicon: 1, 1770 + id: 'sh.tangled.repo.delete', 1771 + defs: { 1772 + main: { 1773 + type: 'procedure', 1774 + description: 'Delete a repository', 1775 + input: { 1776 + encoding: 'application/json', 1777 + schema: { 1778 + type: 'object', 1779 + required: ['did', 'name', 'rkey'], 1780 + properties: { 1781 + did: { 1782 + type: 'string', 1783 + format: 'did', 1784 + description: 'DID of the repository owner', 1785 + }, 1786 + name: { 1787 + type: 'string', 1788 + description: 'Name of the repository to delete', 1789 + }, 1790 + rkey: { 1791 + type: 'string', 1792 + description: 'Rkey of the repository record', 1793 + }, 1794 + }, 1795 + }, 1796 + }, 1797 + }, 1798 + }, 1799 + }, 1800 + ShTangledRepoDeleteBranch: { 1801 + lexicon: 1, 1802 + id: 'sh.tangled.repo.deleteBranch', 1803 + defs: { 1804 + main: { 1805 + type: 'procedure', 1806 + description: 'Delete a branch on this repository', 1807 + input: { 1808 + encoding: 'application/json', 1809 + schema: { 1810 + type: 'object', 1811 + required: ['repo', 'branch'], 1812 + properties: { 1813 + repo: { 1814 + type: 'string', 1815 + format: 'at-uri', 1816 + }, 1817 + branch: { 1818 + type: 'string', 1819 + }, 1820 + }, 1821 + }, 1822 + }, 1823 + }, 1824 + }, 1825 + }, 1826 + ShTangledRepoDiff: { 1827 + lexicon: 1, 1828 + id: 'sh.tangled.repo.diff', 1829 + defs: { 1830 + main: { 1831 + type: 'query', 1832 + parameters: { 1833 + type: 'params', 1834 + required: ['repo', 'ref'], 1835 + properties: { 1836 + repo: { 1837 + type: 'string', 1838 + description: 1839 + "Repository identifier in format 'did:plc:.../repoName'", 1840 + }, 1841 + ref: { 1842 + type: 'string', 1843 + description: 'Git reference (branch, tag, or commit SHA)', 1844 + }, 1845 + }, 1846 + }, 1847 + output: { 1848 + encoding: '*/*', 1849 + }, 1850 + errors: [ 1851 + { 1852 + name: 'RepoNotFound', 1853 + description: 'Repository not found or access denied', 1854 + }, 1855 + { 1856 + name: 'RefNotFound', 1857 + description: 'Git reference not found', 1858 + }, 1859 + { 1860 + name: 'InvalidRequest', 1861 + description: 'Invalid request parameters', 1862 + }, 1863 + ], 1864 + }, 1865 + }, 1866 + }, 1867 + ShTangledRepoForkStatus: { 1868 + lexicon: 1, 1869 + id: 'sh.tangled.repo.forkStatus', 1870 + defs: { 1871 + main: { 1872 + type: 'procedure', 1873 + description: 'Check fork status relative to upstream source', 1874 + input: { 1875 + encoding: 'application/json', 1876 + schema: { 1877 + type: 'object', 1878 + required: ['did', 'name', 'source', 'branch', 'hiddenRef'], 1879 + properties: { 1880 + did: { 1881 + type: 'string', 1882 + format: 'did', 1883 + description: 'DID of the fork owner', 1884 + }, 1885 + name: { 1886 + type: 'string', 1887 + description: 'Name of the forked repository', 1888 + }, 1889 + source: { 1890 + type: 'string', 1891 + description: 'Source repository URL', 1892 + }, 1893 + branch: { 1894 + type: 'string', 1895 + description: 'Branch to check status for', 1896 + }, 1897 + hiddenRef: { 1898 + type: 'string', 1899 + description: 'Hidden ref to use for comparison', 1900 + }, 1901 + }, 1902 + }, 1903 + }, 1904 + output: { 1905 + encoding: 'application/json', 1906 + schema: { 1907 + type: 'object', 1908 + required: ['status'], 1909 + properties: { 1910 + status: { 1911 + type: 'integer', 1912 + description: 1913 + 'Fork status: 0=UpToDate, 1=FastForwardable, 2=Conflict, 3=MissingBranch', 1914 + }, 1915 + }, 1916 + }, 1917 + }, 1918 + }, 1919 + }, 1920 + }, 1921 + ShTangledRepoForkSync: { 1922 + lexicon: 1, 1923 + id: 'sh.tangled.repo.forkSync', 1924 + defs: { 1925 + main: { 1926 + type: 'procedure', 1927 + description: 'Sync a forked repository with its upstream source', 1928 + input: { 1929 + encoding: 'application/json', 1930 + schema: { 1931 + type: 'object', 1932 + required: ['did', 'source', 'name', 'branch'], 1933 + properties: { 1934 + did: { 1935 + type: 'string', 1936 + format: 'did', 1937 + description: 'DID of the fork owner', 1938 + }, 1939 + source: { 1940 + type: 'string', 1941 + format: 'at-uri', 1942 + description: 'AT-URI of the source repository', 1943 + }, 1944 + name: { 1945 + type: 'string', 1946 + description: 'Name of the forked repository', 1947 + }, 1948 + branch: { 1949 + type: 'string', 1950 + description: 'Branch to sync', 1951 + }, 1952 + }, 1953 + }, 1954 + }, 1955 + }, 1956 + }, 1957 + }, 1958 + ShTangledRepoGetDefaultBranch: { 1959 + lexicon: 1, 1960 + id: 'sh.tangled.repo.getDefaultBranch', 1961 + defs: { 1962 + main: { 1963 + type: 'query', 1964 + parameters: { 1965 + type: 'params', 1966 + required: ['repo'], 1967 + properties: { 1968 + repo: { 1969 + type: 'string', 1970 + description: 1971 + "Repository identifier in format 'did:plc:.../repoName'", 1972 + }, 1973 + }, 1974 + }, 1975 + output: { 1976 + encoding: 'application/json', 1977 + schema: { 1978 + type: 'object', 1979 + required: ['name', 'hash', 'when'], 1980 + properties: { 1981 + name: { 1982 + type: 'string', 1983 + description: 'Default branch name', 1984 + }, 1985 + hash: { 1986 + type: 'string', 1987 + description: 'Latest commit hash on default branch', 1988 + }, 1989 + shortHash: { 1990 + type: 'string', 1991 + description: 'Short commit hash', 1992 + }, 1993 + when: { 1994 + type: 'string', 1995 + format: 'datetime', 1996 + description: 'Timestamp of latest commit', 1997 + }, 1998 + message: { 1999 + type: 'string', 2000 + description: 'Latest commit message', 2001 + }, 2002 + author: { 2003 + type: 'ref', 2004 + ref: 'lex:sh.tangled.repo.getDefaultBranch#signature', 2005 + }, 2006 + }, 2007 + }, 2008 + }, 2009 + errors: [ 2010 + { 2011 + name: 'RepoNotFound', 2012 + description: 'Repository not found or access denied', 2013 + }, 2014 + { 2015 + name: 'InvalidRequest', 2016 + description: 'Invalid request parameters', 2017 + }, 2018 + ], 2019 + }, 2020 + signature: { 2021 + type: 'object', 2022 + required: ['name', 'email', 'when'], 2023 + properties: { 2024 + name: { 2025 + type: 'string', 2026 + description: 'Author name', 2027 + }, 2028 + email: { 2029 + type: 'string', 2030 + description: 'Author email', 2031 + }, 2032 + when: { 2033 + type: 'string', 2034 + format: 'datetime', 2035 + description: 'Author timestamp', 2036 + }, 2037 + }, 2038 + }, 2039 + }, 2040 + }, 2041 + ShTangledRepoHiddenRef: { 2042 + lexicon: 1, 2043 + id: 'sh.tangled.repo.hiddenRef', 2044 + defs: { 2045 + main: { 2046 + type: 'procedure', 2047 + description: 'Create a hidden ref in a repository', 2048 + input: { 2049 + encoding: 'application/json', 2050 + schema: { 2051 + type: 'object', 2052 + required: ['repo', 'forkRef', 'remoteRef'], 2053 + properties: { 2054 + repo: { 2055 + type: 'string', 2056 + format: 'at-uri', 2057 + description: 'AT-URI of the repository', 2058 + }, 2059 + forkRef: { 2060 + type: 'string', 2061 + description: 'Fork reference name', 2062 + }, 2063 + remoteRef: { 2064 + type: 'string', 2065 + description: 'Remote reference name', 2066 + }, 2067 + }, 2068 + }, 2069 + }, 2070 + output: { 2071 + encoding: 'application/json', 2072 + schema: { 2073 + type: 'object', 2074 + required: ['success'], 2075 + properties: { 2076 + success: { 2077 + type: 'boolean', 2078 + description: 'Whether the hidden ref was created successfully', 2079 + }, 2080 + ref: { 2081 + type: 'string', 2082 + description: 'The created hidden ref name', 2083 + }, 2084 + error: { 2085 + type: 'string', 2086 + description: 'Error message if creation failed', 2087 + }, 2088 + }, 2089 + }, 2090 + }, 2091 + }, 2092 + }, 2093 + }, 2094 + ShTangledRepoLanguages: { 2095 + lexicon: 1, 2096 + id: 'sh.tangled.repo.languages', 2097 + defs: { 2098 + main: { 2099 + type: 'query', 2100 + parameters: { 2101 + type: 'params', 2102 + required: ['repo'], 2103 + properties: { 2104 + repo: { 2105 + type: 'string', 2106 + description: 2107 + "Repository identifier in format 'did:plc:.../repoName'", 2108 + }, 2109 + ref: { 2110 + type: 'string', 2111 + description: 'Git reference (branch, tag, or commit SHA)', 2112 + default: 'HEAD', 2113 + }, 2114 + }, 2115 + }, 2116 + output: { 2117 + encoding: 'application/json', 2118 + schema: { 2119 + type: 'object', 2120 + required: ['ref', 'languages'], 2121 + properties: { 2122 + ref: { 2123 + type: 'string', 2124 + description: 'The git reference used', 2125 + }, 2126 + languages: { 2127 + type: 'array', 2128 + items: { 2129 + type: 'ref', 2130 + ref: 'lex:sh.tangled.repo.languages#language', 2131 + }, 2132 + }, 2133 + totalSize: { 2134 + type: 'integer', 2135 + description: 'Total size of all analyzed files in bytes', 2136 + }, 2137 + totalFiles: { 2138 + type: 'integer', 2139 + description: 'Total number of files analyzed', 2140 + }, 2141 + }, 2142 + }, 2143 + }, 2144 + errors: [ 2145 + { 2146 + name: 'RepoNotFound', 2147 + description: 'Repository not found or access denied', 2148 + }, 2149 + { 2150 + name: 'RefNotFound', 2151 + description: 'Git reference not found', 2152 + }, 2153 + { 2154 + name: 'InvalidRequest', 2155 + description: 'Invalid request parameters', 2156 + }, 2157 + ], 2158 + }, 2159 + language: { 2160 + type: 'object', 2161 + required: ['name', 'size', 'percentage'], 2162 + properties: { 2163 + name: { 2164 + type: 'string', 2165 + description: 'Programming language name', 2166 + }, 2167 + size: { 2168 + type: 'integer', 2169 + description: 'Total size of files in this language (bytes)', 2170 + }, 2171 + percentage: { 2172 + type: 'integer', 2173 + description: 'Percentage of total codebase (0-100)', 2174 + }, 2175 + fileCount: { 2176 + type: 'integer', 2177 + description: 'Number of files in this language', 2178 + }, 2179 + color: { 2180 + type: 'string', 2181 + description: 'Hex color code for this language', 2182 + }, 2183 + extensions: { 2184 + type: 'array', 2185 + items: { 2186 + type: 'string', 2187 + }, 2188 + description: 'File extensions associated with this language', 2189 + }, 2190 + }, 2191 + }, 2192 + }, 2193 + }, 2194 + ShTangledRepoListSecrets: { 2195 + lexicon: 1, 2196 + id: 'sh.tangled.repo.listSecrets', 2197 + defs: { 2198 + main: { 2199 + type: 'query', 2200 + parameters: { 2201 + type: 'params', 2202 + required: ['repo'], 2203 + properties: { 2204 + repo: { 2205 + type: 'string', 2206 + format: 'at-uri', 2207 + }, 2208 + }, 2209 + }, 2210 + output: { 2211 + encoding: 'application/json', 2212 + schema: { 2213 + type: 'object', 2214 + required: ['secrets'], 2215 + properties: { 2216 + secrets: { 2217 + type: 'array', 2218 + items: { 2219 + type: 'ref', 2220 + ref: 'lex:sh.tangled.repo.listSecrets#secret', 2221 + }, 2222 + }, 2223 + }, 2224 + }, 2225 + }, 2226 + }, 2227 + secret: { 2228 + type: 'object', 2229 + required: ['repo', 'key', 'createdAt', 'createdBy'], 2230 + properties: { 2231 + repo: { 2232 + type: 'string', 2233 + format: 'at-uri', 2234 + }, 2235 + key: { 2236 + type: 'string', 2237 + maxLength: 50, 2238 + minLength: 1, 2239 + }, 2240 + createdAt: { 2241 + type: 'string', 2242 + format: 'datetime', 2243 + }, 2244 + createdBy: { 2245 + type: 'string', 2246 + format: 'did', 2247 + }, 2248 + }, 2249 + }, 2250 + }, 2251 + }, 2252 + ShTangledRepoLog: { 2253 + lexicon: 1, 2254 + id: 'sh.tangled.repo.log', 2255 + defs: { 2256 + main: { 2257 + type: 'query', 2258 + parameters: { 2259 + type: 'params', 2260 + required: ['repo', 'ref'], 2261 + properties: { 2262 + repo: { 2263 + type: 'string', 2264 + description: 2265 + "Repository identifier in format 'did:plc:.../repoName'", 2266 + }, 2267 + ref: { 2268 + type: 'string', 2269 + description: 'Git reference (branch, tag, or commit SHA)', 2270 + }, 2271 + path: { 2272 + type: 'string', 2273 + description: 'Path to filter commits by', 2274 + default: '', 2275 + }, 2276 + limit: { 2277 + type: 'integer', 2278 + description: 'Maximum number of commits to return', 2279 + minimum: 1, 2280 + maximum: 100, 2281 + default: 50, 2282 + }, 2283 + cursor: { 2284 + type: 'string', 2285 + description: 'Pagination cursor (commit SHA)', 2286 + }, 2287 + }, 2288 + }, 2289 + output: { 2290 + encoding: '*/*', 2291 + }, 2292 + errors: [ 2293 + { 2294 + name: 'RepoNotFound', 2295 + description: 'Repository not found or access denied', 2296 + }, 2297 + { 2298 + name: 'RefNotFound', 2299 + description: 'Git reference not found', 2300 + }, 2301 + { 2302 + name: 'PathNotFound', 2303 + description: 'Path not found in repository', 2304 + }, 2305 + { 2306 + name: 'InvalidRequest', 2307 + description: 'Invalid request parameters', 2308 + }, 2309 + ], 2310 + }, 2311 + }, 2312 + }, 2313 + ShTangledRepoMerge: { 2314 + lexicon: 1, 2315 + id: 'sh.tangled.repo.merge', 2316 + defs: { 2317 + main: { 2318 + type: 'procedure', 2319 + description: 'Merge a patch into a repository branch', 2320 + input: { 2321 + encoding: 'application/json', 2322 + schema: { 2323 + type: 'object', 2324 + required: ['did', 'name', 'patch', 'branch'], 2325 + properties: { 2326 + did: { 2327 + type: 'string', 2328 + format: 'did', 2329 + description: 'DID of the repository owner', 2330 + }, 2331 + name: { 2332 + type: 'string', 2333 + description: 'Name of the repository', 2334 + }, 2335 + patch: { 2336 + type: 'string', 2337 + description: 'Patch content to merge', 2338 + }, 2339 + branch: { 2340 + type: 'string', 2341 + description: 'Target branch to merge into', 2342 + }, 2343 + authorName: { 2344 + type: 'string', 2345 + description: 'Author name for the merge commit', 2346 + }, 2347 + authorEmail: { 2348 + type: 'string', 2349 + description: 'Author email for the merge commit', 2350 + }, 2351 + commitBody: { 2352 + type: 'string', 2353 + description: 'Additional commit message body', 2354 + }, 2355 + commitMessage: { 2356 + type: 'string', 2357 + description: 'Merge commit message', 2358 + }, 2359 + }, 2360 + }, 2361 + }, 2362 + }, 2363 + }, 2364 + }, 2365 + ShTangledRepoMergeCheck: { 2366 + lexicon: 1, 2367 + id: 'sh.tangled.repo.mergeCheck', 2368 + defs: { 2369 + main: { 2370 + type: 'procedure', 2371 + description: 'Check if a merge is possible between two branches', 2372 + input: { 2373 + encoding: 'application/json', 2374 + schema: { 2375 + type: 'object', 2376 + required: ['did', 'name', 'patch', 'branch'], 2377 + properties: { 2378 + did: { 2379 + type: 'string', 2380 + format: 'did', 2381 + description: 'DID of the repository owner', 2382 + }, 2383 + name: { 2384 + type: 'string', 2385 + description: 'Name of the repository', 2386 + }, 2387 + patch: { 2388 + type: 'string', 2389 + description: 2390 + 'Patch or pull request to check for merge conflicts', 2391 + }, 2392 + branch: { 2393 + type: 'string', 2394 + description: 'Target branch to merge into', 2395 + }, 2396 + }, 2397 + }, 2398 + }, 2399 + output: { 2400 + encoding: 'application/json', 2401 + schema: { 2402 + type: 'object', 2403 + required: ['is_conflicted'], 2404 + properties: { 2405 + is_conflicted: { 2406 + type: 'boolean', 2407 + description: 'Whether the merge has conflicts', 2408 + }, 2409 + conflicts: { 2410 + type: 'array', 2411 + description: 'List of files with merge conflicts', 2412 + items: { 2413 + type: 'ref', 2414 + ref: 'lex:sh.tangled.repo.mergeCheck#conflictInfo', 2415 + }, 2416 + }, 2417 + message: { 2418 + type: 'string', 2419 + description: 'Additional message about the merge check', 2420 + }, 2421 + error: { 2422 + type: 'string', 2423 + description: 'Error message if check failed', 2424 + }, 2425 + }, 2426 + }, 2427 + }, 2428 + }, 2429 + conflictInfo: { 2430 + type: 'object', 2431 + required: ['filename', 'reason'], 2432 + properties: { 2433 + filename: { 2434 + type: 'string', 2435 + description: 'Name of the conflicted file', 2436 + }, 2437 + reason: { 2438 + type: 'string', 2439 + description: 'Reason for the conflict', 2440 + }, 2441 + }, 2442 + }, 2443 + }, 2444 + }, 2445 + ShTangledRepoRemoveSecret: { 2446 + lexicon: 1, 2447 + id: 'sh.tangled.repo.removeSecret', 2448 + defs: { 2449 + main: { 2450 + type: 'procedure', 2451 + description: 'Remove a CI secret', 2452 + input: { 2453 + encoding: 'application/json', 2454 + schema: { 2455 + type: 'object', 2456 + required: ['repo', 'key'], 2457 + properties: { 2458 + repo: { 2459 + type: 'string', 2460 + format: 'at-uri', 2461 + }, 2462 + key: { 2463 + type: 'string', 2464 + maxLength: 50, 2465 + minLength: 1, 2466 + }, 2467 + }, 2468 + }, 2469 + }, 2470 + }, 2471 + }, 2472 + }, 2473 + ShTangledRepo: { 2474 + lexicon: 1, 2475 + id: 'sh.tangled.repo', 2476 + needsCbor: true, 2477 + needsType: true, 2478 + defs: { 2479 + main: { 2480 + type: 'record', 2481 + key: 'tid', 2482 + record: { 2483 + type: 'object', 2484 + required: ['name', 'knot', 'createdAt'], 2485 + properties: { 2486 + name: { 2487 + type: 'string', 2488 + description: 'name of the repo', 2489 + }, 2490 + knot: { 2491 + type: 'string', 2492 + description: 'knot where the repo was created', 2493 + }, 2494 + spindle: { 2495 + type: 'string', 2496 + description: 'CI runner to send jobs to and receive results from', 2497 + }, 2498 + description: { 2499 + type: 'string', 2500 + minGraphemes: 1, 2501 + maxGraphemes: 140, 2502 + }, 2503 + website: { 2504 + type: 'string', 2505 + format: 'uri', 2506 + description: 'Any URI related to the repo', 2507 + }, 2508 + topics: { 2509 + type: 'array', 2510 + description: 'Topics related to the repo', 2511 + items: { 2512 + type: 'string', 2513 + minLength: 1, 2514 + maxLength: 50, 2515 + }, 2516 + maxLength: 50, 2517 + }, 2518 + source: { 2519 + type: 'string', 2520 + format: 'uri', 2521 + description: 'source of the repo', 2522 + }, 2523 + labels: { 2524 + type: 'array', 2525 + description: 'List of labels that this repo subscribes to', 2526 + items: { 2527 + type: 'string', 2528 + format: 'at-uri', 2529 + }, 2530 + }, 2531 + createdAt: { 2532 + type: 'string', 2533 + format: 'datetime', 2534 + }, 2535 + }, 2536 + }, 2537 + }, 2538 + }, 2539 + }, 2540 + ShTangledRepoTag: { 2541 + lexicon: 1, 2542 + id: 'sh.tangled.repo.tag', 2543 + defs: { 2544 + main: { 2545 + type: 'query', 2546 + parameters: { 2547 + type: 'params', 2548 + required: ['repo', 'tag'], 2549 + properties: { 2550 + repo: { 2551 + type: 'string', 2552 + description: 2553 + "Repository identifier in format 'did:plc:.../repoName'", 2554 + }, 2555 + tag: { 2556 + type: 'string', 2557 + description: 'Name of tag, such as v1.3.0', 2558 + }, 2559 + }, 2560 + }, 2561 + output: { 2562 + encoding: '*/*', 2563 + }, 2564 + errors: [ 2565 + { 2566 + name: 'RepoNotFound', 2567 + description: 'Repository not found or access denied', 2568 + }, 2569 + { 2570 + name: 'TagNotFound', 2571 + description: 'Tag not found', 2572 + }, 2573 + { 2574 + name: 'InvalidRequest', 2575 + description: 'Invalid request parameters', 2576 + }, 2577 + ], 2578 + }, 2579 + }, 2580 + }, 2581 + ShTangledRepoTags: { 2582 + lexicon: 1, 2583 + id: 'sh.tangled.repo.tags', 2584 + defs: { 2585 + main: { 2586 + type: 'query', 2587 + parameters: { 2588 + type: 'params', 2589 + required: ['repo'], 2590 + properties: { 2591 + repo: { 2592 + type: 'string', 2593 + description: 2594 + "Repository identifier in format 'did:plc:.../repoName'", 2595 + }, 2596 + limit: { 2597 + type: 'integer', 2598 + description: 'Maximum number of tags to return', 2599 + minimum: 1, 2600 + maximum: 100, 2601 + default: 50, 2602 + }, 2603 + cursor: { 2604 + type: 'string', 2605 + description: 'Pagination cursor', 2606 + }, 2607 + }, 2608 + }, 2609 + output: { 2610 + encoding: '*/*', 2611 + }, 2612 + errors: [ 2613 + { 2614 + name: 'RepoNotFound', 2615 + description: 'Repository not found or access denied', 2616 + }, 2617 + { 2618 + name: 'InvalidRequest', 2619 + description: 'Invalid request parameters', 2620 + }, 2621 + ], 2622 + }, 2623 + }, 2624 + }, 2625 + ShTangledRepoTree: { 2626 + lexicon: 1, 2627 + id: 'sh.tangled.repo.tree', 2628 + defs: { 2629 + main: { 2630 + type: 'query', 2631 + parameters: { 2632 + type: 'params', 2633 + required: ['repo', 'ref'], 2634 + properties: { 2635 + repo: { 2636 + type: 'string', 2637 + description: 2638 + "Repository identifier in format 'did:plc:.../repoName'", 2639 + }, 2640 + ref: { 2641 + type: 'string', 2642 + description: 'Git reference (branch, tag, or commit SHA)', 2643 + }, 2644 + path: { 2645 + type: 'string', 2646 + description: 'Path within the repository tree', 2647 + default: '', 2648 + }, 2649 + }, 2650 + }, 2651 + output: { 2652 + encoding: 'application/json', 2653 + schema: { 2654 + type: 'object', 2655 + required: ['ref', 'files'], 2656 + properties: { 2657 + ref: { 2658 + type: 'string', 2659 + description: 'The git reference used', 2660 + }, 2661 + parent: { 2662 + type: 'string', 2663 + description: 'The parent path in the tree', 2664 + }, 2665 + dotdot: { 2666 + type: 'string', 2667 + description: 'Parent directory path', 2668 + }, 2669 + readme: { 2670 + type: 'ref', 2671 + ref: 'lex:sh.tangled.repo.tree#readme', 2672 + description: 'Readme for this file tree', 2673 + }, 2674 + lastCommit: { 2675 + type: 'ref', 2676 + ref: 'lex:sh.tangled.repo.tree#lastCommit', 2677 + }, 2678 + files: { 2679 + type: 'array', 2680 + items: { 2681 + type: 'ref', 2682 + ref: 'lex:sh.tangled.repo.tree#treeEntry', 2683 + }, 2684 + }, 2685 + }, 2686 + }, 2687 + }, 2688 + errors: [ 2689 + { 2690 + name: 'RepoNotFound', 2691 + description: 'Repository not found or access denied', 2692 + }, 2693 + { 2694 + name: 'RefNotFound', 2695 + description: 'Git reference not found', 2696 + }, 2697 + { 2698 + name: 'PathNotFound', 2699 + description: 'Path not found in repository tree', 2700 + }, 2701 + { 2702 + name: 'InvalidRequest', 2703 + description: 'Invalid request parameters', 2704 + }, 2705 + ], 2706 + }, 2707 + readme: { 2708 + type: 'object', 2709 + required: ['filename', 'contents'], 2710 + properties: { 2711 + filename: { 2712 + type: 'string', 2713 + description: 'Name of the readme file', 2714 + }, 2715 + contents: { 2716 + type: 'string', 2717 + description: 'Contents of the readme file', 2718 + }, 2719 + }, 2720 + }, 2721 + treeEntry: { 2722 + type: 'object', 2723 + required: ['name', 'mode', 'size'], 2724 + properties: { 2725 + name: { 2726 + type: 'string', 2727 + description: 'Relative file or directory name', 2728 + }, 2729 + mode: { 2730 + type: 'string', 2731 + description: 'File mode', 2732 + }, 2733 + size: { 2734 + type: 'integer', 2735 + description: 'File size in bytes', 2736 + }, 2737 + last_commit: { 2738 + type: 'ref', 2739 + ref: 'lex:sh.tangled.repo.tree#lastCommit', 2740 + }, 2741 + }, 2742 + }, 2743 + lastCommit: { 2744 + type: 'object', 2745 + required: ['hash', 'message', 'when'], 2746 + properties: { 2747 + hash: { 2748 + type: 'string', 2749 + description: 'Commit hash', 2750 + }, 2751 + message: { 2752 + type: 'string', 2753 + description: 'Commit message', 2754 + }, 2755 + author: { 2756 + type: 'ref', 2757 + ref: 'lex:sh.tangled.repo.tree#signature', 2758 + }, 2759 + when: { 2760 + type: 'string', 2761 + format: 'datetime', 2762 + description: 'Commit timestamp', 2763 + }, 2764 + }, 2765 + }, 2766 + signature: { 2767 + type: 'object', 2768 + required: ['name', 'email', 'when'], 2769 + properties: { 2770 + name: { 2771 + type: 'string', 2772 + description: 'Author name', 2773 + }, 2774 + email: { 2775 + type: 'string', 2776 + description: 'Author email', 2777 + }, 2778 + when: { 2779 + type: 'string', 2780 + format: 'datetime', 2781 + description: 'Author timestamp', 2782 + }, 2783 + }, 2784 + }, 2785 + }, 2786 + }, 2787 + ShTangledSpindleMember: { 2788 + lexicon: 1, 2789 + id: 'sh.tangled.spindle.member', 2790 + needsCbor: true, 2791 + needsType: true, 2792 + defs: { 2793 + main: { 2794 + type: 'record', 2795 + key: 'tid', 2796 + record: { 2797 + type: 'object', 2798 + required: ['subject', 'instance', 'createdAt'], 2799 + properties: { 2800 + subject: { 2801 + type: 'string', 2802 + format: 'did', 2803 + }, 2804 + instance: { 2805 + type: 'string', 2806 + description: 2807 + 'spindle instance that the subject is now a member of', 2808 + }, 2809 + createdAt: { 2810 + type: 'string', 2811 + format: 'datetime', 2812 + }, 2813 + }, 2814 + }, 2815 + }, 2816 + }, 2817 + }, 2818 + ShTangledSpindle: { 2819 + lexicon: 1, 2820 + id: 'sh.tangled.spindle', 2821 + needsCbor: true, 2822 + needsType: true, 2823 + defs: { 2824 + main: { 2825 + type: 'record', 2826 + key: 'any', 2827 + record: { 2828 + type: 'object', 2829 + required: ['createdAt'], 2830 + properties: { 2831 + createdAt: { 2832 + type: 'string', 2833 + format: 'datetime', 2834 + }, 2835 + }, 2836 + }, 2837 + }, 2838 + }, 2839 + }, 2840 + ShTangledString: { 2841 + lexicon: 1, 2842 + id: 'sh.tangled.string', 2843 + needsCbor: true, 2844 + needsType: true, 2845 + defs: { 2846 + main: { 2847 + type: 'record', 2848 + key: 'tid', 2849 + record: { 2850 + type: 'object', 2851 + required: ['filename', 'description', 'createdAt', 'contents'], 2852 + properties: { 2853 + filename: { 2854 + type: 'string', 2855 + maxGraphemes: 140, 2856 + minGraphemes: 1, 2857 + }, 2858 + description: { 2859 + type: 'string', 2860 + maxGraphemes: 280, 2861 + }, 2862 + createdAt: { 2863 + type: 'string', 2864 + format: 'datetime', 2865 + }, 2866 + contents: { 2867 + type: 'string', 2868 + minGraphemes: 1, 2869 + }, 2870 + }, 2871 + }, 2872 + }, 2873 + }, 2874 + }, 2875 + } as const satisfies Record<string, LexiconDoc> 2876 + export const schemas = Object.values(schemaDict) satisfies LexiconDoc[] 2877 + export const lexicons: Lexicons = new Lexicons(schemas) 2878 + 2879 + export function validate<T extends { $type: string }>( 2880 + v: unknown, 2881 + id: string, 2882 + hash: string, 2883 + requiredType: true, 2884 + ): ValidationResult<T> 2885 + export function validate<T extends { $type?: string }>( 2886 + v: unknown, 2887 + id: string, 2888 + hash: string, 2889 + requiredType?: false, 2890 + ): ValidationResult<T> 2891 + export function validate( 2892 + v: unknown, 2893 + id: string, 2894 + hash: string, 2895 + requiredType?: boolean, 2896 + ): ValidationResult { 2897 + return (requiredType ? is$typed : maybe$typed)(v, id, hash) 2898 + ? lexicons.validate(`${id}#${hash}`, v) 2899 + : { 2900 + success: false, 2901 + error: new ValidationError( 2902 + `Must be an object with "${hash === 'main' ? id : `${id}#${hash}`}" $type property`, 2903 + ), 2904 + } 2905 + } 2906 + 2907 + export const ids = { 2908 + ShTangledActorProfile: 'sh.tangled.actor.profile', 2909 + ShTangledFeedReaction: 'sh.tangled.feed.reaction', 2910 + ShTangledFeedStar: 'sh.tangled.feed.star', 2911 + ShTangledGitRefUpdate: 'sh.tangled.git.refUpdate', 2912 + ShTangledGraphFollow: 'sh.tangled.graph.follow', 2913 + ShTangledRepoIssueStateClosed: 'sh.tangled.repo.issue.state.closed', 2914 + ShTangledRepoIssueComment: 'sh.tangled.repo.issue.comment', 2915 + ShTangledRepoIssue: 'sh.tangled.repo.issue', 2916 + ShTangledRepoIssueStateOpen: 'sh.tangled.repo.issue.state.open', 2917 + ShTangledRepoIssueState: 'sh.tangled.repo.issue.state', 2918 + ShTangledKnot: 'sh.tangled.knot', 2919 + ShTangledKnotListKeys: 'sh.tangled.knot.listKeys', 2920 + ShTangledKnotMember: 'sh.tangled.knot.member', 2921 + ShTangledKnotVersion: 'sh.tangled.knot.version', 2922 + ShTangledLabelDefinition: 'sh.tangled.label.definition', 2923 + ShTangledLabelOp: 'sh.tangled.label.op', 2924 + ShTangledPipelineCancelPipeline: 'sh.tangled.pipeline.cancelPipeline', 2925 + ShTangledPipeline: 'sh.tangled.pipeline', 2926 + ShTangledPipelineStatus: 'sh.tangled.pipeline.status', 2927 + ShTangledRepoPullStatusClosed: 'sh.tangled.repo.pull.status.closed', 2928 + ShTangledRepoPullComment: 'sh.tangled.repo.pull.comment', 2929 + ShTangledRepoPullStatusMerged: 'sh.tangled.repo.pull.status.merged', 2930 + ShTangledRepoPullStatusOpen: 'sh.tangled.repo.pull.status.open', 2931 + ShTangledRepoPull: 'sh.tangled.repo.pull', 2932 + ShTangledRepoPullStatus: 'sh.tangled.repo.pull.status', 2933 + ShTangledRepoAddSecret: 'sh.tangled.repo.addSecret', 2934 + ShTangledRepoArchive: 'sh.tangled.repo.archive', 2935 + ShTangledRepoArtifact: 'sh.tangled.repo.artifact', 2936 + ShTangledRepoBlob: 'sh.tangled.repo.blob', 2937 + ShTangledRepoBranch: 'sh.tangled.repo.branch', 2938 + ShTangledRepoBranches: 'sh.tangled.repo.branches', 2939 + ShTangledRepoCollaborator: 'sh.tangled.repo.collaborator', 2940 + ShTangledRepoCompare: 'sh.tangled.repo.compare', 2941 + ShTangledRepoCreate: 'sh.tangled.repo.create', 2942 + ShTangledRepoSetDefaultBranch: 'sh.tangled.repo.setDefaultBranch', 2943 + ShTangledRepoDelete: 'sh.tangled.repo.delete', 2944 + ShTangledRepoDeleteBranch: 'sh.tangled.repo.deleteBranch', 2945 + ShTangledRepoDiff: 'sh.tangled.repo.diff', 2946 + ShTangledRepoForkStatus: 'sh.tangled.repo.forkStatus', 2947 + ShTangledRepoForkSync: 'sh.tangled.repo.forkSync', 2948 + ShTangledRepoGetDefaultBranch: 'sh.tangled.repo.getDefaultBranch', 2949 + ShTangledRepoHiddenRef: 'sh.tangled.repo.hiddenRef', 2950 + ShTangledRepoLanguages: 'sh.tangled.repo.languages', 2951 + ShTangledRepoListSecrets: 'sh.tangled.repo.listSecrets', 2952 + ShTangledRepoLog: 'sh.tangled.repo.log', 2953 + ShTangledRepoMerge: 'sh.tangled.repo.merge', 2954 + ShTangledRepoMergeCheck: 'sh.tangled.repo.mergeCheck', 2955 + ShTangledRepoRemoveSecret: 'sh.tangled.repo.removeSecret', 2956 + ShTangledRepo: 'sh.tangled.repo', 2957 + ShTangledRepoTag: 'sh.tangled.repo.tag', 2958 + ShTangledRepoTags: 'sh.tangled.repo.tags', 2959 + ShTangledRepoTree: 'sh.tangled.repo.tree', 2960 + ShTangledSpindleMember: 'sh.tangled.spindle.member', 2961 + ShTangledSpindle: 'sh.tangled.spindle', 2962 + ShTangledString: 'sh.tangled.string', 2963 + } as const
+58
src/lexicon/types/sh/tangled/actor/profile.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.actor.profile' 16 + 17 + export interface Main { 18 + $type: 'sh.tangled.actor.profile' 19 + /** Small image to be displayed next to posts from account. AKA, 'profile picture' */ 20 + avatar?: BlobRef 21 + /** Free-form profile description text. */ 22 + description?: string 23 + links?: string[] 24 + stats?: ( 25 + | 'merged-pull-request-count' 26 + | 'closed-pull-request-count' 27 + | 'open-pull-request-count' 28 + | 'open-issue-count' 29 + | 'closed-issue-count' 30 + | 'repository-count' 31 + | 'star-count' 32 + )[] 33 + /** Include link to this account on Bluesky. */ 34 + bluesky: boolean 35 + /** Free-form location text. */ 36 + location?: string 37 + /** Any ATURI, it is up to appviews to validate these fields. */ 38 + pinnedRepositories?: string[] 39 + /** Preferred gender pronouns. */ 40 + pronouns?: string 41 + [k: string]: unknown 42 + } 43 + 44 + const hashMain = 'main' 45 + 46 + export function isMain<V>(v: V) { 47 + return is$typed(v, id, hashMain) 48 + } 49 + 50 + export function validateMain<V>(v: V) { 51 + return validate<Main & V>(v, id, hashMain, true) 52 + } 53 + 54 + export { 55 + type Main as Record, 56 + isMain as isRecord, 57 + validateMain as validateRecord, 58 + }
+39
src/lexicon/types/sh/tangled/feed/reaction.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.feed.reaction' 16 + 17 + export interface Main { 18 + $type: 'sh.tangled.feed.reaction' 19 + subject: string 20 + reaction: '👍' | '👎' | '😆' | '🎉' | '🫤' | '❤️' | '🚀' | '👀' 21 + createdAt: string 22 + [k: string]: unknown 23 + } 24 + 25 + const hashMain = 'main' 26 + 27 + export function isMain<V>(v: V) { 28 + return is$typed(v, id, hashMain) 29 + } 30 + 31 + export function validateMain<V>(v: V) { 32 + return validate<Main & V>(v, id, hashMain, true) 33 + } 34 + 35 + export { 36 + type Main as Record, 37 + isMain as isRecord, 38 + validateMain as validateRecord, 39 + }
+38
src/lexicon/types/sh/tangled/feed/star.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.feed.star' 16 + 17 + export interface Main { 18 + $type: 'sh.tangled.feed.star' 19 + subject: string 20 + createdAt: string 21 + [k: string]: unknown 22 + } 23 + 24 + const hashMain = 'main' 25 + 26 + export function isMain<V>(v: V) { 27 + return is$typed(v, id, hashMain) 28 + } 29 + 30 + export function validateMain<V>(v: V) { 31 + return validate<Main & V>(v, id, hashMain, true) 32 + } 33 + 34 + export { 35 + type Main as Record, 36 + isMain as isRecord, 37 + validateMain as validateRecord, 38 + }
+132
src/lexicon/types/sh/tangled/git/refUpdate.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.git.refUpdate' 16 + 17 + export interface Main { 18 + $type: 'sh.tangled.git.refUpdate' 19 + /** Ref being updated */ 20 + ref: string 21 + /** did of the user that pushed this ref */ 22 + committerDid: string 23 + /** did of the owner of the repo */ 24 + repoDid: string 25 + /** name of the repo */ 26 + repoName: string 27 + /** old SHA of this ref */ 28 + oldSha: string 29 + /** new SHA of this ref */ 30 + newSha: string 31 + meta: Meta 32 + [k: string]: unknown 33 + } 34 + 35 + const hashMain = 'main' 36 + 37 + export function isMain<V>(v: V) { 38 + return is$typed(v, id, hashMain) 39 + } 40 + 41 + export function validateMain<V>(v: V) { 42 + return validate<Main & V>(v, id, hashMain, true) 43 + } 44 + 45 + export { 46 + type Main as Record, 47 + isMain as isRecord, 48 + validateMain as validateRecord, 49 + } 50 + 51 + export interface Meta { 52 + $type?: 'sh.tangled.git.refUpdate#meta' 53 + isDefaultRef: boolean 54 + langBreakdown?: LangBreakdown 55 + commitCount: CommitCountBreakdown 56 + } 57 + 58 + const hashMeta = 'meta' 59 + 60 + export function isMeta<V>(v: V) { 61 + return is$typed(v, id, hashMeta) 62 + } 63 + 64 + export function validateMeta<V>(v: V) { 65 + return validate<Meta & V>(v, id, hashMeta) 66 + } 67 + 68 + export interface LangBreakdown { 69 + $type?: 'sh.tangled.git.refUpdate#langBreakdown' 70 + inputs?: IndividualLanguageSize[] 71 + } 72 + 73 + const hashLangBreakdown = 'langBreakdown' 74 + 75 + export function isLangBreakdown<V>(v: V) { 76 + return is$typed(v, id, hashLangBreakdown) 77 + } 78 + 79 + export function validateLangBreakdown<V>(v: V) { 80 + return validate<LangBreakdown & V>(v, id, hashLangBreakdown) 81 + } 82 + 83 + export interface IndividualLanguageSize { 84 + $type?: 'sh.tangled.git.refUpdate#individualLanguageSize' 85 + lang: string 86 + size: number 87 + } 88 + 89 + const hashIndividualLanguageSize = 'individualLanguageSize' 90 + 91 + export function isIndividualLanguageSize<V>(v: V) { 92 + return is$typed(v, id, hashIndividualLanguageSize) 93 + } 94 + 95 + export function validateIndividualLanguageSize<V>(v: V) { 96 + return validate<IndividualLanguageSize & V>(v, id, hashIndividualLanguageSize) 97 + } 98 + 99 + export interface CommitCountBreakdown { 100 + $type?: 'sh.tangled.git.refUpdate#commitCountBreakdown' 101 + byEmail?: IndividualEmailCommitCount[] 102 + } 103 + 104 + const hashCommitCountBreakdown = 'commitCountBreakdown' 105 + 106 + export function isCommitCountBreakdown<V>(v: V) { 107 + return is$typed(v, id, hashCommitCountBreakdown) 108 + } 109 + 110 + export function validateCommitCountBreakdown<V>(v: V) { 111 + return validate<CommitCountBreakdown & V>(v, id, hashCommitCountBreakdown) 112 + } 113 + 114 + export interface IndividualEmailCommitCount { 115 + $type?: 'sh.tangled.git.refUpdate#individualEmailCommitCount' 116 + email: string 117 + count: number 118 + } 119 + 120 + const hashIndividualEmailCommitCount = 'individualEmailCommitCount' 121 + 122 + export function isIndividualEmailCommitCount<V>(v: V) { 123 + return is$typed(v, id, hashIndividualEmailCommitCount) 124 + } 125 + 126 + export function validateIndividualEmailCommitCount<V>(v: V) { 127 + return validate<IndividualEmailCommitCount & V>( 128 + v, 129 + id, 130 + hashIndividualEmailCommitCount, 131 + ) 132 + }
+38
src/lexicon/types/sh/tangled/graph/follow.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.graph.follow' 16 + 17 + export interface Main { 18 + $type: 'sh.tangled.graph.follow' 19 + subject: string 20 + createdAt: string 21 + [k: string]: unknown 22 + } 23 + 24 + const hashMain = 'main' 25 + 26 + export function isMain<V>(v: V) { 27 + return is$typed(v, id, hashMain) 28 + } 29 + 30 + export function validateMain<V>(v: V) { 31 + return validate<Main & V>(v, id, hashMain, true) 32 + } 33 + 34 + export { 35 + type Main as Record, 36 + isMain as isRecord, 37 + validateMain as validateRecord, 38 + }
+33
src/lexicon/types/sh/tangled/knot.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../lexicons' 7 + import { type $Typed, is$typed as _is$typed, type OmitKey } from '../../../util' 8 + 9 + const is$typed = _is$typed, 10 + validate = _validate 11 + const id = 'sh.tangled.knot' 12 + 13 + export interface Main { 14 + $type: 'sh.tangled.knot' 15 + createdAt: string 16 + [k: string]: unknown 17 + } 18 + 19 + const hashMain = 'main' 20 + 21 + export function isMain<V>(v: V) { 22 + return is$typed(v, id, hashMain) 23 + } 24 + 25 + export function validateMain<V>(v: V) { 26 + return validate<Main & V>(v, id, hashMain, true) 27 + } 28 + 29 + export { 30 + type Main as Record, 31 + isMain as isRecord, 32 + validateMain as validateRecord, 33 + }
+75
src/lexicon/types/sh/tangled/knot/listKeys.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.knot.listKeys' 17 + 18 + export type QueryParams = { 19 + /** Maximum number of keys to return */ 20 + limit?: number 21 + /** Pagination cursor */ 22 + cursor?: string 23 + } 24 + export type InputSchema = undefined 25 + 26 + export interface OutputSchema { 27 + keys: PublicKey[] 28 + /** Pagination cursor for next page */ 29 + cursor?: string 30 + } 31 + 32 + export interface CallOptions { 33 + signal?: AbortSignal 34 + headers?: HeadersMap 35 + } 36 + 37 + export interface Response { 38 + success: boolean 39 + headers: HeadersMap 40 + data: OutputSchema 41 + } 42 + 43 + export class InternalServerError extends XRPCError { 44 + constructor(src: XRPCError) { 45 + super(src.status, src.error, src.message, src.headers, { cause: src }) 46 + } 47 + } 48 + 49 + export function toKnownErr(e: any) { 50 + if (e instanceof XRPCError) { 51 + if (e.error === 'InternalServerError') return new InternalServerError(e) 52 + } 53 + 54 + return e 55 + } 56 + 57 + export interface PublicKey { 58 + $type?: 'sh.tangled.knot.listKeys#publicKey' 59 + /** DID associated with the public key */ 60 + did: string 61 + /** Public key contents */ 62 + key: string 63 + /** Key upload timestamp */ 64 + createdAt: string 65 + } 66 + 67 + const hashPublicKey = 'publicKey' 68 + 69 + export function isPublicKey<V>(v: V) { 70 + return is$typed(v, id, hashPublicKey) 71 + } 72 + 73 + export function validatePublicKey<V>(v: V) { 74 + return validate<PublicKey & V>(v, id, hashPublicKey) 75 + }
+40
src/lexicon/types/sh/tangled/knot/member.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.knot.member' 16 + 17 + export interface Main { 18 + $type: 'sh.tangled.knot.member' 19 + subject: string 20 + /** domain that this member now belongs to */ 21 + domain: string 22 + createdAt: string 23 + [k: string]: unknown 24 + } 25 + 26 + const hashMain = 'main' 27 + 28 + export function isMain<V>(v: V) { 29 + return is$typed(v, id, hashMain) 30 + } 31 + 32 + export function validateMain<V>(v: V) { 33 + return validate<Main & V>(v, id, hashMain, true) 34 + } 35 + 36 + export { 37 + type Main as Record, 38 + isMain as isRecord, 39 + validateMain as validateRecord, 40 + }
+38
src/lexicon/types/sh/tangled/knot/version.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.knot.version' 17 + 18 + export type QueryParams = {} 19 + export type InputSchema = undefined 20 + 21 + export interface OutputSchema { 22 + version: string 23 + } 24 + 25 + export interface CallOptions { 26 + signal?: AbortSignal 27 + headers?: HeadersMap 28 + } 29 + 30 + export interface Response { 31 + success: boolean 32 + headers: HeadersMap 33 + data: OutputSchema 34 + } 35 + 36 + export function toKnownErr(e: any) { 37 + return e 38 + }
+66
src/lexicon/types/sh/tangled/label/definition.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.label.definition' 16 + 17 + export interface Main { 18 + $type: 'sh.tangled.label.definition' 19 + /** The display name of this label. */ 20 + name: string 21 + valueType: ValueType 22 + /** The areas of the repo this label may apply to, eg.: sh.tangled.repo.issue. Appviews may choose to respect this. */ 23 + scope: string[] 24 + /** The hex value for the background color for the label. Appviews may choose to respect this. */ 25 + color?: string 26 + createdAt: string 27 + /** Whether this label can be repeated for a given entity, eg.: [reviewer:foo, reviewer:bar] */ 28 + multiple?: boolean 29 + [k: string]: unknown 30 + } 31 + 32 + const hashMain = 'main' 33 + 34 + export function isMain<V>(v: V) { 35 + return is$typed(v, id, hashMain) 36 + } 37 + 38 + export function validateMain<V>(v: V) { 39 + return validate<Main & V>(v, id, hashMain, true) 40 + } 41 + 42 + export { 43 + type Main as Record, 44 + isMain as isRecord, 45 + validateMain as validateRecord, 46 + } 47 + 48 + export interface ValueType { 49 + $type?: 'sh.tangled.label.definition#valueType' 50 + /** The concrete type of this label's value. */ 51 + type: 'null' | 'boolean' | 'integer' | 'string' 52 + /** An optional constraint that can be applied on string concrete types. */ 53 + format: 'any' | 'did' | 'nsid' 54 + /** Closed set of values that this label can take. */ 55 + enum?: string[] 56 + } 57 + 58 + const hashValueType = 'valueType' 59 + 60 + export function isValueType<V>(v: V) { 61 + return is$typed(v, id, hashValueType) 62 + } 63 + 64 + export function validateValueType<V>(v: V) { 65 + return validate<ValueType & V>(v, id, hashValueType) 66 + }
+59
src/lexicon/types/sh/tangled/label/op.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.label.op' 16 + 17 + export interface Main { 18 + $type: 'sh.tangled.label.op' 19 + /** The subject (task, pull or discussion) of this label. Appviews may apply a `scope` check and refuse this op. */ 20 + subject: string 21 + performedAt: string 22 + add: Operand[] 23 + delete: Operand[] 24 + [k: string]: unknown 25 + } 26 + 27 + const hashMain = 'main' 28 + 29 + export function isMain<V>(v: V) { 30 + return is$typed(v, id, hashMain) 31 + } 32 + 33 + export function validateMain<V>(v: V) { 34 + return validate<Main & V>(v, id, hashMain, true) 35 + } 36 + 37 + export { 38 + type Main as Record, 39 + isMain as isRecord, 40 + validateMain as validateRecord, 41 + } 42 + 43 + export interface Operand { 44 + $type?: 'sh.tangled.label.op#operand' 45 + /** ATURI to the label definition */ 46 + key: string 47 + /** Stringified value of the label. This is first unstringed by appviews and then interpreted as a concrete value. */ 48 + value: string 49 + } 50 + 51 + const hashOperand = 'operand' 52 + 53 + export function isOperand<V>(v: V) { 54 + return is$typed(v, id, hashOperand) 55 + } 56 + 57 + export function validateOperand<V>(v: V) { 58 + return validate<Operand & V>(v, id, hashOperand) 59 + }
+172
src/lexicon/types/sh/tangled/pipeline.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../lexicons' 7 + import { type $Typed, is$typed as _is$typed, type OmitKey } from '../../../util' 8 + 9 + const is$typed = _is$typed, 10 + validate = _validate 11 + const id = 'sh.tangled.pipeline' 12 + 13 + export interface Main { 14 + $type: 'sh.tangled.pipeline' 15 + triggerMetadata: TriggerMetadata 16 + workflows: Workflow[] 17 + [k: string]: unknown 18 + } 19 + 20 + const hashMain = 'main' 21 + 22 + export function isMain<V>(v: V) { 23 + return is$typed(v, id, hashMain) 24 + } 25 + 26 + export function validateMain<V>(v: V) { 27 + return validate<Main & V>(v, id, hashMain, true) 28 + } 29 + 30 + export { 31 + type Main as Record, 32 + isMain as isRecord, 33 + validateMain as validateRecord, 34 + } 35 + 36 + export interface TriggerMetadata { 37 + $type?: 'sh.tangled.pipeline#triggerMetadata' 38 + kind: 'push' | 'pull_request' | 'manual' 39 + repo: TriggerRepo 40 + push?: PushTriggerData 41 + pullRequest?: PullRequestTriggerData 42 + manual?: ManualTriggerData 43 + } 44 + 45 + const hashTriggerMetadata = 'triggerMetadata' 46 + 47 + export function isTriggerMetadata<V>(v: V) { 48 + return is$typed(v, id, hashTriggerMetadata) 49 + } 50 + 51 + export function validateTriggerMetadata<V>(v: V) { 52 + return validate<TriggerMetadata & V>(v, id, hashTriggerMetadata) 53 + } 54 + 55 + export interface TriggerRepo { 56 + $type?: 'sh.tangled.pipeline#triggerRepo' 57 + knot: string 58 + did: string 59 + repo: string 60 + defaultBranch: string 61 + } 62 + 63 + const hashTriggerRepo = 'triggerRepo' 64 + 65 + export function isTriggerRepo<V>(v: V) { 66 + return is$typed(v, id, hashTriggerRepo) 67 + } 68 + 69 + export function validateTriggerRepo<V>(v: V) { 70 + return validate<TriggerRepo & V>(v, id, hashTriggerRepo) 71 + } 72 + 73 + export interface PushTriggerData { 74 + $type?: 'sh.tangled.pipeline#pushTriggerData' 75 + ref: string 76 + newSha: string 77 + oldSha: string 78 + } 79 + 80 + const hashPushTriggerData = 'pushTriggerData' 81 + 82 + export function isPushTriggerData<V>(v: V) { 83 + return is$typed(v, id, hashPushTriggerData) 84 + } 85 + 86 + export function validatePushTriggerData<V>(v: V) { 87 + return validate<PushTriggerData & V>(v, id, hashPushTriggerData) 88 + } 89 + 90 + export interface PullRequestTriggerData { 91 + $type?: 'sh.tangled.pipeline#pullRequestTriggerData' 92 + sourceBranch: string 93 + targetBranch: string 94 + sourceSha: string 95 + action: string 96 + } 97 + 98 + const hashPullRequestTriggerData = 'pullRequestTriggerData' 99 + 100 + export function isPullRequestTriggerData<V>(v: V) { 101 + return is$typed(v, id, hashPullRequestTriggerData) 102 + } 103 + 104 + export function validatePullRequestTriggerData<V>(v: V) { 105 + return validate<PullRequestTriggerData & V>(v, id, hashPullRequestTriggerData) 106 + } 107 + 108 + export interface ManualTriggerData { 109 + $type?: 'sh.tangled.pipeline#manualTriggerData' 110 + inputs?: Pair[] 111 + } 112 + 113 + const hashManualTriggerData = 'manualTriggerData' 114 + 115 + export function isManualTriggerData<V>(v: V) { 116 + return is$typed(v, id, hashManualTriggerData) 117 + } 118 + 119 + export function validateManualTriggerData<V>(v: V) { 120 + return validate<ManualTriggerData & V>(v, id, hashManualTriggerData) 121 + } 122 + 123 + export interface Workflow { 124 + $type?: 'sh.tangled.pipeline#workflow' 125 + name: string 126 + engine: string 127 + clone: CloneOpts 128 + raw: string 129 + } 130 + 131 + const hashWorkflow = 'workflow' 132 + 133 + export function isWorkflow<V>(v: V) { 134 + return is$typed(v, id, hashWorkflow) 135 + } 136 + 137 + export function validateWorkflow<V>(v: V) { 138 + return validate<Workflow & V>(v, id, hashWorkflow) 139 + } 140 + 141 + export interface CloneOpts { 142 + $type?: 'sh.tangled.pipeline#cloneOpts' 143 + skip: boolean 144 + depth: number 145 + submodules: boolean 146 + } 147 + 148 + const hashCloneOpts = 'cloneOpts' 149 + 150 + export function isCloneOpts<V>(v: V) { 151 + return is$typed(v, id, hashCloneOpts) 152 + } 153 + 154 + export function validateCloneOpts<V>(v: V) { 155 + return validate<CloneOpts & V>(v, id, hashCloneOpts) 156 + } 157 + 158 + export interface Pair { 159 + $type?: 'sh.tangled.pipeline#pair' 160 + key: string 161 + value: string 162 + } 163 + 164 + const hashPair = 'pair' 165 + 166 + export function isPair<V>(v: V) { 167 + return is$typed(v, id, hashPair) 168 + } 169 + 170 + export function validatePair<V>(v: V) { 171 + return validate<Pair & V>(v, id, hashPair) 172 + }
+43
src/lexicon/types/sh/tangled/pipeline/cancelPipeline.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.pipeline.cancelPipeline' 17 + 18 + export type QueryParams = {} 19 + 20 + export interface InputSchema { 21 + /** repo at-uri, spindle can't resolve repo from pipeline at-uri yet */ 22 + repo: string 23 + /** pipeline at-uri */ 24 + pipeline: string 25 + /** workflow name */ 26 + workflow: string 27 + } 28 + 29 + export interface CallOptions { 30 + signal?: AbortSignal 31 + headers?: HeadersMap 32 + qp?: QueryParams 33 + encoding?: 'application/json' 34 + } 35 + 36 + export interface Response { 37 + success: boolean 38 + headers: HeadersMap 39 + } 40 + 41 + export function toKnownErr(e: any) { 42 + return e 43 + }
+48
src/lexicon/types/sh/tangled/pipeline/status.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.pipeline.status' 16 + 17 + export interface Main { 18 + $type: 'sh.tangled.pipeline.status' 19 + /** ATURI of the pipeline */ 20 + pipeline: string 21 + /** name of the workflow within this pipeline */ 22 + workflow: string 23 + /** status of the workflow */ 24 + status: 'pending' | 'running' | 'failed' | 'timeout' | 'cancelled' | 'success' 25 + /** time of creation of this status update */ 26 + createdAt: string 27 + /** error message if failed */ 28 + error?: string 29 + /** exit code if failed */ 30 + exitCode?: number 31 + [k: string]: unknown 32 + } 33 + 34 + const hashMain = 'main' 35 + 36 + export function isMain<V>(v: V) { 37 + return is$typed(v, id, hashMain) 38 + } 39 + 40 + export function validateMain<V>(v: V) { 41 + return validate<Main & V>(v, id, hashMain, true) 42 + } 43 + 44 + export { 45 + type Main as Record, 46 + isMain as isRecord, 47 + validateMain as validateRecord, 48 + }
+48
src/lexicon/types/sh/tangled/repo.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../lexicons' 7 + import { type $Typed, is$typed as _is$typed, type OmitKey } from '../../../util' 8 + 9 + const is$typed = _is$typed, 10 + validate = _validate 11 + const id = 'sh.tangled.repo' 12 + 13 + export interface Main { 14 + $type: 'sh.tangled.repo' 15 + /** name of the repo */ 16 + name: string 17 + /** knot where the repo was created */ 18 + knot: string 19 + /** CI runner to send jobs to and receive results from */ 20 + spindle?: string 21 + description?: string 22 + /** Any URI related to the repo */ 23 + website?: string 24 + /** Topics related to the repo */ 25 + topics?: string[] 26 + /** source of the repo */ 27 + source?: string 28 + /** List of labels that this repo subscribes to */ 29 + labels?: string[] 30 + createdAt: string 31 + [k: string]: unknown 32 + } 33 + 34 + const hashMain = 'main' 35 + 36 + export function isMain<V>(v: V) { 37 + return is$typed(v, id, hashMain) 38 + } 39 + 40 + export function validateMain<V>(v: V) { 41 + return validate<Main & V>(v, id, hashMain, true) 42 + } 43 + 44 + export { 45 + type Main as Record, 46 + isMain as isRecord, 47 + validateMain as validateRecord, 48 + }
+40
src/lexicon/types/sh/tangled/repo/addSecret.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.addSecret' 17 + 18 + export type QueryParams = {} 19 + 20 + export interface InputSchema { 21 + repo: string 22 + key: string 23 + value: string 24 + } 25 + 26 + export interface CallOptions { 27 + signal?: AbortSignal 28 + headers?: HeadersMap 29 + qp?: QueryParams 30 + encoding?: 'application/json' 31 + } 32 + 33 + export interface Response { 34 + success: boolean 35 + headers: HeadersMap 36 + } 37 + 38 + export function toKnownErr(e: any) { 39 + return e 40 + }
+74
src/lexicon/types/sh/tangled/repo/archive.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.archive' 17 + 18 + export type QueryParams = { 19 + /** Repository identifier in format 'did:plc:.../repoName' */ 20 + repo: string 21 + /** Git reference (branch, tag, or commit SHA) */ 22 + ref: string 23 + /** Archive format */ 24 + format?: 'tar' | 'zip' | 'tar.gz' | 'tar.bz2' | 'tar.xz' 25 + /** Prefix for files in the archive */ 26 + prefix?: string 27 + } 28 + export type InputSchema = undefined 29 + 30 + export interface CallOptions { 31 + signal?: AbortSignal 32 + headers?: HeadersMap 33 + } 34 + 35 + export interface Response { 36 + success: boolean 37 + headers: HeadersMap 38 + data: Uint8Array 39 + } 40 + 41 + export class RepoNotFoundError extends XRPCError { 42 + constructor(src: XRPCError) { 43 + super(src.status, src.error, src.message, src.headers, { cause: src }) 44 + } 45 + } 46 + 47 + export class RefNotFoundError extends XRPCError { 48 + constructor(src: XRPCError) { 49 + super(src.status, src.error, src.message, src.headers, { cause: src }) 50 + } 51 + } 52 + 53 + export class InvalidRequestError extends XRPCError { 54 + constructor(src: XRPCError) { 55 + super(src.status, src.error, src.message, src.headers, { cause: src }) 56 + } 57 + } 58 + 59 + export class ArchiveError extends XRPCError { 60 + constructor(src: XRPCError) { 61 + super(src.status, src.error, src.message, src.headers, { cause: src }) 62 + } 63 + } 64 + 65 + export function toKnownErr(e: any) { 66 + if (e instanceof XRPCError) { 67 + if (e.error === 'RepoNotFound') return new RepoNotFoundError(e) 68 + if (e.error === 'RefNotFound') return new RefNotFoundError(e) 69 + if (e.error === 'InvalidRequest') return new InvalidRequestError(e) 70 + if (e.error === 'ArchiveError') return new ArchiveError(e) 71 + } 72 + 73 + return e 74 + }
+46
src/lexicon/types/sh/tangled/repo/artifact.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.repo.artifact' 16 + 17 + export interface Main { 18 + $type: 'sh.tangled.repo.artifact' 19 + /** name of the artifact */ 20 + name: string 21 + /** repo that this artifact is being uploaded to */ 22 + repo: string 23 + /** hash of the tag object that this artifact is attached to (only annotated tags are supported) */ 24 + tag: Uint8Array 25 + /** time of creation of this artifact */ 26 + createdAt: string 27 + /** the artifact */ 28 + artifact: BlobRef 29 + [k: string]: unknown 30 + } 31 + 32 + const hashMain = 'main' 33 + 34 + export function isMain<V>(v: V) { 35 + return is$typed(v, id, hashMain) 36 + } 37 + 38 + export function validateMain<V>(v: V) { 39 + return validate<Main & V>(v, id, hashMain, true) 40 + } 41 + 42 + export { 43 + type Main as Record, 44 + isMain as isRecord, 45 + validateMain as validateRecord, 46 + }
+154
src/lexicon/types/sh/tangled/repo/blob.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.blob' 17 + 18 + export type QueryParams = { 19 + /** Repository identifier in format 'did:plc:.../repoName' */ 20 + repo: string 21 + /** Git reference (branch, tag, or commit SHA) */ 22 + ref: string 23 + /** Path to the file within the repository */ 24 + path: string 25 + /** Return raw file content instead of JSON response */ 26 + raw?: boolean 27 + } 28 + export type InputSchema = undefined 29 + 30 + export interface OutputSchema { 31 + /** The git reference used */ 32 + ref: string 33 + /** The file path */ 34 + path: string 35 + /** File content (base64 encoded for binary files) */ 36 + content?: string 37 + /** Content encoding */ 38 + encoding?: 'utf-8' | 'base64' 39 + /** File size in bytes */ 40 + size?: number 41 + /** Whether the file is binary */ 42 + isBinary?: boolean 43 + /** MIME type of the file */ 44 + mimeType?: string 45 + submodule?: Submodule 46 + lastCommit?: LastCommit 47 + } 48 + 49 + export interface CallOptions { 50 + signal?: AbortSignal 51 + headers?: HeadersMap 52 + } 53 + 54 + export interface Response { 55 + success: boolean 56 + headers: HeadersMap 57 + data: OutputSchema 58 + } 59 + 60 + export class RepoNotFoundError extends XRPCError { 61 + constructor(src: XRPCError) { 62 + super(src.status, src.error, src.message, src.headers, { cause: src }) 63 + } 64 + } 65 + 66 + export class RefNotFoundError extends XRPCError { 67 + constructor(src: XRPCError) { 68 + super(src.status, src.error, src.message, src.headers, { cause: src }) 69 + } 70 + } 71 + 72 + export class FileNotFoundError extends XRPCError { 73 + constructor(src: XRPCError) { 74 + super(src.status, src.error, src.message, src.headers, { cause: src }) 75 + } 76 + } 77 + 78 + export class InvalidRequestError extends XRPCError { 79 + constructor(src: XRPCError) { 80 + super(src.status, src.error, src.message, src.headers, { cause: src }) 81 + } 82 + } 83 + 84 + export function toKnownErr(e: any) { 85 + if (e instanceof XRPCError) { 86 + if (e.error === 'RepoNotFound') return new RepoNotFoundError(e) 87 + if (e.error === 'RefNotFound') return new RefNotFoundError(e) 88 + if (e.error === 'FileNotFound') return new FileNotFoundError(e) 89 + if (e.error === 'InvalidRequest') return new InvalidRequestError(e) 90 + } 91 + 92 + return e 93 + } 94 + 95 + export interface LastCommit { 96 + $type?: 'sh.tangled.repo.blob#lastCommit' 97 + /** Commit hash */ 98 + hash: string 99 + /** Commit message */ 100 + message: string 101 + author?: Signature 102 + /** Commit timestamp */ 103 + when: string 104 + } 105 + 106 + const hashLastCommit = 'lastCommit' 107 + 108 + export function isLastCommit<V>(v: V) { 109 + return is$typed(v, id, hashLastCommit) 110 + } 111 + 112 + export function validateLastCommit<V>(v: V) { 113 + return validate<LastCommit & V>(v, id, hashLastCommit) 114 + } 115 + 116 + export interface Signature { 117 + $type?: 'sh.tangled.repo.blob#signature' 118 + /** Author name */ 119 + name: string 120 + /** Author email */ 121 + email: string 122 + /** Author timestamp */ 123 + when: string 124 + } 125 + 126 + const hashSignature = 'signature' 127 + 128 + export function isSignature<V>(v: V) { 129 + return is$typed(v, id, hashSignature) 130 + } 131 + 132 + export function validateSignature<V>(v: V) { 133 + return validate<Signature & V>(v, id, hashSignature) 134 + } 135 + 136 + export interface Submodule { 137 + $type?: 'sh.tangled.repo.blob#submodule' 138 + /** Submodule name */ 139 + name: string 140 + /** Submodule repository URL */ 141 + url: string 142 + /** Branch to track in the submodule */ 143 + branch?: string 144 + } 145 + 146 + const hashSubmodule = 'submodule' 147 + 148 + export function isSubmodule<V>(v: V) { 149 + return is$typed(v, id, hashSubmodule) 150 + } 151 + 152 + export function validateSubmodule<V>(v: V) { 153 + return validate<Submodule & V>(v, id, hashSubmodule) 154 + }
+99
src/lexicon/types/sh/tangled/repo/branch.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.branch' 17 + 18 + export type QueryParams = { 19 + /** Repository identifier in format 'did:plc:.../repoName' */ 20 + repo: string 21 + /** Branch name to get information for */ 22 + name: string 23 + } 24 + export type InputSchema = undefined 25 + 26 + export interface OutputSchema { 27 + /** Branch name */ 28 + name: string 29 + /** Latest commit hash on this branch */ 30 + hash: string 31 + /** Short commit hash */ 32 + shortHash?: string 33 + /** Timestamp of latest commit */ 34 + when: string 35 + /** Latest commit message */ 36 + message?: string 37 + author?: Signature 38 + /** Whether this is the default branch */ 39 + isDefault?: boolean 40 + } 41 + 42 + export interface CallOptions { 43 + signal?: AbortSignal 44 + headers?: HeadersMap 45 + } 46 + 47 + export interface Response { 48 + success: boolean 49 + headers: HeadersMap 50 + data: OutputSchema 51 + } 52 + 53 + export class RepoNotFoundError extends XRPCError { 54 + constructor(src: XRPCError) { 55 + super(src.status, src.error, src.message, src.headers, { cause: src }) 56 + } 57 + } 58 + 59 + export class BranchNotFoundError extends XRPCError { 60 + constructor(src: XRPCError) { 61 + super(src.status, src.error, src.message, src.headers, { cause: src }) 62 + } 63 + } 64 + 65 + export class InvalidRequestError extends XRPCError { 66 + constructor(src: XRPCError) { 67 + super(src.status, src.error, src.message, src.headers, { cause: src }) 68 + } 69 + } 70 + 71 + export function toKnownErr(e: any) { 72 + if (e instanceof XRPCError) { 73 + if (e.error === 'RepoNotFound') return new RepoNotFoundError(e) 74 + if (e.error === 'BranchNotFound') return new BranchNotFoundError(e) 75 + if (e.error === 'InvalidRequest') return new InvalidRequestError(e) 76 + } 77 + 78 + return e 79 + } 80 + 81 + export interface Signature { 82 + $type?: 'sh.tangled.repo.branch#signature' 83 + /** Author name */ 84 + name: string 85 + /** Author email */ 86 + email: string 87 + /** Author timestamp */ 88 + when: string 89 + } 90 + 91 + const hashSignature = 'signature' 92 + 93 + export function isSignature<V>(v: V) { 94 + return is$typed(v, id, hashSignature) 95 + } 96 + 97 + export function validateSignature<V>(v: V) { 98 + return validate<Signature & V>(v, id, hashSignature) 99 + }
+58
src/lexicon/types/sh/tangled/repo/branches.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.branches' 17 + 18 + export type QueryParams = { 19 + /** Repository identifier in format 'did:plc:.../repoName' */ 20 + repo: string 21 + /** Maximum number of branches to return */ 22 + limit?: number 23 + /** Pagination cursor */ 24 + cursor?: string 25 + } 26 + export type InputSchema = undefined 27 + 28 + export interface CallOptions { 29 + signal?: AbortSignal 30 + headers?: HeadersMap 31 + } 32 + 33 + export interface Response { 34 + success: boolean 35 + headers: HeadersMap 36 + data: Uint8Array 37 + } 38 + 39 + export class RepoNotFoundError extends XRPCError { 40 + constructor(src: XRPCError) { 41 + super(src.status, src.error, src.message, src.headers, { cause: src }) 42 + } 43 + } 44 + 45 + export class InvalidRequestError extends XRPCError { 46 + constructor(src: XRPCError) { 47 + super(src.status, src.error, src.message, src.headers, { cause: src }) 48 + } 49 + } 50 + 51 + export function toKnownErr(e: any) { 52 + if (e instanceof XRPCError) { 53 + if (e.error === 'RepoNotFound') return new RepoNotFoundError(e) 54 + if (e.error === 'InvalidRequest') return new InvalidRequestError(e) 55 + } 56 + 57 + return e 58 + }
+40
src/lexicon/types/sh/tangled/repo/collaborator.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.repo.collaborator' 16 + 17 + export interface Main { 18 + $type: 'sh.tangled.repo.collaborator' 19 + subject: string 20 + /** repo to add this user to */ 21 + repo: string 22 + createdAt: string 23 + [k: string]: unknown 24 + } 25 + 26 + const hashMain = 'main' 27 + 28 + export function isMain<V>(v: V) { 29 + return is$typed(v, id, hashMain) 30 + } 31 + 32 + export function validateMain<V>(v: V) { 33 + return validate<Main & V>(v, id, hashMain, true) 34 + } 35 + 36 + export { 37 + type Main as Record, 38 + isMain as isRecord, 39 + validateMain as validateRecord, 40 + }
+72
src/lexicon/types/sh/tangled/repo/compare.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.compare' 17 + 18 + export type QueryParams = { 19 + /** Repository identifier in format 'did:plc:.../repoName' */ 20 + repo: string 21 + /** First revision (commit, branch, or tag) */ 22 + rev1: string 23 + /** Second revision (commit, branch, or tag) */ 24 + rev2: string 25 + } 26 + export type InputSchema = undefined 27 + 28 + export interface CallOptions { 29 + signal?: AbortSignal 30 + headers?: HeadersMap 31 + } 32 + 33 + export interface Response { 34 + success: boolean 35 + headers: HeadersMap 36 + data: Uint8Array 37 + } 38 + 39 + export class RepoNotFoundError extends XRPCError { 40 + constructor(src: XRPCError) { 41 + super(src.status, src.error, src.message, src.headers, { cause: src }) 42 + } 43 + } 44 + 45 + export class RevisionNotFoundError extends XRPCError { 46 + constructor(src: XRPCError) { 47 + super(src.status, src.error, src.message, src.headers, { cause: src }) 48 + } 49 + } 50 + 51 + export class InvalidRequestError extends XRPCError { 52 + constructor(src: XRPCError) { 53 + super(src.status, src.error, src.message, src.headers, { cause: src }) 54 + } 55 + } 56 + 57 + export class CompareError extends XRPCError { 58 + constructor(src: XRPCError) { 59 + super(src.status, src.error, src.message, src.headers, { cause: src }) 60 + } 61 + } 62 + 63 + export function toKnownErr(e: any) { 64 + if (e instanceof XRPCError) { 65 + if (e.error === 'RepoNotFound') return new RepoNotFoundError(e) 66 + if (e.error === 'RevisionNotFound') return new RevisionNotFoundError(e) 67 + if (e.error === 'InvalidRequest') return new InvalidRequestError(e) 68 + if (e.error === 'CompareError') return new CompareError(e) 69 + } 70 + 71 + return e 72 + }
+43
src/lexicon/types/sh/tangled/repo/create.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.create' 17 + 18 + export type QueryParams = {} 19 + 20 + export interface InputSchema { 21 + /** Rkey of the repository record */ 22 + rkey: string 23 + /** Default branch to push to */ 24 + defaultBranch?: string 25 + /** A source URL to clone from, populate this when forking or importing a repository. */ 26 + source?: string 27 + } 28 + 29 + export interface CallOptions { 30 + signal?: AbortSignal 31 + headers?: HeadersMap 32 + qp?: QueryParams 33 + encoding?: 'application/json' 34 + } 35 + 36 + export interface Response { 37 + success: boolean 38 + headers: HeadersMap 39 + } 40 + 41 + export function toKnownErr(e: any) { 42 + return e 43 + }
+43
src/lexicon/types/sh/tangled/repo/delete.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.delete' 17 + 18 + export type QueryParams = {} 19 + 20 + export interface InputSchema { 21 + /** DID of the repository owner */ 22 + did: string 23 + /** Name of the repository to delete */ 24 + name: string 25 + /** Rkey of the repository record */ 26 + rkey: string 27 + } 28 + 29 + export interface CallOptions { 30 + signal?: AbortSignal 31 + headers?: HeadersMap 32 + qp?: QueryParams 33 + encoding?: 'application/json' 34 + } 35 + 36 + export interface Response { 37 + success: boolean 38 + headers: HeadersMap 39 + } 40 + 41 + export function toKnownErr(e: any) { 42 + return e 43 + }
+39
src/lexicon/types/sh/tangled/repo/deleteBranch.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.deleteBranch' 17 + 18 + export type QueryParams = {} 19 + 20 + export interface InputSchema { 21 + repo: string 22 + branch: string 23 + } 24 + 25 + export interface CallOptions { 26 + signal?: AbortSignal 27 + headers?: HeadersMap 28 + qp?: QueryParams 29 + encoding?: 'application/json' 30 + } 31 + 32 + export interface Response { 33 + success: boolean 34 + headers: HeadersMap 35 + } 36 + 37 + export function toKnownErr(e: any) { 38 + return e 39 + }
+63
src/lexicon/types/sh/tangled/repo/diff.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.diff' 17 + 18 + export type QueryParams = { 19 + /** Repository identifier in format 'did:plc:.../repoName' */ 20 + repo: string 21 + /** Git reference (branch, tag, or commit SHA) */ 22 + ref: string 23 + } 24 + export type InputSchema = undefined 25 + 26 + export interface CallOptions { 27 + signal?: AbortSignal 28 + headers?: HeadersMap 29 + } 30 + 31 + export interface Response { 32 + success: boolean 33 + headers: HeadersMap 34 + data: Uint8Array 35 + } 36 + 37 + export class RepoNotFoundError extends XRPCError { 38 + constructor(src: XRPCError) { 39 + super(src.status, src.error, src.message, src.headers, { cause: src }) 40 + } 41 + } 42 + 43 + export class RefNotFoundError extends XRPCError { 44 + constructor(src: XRPCError) { 45 + super(src.status, src.error, src.message, src.headers, { cause: src }) 46 + } 47 + } 48 + 49 + export class InvalidRequestError extends XRPCError { 50 + constructor(src: XRPCError) { 51 + super(src.status, src.error, src.message, src.headers, { cause: src }) 52 + } 53 + } 54 + 55 + export function toKnownErr(e: any) { 56 + if (e instanceof XRPCError) { 57 + if (e.error === 'RepoNotFound') return new RepoNotFoundError(e) 58 + if (e.error === 'RefNotFound') return new RefNotFoundError(e) 59 + if (e.error === 'InvalidRequest') return new InvalidRequestError(e) 60 + } 61 + 62 + return e 63 + }
+53
src/lexicon/types/sh/tangled/repo/forkStatus.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.forkStatus' 17 + 18 + export type QueryParams = {} 19 + 20 + export interface InputSchema { 21 + /** DID of the fork owner */ 22 + did: string 23 + /** Name of the forked repository */ 24 + name: string 25 + /** Source repository URL */ 26 + source: string 27 + /** Branch to check status for */ 28 + branch: string 29 + /** Hidden ref to use for comparison */ 30 + hiddenRef: string 31 + } 32 + 33 + export interface OutputSchema { 34 + /** Fork status: 0=UpToDate, 1=FastForwardable, 2=Conflict, 3=MissingBranch */ 35 + status: number 36 + } 37 + 38 + export interface CallOptions { 39 + signal?: AbortSignal 40 + headers?: HeadersMap 41 + qp?: QueryParams 42 + encoding?: 'application/json' 43 + } 44 + 45 + export interface Response { 46 + success: boolean 47 + headers: HeadersMap 48 + data: OutputSchema 49 + } 50 + 51 + export function toKnownErr(e: any) { 52 + return e 53 + }
+45
src/lexicon/types/sh/tangled/repo/forkSync.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.forkSync' 17 + 18 + export type QueryParams = {} 19 + 20 + export interface InputSchema { 21 + /** DID of the fork owner */ 22 + did: string 23 + /** AT-URI of the source repository */ 24 + source: string 25 + /** Name of the forked repository */ 26 + name: string 27 + /** Branch to sync */ 28 + branch: string 29 + } 30 + 31 + export interface CallOptions { 32 + signal?: AbortSignal 33 + headers?: HeadersMap 34 + qp?: QueryParams 35 + encoding?: 'application/json' 36 + } 37 + 38 + export interface Response { 39 + success: boolean 40 + headers: HeadersMap 41 + } 42 + 43 + export function toKnownErr(e: any) { 44 + return e 45 + }
+88
src/lexicon/types/sh/tangled/repo/getDefaultBranch.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.getDefaultBranch' 17 + 18 + export type QueryParams = { 19 + /** Repository identifier in format 'did:plc:.../repoName' */ 20 + repo: string 21 + } 22 + export type InputSchema = undefined 23 + 24 + export interface OutputSchema { 25 + /** Default branch name */ 26 + name: string 27 + /** Latest commit hash on default branch */ 28 + hash: string 29 + /** Short commit hash */ 30 + shortHash?: string 31 + /** Timestamp of latest commit */ 32 + when: string 33 + /** Latest commit message */ 34 + message?: string 35 + author?: Signature 36 + } 37 + 38 + export interface CallOptions { 39 + signal?: AbortSignal 40 + headers?: HeadersMap 41 + } 42 + 43 + export interface Response { 44 + success: boolean 45 + headers: HeadersMap 46 + data: OutputSchema 47 + } 48 + 49 + export class RepoNotFoundError extends XRPCError { 50 + constructor(src: XRPCError) { 51 + super(src.status, src.error, src.message, src.headers, { cause: src }) 52 + } 53 + } 54 + 55 + export class InvalidRequestError extends XRPCError { 56 + constructor(src: XRPCError) { 57 + super(src.status, src.error, src.message, src.headers, { cause: src }) 58 + } 59 + } 60 + 61 + export function toKnownErr(e: any) { 62 + if (e instanceof XRPCError) { 63 + if (e.error === 'RepoNotFound') return new RepoNotFoundError(e) 64 + if (e.error === 'InvalidRequest') return new InvalidRequestError(e) 65 + } 66 + 67 + return e 68 + } 69 + 70 + export interface Signature { 71 + $type?: 'sh.tangled.repo.getDefaultBranch#signature' 72 + /** Author name */ 73 + name: string 74 + /** Author email */ 75 + email: string 76 + /** Author timestamp */ 77 + when: string 78 + } 79 + 80 + const hashSignature = 'signature' 81 + 82 + export function isSignature<V>(v: V) { 83 + return is$typed(v, id, hashSignature) 84 + } 85 + 86 + export function validateSignature<V>(v: V) { 87 + return validate<Signature & V>(v, id, hashSignature) 88 + }
+53
src/lexicon/types/sh/tangled/repo/hiddenRef.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.hiddenRef' 17 + 18 + export type QueryParams = {} 19 + 20 + export interface InputSchema { 21 + /** AT-URI of the repository */ 22 + repo: string 23 + /** Fork reference name */ 24 + forkRef: string 25 + /** Remote reference name */ 26 + remoteRef: string 27 + } 28 + 29 + export interface OutputSchema { 30 + /** Whether the hidden ref was created successfully */ 31 + success: boolean 32 + /** The created hidden ref name */ 33 + ref?: string 34 + /** Error message if creation failed */ 35 + error?: string 36 + } 37 + 38 + export interface CallOptions { 39 + signal?: AbortSignal 40 + headers?: HeadersMap 41 + qp?: QueryParams 42 + encoding?: 'application/json' 43 + } 44 + 45 + export interface Response { 46 + success: boolean 47 + headers: HeadersMap 48 + data: OutputSchema 49 + } 50 + 51 + export function toKnownErr(e: any) { 52 + return e 53 + }
+42
src/lexicon/types/sh/tangled/repo/issue.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.repo.issue' 16 + 17 + export interface Main { 18 + $type: 'sh.tangled.repo.issue' 19 + repo: string 20 + title: string 21 + body?: string 22 + createdAt: string 23 + mentions?: string[] 24 + references?: string[] 25 + [k: string]: unknown 26 + } 27 + 28 + const hashMain = 'main' 29 + 30 + export function isMain<V>(v: V) { 31 + return is$typed(v, id, hashMain) 32 + } 33 + 34 + export function validateMain<V>(v: V) { 35 + return validate<Main & V>(v, id, hashMain, true) 36 + } 37 + 38 + export { 39 + type Main as Record, 40 + isMain as isRecord, 41 + validateMain as validateRecord, 42 + }
+42
src/lexicon/types/sh/tangled/repo/issue/comment.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.repo.issue.comment' 16 + 17 + export interface Main { 18 + $type: 'sh.tangled.repo.issue.comment' 19 + issue: string 20 + body: string 21 + createdAt: string 22 + replyTo?: string 23 + mentions?: string[] 24 + references?: string[] 25 + [k: string]: unknown 26 + } 27 + 28 + const hashMain = 'main' 29 + 30 + export function isMain<V>(v: V) { 31 + return is$typed(v, id, hashMain) 32 + } 33 + 34 + export function validateMain<V>(v: V) { 35 + return validate<Main & V>(v, id, hashMain, true) 36 + } 37 + 38 + export { 39 + type Main as Record, 40 + isMain as isRecord, 41 + validateMain as validateRecord, 42 + }
+42
src/lexicon/types/sh/tangled/repo/issue/state.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.repo.issue.state' 16 + 17 + export interface Main { 18 + $type: 'sh.tangled.repo.issue.state' 19 + issue: string 20 + /** state of the issue */ 21 + state: 22 + | 'sh.tangled.repo.issue.state.open' 23 + | 'sh.tangled.repo.issue.state.closed' 24 + | (string & {}) 25 + [k: string]: unknown 26 + } 27 + 28 + const hashMain = 'main' 29 + 30 + export function isMain<V>(v: V) { 31 + return is$typed(v, id, hashMain) 32 + } 33 + 34 + export function validateMain<V>(v: V) { 35 + return validate<Main & V>(v, id, hashMain, true) 36 + } 37 + 38 + export { 39 + type Main as Record, 40 + isMain as isRecord, 41 + validateMain as validateRecord, 42 + }
+17
src/lexicon/types/sh/tangled/repo/issue/state/closed.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.repo.issue.state.closed' 16 + /** closed issue */ 17 + export const MAIN = `${id}#main`
+17
src/lexicon/types/sh/tangled/repo/issue/state/open.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.repo.issue.state.open' 16 + /** open issue */ 17 + export const MAIN = `${id}#main`
+99
src/lexicon/types/sh/tangled/repo/languages.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.languages' 17 + 18 + export type QueryParams = { 19 + /** Repository identifier in format 'did:plc:.../repoName' */ 20 + repo: string 21 + /** Git reference (branch, tag, or commit SHA) */ 22 + ref?: string 23 + } 24 + export type InputSchema = undefined 25 + 26 + export interface OutputSchema { 27 + /** The git reference used */ 28 + ref: string 29 + languages: Language[] 30 + /** Total size of all analyzed files in bytes */ 31 + totalSize?: number 32 + /** Total number of files analyzed */ 33 + totalFiles?: number 34 + } 35 + 36 + export interface CallOptions { 37 + signal?: AbortSignal 38 + headers?: HeadersMap 39 + } 40 + 41 + export interface Response { 42 + success: boolean 43 + headers: HeadersMap 44 + data: OutputSchema 45 + } 46 + 47 + export class RepoNotFoundError extends XRPCError { 48 + constructor(src: XRPCError) { 49 + super(src.status, src.error, src.message, src.headers, { cause: src }) 50 + } 51 + } 52 + 53 + export class RefNotFoundError extends XRPCError { 54 + constructor(src: XRPCError) { 55 + super(src.status, src.error, src.message, src.headers, { cause: src }) 56 + } 57 + } 58 + 59 + export class InvalidRequestError extends XRPCError { 60 + constructor(src: XRPCError) { 61 + super(src.status, src.error, src.message, src.headers, { cause: src }) 62 + } 63 + } 64 + 65 + export function toKnownErr(e: any) { 66 + if (e instanceof XRPCError) { 67 + if (e.error === 'RepoNotFound') return new RepoNotFoundError(e) 68 + if (e.error === 'RefNotFound') return new RefNotFoundError(e) 69 + if (e.error === 'InvalidRequest') return new InvalidRequestError(e) 70 + } 71 + 72 + return e 73 + } 74 + 75 + export interface Language { 76 + $type?: 'sh.tangled.repo.languages#language' 77 + /** Programming language name */ 78 + name: string 79 + /** Total size of files in this language (bytes) */ 80 + size: number 81 + /** Percentage of total codebase (0-100) */ 82 + percentage: number 83 + /** Number of files in this language */ 84 + fileCount?: number 85 + /** Hex color code for this language */ 86 + color?: string 87 + /** File extensions associated with this language */ 88 + extensions?: string[] 89 + } 90 + 91 + const hashLanguage = 'language' 92 + 93 + export function isLanguage<V>(v: V) { 94 + return is$typed(v, id, hashLanguage) 95 + } 96 + 97 + export function validateLanguage<V>(v: V) { 98 + return validate<Language & V>(v, id, hashLanguage) 99 + }
+58
src/lexicon/types/sh/tangled/repo/listSecrets.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.listSecrets' 17 + 18 + export type QueryParams = { 19 + repo: string 20 + } 21 + export type InputSchema = undefined 22 + 23 + export interface OutputSchema { 24 + secrets: Secret[] 25 + } 26 + 27 + export interface CallOptions { 28 + signal?: AbortSignal 29 + headers?: HeadersMap 30 + } 31 + 32 + export interface Response { 33 + success: boolean 34 + headers: HeadersMap 35 + data: OutputSchema 36 + } 37 + 38 + export function toKnownErr(e: any) { 39 + return e 40 + } 41 + 42 + export interface Secret { 43 + $type?: 'sh.tangled.repo.listSecrets#secret' 44 + repo: string 45 + key: string 46 + createdAt: string 47 + createdBy: string 48 + } 49 + 50 + const hashSecret = 'secret' 51 + 52 + export function isSecret<V>(v: V) { 53 + return is$typed(v, id, hashSecret) 54 + } 55 + 56 + export function validateSecret<V>(v: V) { 57 + return validate<Secret & V>(v, id, hashSecret) 58 + }
+76
src/lexicon/types/sh/tangled/repo/log.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.log' 17 + 18 + export type QueryParams = { 19 + /** Repository identifier in format 'did:plc:.../repoName' */ 20 + repo: string 21 + /** Git reference (branch, tag, or commit SHA) */ 22 + ref: string 23 + /** Path to filter commits by */ 24 + path?: string 25 + /** Maximum number of commits to return */ 26 + limit?: number 27 + /** Pagination cursor (commit SHA) */ 28 + cursor?: string 29 + } 30 + export type InputSchema = undefined 31 + 32 + export interface CallOptions { 33 + signal?: AbortSignal 34 + headers?: HeadersMap 35 + } 36 + 37 + export interface Response { 38 + success: boolean 39 + headers: HeadersMap 40 + data: Uint8Array 41 + } 42 + 43 + export class RepoNotFoundError extends XRPCError { 44 + constructor(src: XRPCError) { 45 + super(src.status, src.error, src.message, src.headers, { cause: src }) 46 + } 47 + } 48 + 49 + export class RefNotFoundError extends XRPCError { 50 + constructor(src: XRPCError) { 51 + super(src.status, src.error, src.message, src.headers, { cause: src }) 52 + } 53 + } 54 + 55 + export class PathNotFoundError extends XRPCError { 56 + constructor(src: XRPCError) { 57 + super(src.status, src.error, src.message, src.headers, { cause: src }) 58 + } 59 + } 60 + 61 + export class InvalidRequestError extends XRPCError { 62 + constructor(src: XRPCError) { 63 + super(src.status, src.error, src.message, src.headers, { cause: src }) 64 + } 65 + } 66 + 67 + export function toKnownErr(e: any) { 68 + if (e instanceof XRPCError) { 69 + if (e.error === 'RepoNotFound') return new RepoNotFoundError(e) 70 + if (e.error === 'RefNotFound') return new RefNotFoundError(e) 71 + if (e.error === 'PathNotFound') return new PathNotFoundError(e) 72 + if (e.error === 'InvalidRequest') return new InvalidRequestError(e) 73 + } 74 + 75 + return e 76 + }
+53
src/lexicon/types/sh/tangled/repo/merge.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.merge' 17 + 18 + export type QueryParams = {} 19 + 20 + export interface InputSchema { 21 + /** DID of the repository owner */ 22 + did: string 23 + /** Name of the repository */ 24 + name: string 25 + /** Patch content to merge */ 26 + patch: string 27 + /** Target branch to merge into */ 28 + branch: string 29 + /** Author name for the merge commit */ 30 + authorName?: string 31 + /** Author email for the merge commit */ 32 + authorEmail?: string 33 + /** Additional commit message body */ 34 + commitBody?: string 35 + /** Merge commit message */ 36 + commitMessage?: string 37 + } 38 + 39 + export interface CallOptions { 40 + signal?: AbortSignal 41 + headers?: HeadersMap 42 + qp?: QueryParams 43 + encoding?: 'application/json' 44 + } 45 + 46 + export interface Response { 47 + success: boolean 48 + headers: HeadersMap 49 + } 50 + 51 + export function toKnownErr(e: any) { 52 + return e 53 + }
+75
src/lexicon/types/sh/tangled/repo/mergeCheck.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.mergeCheck' 17 + 18 + export type QueryParams = {} 19 + 20 + export interface InputSchema { 21 + /** DID of the repository owner */ 22 + did: string 23 + /** Name of the repository */ 24 + name: string 25 + /** Patch or pull request to check for merge conflicts */ 26 + patch: string 27 + /** Target branch to merge into */ 28 + branch: string 29 + } 30 + 31 + export interface OutputSchema { 32 + /** Whether the merge has conflicts */ 33 + is_conflicted: boolean 34 + /** List of files with merge conflicts */ 35 + conflicts?: ConflictInfo[] 36 + /** Additional message about the merge check */ 37 + message?: string 38 + /** Error message if check failed */ 39 + error?: string 40 + } 41 + 42 + export interface CallOptions { 43 + signal?: AbortSignal 44 + headers?: HeadersMap 45 + qp?: QueryParams 46 + encoding?: 'application/json' 47 + } 48 + 49 + export interface Response { 50 + success: boolean 51 + headers: HeadersMap 52 + data: OutputSchema 53 + } 54 + 55 + export function toKnownErr(e: any) { 56 + return e 57 + } 58 + 59 + export interface ConflictInfo { 60 + $type?: 'sh.tangled.repo.mergeCheck#conflictInfo' 61 + /** Name of the conflicted file */ 62 + filename: string 63 + /** Reason for the conflict */ 64 + reason: string 65 + } 66 + 67 + const hashConflictInfo = 'conflictInfo' 68 + 69 + export function isConflictInfo<V>(v: V) { 70 + return is$typed(v, id, hashConflictInfo) 71 + } 72 + 73 + export function validateConflictInfo<V>(v: V) { 74 + return validate<ConflictInfo & V>(v, id, hashConflictInfo) 75 + }
+80
src/lexicon/types/sh/tangled/repo/pull.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.repo.pull' 16 + 17 + export interface Main { 18 + $type: 'sh.tangled.repo.pull' 19 + target: Target 20 + title: string 21 + body?: string 22 + /** (deprecated) use patchBlob instead */ 23 + patch?: string 24 + /** patch content */ 25 + patchBlob: BlobRef 26 + source?: Source 27 + createdAt: string 28 + mentions?: string[] 29 + references?: string[] 30 + [k: string]: unknown 31 + } 32 + 33 + const hashMain = 'main' 34 + 35 + export function isMain<V>(v: V) { 36 + return is$typed(v, id, hashMain) 37 + } 38 + 39 + export function validateMain<V>(v: V) { 40 + return validate<Main & V>(v, id, hashMain, true) 41 + } 42 + 43 + export { 44 + type Main as Record, 45 + isMain as isRecord, 46 + validateMain as validateRecord, 47 + } 48 + 49 + export interface Target { 50 + $type?: 'sh.tangled.repo.pull#target' 51 + repo: string 52 + branch: string 53 + } 54 + 55 + const hashTarget = 'target' 56 + 57 + export function isTarget<V>(v: V) { 58 + return is$typed(v, id, hashTarget) 59 + } 60 + 61 + export function validateTarget<V>(v: V) { 62 + return validate<Target & V>(v, id, hashTarget) 63 + } 64 + 65 + export interface Source { 66 + $type?: 'sh.tangled.repo.pull#source' 67 + branch: string 68 + sha: string 69 + repo?: string 70 + } 71 + 72 + const hashSource = 'source' 73 + 74 + export function isSource<V>(v: V) { 75 + return is$typed(v, id, hashSource) 76 + } 77 + 78 + export function validateSource<V>(v: V) { 79 + return validate<Source & V>(v, id, hashSource) 80 + }
+41
src/lexicon/types/sh/tangled/repo/pull/comment.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.repo.pull.comment' 16 + 17 + export interface Main { 18 + $type: 'sh.tangled.repo.pull.comment' 19 + pull: string 20 + body: string 21 + createdAt: string 22 + mentions?: string[] 23 + references?: string[] 24 + [k: string]: unknown 25 + } 26 + 27 + const hashMain = 'main' 28 + 29 + export function isMain<V>(v: V) { 30 + return is$typed(v, id, hashMain) 31 + } 32 + 33 + export function validateMain<V>(v: V) { 34 + return validate<Main & V>(v, id, hashMain, true) 35 + } 36 + 37 + export { 38 + type Main as Record, 39 + isMain as isRecord, 40 + validateMain as validateRecord, 41 + }
+43
src/lexicon/types/sh/tangled/repo/pull/status.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.repo.pull.status' 16 + 17 + export interface Main { 18 + $type: 'sh.tangled.repo.pull.status' 19 + pull: string 20 + /** status of the pull request */ 21 + status: 22 + | 'sh.tangled.repo.pull.status.open' 23 + | 'sh.tangled.repo.pull.status.closed' 24 + | 'sh.tangled.repo.pull.status.merged' 25 + | (string & {}) 26 + [k: string]: unknown 27 + } 28 + 29 + const hashMain = 'main' 30 + 31 + export function isMain<V>(v: V) { 32 + return is$typed(v, id, hashMain) 33 + } 34 + 35 + export function validateMain<V>(v: V) { 36 + return validate<Main & V>(v, id, hashMain, true) 37 + } 38 + 39 + export { 40 + type Main as Record, 41 + isMain as isRecord, 42 + validateMain as validateRecord, 43 + }
+17
src/lexicon/types/sh/tangled/repo/pull/status/closed.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.repo.pull.status.closed' 16 + /** closed pull request */ 17 + export const MAIN = `${id}#main`
+17
src/lexicon/types/sh/tangled/repo/pull/status/merged.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.repo.pull.status.merged' 16 + /** merged pull request */ 17 + export const MAIN = `${id}#main`
+17
src/lexicon/types/sh/tangled/repo/pull/status/open.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.repo.pull.status.open' 16 + /** open pull request */ 17 + export const MAIN = `${id}#main`
+39
src/lexicon/types/sh/tangled/repo/removeSecret.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.removeSecret' 17 + 18 + export type QueryParams = {} 19 + 20 + export interface InputSchema { 21 + repo: string 22 + key: string 23 + } 24 + 25 + export interface CallOptions { 26 + signal?: AbortSignal 27 + headers?: HeadersMap 28 + qp?: QueryParams 29 + encoding?: 'application/json' 30 + } 31 + 32 + export interface Response { 33 + success: boolean 34 + headers: HeadersMap 35 + } 36 + 37 + export function toKnownErr(e: any) { 38 + return e 39 + }
+39
src/lexicon/types/sh/tangled/repo/setDefaultBranch.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.setDefaultBranch' 17 + 18 + export type QueryParams = {} 19 + 20 + export interface InputSchema { 21 + repo: string 22 + defaultBranch: string 23 + } 24 + 25 + export interface CallOptions { 26 + signal?: AbortSignal 27 + headers?: HeadersMap 28 + qp?: QueryParams 29 + encoding?: 'application/json' 30 + } 31 + 32 + export interface Response { 33 + success: boolean 34 + headers: HeadersMap 35 + } 36 + 37 + export function toKnownErr(e: any) { 38 + return e 39 + }
+63
src/lexicon/types/sh/tangled/repo/tag.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.tag' 17 + 18 + export type QueryParams = { 19 + /** Repository identifier in format 'did:plc:.../repoName' */ 20 + repo: string 21 + /** Name of tag, such as v1.3.0 */ 22 + tag: string 23 + } 24 + export type InputSchema = undefined 25 + 26 + export interface CallOptions { 27 + signal?: AbortSignal 28 + headers?: HeadersMap 29 + } 30 + 31 + export interface Response { 32 + success: boolean 33 + headers: HeadersMap 34 + data: Uint8Array 35 + } 36 + 37 + export class RepoNotFoundError extends XRPCError { 38 + constructor(src: XRPCError) { 39 + super(src.status, src.error, src.message, src.headers, { cause: src }) 40 + } 41 + } 42 + 43 + export class TagNotFoundError extends XRPCError { 44 + constructor(src: XRPCError) { 45 + super(src.status, src.error, src.message, src.headers, { cause: src }) 46 + } 47 + } 48 + 49 + export class InvalidRequestError extends XRPCError { 50 + constructor(src: XRPCError) { 51 + super(src.status, src.error, src.message, src.headers, { cause: src }) 52 + } 53 + } 54 + 55 + export function toKnownErr(e: any) { 56 + if (e instanceof XRPCError) { 57 + if (e.error === 'RepoNotFound') return new RepoNotFoundError(e) 58 + if (e.error === 'TagNotFound') return new TagNotFoundError(e) 59 + if (e.error === 'InvalidRequest') return new InvalidRequestError(e) 60 + } 61 + 62 + return e 63 + }
+58
src/lexicon/types/sh/tangled/repo/tags.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.tags' 17 + 18 + export type QueryParams = { 19 + /** Repository identifier in format 'did:plc:.../repoName' */ 20 + repo: string 21 + /** Maximum number of tags to return */ 22 + limit?: number 23 + /** Pagination cursor */ 24 + cursor?: string 25 + } 26 + export type InputSchema = undefined 27 + 28 + export interface CallOptions { 29 + signal?: AbortSignal 30 + headers?: HeadersMap 31 + } 32 + 33 + export interface Response { 34 + success: boolean 35 + headers: HeadersMap 36 + data: Uint8Array 37 + } 38 + 39 + export class RepoNotFoundError extends XRPCError { 40 + constructor(src: XRPCError) { 41 + super(src.status, src.error, src.message, src.headers, { cause: src }) 42 + } 43 + } 44 + 45 + export class InvalidRequestError extends XRPCError { 46 + constructor(src: XRPCError) { 47 + super(src.status, src.error, src.message, src.headers, { cause: src }) 48 + } 49 + } 50 + 51 + export function toKnownErr(e: any) { 52 + if (e instanceof XRPCError) { 53 + if (e.error === 'RepoNotFound') return new RepoNotFoundError(e) 54 + if (e.error === 'InvalidRequest') return new InvalidRequestError(e) 55 + } 56 + 57 + return e 58 + }
+164
src/lexicon/types/sh/tangled/repo/tree.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { HeadersMap, XRPCError } from '@atproto/xrpc' 5 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 6 + import { CID } from 'multiformats/cid' 7 + import { validate as _validate } from '../../../../lexicons' 8 + import { 9 + type $Typed, 10 + is$typed as _is$typed, 11 + type OmitKey, 12 + } from '../../../../util' 13 + 14 + const is$typed = _is$typed, 15 + validate = _validate 16 + const id = 'sh.tangled.repo.tree' 17 + 18 + export type QueryParams = { 19 + /** Repository identifier in format 'did:plc:.../repoName' */ 20 + repo: string 21 + /** Git reference (branch, tag, or commit SHA) */ 22 + ref: string 23 + /** Path within the repository tree */ 24 + path?: string 25 + } 26 + export type InputSchema = undefined 27 + 28 + export interface OutputSchema { 29 + /** The git reference used */ 30 + ref: string 31 + /** The parent path in the tree */ 32 + parent?: string 33 + /** Parent directory path */ 34 + dotdot?: string 35 + readme?: Readme 36 + lastCommit?: LastCommit 37 + files: TreeEntry[] 38 + } 39 + 40 + export interface CallOptions { 41 + signal?: AbortSignal 42 + headers?: HeadersMap 43 + } 44 + 45 + export interface Response { 46 + success: boolean 47 + headers: HeadersMap 48 + data: OutputSchema 49 + } 50 + 51 + export class RepoNotFoundError extends XRPCError { 52 + constructor(src: XRPCError) { 53 + super(src.status, src.error, src.message, src.headers, { cause: src }) 54 + } 55 + } 56 + 57 + export class RefNotFoundError extends XRPCError { 58 + constructor(src: XRPCError) { 59 + super(src.status, src.error, src.message, src.headers, { cause: src }) 60 + } 61 + } 62 + 63 + export class PathNotFoundError extends XRPCError { 64 + constructor(src: XRPCError) { 65 + super(src.status, src.error, src.message, src.headers, { cause: src }) 66 + } 67 + } 68 + 69 + export class InvalidRequestError extends XRPCError { 70 + constructor(src: XRPCError) { 71 + super(src.status, src.error, src.message, src.headers, { cause: src }) 72 + } 73 + } 74 + 75 + export function toKnownErr(e: any) { 76 + if (e instanceof XRPCError) { 77 + if (e.error === 'RepoNotFound') return new RepoNotFoundError(e) 78 + if (e.error === 'RefNotFound') return new RefNotFoundError(e) 79 + if (e.error === 'PathNotFound') return new PathNotFoundError(e) 80 + if (e.error === 'InvalidRequest') return new InvalidRequestError(e) 81 + } 82 + 83 + return e 84 + } 85 + 86 + export interface Readme { 87 + $type?: 'sh.tangled.repo.tree#readme' 88 + /** Name of the readme file */ 89 + filename: string 90 + /** Contents of the readme file */ 91 + contents: string 92 + } 93 + 94 + const hashReadme = 'readme' 95 + 96 + export function isReadme<V>(v: V) { 97 + return is$typed(v, id, hashReadme) 98 + } 99 + 100 + export function validateReadme<V>(v: V) { 101 + return validate<Readme & V>(v, id, hashReadme) 102 + } 103 + 104 + export interface TreeEntry { 105 + $type?: 'sh.tangled.repo.tree#treeEntry' 106 + /** Relative file or directory name */ 107 + name: string 108 + /** File mode */ 109 + mode: string 110 + /** File size in bytes */ 111 + size: number 112 + last_commit?: LastCommit 113 + } 114 + 115 + const hashTreeEntry = 'treeEntry' 116 + 117 + export function isTreeEntry<V>(v: V) { 118 + return is$typed(v, id, hashTreeEntry) 119 + } 120 + 121 + export function validateTreeEntry<V>(v: V) { 122 + return validate<TreeEntry & V>(v, id, hashTreeEntry) 123 + } 124 + 125 + export interface LastCommit { 126 + $type?: 'sh.tangled.repo.tree#lastCommit' 127 + /** Commit hash */ 128 + hash: string 129 + /** Commit message */ 130 + message: string 131 + author?: Signature 132 + /** Commit timestamp */ 133 + when: string 134 + } 135 + 136 + const hashLastCommit = 'lastCommit' 137 + 138 + export function isLastCommit<V>(v: V) { 139 + return is$typed(v, id, hashLastCommit) 140 + } 141 + 142 + export function validateLastCommit<V>(v: V) { 143 + return validate<LastCommit & V>(v, id, hashLastCommit) 144 + } 145 + 146 + export interface Signature { 147 + $type?: 'sh.tangled.repo.tree#signature' 148 + /** Author name */ 149 + name: string 150 + /** Author email */ 151 + email: string 152 + /** Author timestamp */ 153 + when: string 154 + } 155 + 156 + const hashSignature = 'signature' 157 + 158 + export function isSignature<V>(v: V) { 159 + return is$typed(v, id, hashSignature) 160 + } 161 + 162 + export function validateSignature<V>(v: V) { 163 + return validate<Signature & V>(v, id, hashSignature) 164 + }
+33
src/lexicon/types/sh/tangled/spindle.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../lexicons' 7 + import { type $Typed, is$typed as _is$typed, type OmitKey } from '../../../util' 8 + 9 + const is$typed = _is$typed, 10 + validate = _validate 11 + const id = 'sh.tangled.spindle' 12 + 13 + export interface Main { 14 + $type: 'sh.tangled.spindle' 15 + createdAt: string 16 + [k: string]: unknown 17 + } 18 + 19 + const hashMain = 'main' 20 + 21 + export function isMain<V>(v: V) { 22 + return is$typed(v, id, hashMain) 23 + } 24 + 25 + export function validateMain<V>(v: V) { 26 + return validate<Main & V>(v, id, hashMain, true) 27 + } 28 + 29 + export { 30 + type Main as Record, 31 + isMain as isRecord, 32 + validateMain as validateRecord, 33 + }
+40
src/lexicon/types/sh/tangled/spindle/member.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../../lexicons' 7 + import { 8 + type $Typed, 9 + is$typed as _is$typed, 10 + type OmitKey, 11 + } from '../../../../util' 12 + 13 + const is$typed = _is$typed, 14 + validate = _validate 15 + const id = 'sh.tangled.spindle.member' 16 + 17 + export interface Main { 18 + $type: 'sh.tangled.spindle.member' 19 + subject: string 20 + /** spindle instance that the subject is now a member of */ 21 + instance: string 22 + createdAt: string 23 + [k: string]: unknown 24 + } 25 + 26 + const hashMain = 'main' 27 + 28 + export function isMain<V>(v: V) { 29 + return is$typed(v, id, hashMain) 30 + } 31 + 32 + export function validateMain<V>(v: V) { 33 + return validate<Main & V>(v, id, hashMain, true) 34 + } 35 + 36 + export { 37 + type Main as Record, 38 + isMain as isRecord, 39 + validateMain as validateRecord, 40 + }
+36
src/lexicon/types/sh/tangled/string.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + import { type ValidationResult, BlobRef } from '@atproto/lexicon' 5 + import { CID } from 'multiformats/cid' 6 + import { validate as _validate } from '../../../lexicons' 7 + import { type $Typed, is$typed as _is$typed, type OmitKey } from '../../../util' 8 + 9 + const is$typed = _is$typed, 10 + validate = _validate 11 + const id = 'sh.tangled.string' 12 + 13 + export interface Main { 14 + $type: 'sh.tangled.string' 15 + filename: string 16 + description: string 17 + createdAt: string 18 + contents: string 19 + [k: string]: unknown 20 + } 21 + 22 + const hashMain = 'main' 23 + 24 + export function isMain<V>(v: V) { 25 + return is$typed(v, id, hashMain) 26 + } 27 + 28 + export function validateMain<V>(v: V) { 29 + return validate<Main & V>(v, id, hashMain, true) 30 + } 31 + 32 + export { 33 + type Main as Record, 34 + isMain as isRecord, 35 + validateMain as validateRecord, 36 + }
+82
src/lexicon/util.ts
··· 1 + /** 2 + * GENERATED CODE - DO NOT MODIFY 3 + */ 4 + 5 + import { type ValidationResult } from '@atproto/lexicon' 6 + 7 + export type OmitKey<T, K extends keyof T> = { 8 + [K2 in keyof T as K2 extends K ? never : K2]: T[K2] 9 + } 10 + 11 + export type $Typed<V, T extends string = string> = V & { $type: T } 12 + export type Un$Typed<V extends { $type?: string }> = OmitKey<V, '$type'> 13 + 14 + export type $Type<Id extends string, Hash extends string> = Hash extends 'main' 15 + ? Id 16 + : `${Id}#${Hash}` 17 + 18 + function isObject<V>(v: V): v is V & object { 19 + return v != null && typeof v === 'object' 20 + } 21 + 22 + function is$type<Id extends string, Hash extends string>( 23 + $type: unknown, 24 + id: Id, 25 + hash: Hash, 26 + ): $type is $Type<Id, Hash> { 27 + return hash === 'main' 28 + ? $type === id 29 + : // $type === `${id}#${hash}` 30 + typeof $type === 'string' && 31 + $type.length === id.length + 1 + hash.length && 32 + $type.charCodeAt(id.length) === 35 /* '#' */ && 33 + $type.startsWith(id) && 34 + $type.endsWith(hash) 35 + } 36 + 37 + export type $TypedObject< 38 + V, 39 + Id extends string, 40 + Hash extends string, 41 + > = V extends { 42 + $type: $Type<Id, Hash> 43 + } 44 + ? V 45 + : V extends { $type?: string } 46 + ? V extends { $type?: infer T extends $Type<Id, Hash> } 47 + ? V & { $type: T } 48 + : never 49 + : V & { $type: $Type<Id, Hash> } 50 + 51 + export function is$typed<V, Id extends string, Hash extends string>( 52 + v: V, 53 + id: Id, 54 + hash: Hash, 55 + ): v is $TypedObject<V, Id, Hash> { 56 + return isObject(v) && '$type' in v && is$type(v.$type, id, hash) 57 + } 58 + 59 + export function maybe$typed<V, Id extends string, Hash extends string>( 60 + v: V, 61 + id: Id, 62 + hash: Hash, 63 + ): v is V & object & { $type?: $Type<Id, Hash> } { 64 + return ( 65 + isObject(v) && 66 + ('$type' in v ? v.$type === undefined || is$type(v.$type, id, hash) : true) 67 + ) 68 + } 69 + 70 + export type Validator<R = unknown> = (v: unknown) => ValidationResult<R> 71 + export type ValidatorParam<V extends Validator> = 72 + V extends Validator<infer R> ? R : never 73 + 74 + /** 75 + * Utility function that allows to convert a "validate*" utility function into a 76 + * type predicate. 77 + */ 78 + export function asPredicate<V extends Validator>(validate: V) { 79 + return function <T>(v: T): v is T & ValidatorParam<V> { 80 + return validate(v).success 81 + } 82 + }