From cc47b16bb2f3e73cd1fbbca16945f1ba369ba0b2 Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Mon, 3 Aug 2026 11:00:05 +0300 Subject: [PATCH] api: generate `org.tangled` as `api/org_tangled` Avoid placing both `org.tangled` and `sh.tangled` at same place. That cause name conflicts and import cycle from generated code (especially go.) Signed-off-by: Seongmin Lee Signed-off-by: dawn --- api/org_tangled/accountbeginSignup.go | 32 + api/org_tangled/accountcompleteSignup.go | 43 + api/org_tangled/accountdeleteEmail.go | 30 + api/org_tangled/accountdismissNewsletter.go | 24 + api/org_tangled/accountlistEmails.go | 41 + api/org_tangled/accountsetPrimaryEmail.go | 30 + api/org_tangled/accountsubscribeNewsletter.go | 24 + api/org_tangled/cbor_gen.go | 446 ++++++++ api/org_tangled/feedsubscription.go | 113 ++ api/org_tangled/focusbeginSession.go | 37 + api/org_tangled/focusendSession.go | 24 + api/org_tangled/focusnextItem.go | 43 + api/org_tangled/modban.go | 30 + api/org_tangled/moddefs.go | 17 + api/org_tangled/modgetBan.go | 36 + api/org_tangled/modlistBans.go | 31 + api/org_tangled/modunban.go | 30 + .../notificationdeleteNotification.go | 30 + api/org_tangled/notificationgetPreferences.go | 39 + api/org_tangled/notificationgetUnreadCount.go | 30 + .../notificationlistNotifications.go | 71 ++ api/org_tangled/notificationlistRecipients.go | 39 + api/org_tangled/notificationmarkAllRead.go | 24 + api/org_tangled/notificationmarkEntityRead.go | 30 + .../notificationupdatePreferences.go | 38 + api/org_tangled/notificationupdateSeen.go | 31 + api/org_tangled/quotadefs.go | 33 + api/org_tangled/quotaget.go | 38 + api/org_tangled/quotalist.go | 31 + api/org_tangled/quotaset.go | 36 + api/org_tangled/quotaunset.go | 32 + api/org_tangled/quotausage.go | 42 + api/org_tangled/repocreateWebhook.go | 45 + api/org_tangled/repodeleteWebhook.go | 32 + api/org_tangled/repodisableSite.go | 30 + api/org_tangled/repogetSiteConfig.go | 46 + api/org_tangled/repolistWebhookDeliveries.go | 55 + api/org_tangled/repolistWebhooks.go | 49 + api/org_tangled/reporetryWebhookDelivery.go | 34 + api/org_tangled/repotoggleWebhook.go | 39 + api/org_tangled/repoupdateSiteConfig.go | 36 + api/org_tangled/repoupdateWebhook.go | 36 + api/org_tangled/searchsearchCode.go | 79 ++ api/org_tangled/siteclaimDomain.go | 30 + api/org_tangled/sitegetDomainClaim.go | 31 + api/org_tangled/sitereleaseDomain.go | 30 + api/tangled/accountbeginSignup.go | 32 - api/tangled/accountcompleteSignup.go | 43 - api/tangled/accountdeleteEmail.go | 30 - api/tangled/accountdismissNewsletter.go | 24 - api/tangled/accountlistEmails.go | 41 - api/tangled/accountsetPrimaryEmail.go | 30 - api/tangled/accountsubscribeNewsletter.go | 24 - api/tangled/actorgetTrending.go | 31 + api/tangled/bobbinawaitRecord.go | 46 + api/tangled/cbor_gen.go | 976 +++++++----------- api/tangled/embedcommit.go | 83 ++ api/tangled/feedcomment.go | 61 +- api/tangled/feedlistComments.go | 8 +- api/tangled/feedlistCommentsBy.go | 8 +- api/tangled/feedlistReactions.go | 8 +- api/tangled/feedlistReactionsBy.go | 8 +- api/tangled/feedlistStars.go | 8 +- api/tangled/feedlistStarsBy.go | 8 +- api/tangled/feedsubscription.go | 115 --- api/tangled/focusbeginSession.go | 37 - api/tangled/focusendSession.go | 24 - api/tangled/focusnextItem.go | 43 - api/tangled/gitdefs.go | 47 + api/tangled/gitkeepCommit.go | 2 +- api/tangled/gitlistRefUpdates.go | 8 +- api/tangled/gitlistRefUpdatesBy.go | 8 +- api/tangled/gitmergeCheck.go | 19 +- api/tangled/gitmergeCommit.go | 18 +- api/tangled/gitoid.go | 22 + api/tangled/graphlistFollows.go | 8 +- api/tangled/graphlistFollowsBy.go | 8 +- api/tangled/graphlistNetworkVouches.go | 51 + api/tangled/graphlistVouches.go | 8 +- api/tangled/graphlistVouchesBy.go | 8 +- api/tangled/knotlistKnots.go | 8 +- api/tangled/knotlistMembers.go | 8 +- api/tangled/knotlistMembersBy.go | 8 +- api/tangled/labellistDefinitions.go | 8 +- api/tangled/labellistOps.go | 8 +- api/tangled/labellistOpsBy.go | 8 +- api/tangled/notificationdeleteNotification.go | 30 - api/tangled/notificationgetPreferences.go | 39 - api/tangled/notificationgetUnreadCount.go | 30 - api/tangled/notificationlistNotifications.go | 71 -- api/tangled/notificationlistRecipients.go | 39 - api/tangled/notificationmarkAllRead.go | 24 - api/tangled/notificationmarkEntityRead.go | 30 - api/tangled/notificationupdatePreferences.go | 38 - api/tangled/notificationupdateSeen.go | 31 - api/tangled/pipelinelistPipelines.go | 8 +- api/tangled/pipelinelistPipelinesBy.go | 8 +- api/tangled/pipelinelistStatuses.go | 8 +- api/tangled/pipelinelistStatusesBy.go | 8 +- api/tangled/publicKeylistKeys.go | 8 +- api/tangled/pulldefs.go | 48 + api/tangled/pullgetPullView.go | 28 + api/tangled/pulllistPullViews.go | 46 + api/tangled/queryenrichResponse.go | 4 +- api/tangled/quotadefs.go | 33 - api/tangled/quotaget.go | 38 - api/tangled/quotalist.go | 31 - api/tangled/quotaset.go | 36 - api/tangled/quotaunset.go | 32 - api/tangled/quotausage.go | 42 - api/tangled/repocreateWebhook.go | 45 - api/tangled/repodefs.go | 2 + api/tangled/repodeleteWebhook.go | 32 - api/tangled/repodisableSite.go | 30 - api/tangled/repogetSiteConfig.go | 46 - api/tangled/repolistArtifacts.go | 8 +- api/tangled/repolistArtifactsBy.go | 8 +- api/tangled/repolistCollaborators.go | 8 +- api/tangled/repolistCollaboratorsBy.go | 8 +- api/tangled/repolistIssues.go | 8 +- api/tangled/repolistIssuesBy.go | 8 +- api/tangled/repolistPulls.go | 8 +- api/tangled/repolistPullsBy.go | 8 +- api/tangled/repolistRepos.go | 8 +- api/tangled/repolistWebhookDeliveries.go | 55 - api/tangled/repolistWebhooks.go | 49 - api/tangled/repopull.go | 4 +- api/tangled/reporetryWebhookDelivery.go | 34 - api/tangled/repotoggleWebhook.go | 39 - api/tangled/repoupdateSiteConfig.go | 36 - api/tangled/repoupdateWebhook.go | 36 - api/tangled/searchquery.go | 6 +- api/tangled/searchsearchCode.go | 79 -- api/tangled/siteclaimDomain.go | 30 - api/tangled/sitegetDomainClaim.go | 31 - api/tangled/sitereleaseDomain.go | 30 - api/tangled/spindlelistMembers.go | 8 +- api/tangled/spindlelistMembersBy.go | 8 +- api/tangled/spindlelistSpindles.go | 8 +- api/tangled/stringlistStrings.go | 8 +- api/tangled/temp2getDiff.go | 36 + api/tangled/temp2getInterdiff.go | 38 + api/tangled/temp2listCommits.go | 72 ++ api/tangled/temp2mergeCheck.go | 51 + cmd/cborgen/cborgen.go | 16 +- flake.nix | 16 +- lexicon-build-config.json | 6 +- lexicons/feed/subscription.json | 9 +- 148 files changed, 3507 insertions(+), 2225 deletions(-) create mode 100644 api/org_tangled/accountbeginSignup.go create mode 100644 api/org_tangled/accountcompleteSignup.go create mode 100644 api/org_tangled/accountdeleteEmail.go create mode 100644 api/org_tangled/accountdismissNewsletter.go create mode 100644 api/org_tangled/accountlistEmails.go create mode 100644 api/org_tangled/accountsetPrimaryEmail.go create mode 100644 api/org_tangled/accountsubscribeNewsletter.go create mode 100644 api/org_tangled/cbor_gen.go create mode 100644 api/org_tangled/feedsubscription.go create mode 100644 api/org_tangled/focusbeginSession.go create mode 100644 api/org_tangled/focusendSession.go create mode 100644 api/org_tangled/focusnextItem.go create mode 100644 api/org_tangled/modban.go create mode 100644 api/org_tangled/moddefs.go create mode 100644 api/org_tangled/modgetBan.go create mode 100644 api/org_tangled/modlistBans.go create mode 100644 api/org_tangled/modunban.go create mode 100644 api/org_tangled/notificationdeleteNotification.go create mode 100644 api/org_tangled/notificationgetPreferences.go create mode 100644 api/org_tangled/notificationgetUnreadCount.go create mode 100644 api/org_tangled/notificationlistNotifications.go create mode 100644 api/org_tangled/notificationlistRecipients.go create mode 100644 api/org_tangled/notificationmarkAllRead.go create mode 100644 api/org_tangled/notificationmarkEntityRead.go create mode 100644 api/org_tangled/notificationupdatePreferences.go create mode 100644 api/org_tangled/notificationupdateSeen.go create mode 100644 api/org_tangled/quotadefs.go create mode 100644 api/org_tangled/quotaget.go create mode 100644 api/org_tangled/quotalist.go create mode 100644 api/org_tangled/quotaset.go create mode 100644 api/org_tangled/quotaunset.go create mode 100644 api/org_tangled/quotausage.go create mode 100644 api/org_tangled/repocreateWebhook.go create mode 100644 api/org_tangled/repodeleteWebhook.go create mode 100644 api/org_tangled/repodisableSite.go create mode 100644 api/org_tangled/repogetSiteConfig.go create mode 100644 api/org_tangled/repolistWebhookDeliveries.go create mode 100644 api/org_tangled/repolistWebhooks.go create mode 100644 api/org_tangled/reporetryWebhookDelivery.go create mode 100644 api/org_tangled/repotoggleWebhook.go create mode 100644 api/org_tangled/repoupdateSiteConfig.go create mode 100644 api/org_tangled/repoupdateWebhook.go create mode 100644 api/org_tangled/searchsearchCode.go create mode 100644 api/org_tangled/siteclaimDomain.go create mode 100644 api/org_tangled/sitegetDomainClaim.go create mode 100644 api/org_tangled/sitereleaseDomain.go delete mode 100644 api/tangled/accountbeginSignup.go delete mode 100644 api/tangled/accountcompleteSignup.go delete mode 100644 api/tangled/accountdeleteEmail.go delete mode 100644 api/tangled/accountdismissNewsletter.go delete mode 100644 api/tangled/accountlistEmails.go delete mode 100644 api/tangled/accountsetPrimaryEmail.go delete mode 100644 api/tangled/accountsubscribeNewsletter.go create mode 100644 api/tangled/actorgetTrending.go create mode 100644 api/tangled/bobbinawaitRecord.go create mode 100644 api/tangled/embedcommit.go delete mode 100644 api/tangled/feedsubscription.go delete mode 100644 api/tangled/focusbeginSession.go delete mode 100644 api/tangled/focusendSession.go delete mode 100644 api/tangled/focusnextItem.go create mode 100644 api/tangled/gitoid.go create mode 100644 api/tangled/graphlistNetworkVouches.go delete mode 100644 api/tangled/notificationdeleteNotification.go delete mode 100644 api/tangled/notificationgetPreferences.go delete mode 100644 api/tangled/notificationgetUnreadCount.go delete mode 100644 api/tangled/notificationlistNotifications.go delete mode 100644 api/tangled/notificationlistRecipients.go delete mode 100644 api/tangled/notificationmarkAllRead.go delete mode 100644 api/tangled/notificationmarkEntityRead.go delete mode 100644 api/tangled/notificationupdatePreferences.go delete mode 100644 api/tangled/notificationupdateSeen.go create mode 100644 api/tangled/pulldefs.go create mode 100644 api/tangled/pullgetPullView.go create mode 100644 api/tangled/pulllistPullViews.go delete mode 100644 api/tangled/quotadefs.go delete mode 100644 api/tangled/quotaget.go delete mode 100644 api/tangled/quotalist.go delete mode 100644 api/tangled/quotaset.go delete mode 100644 api/tangled/quotaunset.go delete mode 100644 api/tangled/quotausage.go delete mode 100644 api/tangled/repocreateWebhook.go delete mode 100644 api/tangled/repodeleteWebhook.go delete mode 100644 api/tangled/repodisableSite.go delete mode 100644 api/tangled/repogetSiteConfig.go delete mode 100644 api/tangled/repolistWebhookDeliveries.go delete mode 100644 api/tangled/repolistWebhooks.go delete mode 100644 api/tangled/reporetryWebhookDelivery.go delete mode 100644 api/tangled/repotoggleWebhook.go delete mode 100644 api/tangled/repoupdateSiteConfig.go delete mode 100644 api/tangled/repoupdateWebhook.go delete mode 100644 api/tangled/searchsearchCode.go delete mode 100644 api/tangled/siteclaimDomain.go delete mode 100644 api/tangled/sitegetDomainClaim.go delete mode 100644 api/tangled/sitereleaseDomain.go create mode 100644 api/tangled/temp2getDiff.go create mode 100644 api/tangled/temp2getInterdiff.go create mode 100644 api/tangled/temp2listCommits.go create mode 100644 api/tangled/temp2mergeCheck.go diff --git a/api/org_tangled/accountbeginSignup.go b/api/org_tangled/accountbeginSignup.go new file mode 100644 index 000000000..5e535e4af --- /dev/null +++ b/api/org_tangled/accountbeginSignup.go @@ -0,0 +1,32 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.account.beginSignup + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempAccountBeginSignupNSID = "org.tangled.temp.account.beginSignup" +) + +// TempAccountBeginSignup_Input is the input argument to a org.tangled.temp.account.beginSignup call. +type TempAccountBeginSignup_Input struct { + // email: Email address for the new account. + Email string `json:"email" cborgen:"email"` + // turnstileToken: Cloudflare Turnstile challenge response token. + TurnstileToken string `json:"turnstileToken" cborgen:"turnstileToken"` +} + +// TempAccountBeginSignup calls the XRPC method "org.tangled.temp.account.beginSignup". +func TempAccountBeginSignup(ctx context.Context, c util.LexClient, input *TempAccountBeginSignup_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.account.beginSignup", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/accountcompleteSignup.go b/api/org_tangled/accountcompleteSignup.go new file mode 100644 index 000000000..fc4253529 --- /dev/null +++ b/api/org_tangled/accountcompleteSignup.go @@ -0,0 +1,43 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.account.completeSignup + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempAccountCompleteSignupNSID = "org.tangled.temp.account.completeSignup" +) + +// TempAccountCompleteSignup_Input is the input argument to a org.tangled.temp.account.completeSignup call. +type TempAccountCompleteSignup_Input struct { + // code: Verification code from the signup email. + Code string `json:"code" cborgen:"code"` + // password: Password for the new account. + Password string `json:"password" cborgen:"password"` + // username: Desired username; the assigned handle is .. + Username string `json:"username" cborgen:"username"` +} + +// TempAccountCompleteSignup_Output is the output of a org.tangled.temp.account.completeSignup call. +type TempAccountCompleteSignup_Output struct { + // did: DID of the newly provisioned account. + Did string `json:"did" cborgen:"did"` + // handle: The assigned handle, .. + Handle string `json:"handle" cborgen:"handle"` +} + +// TempAccountCompleteSignup calls the XRPC method "org.tangled.temp.account.completeSignup". +func TempAccountCompleteSignup(ctx context.Context, c util.LexClient, input *TempAccountCompleteSignup_Input) (*TempAccountCompleteSignup_Output, error) { + var out TempAccountCompleteSignup_Output + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.account.completeSignup", nil, input, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/accountdeleteEmail.go b/api/org_tangled/accountdeleteEmail.go new file mode 100644 index 000000000..35095738b --- /dev/null +++ b/api/org_tangled/accountdeleteEmail.go @@ -0,0 +1,30 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.account.deleteEmail + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempAccountDeleteEmailNSID = "org.tangled.temp.account.deleteEmail" +) + +// TempAccountDeleteEmail_Input is the input argument to a org.tangled.temp.account.deleteEmail call. +type TempAccountDeleteEmail_Input struct { + // email: Email address to remove. + Email string `json:"email" cborgen:"email"` +} + +// TempAccountDeleteEmail calls the XRPC method "org.tangled.temp.account.deleteEmail". +func TempAccountDeleteEmail(ctx context.Context, c util.LexClient, input *TempAccountDeleteEmail_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.account.deleteEmail", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/accountdismissNewsletter.go b/api/org_tangled/accountdismissNewsletter.go new file mode 100644 index 000000000..fb216a763 --- /dev/null +++ b/api/org_tangled/accountdismissNewsletter.go @@ -0,0 +1,24 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.account.dismissNewsletter + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempAccountDismissNewsletterNSID = "org.tangled.temp.account.dismissNewsletter" +) + +// TempAccountDismissNewsletter calls the XRPC method "org.tangled.temp.account.dismissNewsletter". +func TempAccountDismissNewsletter(ctx context.Context, c util.LexClient) error { + if err := c.LexDo(ctx, util.Procedure, "", "org.tangled.temp.account.dismissNewsletter", nil, nil, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/accountlistEmails.go b/api/org_tangled/accountlistEmails.go new file mode 100644 index 000000000..b826555fd --- /dev/null +++ b/api/org_tangled/accountlistEmails.go @@ -0,0 +1,41 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.account.listEmails + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempAccountListEmailsNSID = "org.tangled.temp.account.listEmails" +) + +// TempAccountListEmails_Email is a "email" in the org.tangled.temp.account.listEmails schema. +type TempAccountListEmails_Email struct { + // address: Email address. + Address string `json:"address" cborgen:"address"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // primary: Whether this is the primary email address. + Primary bool `json:"primary" cborgen:"primary"` + // verified: Whether the address has been verified. + Verified bool `json:"verified" cborgen:"verified"` +} + +// TempAccountListEmails_Output is the output of a org.tangled.temp.account.listEmails call. +type TempAccountListEmails_Output struct { + Emails []*TempAccountListEmails_Email `json:"emails" cborgen:"emails"` +} + +// TempAccountListEmails calls the XRPC method "org.tangled.temp.account.listEmails". +func TempAccountListEmails(ctx context.Context, c util.LexClient) (*TempAccountListEmails_Output, error) { + var out TempAccountListEmails_Output + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.account.listEmails", nil, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/accountsetPrimaryEmail.go b/api/org_tangled/accountsetPrimaryEmail.go new file mode 100644 index 000000000..39cfd07d3 --- /dev/null +++ b/api/org_tangled/accountsetPrimaryEmail.go @@ -0,0 +1,30 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.account.setPrimaryEmail + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempAccountSetPrimaryEmailNSID = "org.tangled.temp.account.setPrimaryEmail" +) + +// TempAccountSetPrimaryEmail_Input is the input argument to a org.tangled.temp.account.setPrimaryEmail call. +type TempAccountSetPrimaryEmail_Input struct { + // email: Email address to promote to primary. + Email string `json:"email" cborgen:"email"` +} + +// TempAccountSetPrimaryEmail calls the XRPC method "org.tangled.temp.account.setPrimaryEmail". +func TempAccountSetPrimaryEmail(ctx context.Context, c util.LexClient, input *TempAccountSetPrimaryEmail_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.account.setPrimaryEmail", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/accountsubscribeNewsletter.go b/api/org_tangled/accountsubscribeNewsletter.go new file mode 100644 index 000000000..1176d72f0 --- /dev/null +++ b/api/org_tangled/accountsubscribeNewsletter.go @@ -0,0 +1,24 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.account.subscribeNewsletter + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempAccountSubscribeNewsletterNSID = "org.tangled.temp.account.subscribeNewsletter" +) + +// TempAccountSubscribeNewsletter calls the XRPC method "org.tangled.temp.account.subscribeNewsletter". +func TempAccountSubscribeNewsletter(ctx context.Context, c util.LexClient) error { + if err := c.LexDo(ctx, util.Procedure, "", "org.tangled.temp.account.subscribeNewsletter", nil, nil, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/cbor_gen.go b/api/org_tangled/cbor_gen.go new file mode 100644 index 000000000..6ada35ddd --- /dev/null +++ b/api/org_tangled/cbor_gen.go @@ -0,0 +1,446 @@ +// Code generated by github.com/whyrusleeping/cbor-gen. DO NOT EDIT. + +package org_tangled + +import ( + "fmt" + "io" + "math" + "sort" + + cid "github.com/ipfs/go-cid" + cbg "github.com/whyrusleeping/cbor-gen" + xerrors "golang.org/x/xerrors" +) + +var _ = xerrors.Errorf +var _ = cid.Undef +var _ = math.E +var _ = sort.Sort + +func (t *FeedSubscription) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + + if _, err := cw.Write([]byte{163}); err != nil { + return err + } + + // t.LexiconTypeID (string) (string) + if len("$type") > 1000000 { + return xerrors.Errorf("Value in field \"$type\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { + return err + } + if _, err := cw.WriteString(string("$type")); err != nil { + return err + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.feed.subscription"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.feed.subscription")); err != nil { + return err + } + + // t.Subject (org_tangled.FeedSubscription_Subject) (struct) + if len("subject") > 1000000 { + return xerrors.Errorf("Value in field \"subject\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("subject"))); err != nil { + return err + } + if _, err := cw.WriteString(string("subject")); err != nil { + return err + } + + if err := t.Subject.MarshalCBOR(cw); err != nil { + return err + } + + // t.CreatedAt (string) (string) + if len("createdAt") > 1000000 { + return xerrors.Errorf("Value in field \"createdAt\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { + return err + } + if _, err := cw.WriteString(string("createdAt")); err != nil { + return err + } + + if len(t.CreatedAt) > 1000000 { + return xerrors.Errorf("Value in field t.CreatedAt was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { + return err + } + return nil +} + +func (t *FeedSubscription) UnmarshalCBOR(r io.Reader) (err error) { + *t = FeedSubscription{} + + cr := cbg.NewCborReader(r) + + maj, extra, err := cr.ReadHeader() + if err != nil { + return err + } + defer func() { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + }() + + if maj != cbg.MajMap { + return fmt.Errorf("cbor input should be of type map") + } + + if extra > cbg.MaxLength { + return fmt.Errorf("FeedSubscription: map struct too large (%d)", extra) + } + + n := extra + + nameBuf := make([]byte, 9) + for i := uint64(0); i < n; i++ { + nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) + if err != nil { + return err + } + + if !ok { + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { + return err + } + continue + } + + switch string(nameBuf[:nameLen]) { + // t.LexiconTypeID (string) (string) + case "$type": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.LexiconTypeID = string(sval) + } + // t.Subject (org_tangled.FeedSubscription_Subject) (struct) + case "subject": + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Subject = new(FeedSubscription_Subject) + if err := t.Subject.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Subject pointer: %w", err) + } + } + + } + // t.CreatedAt (string) (string) + case "createdAt": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.CreatedAt = string(sval) + } + + default: + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { + return err + } + } + } + + return nil +} +func (t *FeedSubscription_Record) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + + if _, err := cw.Write([]byte{162}); err != nil { + return err + } + + // t.Uri (string) (string) + if len("uri") > 1000000 { + return xerrors.Errorf("Value in field \"uri\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("uri"))); err != nil { + return err + } + if _, err := cw.WriteString(string("uri")); err != nil { + return err + } + + if len(t.Uri) > 1000000 { + return xerrors.Errorf("Value in field t.Uri was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Uri))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Uri)); err != nil { + return err + } + + // t.LexiconTypeID (string) (string) + if len("$type") > 1000000 { + return xerrors.Errorf("Value in field \"$type\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { + return err + } + if _, err := cw.WriteString(string("$type")); err != nil { + return err + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.feed.subscription#record"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.feed.subscription#record")); err != nil { + return err + } + return nil +} + +func (t *FeedSubscription_Record) UnmarshalCBOR(r io.Reader) (err error) { + *t = FeedSubscription_Record{} + + cr := cbg.NewCborReader(r) + + maj, extra, err := cr.ReadHeader() + if err != nil { + return err + } + defer func() { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + }() + + if maj != cbg.MajMap { + return fmt.Errorf("cbor input should be of type map") + } + + if extra > cbg.MaxLength { + return fmt.Errorf("FeedSubscription_Record: map struct too large (%d)", extra) + } + + n := extra + + nameBuf := make([]byte, 5) + for i := uint64(0); i < n; i++ { + nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) + if err != nil { + return err + } + + if !ok { + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { + return err + } + continue + } + + switch string(nameBuf[:nameLen]) { + // t.Uri (string) (string) + case "uri": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Uri = string(sval) + } + // t.LexiconTypeID (string) (string) + case "$type": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.LexiconTypeID = string(sval) + } + + default: + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { + return err + } + } + } + + return nil +} +func (t *FeedSubscription_Repo) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + + if _, err := cw.Write([]byte{162}); err != nil { + return err + } + + // t.Did (string) (string) + if len("did") > 1000000 { + return xerrors.Errorf("Value in field \"did\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("did"))); err != nil { + return err + } + if _, err := cw.WriteString(string("did")); err != nil { + return err + } + + if len(t.Did) > 1000000 { + return xerrors.Errorf("Value in field t.Did was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Did))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Did)); err != nil { + return err + } + + // t.LexiconTypeID (string) (string) + if len("$type") > 1000000 { + return xerrors.Errorf("Value in field \"$type\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { + return err + } + if _, err := cw.WriteString(string("$type")); err != nil { + return err + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.feed.subscription#repo"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.feed.subscription#repo")); err != nil { + return err + } + return nil +} + +func (t *FeedSubscription_Repo) UnmarshalCBOR(r io.Reader) (err error) { + *t = FeedSubscription_Repo{} + + cr := cbg.NewCborReader(r) + + maj, extra, err := cr.ReadHeader() + if err != nil { + return err + } + defer func() { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + }() + + if maj != cbg.MajMap { + return fmt.Errorf("cbor input should be of type map") + } + + if extra > cbg.MaxLength { + return fmt.Errorf("FeedSubscription_Repo: map struct too large (%d)", extra) + } + + n := extra + + nameBuf := make([]byte, 5) + for i := uint64(0); i < n; i++ { + nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) + if err != nil { + return err + } + + if !ok { + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { + return err + } + continue + } + + switch string(nameBuf[:nameLen]) { + // t.Did (string) (string) + case "did": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Did = string(sval) + } + // t.LexiconTypeID (string) (string) + case "$type": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.LexiconTypeID = string(sval) + } + + default: + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { + return err + } + } + } + + return nil +} diff --git a/api/org_tangled/feedsubscription.go b/api/org_tangled/feedsubscription.go new file mode 100644 index 000000000..8ccd828cb --- /dev/null +++ b/api/org_tangled/feedsubscription.go @@ -0,0 +1,113 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.feed.subscription + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + + "github.com/bluesky-social/indigo/lex/util" + cbg "github.com/whyrusleeping/cbor-gen" +) + +const ( + FeedSubscriptionNSID = "org.tangled.feed.subscription" +) + +func init() { + util.RegisterType("org.tangled.feed.subscription", &FeedSubscription{}) +} // +// RECORDTYPE: FeedSubscription +type FeedSubscription struct { + LexiconTypeID string `json:"$type,const=org.tangled.feed.subscription" cborgen:"$type,const=org.tangled.feed.subscription"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + Subject *FeedSubscription_Subject `json:"subject" cborgen:"subject"` +} + +// FeedSubscription_Record is a "record" in the org.tangled.feed.subscription schema. +// +// RECORDTYPE: FeedSubscription_Record +type FeedSubscription_Record struct { + LexiconTypeID string `json:"$type,const=org.tangled.feed.subscription#record" cborgen:"$type,const=org.tangled.feed.subscription#record"` + Uri string `json:"uri" cborgen:"uri"` +} + +// FeedSubscription_Repo is a "repo" in the org.tangled.feed.subscription schema. +// +// RECORDTYPE: FeedSubscription_Repo +type FeedSubscription_Repo struct { + LexiconTypeID string `json:"$type,const=org.tangled.feed.subscription#repo" cborgen:"$type,const=org.tangled.feed.subscription#repo"` + Did string `json:"did" cborgen:"did"` +} + +type FeedSubscription_Subject struct { + FeedSubscription_Record *FeedSubscription_Record + FeedSubscription_Repo *FeedSubscription_Repo +} + +func (t *FeedSubscription_Subject) MarshalJSON() ([]byte, error) { + if t.FeedSubscription_Record != nil { + t.FeedSubscription_Record.LexiconTypeID = "org.tangled.feed.subscription#record" + return json.Marshal(t.FeedSubscription_Record) + } + if t.FeedSubscription_Repo != nil { + t.FeedSubscription_Repo.LexiconTypeID = "org.tangled.feed.subscription#repo" + return json.Marshal(t.FeedSubscription_Repo) + } + return nil, fmt.Errorf("cannot marshal empty enum") +} +func (t *FeedSubscription_Subject) UnmarshalJSON(b []byte) error { + typ, err := util.TypeExtract(b) + if err != nil { + return err + } + + switch typ { + case "org.tangled.feed.subscription#record": + t.FeedSubscription_Record = new(FeedSubscription_Record) + return json.Unmarshal(b, t.FeedSubscription_Record) + case "org.tangled.feed.subscription#repo": + t.FeedSubscription_Repo = new(FeedSubscription_Repo) + return json.Unmarshal(b, t.FeedSubscription_Repo) + + default: + return fmt.Errorf("closed enums must have a matching value") + } +} + +func (t *FeedSubscription_Subject) MarshalCBOR(w io.Writer) error { + + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + if t.FeedSubscription_Record != nil { + return t.FeedSubscription_Record.MarshalCBOR(w) + } + if t.FeedSubscription_Repo != nil { + return t.FeedSubscription_Repo.MarshalCBOR(w) + } + return fmt.Errorf("cannot cbor marshal empty enum") +} +func (t *FeedSubscription_Subject) UnmarshalCBOR(r io.Reader) error { + typ, b, err := util.CborTypeExtractReader(r) + if err != nil { + return err + } + + switch typ { + case "org.tangled.feed.subscription#record": + t.FeedSubscription_Record = new(FeedSubscription_Record) + return t.FeedSubscription_Record.UnmarshalCBOR(bytes.NewReader(b)) + case "org.tangled.feed.subscription#repo": + t.FeedSubscription_Repo = new(FeedSubscription_Repo) + return t.FeedSubscription_Repo.UnmarshalCBOR(bytes.NewReader(b)) + + default: + return fmt.Errorf("closed enums must have a matching value") + } +} diff --git a/api/org_tangled/focusbeginSession.go b/api/org_tangled/focusbeginSession.go new file mode 100644 index 000000000..b77afc839 --- /dev/null +++ b/api/org_tangled/focusbeginSession.go @@ -0,0 +1,37 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.focus.beginSession + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempFocusBeginSessionNSID = "org.tangled.temp.focus.beginSession" +) + +// TempFocusBeginSession_Output is the output of a org.tangled.temp.focus.beginSession call. +type TempFocusBeginSession_Output struct { + // issueAt: AT-URI of the issue to navigate to, if the item is an issue. + IssueAt *string `json:"issueAt,omitempty" cborgen:"issueAt,omitempty"` + // notificationId: ID of the first notification to address. Absent if the queue is empty. + NotificationId *int64 `json:"notificationId,omitempty" cborgen:"notificationId,omitempty"` + // pullAt: AT-URI of the pull to navigate to, if the item is a pull. + PullAt *string `json:"pullAt,omitempty" cborgen:"pullAt,omitempty"` + // repoDid: DID of the repository the item belongs to. Absent if the queue is empty. + RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` +} + +// TempFocusBeginSession calls the XRPC method "org.tangled.temp.focus.beginSession". +func TempFocusBeginSession(ctx context.Context, c util.LexClient) (*TempFocusBeginSession_Output, error) { + var out TempFocusBeginSession_Output + if err := c.LexDo(ctx, util.Procedure, "", "org.tangled.temp.focus.beginSession", nil, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/focusendSession.go b/api/org_tangled/focusendSession.go new file mode 100644 index 000000000..046caa3c5 --- /dev/null +++ b/api/org_tangled/focusendSession.go @@ -0,0 +1,24 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.focus.endSession + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempFocusEndSessionNSID = "org.tangled.temp.focus.endSession" +) + +// TempFocusEndSession calls the XRPC method "org.tangled.temp.focus.endSession". +func TempFocusEndSession(ctx context.Context, c util.LexClient) error { + if err := c.LexDo(ctx, util.Procedure, "", "org.tangled.temp.focus.endSession", nil, nil, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/focusnextItem.go b/api/org_tangled/focusnextItem.go new file mode 100644 index 000000000..5d64ab44a --- /dev/null +++ b/api/org_tangled/focusnextItem.go @@ -0,0 +1,43 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.focus.nextItem + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempFocusNextItemNSID = "org.tangled.temp.focus.nextItem" +) + +// TempFocusNextItem_Input is the input argument to a org.tangled.temp.focus.nextItem call. +type TempFocusNextItem_Input struct { + // currentId: ID of the notification just addressed, to be marked read. + CurrentId int64 `json:"currentId" cborgen:"currentId"` +} + +// TempFocusNextItem_Output is the output of a org.tangled.temp.focus.nextItem call. +type TempFocusNextItem_Output struct { + // issueAt: AT-URI of the issue to navigate to, if the item is an issue. + IssueAt *string `json:"issueAt,omitempty" cborgen:"issueAt,omitempty"` + // notificationId: ID of the next notification to address. Absent when focus mode has ended. + NotificationId *int64 `json:"notificationId,omitempty" cborgen:"notificationId,omitempty"` + // pullAt: AT-URI of the pull to navigate to, if the item is a pull. + PullAt *string `json:"pullAt,omitempty" cborgen:"pullAt,omitempty"` + // repoDid: DID of the repository the next item belongs to. Absent when focus mode has ended. + RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` +} + +// TempFocusNextItem calls the XRPC method "org.tangled.temp.focus.nextItem". +func TempFocusNextItem(ctx context.Context, c util.LexClient, input *TempFocusNextItem_Input) (*TempFocusNextItem_Output, error) { + var out TempFocusNextItem_Output + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.focus.nextItem", nil, input, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/modban.go b/api/org_tangled/modban.go new file mode 100644 index 000000000..c2023619b --- /dev/null +++ b/api/org_tangled/modban.go @@ -0,0 +1,30 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.spindle.mod.ban + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempSpindleModBanNSID = "org.tangled.temp.spindle.mod.ban" +) + +// TempSpindleModBan_Input is the input argument to a org.tangled.temp.spindle.mod.ban call. +type TempSpindleModBan_Input struct { + // did: DID of the repository or account owner to ban + Did string `json:"did" cborgen:"did"` +} + +// TempSpindleModBan calls the XRPC method "org.tangled.temp.spindle.mod.ban". +func TempSpindleModBan(ctx context.Context, c util.LexClient, input *TempSpindleModBan_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.spindle.mod.ban", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/moddefs.go b/api/org_tangled/moddefs.go new file mode 100644 index 000000000..c21dea8d1 --- /dev/null +++ b/api/org_tangled/moddefs.go @@ -0,0 +1,17 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.spindle.mod.defs + +const () + +// TempSpindleModDefs_Ban is a "ban" in the org.tangled.temp.spindle.mod.defs schema. +// +// an active ban for a repository or account owner +type TempSpindleModDefs_Ban struct { + // createdAt: time at which the ban was created + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // did: DID of the banned subject, either a repository or its owner + Did string `json:"did" cborgen:"did"` +} diff --git a/api/org_tangled/modgetBan.go b/api/org_tangled/modgetBan.go new file mode 100644 index 000000000..9e4ab0182 --- /dev/null +++ b/api/org_tangled/modgetBan.go @@ -0,0 +1,36 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.spindle.mod.getBan + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempSpindleModGetBanNSID = "org.tangled.temp.spindle.mod.getBan" +) + +// TempSpindleModGetBan_Output is the output of a org.tangled.temp.spindle.mod.getBan call. +type TempSpindleModGetBan_Output struct { + // ban: active ban matching the requested DID + Ban *TempSpindleModDefs_Ban `json:"ban" cborgen:"ban"` +} + +// TempSpindleModGetBan calls the XRPC method "org.tangled.temp.spindle.mod.getBan". +// +// did: DID of the repository or account owner to look up +func TempSpindleModGetBan(ctx context.Context, c util.LexClient, did string) (*TempSpindleModGetBan_Output, error) { + var out TempSpindleModGetBan_Output + + params := map[string]interface{}{} + params["did"] = did + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.spindle.mod.getBan", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/modlistBans.go b/api/org_tangled/modlistBans.go new file mode 100644 index 000000000..287ac9329 --- /dev/null +++ b/api/org_tangled/modlistBans.go @@ -0,0 +1,31 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.spindle.mod.listBans + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempSpindleModListBansNSID = "org.tangled.temp.spindle.mod.listBans" +) + +// TempSpindleModListBans_Output is the output of a org.tangled.temp.spindle.mod.listBans call. +type TempSpindleModListBans_Output struct { + // bans: active bans ordered by subject DID + Bans []*TempSpindleModDefs_Ban `json:"bans" cborgen:"bans"` +} + +// TempSpindleModListBans calls the XRPC method "org.tangled.temp.spindle.mod.listBans". +func TempSpindleModListBans(ctx context.Context, c util.LexClient) (*TempSpindleModListBans_Output, error) { + var out TempSpindleModListBans_Output + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.spindle.mod.listBans", nil, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/modunban.go b/api/org_tangled/modunban.go new file mode 100644 index 000000000..b2102dc77 --- /dev/null +++ b/api/org_tangled/modunban.go @@ -0,0 +1,30 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.spindle.mod.unban + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempSpindleModUnbanNSID = "org.tangled.temp.spindle.mod.unban" +) + +// TempSpindleModUnban_Input is the input argument to a org.tangled.temp.spindle.mod.unban call. +type TempSpindleModUnban_Input struct { + // did: DID of the repository or account owner to unban + Did string `json:"did" cborgen:"did"` +} + +// TempSpindleModUnban calls the XRPC method "org.tangled.temp.spindle.mod.unban". +func TempSpindleModUnban(ctx context.Context, c util.LexClient, input *TempSpindleModUnban_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.spindle.mod.unban", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/notificationdeleteNotification.go b/api/org_tangled/notificationdeleteNotification.go new file mode 100644 index 000000000..17b09b2dd --- /dev/null +++ b/api/org_tangled/notificationdeleteNotification.go @@ -0,0 +1,30 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.notification.deleteNotification + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempNotificationDeleteNotificationNSID = "org.tangled.temp.notification.deleteNotification" +) + +// TempNotificationDeleteNotification_Input is the input argument to a org.tangled.temp.notification.deleteNotification call. +type TempNotificationDeleteNotification_Input struct { + // uri: at-uri of the notification to delete. + Uri string `json:"uri" cborgen:"uri"` +} + +// TempNotificationDeleteNotification calls the XRPC method "org.tangled.temp.notification.deleteNotification". +func TempNotificationDeleteNotification(ctx context.Context, c util.LexClient, input *TempNotificationDeleteNotification_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.notification.deleteNotification", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/notificationgetPreferences.go b/api/org_tangled/notificationgetPreferences.go new file mode 100644 index 000000000..8c4447b78 --- /dev/null +++ b/api/org_tangled/notificationgetPreferences.go @@ -0,0 +1,39 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.notification.getPreferences + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempNotificationGetPreferencesNSID = "org.tangled.temp.notification.getPreferences" +) + +// TempNotificationGetPreferences_Preferences is a "preferences" in the org.tangled.temp.notification.getPreferences schema. +type TempNotificationGetPreferences_Preferences struct { + EmailNotifications bool `json:"emailNotifications" cborgen:"emailNotifications"` + Followed bool `json:"followed" cborgen:"followed"` + IssueClosed bool `json:"issueClosed" cborgen:"issueClosed"` + IssueCommented bool `json:"issueCommented" cborgen:"issueCommented"` + IssueCreated bool `json:"issueCreated" cborgen:"issueCreated"` + PullCommented bool `json:"pullCommented" cborgen:"pullCommented"` + PullCreated bool `json:"pullCreated" cborgen:"pullCreated"` + PullMerged bool `json:"pullMerged" cborgen:"pullMerged"` + RepoStarred bool `json:"repoStarred" cborgen:"repoStarred"` + UserMentioned bool `json:"userMentioned" cborgen:"userMentioned"` +} + +// TempNotificationGetPreferences calls the XRPC method "org.tangled.temp.notification.getPreferences". +func TempNotificationGetPreferences(ctx context.Context, c util.LexClient) (*TempNotificationGetPreferences_Preferences, error) { + var out TempNotificationGetPreferences_Preferences + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.notification.getPreferences", nil, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/notificationgetUnreadCount.go b/api/org_tangled/notificationgetUnreadCount.go new file mode 100644 index 000000000..d641b754a --- /dev/null +++ b/api/org_tangled/notificationgetUnreadCount.go @@ -0,0 +1,30 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.notification.getUnreadCount + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempNotificationGetUnreadCountNSID = "org.tangled.temp.notification.getUnreadCount" +) + +// TempNotificationGetUnreadCount_Output is the output of a org.tangled.temp.notification.getUnreadCount call. +type TempNotificationGetUnreadCount_Output struct { + Count int64 `json:"count" cborgen:"count"` +} + +// TempNotificationGetUnreadCount calls the XRPC method "org.tangled.temp.notification.getUnreadCount". +func TempNotificationGetUnreadCount(ctx context.Context, c util.LexClient) (*TempNotificationGetUnreadCount_Output, error) { + var out TempNotificationGetUnreadCount_Output + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.notification.getUnreadCount", nil, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/notificationlistNotifications.go b/api/org_tangled/notificationlistNotifications.go new file mode 100644 index 000000000..c07499f8b --- /dev/null +++ b/api/org_tangled/notificationlistNotifications.go @@ -0,0 +1,71 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.notification.listNotifications + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempNotificationListNotificationsNSID = "org.tangled.temp.notification.listNotifications" +) + +// TempNotificationListNotifications_Notification is a "notification" in the org.tangled.temp.notification.listNotifications schema. +type TempNotificationListNotifications_Notification struct { + // actorDid: DID of the user who triggered this notification. + ActorDid string `json:"actorDid" cborgen:"actorDid"` + // category: Broad category: 'social' or 'work'. + Category string `json:"category" cborgen:"category"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // issueAt: AT-URI of the related org.tangled.issue.issue record, if applicable. + IssueAt *string `json:"issueAt,omitempty" cborgen:"issueAt,omitempty"` + // pullAt: AT-URI of the related org.tangled.pulls.pull record, if applicable. + PullAt *string `json:"pullAt,omitempty" cborgen:"pullAt,omitempty"` + Read bool `json:"read" cborgen:"read"` + // repoDid: DID of the related repository, if applicable. + RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` + // type: Notification type: repo_starred, issue_created, issue_commented, issue_closed, issue_reopen, issue_assigned, issue_unassigned, pull_created, pull_commented, pull_merged, pull_closed, pull_reopen, pull_assigned, pull_unassigned, followed, user_mentioned. + Type string `json:"type" cborgen:"type"` + // uri: at-uri of this notification; the stable key for read/unread state. + Uri string `json:"uri" cborgen:"uri"` +} + +// TempNotificationListNotifications_Output is the output of a org.tangled.temp.notification.listNotifications call. +type TempNotificationListNotifications_Output struct { + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` + Notifications []*TempNotificationListNotifications_Notification `json:"notifications" cborgen:"notifications"` + SocialUnreadCount int64 `json:"socialUnreadCount" cborgen:"socialUnreadCount"` + WorkUnreadCount int64 `json:"workUnreadCount" cborgen:"workUnreadCount"` +} + +// TempNotificationListNotifications calls the XRPC method "org.tangled.temp.notification.listNotifications". +// +// category: Filter by category: 'all', 'social', or 'work'. +// limit: Max notifications per category to return. +// read: Filter by read state: 'all' or 'unread'. +func TempNotificationListNotifications(ctx context.Context, c util.LexClient, category string, cursor string, limit int64, read string) (*TempNotificationListNotifications_Output, error) { + var out TempNotificationListNotifications_Output + + params := map[string]interface{}{} + if category != "" { + params["category"] = category + } + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + if read != "" { + params["read"] = read + } + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.notification.listNotifications", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/notificationlistRecipients.go b/api/org_tangled/notificationlistRecipients.go new file mode 100644 index 000000000..4fc9b1225 --- /dev/null +++ b/api/org_tangled/notificationlistRecipients.go @@ -0,0 +1,39 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.notification.listRecipients + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempNotificationListRecipientsNSID = "org.tangled.temp.notification.listRecipients" +) + +// TempNotificationListRecipients_Output is the output of a org.tangled.temp.notification.listRecipients call. +type TempNotificationListRecipients_Output struct { + Dids []string `json:"dids" cborgen:"dids"` +} + +// TempNotificationListRecipients calls the XRPC method "org.tangled.temp.notification.listRecipients". +// +// collection: Optional collection NSID to filter subscribers by subscription scope. Only subscribers with no collection filter or a filter containing this NSID are returned. +// subject: at-uri of the entity (for entity-level subscribers) or a repo DID (for repo-level subscribers). +func TempNotificationListRecipients(ctx context.Context, c util.LexClient, collection string, subject string) (*TempNotificationListRecipients_Output, error) { + var out TempNotificationListRecipients_Output + + params := map[string]interface{}{} + if collection != "" { + params["collection"] = collection + } + params["subject"] = subject + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.notification.listRecipients", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/notificationmarkAllRead.go b/api/org_tangled/notificationmarkAllRead.go new file mode 100644 index 000000000..6bef13fa7 --- /dev/null +++ b/api/org_tangled/notificationmarkAllRead.go @@ -0,0 +1,24 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.notification.markAllRead + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempNotificationMarkAllReadNSID = "org.tangled.temp.notification.markAllRead" +) + +// TempNotificationMarkAllRead calls the XRPC method "org.tangled.temp.notification.markAllRead". +func TempNotificationMarkAllRead(ctx context.Context, c util.LexClient) error { + if err := c.LexDo(ctx, util.Procedure, "", "org.tangled.temp.notification.markAllRead", nil, nil, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/notificationmarkEntityRead.go b/api/org_tangled/notificationmarkEntityRead.go new file mode 100644 index 000000000..190a9099d --- /dev/null +++ b/api/org_tangled/notificationmarkEntityRead.go @@ -0,0 +1,30 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.notification.markEntityRead + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempNotificationMarkEntityReadNSID = "org.tangled.temp.notification.markEntityRead" +) + +// TempNotificationMarkEntityRead_Input is the input argument to a org.tangled.temp.notification.markEntityRead call. +type TempNotificationMarkEntityRead_Input struct { + // entityAt: at-uri of the issue or pull whose notifications should be marked read. + EntityAt string `json:"entityAt" cborgen:"entityAt"` +} + +// TempNotificationMarkEntityRead calls the XRPC method "org.tangled.temp.notification.markEntityRead". +func TempNotificationMarkEntityRead(ctx context.Context, c util.LexClient, input *TempNotificationMarkEntityRead_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.notification.markEntityRead", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/notificationupdatePreferences.go b/api/org_tangled/notificationupdatePreferences.go new file mode 100644 index 000000000..7ba8db4b8 --- /dev/null +++ b/api/org_tangled/notificationupdatePreferences.go @@ -0,0 +1,38 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.notification.updatePreferences + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempNotificationUpdatePreferencesNSID = "org.tangled.temp.notification.updatePreferences" +) + +// TempNotificationUpdatePreferences_Input is the input argument to a org.tangled.temp.notification.updatePreferences call. +type TempNotificationUpdatePreferences_Input struct { + EmailNotifications *bool `json:"emailNotifications,omitempty" cborgen:"emailNotifications,omitempty"` + Followed *bool `json:"followed,omitempty" cborgen:"followed,omitempty"` + IssueClosed *bool `json:"issueClosed,omitempty" cborgen:"issueClosed,omitempty"` + IssueCommented *bool `json:"issueCommented,omitempty" cborgen:"issueCommented,omitempty"` + IssueCreated *bool `json:"issueCreated,omitempty" cborgen:"issueCreated,omitempty"` + PullCommented *bool `json:"pullCommented,omitempty" cborgen:"pullCommented,omitempty"` + PullCreated *bool `json:"pullCreated,omitempty" cborgen:"pullCreated,omitempty"` + PullMerged *bool `json:"pullMerged,omitempty" cborgen:"pullMerged,omitempty"` + RepoStarred *bool `json:"repoStarred,omitempty" cborgen:"repoStarred,omitempty"` + UserMentioned *bool `json:"userMentioned,omitempty" cborgen:"userMentioned,omitempty"` +} + +// TempNotificationUpdatePreferences calls the XRPC method "org.tangled.temp.notification.updatePreferences". +func TempNotificationUpdatePreferences(ctx context.Context, c util.LexClient, input *TempNotificationUpdatePreferences_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.notification.updatePreferences", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/notificationupdateSeen.go b/api/org_tangled/notificationupdateSeen.go new file mode 100644 index 000000000..a2de7102d --- /dev/null +++ b/api/org_tangled/notificationupdateSeen.go @@ -0,0 +1,31 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.notification.updateSeen + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempNotificationUpdateSeenNSID = "org.tangled.temp.notification.updateSeen" +) + +// TempNotificationUpdateSeen_Input is the input argument to a org.tangled.temp.notification.updateSeen call. +type TempNotificationUpdateSeen_Input struct { + Read bool `json:"read" cborgen:"read"` + // uri: at-uri of the notification to update. + Uri string `json:"uri" cborgen:"uri"` +} + +// TempNotificationUpdateSeen calls the XRPC method "org.tangled.temp.notification.updateSeen". +func TempNotificationUpdateSeen(ctx context.Context, c util.LexClient, input *TempNotificationUpdateSeen_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.notification.updateSeen", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/quotadefs.go b/api/org_tangled/quotadefs.go new file mode 100644 index 000000000..6684772dc --- /dev/null +++ b/api/org_tangled/quotadefs.go @@ -0,0 +1,33 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.spindle.quota.defs + +const () + +// TempSpindleQuotaDefs_Limit is a "limit" in the org.tangled.temp.spindle.quota.defs schema. +// +// a per-subject override for one quota resource +type TempSpindleQuotaDefs_Limit struct { + // did: DID whose quota is overridden, either a repository or an account owner + Did string `json:"did" cborgen:"did"` + // limit: maximum amount in the resource's native units; -1 means unlimited + Limit int64 `json:"limit" cborgen:"limit"` + // resource: quota resource name + Resource string `json:"resource" cborgen:"resource"` +} + +// TempSpindleQuotaDefs_Usage is a "usage" in the org.tangled.temp.spindle.quota.defs schema. +// +// current usage aggregated for one subject and resource +type TempSpindleQuotaDefs_Usage struct { + // did: DID for the user or repository scope + Did string `json:"did" cborgen:"did"` + // resource: quota resource name + Resource string `json:"resource" cborgen:"resource"` + // scope: aggregation axis for this row: user or repo + Scope string `json:"scope" cborgen:"scope"` + // used: amount currently allocated or reserved in native resource units + Used int64 `json:"used" cborgen:"used"` +} diff --git a/api/org_tangled/quotaget.go b/api/org_tangled/quotaget.go new file mode 100644 index 000000000..9912b4849 --- /dev/null +++ b/api/org_tangled/quotaget.go @@ -0,0 +1,38 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.spindle.quota.get + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempSpindleQuotaGetNSID = "org.tangled.temp.spindle.quota.get" +) + +// TempSpindleQuotaGet_Output is the output of a org.tangled.temp.spindle.quota.get call. +type TempSpindleQuotaGet_Output struct { + // limit: quota override for the requested DID and resource + Limit *TempSpindleQuotaDefs_Limit `json:"limit" cborgen:"limit"` +} + +// TempSpindleQuotaGet calls the XRPC method "org.tangled.temp.spindle.quota.get". +// +// did: DID of the repository or account owner +// resource: quota resource to look up +func TempSpindleQuotaGet(ctx context.Context, c util.LexClient, did string, resource string) (*TempSpindleQuotaGet_Output, error) { + var out TempSpindleQuotaGet_Output + + params := map[string]interface{}{} + params["did"] = did + params["resource"] = resource + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.spindle.quota.get", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/quotalist.go b/api/org_tangled/quotalist.go new file mode 100644 index 000000000..d3f5d33df --- /dev/null +++ b/api/org_tangled/quotalist.go @@ -0,0 +1,31 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.spindle.quota.list + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempSpindleQuotaListNSID = "org.tangled.temp.spindle.quota.list" +) + +// TempSpindleQuotaList_Output is the output of a org.tangled.temp.spindle.quota.list call. +type TempSpindleQuotaList_Output struct { + // limits: quota overrides ordered by DID and resource + Limits []*TempSpindleQuotaDefs_Limit `json:"limits" cborgen:"limits"` +} + +// TempSpindleQuotaList calls the XRPC method "org.tangled.temp.spindle.quota.list". +func TempSpindleQuotaList(ctx context.Context, c util.LexClient) (*TempSpindleQuotaList_Output, error) { + var out TempSpindleQuotaList_Output + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.spindle.quota.list", nil, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/quotaset.go b/api/org_tangled/quotaset.go new file mode 100644 index 000000000..e95579eb6 --- /dev/null +++ b/api/org_tangled/quotaset.go @@ -0,0 +1,36 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.spindle.quota.set + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempSpindleQuotaSetNSID = "org.tangled.temp.spindle.quota.set" +) + +// TempSpindleQuotaSet_Input is the input argument to a org.tangled.temp.spindle.quota.set call. +type TempSpindleQuotaSet_Input struct { + // did: DID of the repository or account owner + Did string `json:"did" cborgen:"did"` + // limit: positive maximum in the resource's native units; cannot be combined with unlimited + Limit *int64 `json:"limit,omitempty" cborgen:"limit,omitempty"` + // resource: quota resource name, such as workflows, vcpus, memory_mib, disk_mib, or cache_storage_bytes + Resource string `json:"resource" cborgen:"resource"` + // unlimited: store an unlimited override; cannot be combined with limit + Unlimited *bool `json:"unlimited,omitempty" cborgen:"unlimited,omitempty"` +} + +// TempSpindleQuotaSet calls the XRPC method "org.tangled.temp.spindle.quota.set". +func TempSpindleQuotaSet(ctx context.Context, c util.LexClient, input *TempSpindleQuotaSet_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.spindle.quota.set", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/quotaunset.go b/api/org_tangled/quotaunset.go new file mode 100644 index 000000000..aee9cf11d --- /dev/null +++ b/api/org_tangled/quotaunset.go @@ -0,0 +1,32 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.spindle.quota.unset + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempSpindleQuotaUnsetNSID = "org.tangled.temp.spindle.quota.unset" +) + +// TempSpindleQuotaUnset_Input is the input argument to a org.tangled.temp.spindle.quota.unset call. +type TempSpindleQuotaUnset_Input struct { + // did: DID of the repository or account owner + Did string `json:"did" cborgen:"did"` + // resource: quota resource whose override to remove + Resource string `json:"resource" cborgen:"resource"` +} + +// TempSpindleQuotaUnset calls the XRPC method "org.tangled.temp.spindle.quota.unset". +func TempSpindleQuotaUnset(ctx context.Context, c util.LexClient, input *TempSpindleQuotaUnset_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.spindle.quota.unset", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/quotausage.go b/api/org_tangled/quotausage.go new file mode 100644 index 000000000..02bb5cd2f --- /dev/null +++ b/api/org_tangled/quotausage.go @@ -0,0 +1,42 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.spindle.quota.usage + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempSpindleQuotaUsageNSID = "org.tangled.temp.spindle.quota.usage" +) + +// TempSpindleQuotaUsage_Output is the output of a org.tangled.temp.spindle.quota.usage call. +type TempSpindleQuotaUsage_Output struct { + // usages: non-zero usage rows, including active reservations and committed allocations + Usages []*TempSpindleQuotaDefs_Usage `json:"usages" cborgen:"usages"` +} + +// TempSpindleQuotaUsage calls the XRPC method "org.tangled.temp.spindle.quota.usage". +// +// did: limit results to rows for this subject DID +// scope: limit results to one aggregation axis: user or repo +func TempSpindleQuotaUsage(ctx context.Context, c util.LexClient, did string, scope string) (*TempSpindleQuotaUsage_Output, error) { + var out TempSpindleQuotaUsage_Output + + params := map[string]interface{}{} + if did != "" { + params["did"] = did + } + if scope != "" { + params["scope"] = scope + } + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.spindle.quota.usage", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/repocreateWebhook.go b/api/org_tangled/repocreateWebhook.go new file mode 100644 index 000000000..e46706941 --- /dev/null +++ b/api/org_tangled/repocreateWebhook.go @@ -0,0 +1,45 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.repo.createWebhook + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempRepoCreateWebhookNSID = "org.tangled.temp.repo.createWebhook" +) + +// TempRepoCreateWebhook_Input is the input argument to a org.tangled.temp.repo.createWebhook call. +type TempRepoCreateWebhook_Input struct { + // active: Whether the webhook should be active immediately. Defaults to true. + Active *bool `json:"active,omitempty" cborgen:"active,omitempty"` + // events: Event types to subscribe to (e.g. 'push', 'repository:renamed'). + Events []string `json:"events" cborgen:"events"` + // repoDid: DID of the repository as minted by the knot. + RepoDid string `json:"repoDid" cborgen:"repoDid"` + // secret: Optional HMAC secret used to sign payloads. If omitted, payloads are not signed. + Secret *string `json:"secret,omitempty" cborgen:"secret,omitempty"` + // url: Endpoint URL that will receive webhook payloads. + Url string `json:"url" cborgen:"url"` +} + +// TempRepoCreateWebhook_Output is the output of a org.tangled.temp.repo.createWebhook call. +type TempRepoCreateWebhook_Output struct { + // id: ID of the newly created webhook. + Id int64 `json:"id" cborgen:"id"` +} + +// TempRepoCreateWebhook calls the XRPC method "org.tangled.temp.repo.createWebhook". +func TempRepoCreateWebhook(ctx context.Context, c util.LexClient, input *TempRepoCreateWebhook_Input) (*TempRepoCreateWebhook_Output, error) { + var out TempRepoCreateWebhook_Output + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.repo.createWebhook", nil, input, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/repodeleteWebhook.go b/api/org_tangled/repodeleteWebhook.go new file mode 100644 index 000000000..ba7191ea0 --- /dev/null +++ b/api/org_tangled/repodeleteWebhook.go @@ -0,0 +1,32 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.repo.deleteWebhook + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempRepoDeleteWebhookNSID = "org.tangled.temp.repo.deleteWebhook" +) + +// TempRepoDeleteWebhook_Input is the input argument to a org.tangled.temp.repo.deleteWebhook call. +type TempRepoDeleteWebhook_Input struct { + // id: Webhook ID to delete. + Id int64 `json:"id" cborgen:"id"` + // repoDid: DID of the repository as minted by the knot. + RepoDid string `json:"repoDid" cborgen:"repoDid"` +} + +// TempRepoDeleteWebhook calls the XRPC method "org.tangled.temp.repo.deleteWebhook". +func TempRepoDeleteWebhook(ctx context.Context, c util.LexClient, input *TempRepoDeleteWebhook_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.repo.deleteWebhook", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/repodisableSite.go b/api/org_tangled/repodisableSite.go new file mode 100644 index 000000000..9513c312b --- /dev/null +++ b/api/org_tangled/repodisableSite.go @@ -0,0 +1,30 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.repo.disableSite + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempRepoDisableSiteNSID = "org.tangled.temp.repo.disableSite" +) + +// TempRepoDisableSite_Input is the input argument to a org.tangled.temp.repo.disableSite call. +type TempRepoDisableSite_Input struct { + // repoDid: DID of the repository as minted by the knot. + RepoDid string `json:"repoDid" cborgen:"repoDid"` +} + +// TempRepoDisableSite calls the XRPC method "org.tangled.temp.repo.disableSite". +func TempRepoDisableSite(ctx context.Context, c util.LexClient, input *TempRepoDisableSite_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.repo.disableSite", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/repogetSiteConfig.go b/api/org_tangled/repogetSiteConfig.go new file mode 100644 index 000000000..d5a96a976 --- /dev/null +++ b/api/org_tangled/repogetSiteConfig.go @@ -0,0 +1,46 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.repo.getSiteConfig + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempRepoGetSiteConfigNSID = "org.tangled.temp.repo.getSiteConfig" +) + +// TempRepoGetSiteConfig_Output is the output of a org.tangled.temp.repo.getSiteConfig call. +type TempRepoGetSiteConfig_Output struct { + // config: Site config for the repository. Absent if no site is configured. + Config *TempRepoGetSiteConfig_SiteConfig `json:"config,omitempty" cborgen:"config,omitempty"` +} + +// TempRepoGetSiteConfig_SiteConfig is a "siteConfig" in the org.tangled.temp.repo.getSiteConfig schema. +type TempRepoGetSiteConfig_SiteConfig struct { + // branch: Branch to deploy from. + Branch string `json:"branch" cborgen:"branch"` + // dir: Directory within the repository to deploy (e.g. '/' or '/docs'). + Dir string `json:"dir" cborgen:"dir"` + // isIndex: Whether this repo serves as the index (root) for the domain. + IsIndex bool `json:"isIndex" cborgen:"isIndex"` +} + +// TempRepoGetSiteConfig calls the XRPC method "org.tangled.temp.repo.getSiteConfig". +// +// repoDid: DID of the repository as minted by the knot. +func TempRepoGetSiteConfig(ctx context.Context, c util.LexClient, repoDid string) (*TempRepoGetSiteConfig_Output, error) { + var out TempRepoGetSiteConfig_Output + + params := map[string]interface{}{} + params["repoDid"] = repoDid + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.repo.getSiteConfig", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/repolistWebhookDeliveries.go b/api/org_tangled/repolistWebhookDeliveries.go new file mode 100644 index 000000000..46f8052e2 --- /dev/null +++ b/api/org_tangled/repolistWebhookDeliveries.go @@ -0,0 +1,55 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.repo.listWebhookDeliveries + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempRepoListWebhookDeliveriesNSID = "org.tangled.temp.repo.listWebhookDeliveries" +) + +// TempRepoListWebhookDeliveries_Delivery is a "delivery" in the org.tangled.temp.repo.listWebhookDeliveries schema. +type TempRepoListWebhookDeliveries_Delivery struct { + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // deliveryId: UUID for tracking this delivery attempt. + DeliveryId string `json:"deliveryId" cborgen:"deliveryId"` + // event: Event type that triggered the delivery. + Event string `json:"event" cborgen:"event"` + Id int64 `json:"id" cborgen:"id"` + RequestBody *string `json:"requestBody,omitempty" cborgen:"requestBody,omitempty"` + ResponseBody *string `json:"responseBody,omitempty" cborgen:"responseBody,omitempty"` + ResponseCode *int64 `json:"responseCode,omitempty" cborgen:"responseCode,omitempty"` + Success bool `json:"success" cborgen:"success"` + Url string `json:"url" cborgen:"url"` +} + +// TempRepoListWebhookDeliveries_Output is the output of a org.tangled.temp.repo.listWebhookDeliveries call. +type TempRepoListWebhookDeliveries_Output struct { + Deliveries []*TempRepoListWebhookDeliveries_Delivery `json:"deliveries" cborgen:"deliveries"` +} + +// TempRepoListWebhookDeliveries calls the XRPC method "org.tangled.temp.repo.listWebhookDeliveries". +// +// id: Webhook ID. +// repoDid: DID of the repository as minted by the knot. +func TempRepoListWebhookDeliveries(ctx context.Context, c util.LexClient, id int64, limit int64, repoDid string) (*TempRepoListWebhookDeliveries_Output, error) { + var out TempRepoListWebhookDeliveries_Output + + params := map[string]interface{}{} + params["id"] = id + if limit != 0 { + params["limit"] = limit + } + params["repoDid"] = repoDid + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.repo.listWebhookDeliveries", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/repolistWebhooks.go b/api/org_tangled/repolistWebhooks.go new file mode 100644 index 000000000..13f6b1e2c --- /dev/null +++ b/api/org_tangled/repolistWebhooks.go @@ -0,0 +1,49 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.repo.listWebhooks + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempRepoListWebhooksNSID = "org.tangled.temp.repo.listWebhooks" +) + +// TempRepoListWebhooks_Output is the output of a org.tangled.temp.repo.listWebhooks call. +type TempRepoListWebhooks_Output struct { + Webhooks []*TempRepoListWebhooks_Webhook `json:"webhooks" cborgen:"webhooks"` +} + +// TempRepoListWebhooks_Webhook is a "webhook" in the org.tangled.temp.repo.listWebhooks schema. +type TempRepoListWebhooks_Webhook struct { + // active: Whether the webhook is currently enabled. + Active bool `json:"active" cborgen:"active"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // events: Event types this webhook is subscribed to (e.g. 'push', 'repository:renamed'). + Events []string `json:"events" cborgen:"events"` + // id: Webhook identifier. + Id int64 `json:"id" cborgen:"id"` + UpdatedAt *string `json:"updatedAt,omitempty" cborgen:"updatedAt,omitempty"` + // url: Endpoint URL that receives webhook payloads. + Url string `json:"url" cborgen:"url"` +} + +// TempRepoListWebhooks calls the XRPC method "org.tangled.temp.repo.listWebhooks". +// +// repoDid: DID of the repository as minted by the knot. +func TempRepoListWebhooks(ctx context.Context, c util.LexClient, repoDid string) (*TempRepoListWebhooks_Output, error) { + var out TempRepoListWebhooks_Output + + params := map[string]interface{}{} + params["repoDid"] = repoDid + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.repo.listWebhooks", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/reporetryWebhookDelivery.go b/api/org_tangled/reporetryWebhookDelivery.go new file mode 100644 index 000000000..5963d0068 --- /dev/null +++ b/api/org_tangled/reporetryWebhookDelivery.go @@ -0,0 +1,34 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.repo.retryWebhookDelivery + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempRepoRetryWebhookDeliveryNSID = "org.tangled.temp.repo.retryWebhookDelivery" +) + +// TempRepoRetryWebhookDelivery_Input is the input argument to a org.tangled.temp.repo.retryWebhookDelivery call. +type TempRepoRetryWebhookDelivery_Input struct { + // deliveryId: UUID of the delivery to retry. + DeliveryId string `json:"deliveryId" cborgen:"deliveryId"` + // repoDid: DID of the repository as minted by the knot. + RepoDid string `json:"repoDid" cborgen:"repoDid"` + // webhookId: Webhook ID that owns the delivery. + WebhookId int64 `json:"webhookId" cborgen:"webhookId"` +} + +// TempRepoRetryWebhookDelivery calls the XRPC method "org.tangled.temp.repo.retryWebhookDelivery". +func TempRepoRetryWebhookDelivery(ctx context.Context, c util.LexClient, input *TempRepoRetryWebhookDelivery_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.repo.retryWebhookDelivery", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/repotoggleWebhook.go b/api/org_tangled/repotoggleWebhook.go new file mode 100644 index 000000000..5d4aa8404 --- /dev/null +++ b/api/org_tangled/repotoggleWebhook.go @@ -0,0 +1,39 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.repo.toggleWebhook + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempRepoToggleWebhookNSID = "org.tangled.temp.repo.toggleWebhook" +) + +// TempRepoToggleWebhook_Input is the input argument to a org.tangled.temp.repo.toggleWebhook call. +type TempRepoToggleWebhook_Input struct { + // id: Webhook ID to toggle. + Id int64 `json:"id" cborgen:"id"` + // repoDid: DID of the repository as minted by the knot. + RepoDid string `json:"repoDid" cborgen:"repoDid"` +} + +// TempRepoToggleWebhook_Output is the output of a org.tangled.temp.repo.toggleWebhook call. +type TempRepoToggleWebhook_Output struct { + // active: New active state of the webhook. + Active bool `json:"active" cborgen:"active"` +} + +// TempRepoToggleWebhook calls the XRPC method "org.tangled.temp.repo.toggleWebhook". +func TempRepoToggleWebhook(ctx context.Context, c util.LexClient, input *TempRepoToggleWebhook_Input) (*TempRepoToggleWebhook_Output, error) { + var out TempRepoToggleWebhook_Output + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.repo.toggleWebhook", nil, input, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/repoupdateSiteConfig.go b/api/org_tangled/repoupdateSiteConfig.go new file mode 100644 index 000000000..575141ed3 --- /dev/null +++ b/api/org_tangled/repoupdateSiteConfig.go @@ -0,0 +1,36 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.repo.updateSiteConfig + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempRepoUpdateSiteConfigNSID = "org.tangled.temp.repo.updateSiteConfig" +) + +// TempRepoUpdateSiteConfig_Input is the input argument to a org.tangled.temp.repo.updateSiteConfig call. +type TempRepoUpdateSiteConfig_Input struct { + // branch: Branch to deploy from. + Branch string `json:"branch" cborgen:"branch"` + // dir: Directory within the repository to deploy (e.g. '/' or '/docs'). + Dir string `json:"dir" cborgen:"dir"` + // isIndex: Whether this repo should serve as the index (root) for the claimed domain. + IsIndex *bool `json:"isIndex,omitempty" cborgen:"isIndex,omitempty"` + // repoDid: DID of the repository as minted by the knot. + RepoDid string `json:"repoDid" cborgen:"repoDid"` +} + +// TempRepoUpdateSiteConfig calls the XRPC method "org.tangled.temp.repo.updateSiteConfig". +func TempRepoUpdateSiteConfig(ctx context.Context, c util.LexClient, input *TempRepoUpdateSiteConfig_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.repo.updateSiteConfig", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/repoupdateWebhook.go b/api/org_tangled/repoupdateWebhook.go new file mode 100644 index 000000000..f9078d3f7 --- /dev/null +++ b/api/org_tangled/repoupdateWebhook.go @@ -0,0 +1,36 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.repo.updateWebhook + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempRepoUpdateWebhookNSID = "org.tangled.temp.repo.updateWebhook" +) + +// TempRepoUpdateWebhook_Input is the input argument to a org.tangled.temp.repo.updateWebhook call. +type TempRepoUpdateWebhook_Input struct { + Active *bool `json:"active,omitempty" cborgen:"active,omitempty"` + Events []string `json:"events,omitempty" cborgen:"events,omitempty"` + // id: Webhook ID to update. + Id int64 `json:"id" cborgen:"id"` + // repoDid: DID of the repository as minted by the knot. + RepoDid string `json:"repoDid" cborgen:"repoDid"` + Secret *string `json:"secret,omitempty" cborgen:"secret,omitempty"` + Url *string `json:"url,omitempty" cborgen:"url,omitempty"` +} + +// TempRepoUpdateWebhook calls the XRPC method "org.tangled.temp.repo.updateWebhook". +func TempRepoUpdateWebhook(ctx context.Context, c util.LexClient, input *TempRepoUpdateWebhook_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.repo.updateWebhook", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/searchsearchCode.go b/api/org_tangled/searchsearchCode.go new file mode 100644 index 000000000..c7aee7755 --- /dev/null +++ b/api/org_tangled/searchsearchCode.go @@ -0,0 +1,79 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.search.searchCode + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempSearchSearchCodeNSID = "org.tangled.temp.search.searchCode" +) + +// TempSearchSearchCode_Chunk is a "chunk" in the org.tangled.temp.search.searchCode schema. +type TempSearchSearchCode_Chunk struct { + // content: Source lines for this match chunk. + Content string `json:"content" cborgen:"content"` + // highlights: Byte-offset ranges within content that match the query. + Highlights []*TempSearchSearchCode_Highlight `json:"highlights,omitempty" cborgen:"highlights,omitempty"` + // lineStart: 1-based line number of the first line in content. + LineStart int64 `json:"lineStart" cborgen:"lineStart"` +} + +// TempSearchSearchCode_FileResult is a "fileResult" in the org.tangled.temp.search.searchCode schema. +type TempSearchSearchCode_FileResult struct { + Chunks []*TempSearchSearchCode_Chunk `json:"chunks" cborgen:"chunks"` + // language: Detected programming language. + Language *string `json:"language,omitempty" cborgen:"language,omitempty"` + // path: File path relative to repository root. + Path string `json:"path" cborgen:"path"` + // repoDid: DID of the repository as minted by the knot. + RepoDid string `json:"repoDid" cborgen:"repoDid"` +} + +// TempSearchSearchCode_Highlight is a "highlight" in the org.tangled.temp.search.searchCode schema. +type TempSearchSearchCode_Highlight struct { + // end: End byte offset (exclusive) within the chunk content string. + End int64 `json:"end" cborgen:"end"` + // start: Start byte offset within the chunk content string. + Start int64 `json:"start" cborgen:"start"` +} + +// TempSearchSearchCode_Output is the output of a org.tangled.temp.search.searchCode call. +type TempSearchSearchCode_Output struct { + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` + Results []*TempSearchSearchCode_FileResult `json:"results" cborgen:"results"` +} + +// TempSearchSearchCode calls the XRPC method "org.tangled.temp.search.searchCode". +// +// lang: Restrict search to a specific programming language (e.g. 'go', 'rust'). +// q: Search query string. +// repoDid: Restrict search to a specific repository, by its DID. +func TempSearchSearchCode(ctx context.Context, c util.LexClient, cursor string, lang string, limit int64, q string, repoDid string) (*TempSearchSearchCode_Output, error) { + var out TempSearchSearchCode_Output + + params := map[string]interface{}{} + if cursor != "" { + params["cursor"] = cursor + } + if lang != "" { + params["lang"] = lang + } + if limit != 0 { + params["limit"] = limit + } + params["q"] = q + if repoDid != "" { + params["repoDid"] = repoDid + } + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.search.searchCode", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/siteclaimDomain.go b/api/org_tangled/siteclaimDomain.go new file mode 100644 index 000000000..521cdfed6 --- /dev/null +++ b/api/org_tangled/siteclaimDomain.go @@ -0,0 +1,30 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.site.claimDomain + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempSiteClaimDomainNSID = "org.tangled.temp.site.claimDomain" +) + +// TempSiteClaimDomain_Input is the input argument to a org.tangled.temp.site.claimDomain call. +type TempSiteClaimDomain_Input struct { + // subdomain: Desired subdomain label (lowercase letters, digits, and hyphens; 4–63 characters). + Subdomain string `json:"subdomain" cborgen:"subdomain"` +} + +// TempSiteClaimDomain calls the XRPC method "org.tangled.temp.site.claimDomain". +func TempSiteClaimDomain(ctx context.Context, c util.LexClient, input *TempSiteClaimDomain_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.site.claimDomain", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/sitegetDomainClaim.go b/api/org_tangled/sitegetDomainClaim.go new file mode 100644 index 000000000..53132a07f --- /dev/null +++ b/api/org_tangled/sitegetDomainClaim.go @@ -0,0 +1,31 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.site.getDomainClaim + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempSiteGetDomainClaimNSID = "org.tangled.temp.site.getDomainClaim" +) + +// TempSiteGetDomainClaim_Output is the output of a org.tangled.temp.site.getDomainClaim call. +type TempSiteGetDomainClaim_Output struct { + // domain: The claimed domain (e.g. 'alice.sites.tangled.sh'). Absent if no active claim. + Domain *string `json:"domain,omitempty" cborgen:"domain,omitempty"` +} + +// TempSiteGetDomainClaim calls the XRPC method "org.tangled.temp.site.getDomainClaim". +func TempSiteGetDomainClaim(ctx context.Context, c util.LexClient) (*TempSiteGetDomainClaim_Output, error) { + var out TempSiteGetDomainClaim_Output + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.site.getDomainClaim", nil, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/sitereleaseDomain.go b/api/org_tangled/sitereleaseDomain.go new file mode 100644 index 000000000..27f3d2283 --- /dev/null +++ b/api/org_tangled/sitereleaseDomain.go @@ -0,0 +1,30 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.site.releaseDomain + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempSiteReleaseDomainNSID = "org.tangled.temp.site.releaseDomain" +) + +// TempSiteReleaseDomain_Input is the input argument to a org.tangled.temp.site.releaseDomain call. +type TempSiteReleaseDomain_Input struct { + // domain: Full domain to release (must match the user's active claim). + Domain string `json:"domain" cborgen:"domain"` +} + +// TempSiteReleaseDomain calls the XRPC method "org.tangled.temp.site.releaseDomain". +func TempSiteReleaseDomain(ctx context.Context, c util.LexClient, input *TempSiteReleaseDomain_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.site.releaseDomain", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/tangled/accountbeginSignup.go b/api/tangled/accountbeginSignup.go deleted file mode 100644 index f503b7e8b..000000000 --- a/api/tangled/accountbeginSignup.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.account.beginSignup - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempAccountBeginSignupNSID = "org.tangled.temp.account.beginSignup" -) - -// TempAccountBeginSignup_Input is the input argument to a org.tangled.temp.account.beginSignup call. -type TempAccountBeginSignup_Input struct { - // email: Email address for the new account. - Email string `json:"email" cborgen:"email"` - // turnstileToken: Cloudflare Turnstile challenge response token. - TurnstileToken string `json:"turnstileToken" cborgen:"turnstileToken"` -} - -// TempAccountBeginSignup calls the XRPC method "org.tangled.temp.account.beginSignup". -func TempAccountBeginSignup(ctx context.Context, c util.LexClient, input *TempAccountBeginSignup_Input) error { - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.account.beginSignup", nil, input, nil); err != nil { - return err - } - - return nil -} diff --git a/api/tangled/accountcompleteSignup.go b/api/tangled/accountcompleteSignup.go deleted file mode 100644 index 57a11eda7..000000000 --- a/api/tangled/accountcompleteSignup.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.account.completeSignup - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempAccountCompleteSignupNSID = "org.tangled.temp.account.completeSignup" -) - -// TempAccountCompleteSignup_Input is the input argument to a org.tangled.temp.account.completeSignup call. -type TempAccountCompleteSignup_Input struct { - // code: Verification code from the signup email. - Code string `json:"code" cborgen:"code"` - // password: Password for the new account. - Password string `json:"password" cborgen:"password"` - // username: Desired username; the assigned handle is .. - Username string `json:"username" cborgen:"username"` -} - -// TempAccountCompleteSignup_Output is the output of a org.tangled.temp.account.completeSignup call. -type TempAccountCompleteSignup_Output struct { - // did: DID of the newly provisioned account. - Did string `json:"did" cborgen:"did"` - // handle: The assigned handle, .. - Handle string `json:"handle" cborgen:"handle"` -} - -// TempAccountCompleteSignup calls the XRPC method "org.tangled.temp.account.completeSignup". -func TempAccountCompleteSignup(ctx context.Context, c util.LexClient, input *TempAccountCompleteSignup_Input) (*TempAccountCompleteSignup_Output, error) { - var out TempAccountCompleteSignup_Output - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.account.completeSignup", nil, input, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/tangled/accountdeleteEmail.go b/api/tangled/accountdeleteEmail.go deleted file mode 100644 index 35af9452e..000000000 --- a/api/tangled/accountdeleteEmail.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.account.deleteEmail - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempAccountDeleteEmailNSID = "org.tangled.temp.account.deleteEmail" -) - -// TempAccountDeleteEmail_Input is the input argument to a org.tangled.temp.account.deleteEmail call. -type TempAccountDeleteEmail_Input struct { - // email: Email address to remove. - Email string `json:"email" cborgen:"email"` -} - -// TempAccountDeleteEmail calls the XRPC method "org.tangled.temp.account.deleteEmail". -func TempAccountDeleteEmail(ctx context.Context, c util.LexClient, input *TempAccountDeleteEmail_Input) error { - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.account.deleteEmail", nil, input, nil); err != nil { - return err - } - - return nil -} diff --git a/api/tangled/accountdismissNewsletter.go b/api/tangled/accountdismissNewsletter.go deleted file mode 100644 index 03f7bc326..000000000 --- a/api/tangled/accountdismissNewsletter.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.account.dismissNewsletter - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempAccountDismissNewsletterNSID = "org.tangled.temp.account.dismissNewsletter" -) - -// TempAccountDismissNewsletter calls the XRPC method "org.tangled.temp.account.dismissNewsletter". -func TempAccountDismissNewsletter(ctx context.Context, c util.LexClient) error { - if err := c.LexDo(ctx, util.Procedure, "", "org.tangled.temp.account.dismissNewsletter", nil, nil, nil); err != nil { - return err - } - - return nil -} diff --git a/api/tangled/accountlistEmails.go b/api/tangled/accountlistEmails.go deleted file mode 100644 index 45accf481..000000000 --- a/api/tangled/accountlistEmails.go +++ /dev/null @@ -1,41 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.account.listEmails - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempAccountListEmailsNSID = "org.tangled.temp.account.listEmails" -) - -// TempAccountListEmails_Email is a "email" in the org.tangled.temp.account.listEmails schema. -type TempAccountListEmails_Email struct { - // address: Email address. - Address string `json:"address" cborgen:"address"` - CreatedAt string `json:"createdAt" cborgen:"createdAt"` - // primary: Whether this is the primary email address. - Primary bool `json:"primary" cborgen:"primary"` - // verified: Whether the address has been verified. - Verified bool `json:"verified" cborgen:"verified"` -} - -// TempAccountListEmails_Output is the output of a org.tangled.temp.account.listEmails call. -type TempAccountListEmails_Output struct { - Emails []*TempAccountListEmails_Email `json:"emails" cborgen:"emails"` -} - -// TempAccountListEmails calls the XRPC method "org.tangled.temp.account.listEmails". -func TempAccountListEmails(ctx context.Context, c util.LexClient) (*TempAccountListEmails_Output, error) { - var out TempAccountListEmails_Output - if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.account.listEmails", nil, nil, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/tangled/accountsetPrimaryEmail.go b/api/tangled/accountsetPrimaryEmail.go deleted file mode 100644 index ebf4d5588..000000000 --- a/api/tangled/accountsetPrimaryEmail.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.account.setPrimaryEmail - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempAccountSetPrimaryEmailNSID = "org.tangled.temp.account.setPrimaryEmail" -) - -// TempAccountSetPrimaryEmail_Input is the input argument to a org.tangled.temp.account.setPrimaryEmail call. -type TempAccountSetPrimaryEmail_Input struct { - // email: Email address to promote to primary. - Email string `json:"email" cborgen:"email"` -} - -// TempAccountSetPrimaryEmail calls the XRPC method "org.tangled.temp.account.setPrimaryEmail". -func TempAccountSetPrimaryEmail(ctx context.Context, c util.LexClient, input *TempAccountSetPrimaryEmail_Input) error { - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.account.setPrimaryEmail", nil, input, nil); err != nil { - return err - } - - return nil -} diff --git a/api/tangled/accountsubscribeNewsletter.go b/api/tangled/accountsubscribeNewsletter.go deleted file mode 100644 index 0732deee1..000000000 --- a/api/tangled/accountsubscribeNewsletter.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.account.subscribeNewsletter - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempAccountSubscribeNewsletterNSID = "org.tangled.temp.account.subscribeNewsletter" -) - -// TempAccountSubscribeNewsletter calls the XRPC method "org.tangled.temp.account.subscribeNewsletter". -func TempAccountSubscribeNewsletter(ctx context.Context, c util.LexClient) error { - if err := c.LexDo(ctx, util.Procedure, "", "org.tangled.temp.account.subscribeNewsletter", nil, nil, nil); err != nil { - return err - } - - return nil -} diff --git a/api/tangled/actorgetTrending.go b/api/tangled/actorgetTrending.go new file mode 100644 index 000000000..8c335cd3b --- /dev/null +++ b/api/tangled/actorgetTrending.go @@ -0,0 +1,31 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.actor.getTrending + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + ActorGetTrendingNSID = "sh.tangled.actor.getTrending" +) + +// ActorGetTrending_Output is the output of a sh.tangled.actor.getTrending call. +type ActorGetTrending_Output struct { + People []*ActorDefs_ProfileViewDetailed `json:"people" cborgen:"people"` + Repos []*RepoDefs_RepoViewBasic `json:"repos" cborgen:"repos"` +} + +// ActorGetTrending calls the XRPC method "sh.tangled.actor.getTrending". +func ActorGetTrending(ctx context.Context, c util.LexClient) (*ActorGetTrending_Output, error) { + var out ActorGetTrending_Output + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.actor.getTrending", nil, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/bobbinawaitRecord.go b/api/tangled/bobbinawaitRecord.go new file mode 100644 index 000000000..d8432cac2 --- /dev/null +++ b/api/tangled/bobbinawaitRecord.go @@ -0,0 +1,46 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.bobbin.awaitRecord + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + BobbinAwaitRecordNSID = "sh.tangled.bobbin.awaitRecord" +) + +// BobbinAwaitRecord_Output is the output of a sh.tangled.bobbin.awaitRecord call. +type BobbinAwaitRecord_Output struct { + // cid: CID of the revision this result is about. + Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"` + // detail: Opaque error message which can be more detailed than the reason. + Detail *string `json:"detail,omitempty" cborgen:"detail,omitempty"` + // reason: Why a rejected record will not appear. + Reason *string `json:"reason,omitempty" cborgen:"reason,omitempty"` + // status: What bobbin did with the record. + Status string `json:"status" cborgen:"status"` +} + +// BobbinAwaitRecord calls the XRPC method "sh.tangled.bobbin.awaitRecord". +// +// cid: CID of the revision that was written, as returned by createRecord, putRecord or applyWrites. Omit it only when awaiting a delete, which has no CID. any other responds with whatever revision of the record settles first. +// uri: AT-URI of the record that was written. +func BobbinAwaitRecord(ctx context.Context, c util.LexClient, cid string, uri string) (*BobbinAwaitRecord_Output, error) { + var out BobbinAwaitRecord_Output + + params := map[string]interface{}{} + if cid != "" { + params["cid"] = cid + } + params["uri"] = uri + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.bobbin.awaitRecord", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/cbor_gen.go b/api/tangled/cbor_gen.go index 0f5163dbe..7b39f0b3a 100644 --- a/api/tangled/cbor_gen.go +++ b/api/tangled/cbor_gen.go @@ -3283,6 +3283,172 @@ func (t *CiTrigger_Push) UnmarshalCBOR(r io.Reader) (err error) { return nil } +func (t *EmbedCommit) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + + if _, err := cw.Write([]byte{163}); err != nil { + return err + } + + // t.Repo (string) (string) + if len("repo") > 1000000 { + return xerrors.Errorf("Value in field \"repo\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil { + return err + } + if _, err := cw.WriteString(string("repo")); err != nil { + return err + } + + if len(t.Repo) > 1000000 { + return xerrors.Errorf("Value in field t.Repo was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Repo))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Repo)); err != nil { + return err + } + + // t.LexiconTypeID (string) (string) + if len("$type") > 1000000 { + return xerrors.Errorf("Value in field \"$type\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { + return err + } + if _, err := cw.WriteString(string("$type")); err != nil { + return err + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.embed.commit"))); err != nil { + return err + } + if _, err := cw.WriteString(string("sh.tangled.embed.commit")); err != nil { + return err + } + + // t.Commit (tangled.EmbedCommit_Commit) (struct) + if len("commit") > 1000000 { + return xerrors.Errorf("Value in field \"commit\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("commit"))); err != nil { + return err + } + if _, err := cw.WriteString(string("commit")); err != nil { + return err + } + + if err := t.Commit.MarshalCBOR(cw); err != nil { + return err + } + return nil +} + +func (t *EmbedCommit) UnmarshalCBOR(r io.Reader) (err error) { + *t = EmbedCommit{} + + cr := cbg.NewCborReader(r) + + maj, extra, err := cr.ReadHeader() + if err != nil { + return err + } + defer func() { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + }() + + if maj != cbg.MajMap { + return fmt.Errorf("cbor input should be of type map") + } + + if extra > cbg.MaxLength { + return fmt.Errorf("EmbedCommit: map struct too large (%d)", extra) + } + + n := extra + + nameBuf := make([]byte, 6) + for i := uint64(0); i < n; i++ { + nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) + if err != nil { + return err + } + + if !ok { + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { + return err + } + continue + } + + switch string(nameBuf[:nameLen]) { + // t.Repo (string) (string) + case "repo": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Repo = string(sval) + } + // t.LexiconTypeID (string) (string) + case "$type": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.LexiconTypeID = string(sval) + } + // t.Commit (tangled.EmbedCommit_Commit) (struct) + case "commit": + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Commit = new(EmbedCommit_Commit) + if err := t.Commit.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Commit pointer: %w", err) + } + } + + } + + default: + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { + return err + } + } + } + + return nil +} func (t *FeedComment) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) @@ -3290,7 +3456,11 @@ func (t *FeedComment) MarshalCBOR(w io.Writer) error { } cw := cbg.NewCborWriter(w) - fieldCount := 6 + fieldCount := 7 + + if t.Embed == nil { + fieldCount-- + } if t.PullRoundIdx == nil { fieldCount-- @@ -3339,6 +3509,25 @@ func (t *FeedComment) MarshalCBOR(w io.Writer) error { return err } + // t.Embed (tangled.FeedComment_Embed) (struct) + if t.Embed != nil { + + if len("embed") > 1000000 { + return xerrors.Errorf("Value in field \"embed\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("embed"))); err != nil { + return err + } + if _, err := cw.WriteString(string("embed")); err != nil { + return err + } + + if err := t.Embed.MarshalCBOR(cw); err != nil { + return err + } + } + // t.ReplyTo (atproto.RepoStrongRef) (struct) if t.ReplyTo != nil { @@ -3503,6 +3692,26 @@ func (t *FeedComment) UnmarshalCBOR(r io.Reader) (err error) { t.LexiconTypeID = string(sval) } + // t.Embed (tangled.FeedComment_Embed) (struct) + case "embed": + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Embed = new(FeedComment_Embed) + if err := t.Embed.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Embed pointer: %w", err) + } + } + + } // t.ReplyTo (atproto.RepoStrongRef) (struct) case "replyTo": @@ -3762,438 +3971,12 @@ func (t *FeedReaction) UnmarshalCBOR(r io.Reader) (err error) { sval, err := cbg.ReadStringWithMax(cr, 1000000) if err != nil { return err - } - - t.Subject = string(sval) - } - // t.Reaction (string) (string) - case "reaction": - - { - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } - - t.Reaction = string(sval) - } - // t.CreatedAt (string) (string) - case "createdAt": - - { - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } - - t.CreatedAt = string(sval) - } - - default: - // Field doesn't exist on this type, so ignore it - if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { - return err - } - } - } - - return nil -} -func (t *FeedStar) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - - cw := cbg.NewCborWriter(w) - - if _, err := cw.Write([]byte{163}); err != nil { - return err - } - - // t.LexiconTypeID (string) (string) - if len("$type") > 1000000 { - return xerrors.Errorf("Value in field \"$type\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { - return err - } - if _, err := cw.WriteString(string("$type")); err != nil { - return err - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.feed.star"))); err != nil { - return err - } - if _, err := cw.WriteString(string("sh.tangled.feed.star")); err != nil { - return err - } - - // t.Subject (tangled.FeedStar_Subject) (struct) - if len("subject") > 1000000 { - return xerrors.Errorf("Value in field \"subject\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("subject"))); err != nil { - return err - } - if _, err := cw.WriteString(string("subject")); err != nil { - return err - } - - if err := t.Subject.MarshalCBOR(cw); err != nil { - return err - } - - // t.CreatedAt (string) (string) - if len("createdAt") > 1000000 { - return xerrors.Errorf("Value in field \"createdAt\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { - return err - } - if _, err := cw.WriteString(string("createdAt")); err != nil { - return err - } - - if len(t.CreatedAt) > 1000000 { - return xerrors.Errorf("Value in field t.CreatedAt was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil { - return err - } - if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { - return err - } - return nil -} - -func (t *FeedStar) UnmarshalCBOR(r io.Reader) (err error) { - *t = FeedStar{} - - cr := cbg.NewCborReader(r) - - maj, extra, err := cr.ReadHeader() - if err != nil { - return err - } - defer func() { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - }() - - if maj != cbg.MajMap { - return fmt.Errorf("cbor input should be of type map") - } - - if extra > cbg.MaxLength { - return fmt.Errorf("FeedStar: map struct too large (%d)", extra) - } - - n := extra - - nameBuf := make([]byte, 9) - for i := uint64(0); i < n; i++ { - nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) - if err != nil { - return err - } - - if !ok { - // Field doesn't exist on this type, so ignore it - if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { - return err - } - continue - } - - switch string(nameBuf[:nameLen]) { - // t.LexiconTypeID (string) (string) - case "$type": - - { - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } - - t.LexiconTypeID = string(sval) - } - // t.Subject (tangled.FeedStar_Subject) (struct) - case "subject": - - { - - b, err := cr.ReadByte() - if err != nil { - return err - } - if b != cbg.CborNull[0] { - if err := cr.UnreadByte(); err != nil { - return err - } - t.Subject = new(FeedStar_Subject) - if err := t.Subject.UnmarshalCBOR(cr); err != nil { - return xerrors.Errorf("unmarshaling t.Subject pointer: %w", err) - } - } - - } - // t.CreatedAt (string) (string) - case "createdAt": - - { - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } - - t.CreatedAt = string(sval) - } - - default: - // Field doesn't exist on this type, so ignore it - if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { - return err - } - } - } - - return nil -} -func (t *FeedStar_Repo) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - - cw := cbg.NewCborWriter(w) - - if _, err := cw.Write([]byte{162}); err != nil { - return err - } - - // t.Did (string) (string) - if len("did") > 1000000 { - return xerrors.Errorf("Value in field \"did\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("did"))); err != nil { - return err - } - if _, err := cw.WriteString(string("did")); err != nil { - return err - } - - if len(t.Did) > 1000000 { - return xerrors.Errorf("Value in field t.Did was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Did))); err != nil { - return err - } - if _, err := cw.WriteString(string(t.Did)); err != nil { - return err - } - - // t.LexiconTypeID (string) (string) - if len("$type") > 1000000 { - return xerrors.Errorf("Value in field \"$type\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { - return err - } - if _, err := cw.WriteString(string("$type")); err != nil { - return err - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.feed.star#repo"))); err != nil { - return err - } - if _, err := cw.WriteString(string("sh.tangled.feed.star#repo")); err != nil { - return err - } - return nil -} - -func (t *FeedStar_Repo) UnmarshalCBOR(r io.Reader) (err error) { - *t = FeedStar_Repo{} - - cr := cbg.NewCborReader(r) - - maj, extra, err := cr.ReadHeader() - if err != nil { - return err - } - defer func() { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - }() - - if maj != cbg.MajMap { - return fmt.Errorf("cbor input should be of type map") - } - - if extra > cbg.MaxLength { - return fmt.Errorf("FeedStar_Repo: map struct too large (%d)", extra) - } - - n := extra - - nameBuf := make([]byte, 5) - for i := uint64(0); i < n; i++ { - nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) - if err != nil { - return err - } - - if !ok { - // Field doesn't exist on this type, so ignore it - if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { - return err - } - continue - } - - switch string(nameBuf[:nameLen]) { - // t.Did (string) (string) - case "did": - - { - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } - - t.Did = string(sval) - } - // t.LexiconTypeID (string) (string) - case "$type": - - { - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } - - t.LexiconTypeID = string(sval) - } - - default: - // Field doesn't exist on this type, so ignore it - if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { - return err - } - } - } - - return nil -} -func (t *FeedStar_String) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - - cw := cbg.NewCborWriter(w) - - if _, err := cw.Write([]byte{162}); err != nil { - return err - } - - // t.Uri (string) (string) - if len("uri") > 1000000 { - return xerrors.Errorf("Value in field \"uri\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("uri"))); err != nil { - return err - } - if _, err := cw.WriteString(string("uri")); err != nil { - return err - } - - if len(t.Uri) > 1000000 { - return xerrors.Errorf("Value in field t.Uri was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Uri))); err != nil { - return err - } - if _, err := cw.WriteString(string(t.Uri)); err != nil { - return err - } - - // t.LexiconTypeID (string) (string) - if len("$type") > 1000000 { - return xerrors.Errorf("Value in field \"$type\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { - return err - } - if _, err := cw.WriteString(string("$type")); err != nil { - return err - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.feed.star#string"))); err != nil { - return err - } - if _, err := cw.WriteString(string("sh.tangled.feed.star#string")); err != nil { - return err - } - return nil -} - -func (t *FeedStar_String) UnmarshalCBOR(r io.Reader) (err error) { - *t = FeedStar_String{} - - cr := cbg.NewCborReader(r) - - maj, extra, err := cr.ReadHeader() - if err != nil { - return err - } - defer func() { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - }() - - if maj != cbg.MajMap { - return fmt.Errorf("cbor input should be of type map") - } - - if extra > cbg.MaxLength { - return fmt.Errorf("FeedStar_String: map struct too large (%d)", extra) - } - - n := extra - - nameBuf := make([]byte, 5) - for i := uint64(0); i < n; i++ { - nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) - if err != nil { - return err - } - - if !ok { - // Field doesn't exist on this type, so ignore it - if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { - return err - } - continue - } - - switch string(nameBuf[:nameLen]) { - // t.Uri (string) (string) - case "uri": + } + + t.Subject = string(sval) + } + // t.Reaction (string) (string) + case "reaction": { sval, err := cbg.ReadStringWithMax(cr, 1000000) @@ -4201,10 +3984,10 @@ func (t *FeedStar_String) UnmarshalCBOR(r io.Reader) (err error) { return err } - t.Uri = string(sval) + t.Reaction = string(sval) } - // t.LexiconTypeID (string) (string) - case "$type": + // t.CreatedAt (string) (string) + case "createdAt": { sval, err := cbg.ReadStringWithMax(cr, 1000000) @@ -4212,7 +3995,7 @@ func (t *FeedStar_String) UnmarshalCBOR(r io.Reader) (err error) { return err } - t.LexiconTypeID = string(sval) + t.CreatedAt = string(sval) } default: @@ -4225,20 +4008,15 @@ func (t *FeedStar_String) UnmarshalCBOR(r io.Reader) (err error) { return nil } -func (t *FeedSubscription) MarshalCBOR(w io.Writer) error { +func (t *FeedStar) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } cw := cbg.NewCborWriter(w) - fieldCount := 4 - if t.Collections == nil { - fieldCount-- - } - - if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { + if _, err := cw.Write([]byte{163}); err != nil { return err } @@ -4254,14 +4032,14 @@ func (t *FeedSubscription) MarshalCBOR(w io.Writer) error { return err } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.feed.subscription"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.feed.star"))); err != nil { return err } - if _, err := cw.WriteString(string("org.tangled.feed.subscription")); err != nil { + if _, err := cw.WriteString(string("sh.tangled.feed.star")); err != nil { return err } - // t.Subject (tangled.FeedSubscription_Subject) (struct) + // t.Subject (tangled.FeedStar_Subject) (struct) if len("subject") > 1000000 { return xerrors.Errorf("Value in field \"subject\" was too long") } @@ -4299,47 +4077,11 @@ func (t *FeedSubscription) MarshalCBOR(w io.Writer) error { if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { return err } - - // t.Collections ([]string) (slice) - if t.Collections != nil { - - if len("collections") > 1000000 { - return xerrors.Errorf("Value in field \"collections\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("collections"))); err != nil { - return err - } - if _, err := cw.WriteString(string("collections")); err != nil { - return err - } - - if len(t.Collections) > 8192 { - return xerrors.Errorf("Slice value in field t.Collections was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Collections))); err != nil { - return err - } - for _, v := range t.Collections { - if len(v) > 1000000 { - return xerrors.Errorf("Value in field v was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil { - return err - } - if _, err := cw.WriteString(string(v)); err != nil { - return err - } - - } - } return nil } -func (t *FeedSubscription) UnmarshalCBOR(r io.Reader) (err error) { - *t = FeedSubscription{} +func (t *FeedStar) UnmarshalCBOR(r io.Reader) (err error) { + *t = FeedStar{} cr := cbg.NewCborReader(r) @@ -4358,12 +4100,12 @@ func (t *FeedSubscription) UnmarshalCBOR(r io.Reader) (err error) { } if extra > cbg.MaxLength { - return fmt.Errorf("FeedSubscription: map struct too large (%d)", extra) + return fmt.Errorf("FeedStar: map struct too large (%d)", extra) } n := extra - nameBuf := make([]byte, 11) + nameBuf := make([]byte, 9) for i := uint64(0); i < n; i++ { nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) if err != nil { @@ -4390,7 +4132,7 @@ func (t *FeedSubscription) UnmarshalCBOR(r io.Reader) (err error) { t.LexiconTypeID = string(sval) } - // t.Subject (tangled.FeedSubscription_Subject) (struct) + // t.Subject (tangled.FeedStar_Subject) (struct) case "subject": { @@ -4403,7 +4145,7 @@ func (t *FeedSubscription) UnmarshalCBOR(r io.Reader) (err error) { if err := cr.UnreadByte(); err != nil { return err } - t.Subject = new(FeedSubscription_Subject) + t.Subject = new(FeedStar_Subject) if err := t.Subject.UnmarshalCBOR(cr); err != nil { return xerrors.Errorf("unmarshaling t.Subject pointer: %w", err) } @@ -4421,45 +4163,135 @@ func (t *FeedSubscription) UnmarshalCBOR(r io.Reader) (err error) { t.CreatedAt = string(sval) } - // t.Collections ([]string) (slice) - case "collections": - maj, extra, err = cr.ReadHeader() - if err != nil { + default: + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { return err } + } + } - if extra > 8192 { - return fmt.Errorf("t.Collections: array too large (%d)", extra) - } + return nil +} +func (t *FeedStar_Repo) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } - if maj != cbg.MajArray { - return fmt.Errorf("expected cbor array") - } + cw := cbg.NewCborWriter(w) - if extra > 0 { - t.Collections = make([]string, extra) + if _, err := cw.Write([]byte{162}); err != nil { + return err + } + + // t.Did (string) (string) + if len("did") > 1000000 { + return xerrors.Errorf("Value in field \"did\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("did"))); err != nil { + return err + } + if _, err := cw.WriteString(string("did")); err != nil { + return err + } + + if len(t.Did) > 1000000 { + return xerrors.Errorf("Value in field t.Did was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Did))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Did)); err != nil { + return err + } + + // t.LexiconTypeID (string) (string) + if len("$type") > 1000000 { + return xerrors.Errorf("Value in field \"$type\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { + return err + } + if _, err := cw.WriteString(string("$type")); err != nil { + return err + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.feed.star#repo"))); err != nil { + return err + } + if _, err := cw.WriteString(string("sh.tangled.feed.star#repo")); err != nil { + return err + } + return nil +} + +func (t *FeedStar_Repo) UnmarshalCBOR(r io.Reader) (err error) { + *t = FeedStar_Repo{} + + cr := cbg.NewCborReader(r) + + maj, extra, err := cr.ReadHeader() + if err != nil { + return err + } + defer func() { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + }() + + if maj != cbg.MajMap { + return fmt.Errorf("cbor input should be of type map") + } + + if extra > cbg.MaxLength { + return fmt.Errorf("FeedStar_Repo: map struct too large (%d)", extra) + } + + n := extra + + nameBuf := make([]byte, 5) + for i := uint64(0); i < n; i++ { + nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) + if err != nil { + return err + } + + if !ok { + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { + return err } + continue + } - for i := 0; i < int(extra); i++ { - { - var maj byte - var extra uint64 - var err error - _ = maj - _ = extra - _ = err + switch string(nameBuf[:nameLen]) { + // t.Did (string) (string) + case "did": - { - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } - t.Collections[i] = string(sval) - } + t.Did = string(sval) + } + // t.LexiconTypeID (string) (string) + case "$type": + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err } + + t.LexiconTypeID = string(sval) } default: @@ -4472,7 +4304,7 @@ func (t *FeedSubscription) UnmarshalCBOR(r io.Reader) (err error) { return nil } -func (t *FeedSubscription_Uri) MarshalCBOR(w io.Writer) error { +func (t *FeedStar_String) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err @@ -4519,17 +4351,17 @@ func (t *FeedSubscription_Uri) MarshalCBOR(w io.Writer) error { return err } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.feed.subscription#uri"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.feed.star#string"))); err != nil { return err } - if _, err := cw.WriteString(string("org.tangled.feed.subscription#uri")); err != nil { + if _, err := cw.WriteString(string("sh.tangled.feed.star#string")); err != nil { return err } return nil } -func (t *FeedSubscription_Uri) UnmarshalCBOR(r io.Reader) (err error) { - *t = FeedSubscription_Uri{} +func (t *FeedStar_String) UnmarshalCBOR(r io.Reader) (err error) { + *t = FeedStar_String{} cr := cbg.NewCborReader(r) @@ -4548,7 +4380,7 @@ func (t *FeedSubscription_Uri) UnmarshalCBOR(r io.Reader) (err error) { } if extra > cbg.MaxLength { - return fmt.Errorf("FeedSubscription_Uri: map struct too large (%d)", extra) + return fmt.Errorf("FeedStar_String: map struct too large (%d)", extra) } n := extra @@ -4602,7 +4434,7 @@ func (t *FeedSubscription_Uri) UnmarshalCBOR(r io.Reader) (err error) { return nil } -func (t *FeedSubscription_Repo) MarshalCBOR(w io.Writer) error { +func (t *GitOid) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err @@ -4614,26 +4446,26 @@ func (t *FeedSubscription_Repo) MarshalCBOR(w io.Writer) error { return err } - // t.Did (string) (string) - if len("did") > 1000000 { - return xerrors.Errorf("Value in field \"did\" was too long") + // t.Oid (string) (string) + if len("oid") > 1000000 { + return xerrors.Errorf("Value in field \"oid\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("did"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("oid"))); err != nil { return err } - if _, err := cw.WriteString(string("did")); err != nil { + if _, err := cw.WriteString(string("oid")); err != nil { return err } - if len(t.Did) > 1000000 { - return xerrors.Errorf("Value in field t.Did was too long") + if len(t.Oid) > 1000000 { + return xerrors.Errorf("Value in field t.Oid was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Did))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Oid))); err != nil { return err } - if _, err := cw.WriteString(string(t.Did)); err != nil { + if _, err := cw.WriteString(string(t.Oid)); err != nil { return err } @@ -4649,17 +4481,17 @@ func (t *FeedSubscription_Repo) MarshalCBOR(w io.Writer) error { return err } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.feed.subscription#repo"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.git.oid"))); err != nil { return err } - if _, err := cw.WriteString(string("org.tangled.feed.subscription#repo")); err != nil { + if _, err := cw.WriteString(string("sh.tangled.git.oid")); err != nil { return err } return nil } -func (t *FeedSubscription_Repo) UnmarshalCBOR(r io.Reader) (err error) { - *t = FeedSubscription_Repo{} +func (t *GitOid) UnmarshalCBOR(r io.Reader) (err error) { + *t = GitOid{} cr := cbg.NewCborReader(r) @@ -4678,7 +4510,7 @@ func (t *FeedSubscription_Repo) UnmarshalCBOR(r io.Reader) (err error) { } if extra > cbg.MaxLength { - return fmt.Errorf("FeedSubscription_Repo: map struct too large (%d)", extra) + return fmt.Errorf("GitOid: map struct too large (%d)", extra) } n := extra @@ -4699,8 +4531,8 @@ func (t *FeedSubscription_Repo) UnmarshalCBOR(r io.Reader) (err error) { } switch string(nameBuf[:nameLen]) { - // t.Did (string) (string) - case "did": + // t.Oid (string) (string) + case "oid": { sval, err := cbg.ReadStringWithMax(cr, 1000000) @@ -4708,7 +4540,7 @@ func (t *FeedSubscription_Repo) UnmarshalCBOR(r io.Reader) (err error) { return err } - t.Did = string(sval) + t.Oid = string(sval) } // t.LexiconTypeID (string) (string) case "$type": @@ -15455,46 +15287,32 @@ func (t *RepoPull_Version) MarshalCBOR(w io.Writer) error { } cw := cbg.NewCborWriter(w) - fieldCount := 3 - - if t.Base == nil { - fieldCount-- - } - if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { + if _, err := cw.Write([]byte{163}); err != nil { return err } // t.Base (string) (string) - if t.Base != nil { - - if len("base") > 1000000 { - return xerrors.Errorf("Value in field \"base\" was too long") - } + if len("base") > 1000000 { + return xerrors.Errorf("Value in field \"base\" was too long") + } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("base"))); err != nil { - return err - } - if _, err := cw.WriteString(string("base")); err != nil { - return err - } + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("base"))); err != nil { + return err + } + if _, err := cw.WriteString(string("base")); err != nil { + return err + } - if t.Base == nil { - if _, err := cw.Write(cbg.CborNull); err != nil { - return err - } - } else { - if len(*t.Base) > 1000000 { - return xerrors.Errorf("Value in field t.Base was too long") - } + if len(t.Base) > 1000000 { + return xerrors.Errorf("Value in field t.Base was too long") + } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Base))); err != nil { - return err - } - if _, err := cw.WriteString(string(*t.Base)); err != nil { - return err - } - } + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Base))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Base)); err != nil { + return err } // t.Head (string) (string) @@ -15590,22 +15408,12 @@ func (t *RepoPull_Version) UnmarshalCBOR(r io.Reader) (err error) { case "base": { - b, err := cr.ReadByte() + sval, err := cbg.ReadStringWithMax(cr, 1000000) if err != nil { return err } - if b != cbg.CborNull[0] { - if err := cr.UnreadByte(); err != nil { - return err - } - - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } - t.Base = (*string)(&sval) - } + t.Base = string(sval) } // t.Head (string) (string) case "head": diff --git a/api/tangled/embedcommit.go b/api/tangled/embedcommit.go new file mode 100644 index 000000000..a7b160dc1 --- /dev/null +++ b/api/tangled/embedcommit.go @@ -0,0 +1,83 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.embed.commit + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + + "github.com/bluesky-social/indigo/lex/util" + cbg "github.com/whyrusleeping/cbor-gen" +) + +const ( + EmbedCommitNSID = "sh.tangled.embed.commit" +) + +func init() { + util.RegisterType("sh.tangled.embed.commit#main", &EmbedCommit{}) +} // EmbedCommit is a "main" in the sh.tangled.embed.commit schema. +// RECORDTYPE: EmbedCommit +type EmbedCommit struct { + LexiconTypeID string `json:"$type,const=sh.tangled.embed.commit" cborgen:"$type,const=sh.tangled.embed.commit"` + Commit *EmbedCommit_Commit `json:"commit" cborgen:"commit"` + Repo string `json:"repo" cborgen:"repo"` +} + +type EmbedCommit_Commit struct { + GitOid *GitOid +} + +func (t *EmbedCommit_Commit) MarshalJSON() ([]byte, error) { + if t.GitOid != nil { + t.GitOid.LexiconTypeID = "sh.tangled.git.oid" + return json.Marshal(t.GitOid) + } + return nil, fmt.Errorf("cannot marshal empty enum") +} +func (t *EmbedCommit_Commit) UnmarshalJSON(b []byte) error { + typ, err := util.TypeExtract(b) + if err != nil { + return err + } + + switch typ { + case "sh.tangled.git.oid": + t.GitOid = new(GitOid) + return json.Unmarshal(b, t.GitOid) + + default: + return nil + } +} + +func (t *EmbedCommit_Commit) MarshalCBOR(w io.Writer) error { + + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + if t.GitOid != nil { + return t.GitOid.MarshalCBOR(w) + } + return fmt.Errorf("cannot cbor marshal empty enum") +} +func (t *EmbedCommit_Commit) UnmarshalCBOR(r io.Reader) error { + typ, b, err := util.CborTypeExtractReader(r) + if err != nil { + return err + } + + switch typ { + case "sh.tangled.git.oid": + t.GitOid = new(GitOid) + return t.GitOid.UnmarshalCBOR(bytes.NewReader(b)) + + default: + return nil + } +} diff --git a/api/tangled/feedcomment.go b/api/tangled/feedcomment.go index d535ec6d4..5237ef3ca 100644 --- a/api/tangled/feedcomment.go +++ b/api/tangled/feedcomment.go @@ -24,9 +24,10 @@ func init() { } // // RECORDTYPE: FeedComment type FeedComment struct { - LexiconTypeID string `json:"$type,const=sh.tangled.feed.comment" cborgen:"$type,const=sh.tangled.feed.comment"` - Body *FeedComment_Body `json:"body" cborgen:"body"` - CreatedAt string `json:"createdAt" cborgen:"createdAt"` + LexiconTypeID string `json:"$type,const=sh.tangled.feed.comment" cborgen:"$type,const=sh.tangled.feed.comment"` + Body *FeedComment_Body `json:"body" cborgen:"body"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + Embed *FeedComment_Embed `json:"embed,omitempty" cborgen:"embed,omitempty"` // pullRoundIdx: optional pull submission round index. required when subject is sh.tangled.repo.pull PullRoundIdx *int64 `json:"pullRoundIdx,omitempty" cborgen:"pullRoundIdx,omitempty"` ReplyTo *comatprototypes.RepoStrongRef `json:"replyTo,omitempty" cborgen:"replyTo,omitempty"` @@ -86,3 +87,57 @@ func (t *FeedComment_Body) UnmarshalCBOR(r io.Reader) error { return nil } } + +type FeedComment_Embed struct { + EmbedCommit *EmbedCommit +} + +func (t *FeedComment_Embed) MarshalJSON() ([]byte, error) { + if t.EmbedCommit != nil { + t.EmbedCommit.LexiconTypeID = "sh.tangled.embed.commit" + return json.Marshal(t.EmbedCommit) + } + return nil, fmt.Errorf("cannot marshal empty enum") +} +func (t *FeedComment_Embed) UnmarshalJSON(b []byte) error { + typ, err := util.TypeExtract(b) + if err != nil { + return err + } + + switch typ { + case "sh.tangled.embed.commit": + t.EmbedCommit = new(EmbedCommit) + return json.Unmarshal(b, t.EmbedCommit) + + default: + return nil + } +} + +func (t *FeedComment_Embed) MarshalCBOR(w io.Writer) error { + + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + if t.EmbedCommit != nil { + return t.EmbedCommit.MarshalCBOR(w) + } + return fmt.Errorf("cannot cbor marshal empty enum") +} +func (t *FeedComment_Embed) UnmarshalCBOR(r io.Reader) error { + typ, b, err := util.CborTypeExtractReader(r) + if err != nil { + return err + } + + switch typ { + case "sh.tangled.embed.commit": + t.EmbedCommit = new(EmbedCommit) + return t.EmbedCommit.UnmarshalCBOR(bytes.NewReader(b)) + + default: + return nil + } +} diff --git a/api/tangled/feedlistComments.go b/api/tangled/feedlistComments.go index f791ef439..568792adb 100644 --- a/api/tangled/feedlistComments.go +++ b/api/tangled/feedlistComments.go @@ -26,14 +26,17 @@ type FeedListComments_ListItem struct { type FeedListComments_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*FeedListComments_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // FeedListComments calls the XRPC method "sh.tangled.feed.listComments". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Record AT-URI the comments attach to. -func FeedListComments(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*FeedListComments_Output, error) { +func FeedListComments(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*FeedListComments_Output, error) { var out FeedListComments_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func FeedListComments(ctx context.Context, c util.LexClient, cursor string, limi if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/feedlistCommentsBy.go b/api/tangled/feedlistCommentsBy.go index 78c575fbf..46d4b6726 100644 --- a/api/tangled/feedlistCommentsBy.go +++ b/api/tangled/feedlistCommentsBy.go @@ -18,14 +18,17 @@ const ( type FeedListCommentsBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*FeedListComments_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // FeedListCommentsBy calls the XRPC method "sh.tangled.feed.listCommentsBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose comment authorings to list. -func FeedListCommentsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*FeedListCommentsBy_Output, error) { +func FeedListCommentsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*FeedListCommentsBy_Output, error) { var out FeedListCommentsBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func FeedListCommentsBy(ctx context.Context, c util.LexClient, cursor string, li if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/feedlistReactions.go b/api/tangled/feedlistReactions.go index 1880b7a7d..28723bccb 100644 --- a/api/tangled/feedlistReactions.go +++ b/api/tangled/feedlistReactions.go @@ -26,14 +26,17 @@ type FeedListReactions_ListItem struct { type FeedListReactions_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*FeedListReactions_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // FeedListReactions calls the XRPC method "sh.tangled.feed.listReactions". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Record AT-URI the reactions target. -func FeedListReactions(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*FeedListReactions_Output, error) { +func FeedListReactions(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*FeedListReactions_Output, error) { var out FeedListReactions_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func FeedListReactions(ctx context.Context, c util.LexClient, cursor string, lim if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/feedlistReactionsBy.go b/api/tangled/feedlistReactionsBy.go index aafb5d39f..f59946a6c 100644 --- a/api/tangled/feedlistReactionsBy.go +++ b/api/tangled/feedlistReactionsBy.go @@ -18,14 +18,17 @@ const ( type FeedListReactionsBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*FeedListReactions_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // FeedListReactionsBy calls the XRPC method "sh.tangled.feed.listReactionsBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose reaction authorings to list. -func FeedListReactionsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*FeedListReactionsBy_Output, error) { +func FeedListReactionsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*FeedListReactionsBy_Output, error) { var out FeedListReactionsBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func FeedListReactionsBy(ctx context.Context, c util.LexClient, cursor string, l if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/feedlistStars.go b/api/tangled/feedlistStars.go index a712c4200..b478a1c81 100644 --- a/api/tangled/feedlistStars.go +++ b/api/tangled/feedlistStars.go @@ -26,14 +26,17 @@ type FeedListStars_ListItem struct { type FeedListStars_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*FeedListStars_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // FeedListStars calls the XRPC method "sh.tangled.feed.listStars". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Repo DID to list star edges for. -func FeedListStars(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*FeedListStars_Output, error) { +func FeedListStars(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*FeedListStars_Output, error) { var out FeedListStars_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func FeedListStars(ctx context.Context, c util.LexClient, cursor string, limit i if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/feedlistStarsBy.go b/api/tangled/feedlistStarsBy.go index 34a5bd7bc..7dfe481a4 100644 --- a/api/tangled/feedlistStarsBy.go +++ b/api/tangled/feedlistStarsBy.go @@ -18,14 +18,17 @@ const ( type FeedListStarsBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*FeedListStars_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // FeedListStarsBy calls the XRPC method "sh.tangled.feed.listStarsBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose star authorings to list. -func FeedListStarsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*FeedListStarsBy_Output, error) { +func FeedListStarsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*FeedListStarsBy_Output, error) { var out FeedListStarsBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func FeedListStarsBy(ctx context.Context, c util.LexClient, cursor string, limit if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/feedsubscription.go b/api/tangled/feedsubscription.go deleted file mode 100644 index 776e3d63b..000000000 --- a/api/tangled/feedsubscription.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.feed.subscription - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - - "github.com/bluesky-social/indigo/lex/util" - cbg "github.com/whyrusleeping/cbor-gen" -) - -const ( - FeedSubscriptionNSID = "org.tangled.feed.subscription" -) - -func init() { - util.RegisterType("org.tangled.feed.subscription", &FeedSubscription{}) -} // -// RECORDTYPE: FeedSubscription -type FeedSubscription struct { - LexiconTypeID string `json:"$type,const=org.tangled.feed.subscription" cborgen:"$type,const=org.tangled.feed.subscription"` - // collections: Optional collection NSIDs to filter which notifications are sent. Empty or absent means all collections. - Collections []string `json:"collections,omitempty" cborgen:"collections,omitempty"` - CreatedAt string `json:"createdAt" cborgen:"createdAt"` - Subject *FeedSubscription_Subject `json:"subject" cborgen:"subject"` -} - -// FeedSubscription_Repo is a "repo" in the org.tangled.feed.subscription schema. -// -// RECORDTYPE: FeedSubscription_Repo -type FeedSubscription_Repo struct { - LexiconTypeID string `json:"$type,const=org.tangled.feed.subscription#repo" cborgen:"$type,const=org.tangled.feed.subscription#repo"` - Did string `json:"did" cborgen:"did"` -} - -type FeedSubscription_Subject struct { - FeedSubscription_Uri *FeedSubscription_Uri - FeedSubscription_Repo *FeedSubscription_Repo -} - -func (t *FeedSubscription_Subject) MarshalJSON() ([]byte, error) { - if t.FeedSubscription_Uri != nil { - t.FeedSubscription_Uri.LexiconTypeID = "org.tangled.feed.subscription#uri" - return json.Marshal(t.FeedSubscription_Uri) - } - if t.FeedSubscription_Repo != nil { - t.FeedSubscription_Repo.LexiconTypeID = "org.tangled.feed.subscription#repo" - return json.Marshal(t.FeedSubscription_Repo) - } - return nil, fmt.Errorf("cannot marshal empty enum") -} -func (t *FeedSubscription_Subject) UnmarshalJSON(b []byte) error { - typ, err := util.TypeExtract(b) - if err != nil { - return err - } - - switch typ { - case "org.tangled.feed.subscription#uri": - t.FeedSubscription_Uri = new(FeedSubscription_Uri) - return json.Unmarshal(b, t.FeedSubscription_Uri) - case "org.tangled.feed.subscription#repo": - t.FeedSubscription_Repo = new(FeedSubscription_Repo) - return json.Unmarshal(b, t.FeedSubscription_Repo) - - default: - return fmt.Errorf("closed enums must have a matching value") - } -} - -func (t *FeedSubscription_Subject) MarshalCBOR(w io.Writer) error { - - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - if t.FeedSubscription_Uri != nil { - return t.FeedSubscription_Uri.MarshalCBOR(w) - } - if t.FeedSubscription_Repo != nil { - return t.FeedSubscription_Repo.MarshalCBOR(w) - } - return fmt.Errorf("cannot cbor marshal empty enum") -} -func (t *FeedSubscription_Subject) UnmarshalCBOR(r io.Reader) error { - typ, b, err := util.CborTypeExtractReader(r) - if err != nil { - return err - } - - switch typ { - case "org.tangled.feed.subscription#uri": - t.FeedSubscription_Uri = new(FeedSubscription_Uri) - return t.FeedSubscription_Uri.UnmarshalCBOR(bytes.NewReader(b)) - case "org.tangled.feed.subscription#repo": - t.FeedSubscription_Repo = new(FeedSubscription_Repo) - return t.FeedSubscription_Repo.UnmarshalCBOR(bytes.NewReader(b)) - - default: - return fmt.Errorf("closed enums must have a matching value") - } -} - -// FeedSubscription_Uri is a "uri" in the org.tangled.feed.subscription schema. -// -// RECORDTYPE: FeedSubscription_Uri -type FeedSubscription_Uri struct { - LexiconTypeID string `json:"$type,const=org.tangled.feed.subscription#uri" cborgen:"$type,const=org.tangled.feed.subscription#uri"` - Uri string `json:"uri" cborgen:"uri"` -} diff --git a/api/tangled/focusbeginSession.go b/api/tangled/focusbeginSession.go deleted file mode 100644 index ea88d043e..000000000 --- a/api/tangled/focusbeginSession.go +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.focus.beginSession - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempFocusBeginSessionNSID = "org.tangled.temp.focus.beginSession" -) - -// TempFocusBeginSession_Output is the output of a org.tangled.temp.focus.beginSession call. -type TempFocusBeginSession_Output struct { - // issueAt: AT-URI of the issue to navigate to, if the item is an issue. - IssueAt *string `json:"issueAt,omitempty" cborgen:"issueAt,omitempty"` - // notificationId: ID of the first notification to address. Absent if the queue is empty. - NotificationId *int64 `json:"notificationId,omitempty" cborgen:"notificationId,omitempty"` - // pullAt: AT-URI of the pull to navigate to, if the item is a pull. - PullAt *string `json:"pullAt,omitempty" cborgen:"pullAt,omitempty"` - // repoDid: DID of the repository the item belongs to. Absent if the queue is empty. - RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` -} - -// TempFocusBeginSession calls the XRPC method "org.tangled.temp.focus.beginSession". -func TempFocusBeginSession(ctx context.Context, c util.LexClient) (*TempFocusBeginSession_Output, error) { - var out TempFocusBeginSession_Output - if err := c.LexDo(ctx, util.Procedure, "", "org.tangled.temp.focus.beginSession", nil, nil, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/tangled/focusendSession.go b/api/tangled/focusendSession.go deleted file mode 100644 index 88f07d352..000000000 --- a/api/tangled/focusendSession.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.focus.endSession - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempFocusEndSessionNSID = "org.tangled.temp.focus.endSession" -) - -// TempFocusEndSession calls the XRPC method "org.tangled.temp.focus.endSession". -func TempFocusEndSession(ctx context.Context, c util.LexClient) error { - if err := c.LexDo(ctx, util.Procedure, "", "org.tangled.temp.focus.endSession", nil, nil, nil); err != nil { - return err - } - - return nil -} diff --git a/api/tangled/focusnextItem.go b/api/tangled/focusnextItem.go deleted file mode 100644 index 1563ebe1c..000000000 --- a/api/tangled/focusnextItem.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.focus.nextItem - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempFocusNextItemNSID = "org.tangled.temp.focus.nextItem" -) - -// TempFocusNextItem_Input is the input argument to a org.tangled.temp.focus.nextItem call. -type TempFocusNextItem_Input struct { - // currentId: ID of the notification just addressed, to be marked read. - CurrentId int64 `json:"currentId" cborgen:"currentId"` -} - -// TempFocusNextItem_Output is the output of a org.tangled.temp.focus.nextItem call. -type TempFocusNextItem_Output struct { - // issueAt: AT-URI of the issue to navigate to, if the item is an issue. - IssueAt *string `json:"issueAt,omitempty" cborgen:"issueAt,omitempty"` - // notificationId: ID of the next notification to address. Absent when focus mode has ended. - NotificationId *int64 `json:"notificationId,omitempty" cborgen:"notificationId,omitempty"` - // pullAt: AT-URI of the pull to navigate to, if the item is a pull. - PullAt *string `json:"pullAt,omitempty" cborgen:"pullAt,omitempty"` - // repoDid: DID of the repository the next item belongs to. Absent when focus mode has ended. - RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` -} - -// TempFocusNextItem calls the XRPC method "org.tangled.temp.focus.nextItem". -func TempFocusNextItem(ctx context.Context, c util.LexClient, input *TempFocusNextItem_Input) (*TempFocusNextItem_Output, error) { - var out TempFocusNextItem_Output - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.focus.nextItem", nil, input, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/tangled/gitdefs.go b/api/tangled/gitdefs.go index 80fcc3e9f..70f06012a 100644 --- a/api/tangled/gitdefs.go +++ b/api/tangled/gitdefs.go @@ -6,6 +6,53 @@ package tangled const () +// GitDefs_ByteChanges is a "byteChanges" in the sh.tangled.git.defs schema. +type GitDefs_ByteChanges struct { + Lhs int64 `json:"lhs" cborgen:"lhs"` + Rhs int64 `json:"rhs" cborgen:"rhs"` +} + +// GitDefs_DiffHunk is a "diffHunk" in the sh.tangled.git.defs schema. +type GitDefs_DiffHunk struct { + Lines []*GitDefs_LinePair `json:"lines" cborgen:"lines"` + // novelLhs: 0-based line numbers holding novel content on the left side + NovelLhs []int64 `json:"novelLhs" cborgen:"novelLhs"` + // novelRhs: 0-based line numbers holding novel content on the right side + NovelRhs []int64 `json:"novelRhs" cborgen:"novelRhs"` +} + +// GitDefs_DiffSrc is a "diffSrc" in the sh.tangled.git.defs schema. +// +// One side of a file diff. +type GitDefs_DiffSrc struct { + // content: Inlined content. Used on interdiff's LHS. + Content *string `json:"content,omitempty" cborgen:"content,omitempty"` + IsBinary bool `json:"isBinary" cborgen:"isBinary"` + IsSubmodule bool `json:"isSubmodule" cborgen:"isSubmodule"` + // oid: Blob oid, or the commit oid for a submodule + Oid string `json:"oid" cborgen:"oid"` + Path string `json:"path" cborgen:"path"` + Size int64 `json:"size" cborgen:"size"` +} + +// GitDefs_FileDiff is a "fileDiff" in the sh.tangled.git.defs schema. +type GitDefs_FileDiff struct { + // hasByteChanges: Byte count per side, present only when the two sides differ + HasByteChanges *GitDefs_ByteChanges `json:"hasByteChanges,omitempty" cborgen:"hasByteChanges,omitempty"` + HasSyntacticChanges bool `json:"hasSyntacticChanges" cborgen:"hasSyntacticChanges"` + Hunks []*GitDefs_DiffHunk `json:"hunks" cborgen:"hunks"` + LhsSrc *GitDefs_DiffSrc `json:"lhsSrc" cborgen:"lhsSrc"` + RhsSrc *GitDefs_DiffSrc `json:"rhsSrc" cborgen:"rhsSrc"` +} + +// GitDefs_LinePair is a "linePair" in the sh.tangled.git.defs schema. +// +// One aligned line pair; a side is absent when that side has no line. +type GitDefs_LinePair struct { + Lhs *int64 `json:"lhs,omitempty" cborgen:"lhs,omitempty"` + Rhs *int64 `json:"rhs,omitempty" cborgen:"rhs,omitempty"` +} + // GitDefs_Signature is a "signature" in the sh.tangled.git.defs schema. type GitDefs_Signature struct { // email: Person email diff --git a/api/tangled/gitkeepCommit.go b/api/tangled/gitkeepCommit.go index 36bca0de9..d0f50a575 100644 --- a/api/tangled/gitkeepCommit.go +++ b/api/tangled/gitkeepCommit.go @@ -78,7 +78,7 @@ type GitKeepCommit_Output struct { // RECORDTYPE: GitKeepCommit_Patches type GitKeepCommit_Patches struct { LexiconTypeID string `json:"$type,const=sh.tangled.git.keepCommit#patches" cborgen:"$type,const=sh.tangled.git.keepCommit#patches"` - Patches []string `json:"patches,omitempty" cborgen:"patches,omitempty"` + Patches []string `json:"patches" cborgen:"patches"` } // GitKeepCommit calls the XRPC method "sh.tangled.git.keepCommit". diff --git a/api/tangled/gitlistRefUpdates.go b/api/tangled/gitlistRefUpdates.go index 86492863d..baa9f51bf 100644 --- a/api/tangled/gitlistRefUpdates.go +++ b/api/tangled/gitlistRefUpdates.go @@ -26,14 +26,17 @@ type GitListRefUpdates_ListItem struct { type GitListRefUpdates_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*GitListRefUpdates_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // GitListRefUpdates calls the XRPC method "sh.tangled.git.listRefUpdates". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Repo DID whose ref-update records to list. -func GitListRefUpdates(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*GitListRefUpdates_Output, error) { +func GitListRefUpdates(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*GitListRefUpdates_Output, error) { var out GitListRefUpdates_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func GitListRefUpdates(ctx context.Context, c util.LexClient, cursor string, lim if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/gitlistRefUpdatesBy.go b/api/tangled/gitlistRefUpdatesBy.go index 341edc35b..fef424ab1 100644 --- a/api/tangled/gitlistRefUpdatesBy.go +++ b/api/tangled/gitlistRefUpdatesBy.go @@ -18,14 +18,17 @@ const ( type GitListRefUpdatesBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*GitListRefUpdates_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // GitListRefUpdatesBy calls the XRPC method "sh.tangled.git.listRefUpdatesBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose ref-update authorings to list. -func GitListRefUpdatesBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*GitListRefUpdatesBy_Output, error) { +func GitListRefUpdatesBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*GitListRefUpdatesBy_Output, error) { var out GitListRefUpdatesBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func GitListRefUpdatesBy(ctx context.Context, c util.LexClient, cursor string, l if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/gitmergeCheck.go b/api/tangled/gitmergeCheck.go index ad61b06ba..06d12ce6f 100644 --- a/api/tangled/gitmergeCheck.go +++ b/api/tangled/gitmergeCheck.go @@ -27,15 +27,8 @@ type GitMergeCheck_Input struct { // branch: Target branch to merge into Branch string `json:"branch" cborgen:"branch"` // repo: DID of Git repository - Repo string `json:"repo" cborgen:"repo"` - Source *GitMergeCheck_Input_Source `json:"source" cborgen:"source"` -} - -type GitMergeCheck_Input_Source struct { - // commit: Head commit ID of PR to merge - Commit string `json:"commit" cborgen:"commit"` - // repo: DID of source git repository - Repo string `json:"repo" cborgen:"repo"` + Repo string `json:"repo" cborgen:"repo"` + Source *GitMergeCheck_Source `json:"source" cborgen:"source"` } // GitMergeCheck_Output is the output of a sh.tangled.git.mergeCheck call. @@ -48,6 +41,14 @@ type GitMergeCheck_Output struct { Message *string `json:"message,omitempty" cborgen:"message,omitempty"` } +// GitMergeCheck_Source is a "source" in the sh.tangled.git.mergeCheck schema. +type GitMergeCheck_Source struct { + // commit: Head commit ID of PR to merge + Commit string `json:"commit" cborgen:"commit"` + // repo: DID of source git repository + Repo string `json:"repo" cborgen:"repo"` +} + // GitMergeCheck calls the XRPC method "sh.tangled.git.mergeCheck". func GitMergeCheck(ctx context.Context, c util.LexClient, input *GitMergeCheck_Input) (*GitMergeCheck_Output, error) { var out GitMergeCheck_Output diff --git a/api/tangled/gitmergeCommit.go b/api/tangled/gitmergeCommit.go index 7e9d24f9b..e917fe2da 100644 --- a/api/tangled/gitmergeCommit.go +++ b/api/tangled/gitmergeCommit.go @@ -17,26 +17,30 @@ const ( // GitMergeCommit_Input is the input argument to a sh.tangled.git.mergeCommit call. type GitMergeCommit_Input struct { // mergeCommit: Merge commit content. Used when merge commit is created. - MergeCommit *GitMergeCommit_Input_MergeCommit `json:"mergeCommit,omitempty" cborgen:"mergeCommit,omitempty"` - Source *GitMergeCommit_Input_Source `json:"source" cborgen:"source"` - Style string `json:"style" cborgen:"style"` - Target *GitMergeCommit_Input_Target `json:"target" cborgen:"target"` + MergeCommit *GitMergeCommit_MergeCommitContent `json:"mergeCommit,omitempty" cborgen:"mergeCommit,omitempty"` + Source *GitMergeCommit_Source `json:"source" cborgen:"source"` + Style string `json:"style" cborgen:"style"` + Target *GitMergeCommit_Target `json:"target" cborgen:"target"` } +// GitMergeCommit_MergeCommitContent is a "mergeCommitContent" in the sh.tangled.git.mergeCommit schema. +// // Merge commit content. Used when merge commit is created. -type GitMergeCommit_Input_MergeCommit struct { +type GitMergeCommit_MergeCommitContent struct { Author *GitDefs_Signature `json:"author,omitempty" cborgen:"author,omitempty"` Message *string `json:"message,omitempty" cborgen:"message,omitempty"` } -type GitMergeCommit_Input_Source struct { +// GitMergeCommit_Source is a "source" in the sh.tangled.git.mergeCommit schema. +type GitMergeCommit_Source struct { // commit: Head commit ID to merge Commit string `json:"commit" cborgen:"commit"` // repo: DID of source git repository Repo string `json:"repo" cborgen:"repo"` } -type GitMergeCommit_Input_Target struct { +// GitMergeCommit_Target is a "target" in the sh.tangled.git.mergeCommit schema. +type GitMergeCommit_Target struct { // branch: Target branch to merge into Branch string `json:"branch" cborgen:"branch"` // repo: DID of target git repository diff --git a/api/tangled/gitoid.go b/api/tangled/gitoid.go new file mode 100644 index 000000000..35bc62da6 --- /dev/null +++ b/api/tangled/gitoid.go @@ -0,0 +1,22 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.git.oid + +import ( + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitOidNSID = "sh.tangled.git.oid" +) + +func init() { + util.RegisterType("sh.tangled.git.oid#main", &GitOid{}) +} // GitOid is a "main" in the sh.tangled.git.oid schema. +// RECORDTYPE: GitOid +type GitOid struct { + LexiconTypeID string `json:"$type,const=sh.tangled.git.oid" cborgen:"$type,const=sh.tangled.git.oid"` + Oid string `json:"oid" cborgen:"oid"` +} diff --git a/api/tangled/graphlistFollows.go b/api/tangled/graphlistFollows.go index b9e631ba8..e097746be 100644 --- a/api/tangled/graphlistFollows.go +++ b/api/tangled/graphlistFollows.go @@ -26,14 +26,17 @@ type GraphListFollows_ListItem struct { type GraphListFollows_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*GraphListFollows_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // GraphListFollows calls the XRPC method "sh.tangled.graph.listFollows". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Followee DID whose inbound follows to list. -func GraphListFollows(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*GraphListFollows_Output, error) { +func GraphListFollows(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*GraphListFollows_Output, error) { var out GraphListFollows_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func GraphListFollows(ctx context.Context, c util.LexClient, cursor string, limi if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/graphlistFollowsBy.go b/api/tangled/graphlistFollowsBy.go index 57eb746e1..a32bba6af 100644 --- a/api/tangled/graphlistFollowsBy.go +++ b/api/tangled/graphlistFollowsBy.go @@ -18,14 +18,17 @@ const ( type GraphListFollowsBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*GraphListFollows_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // GraphListFollowsBy calls the XRPC method "sh.tangled.graph.listFollowsBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose follow authorings to list. -func GraphListFollowsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*GraphListFollowsBy_Output, error) { +func GraphListFollowsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*GraphListFollowsBy_Output, error) { var out GraphListFollowsBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func GraphListFollowsBy(ctx context.Context, c util.LexClient, cursor string, li if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/graphlistNetworkVouches.go b/api/tangled/graphlistNetworkVouches.go new file mode 100644 index 000000000..86588e02e --- /dev/null +++ b/api/tangled/graphlistNetworkVouches.go @@ -0,0 +1,51 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.graph.listNetworkVouches + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GraphListNetworkVouchesNSID = "sh.tangled.graph.listNetworkVouches" +) + +// GraphListNetworkVouches_ListItem is a "listItem" in the sh.tangled.graph.listNetworkVouches schema. +type GraphListNetworkVouches_ListItem struct { + Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"` + Uri string `json:"uri" cborgen:"uri"` + // value: Embedded sh.tangled.graph.vouch record + Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"` +} + +// GraphListNetworkVouches_Output is the output of a sh.tangled.graph.listNetworkVouches call. +type GraphListNetworkVouches_Output struct { + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` + Items []*GraphListNetworkVouches_ListItem `json:"items" cborgen:"items"` +} + +// GraphListNetworkVouches calls the XRPC method "sh.tangled.graph.listNetworkVouches". +// +// actor: The DID of the profile whose network vouches to list. +// cursor: Pagination cursor +func GraphListNetworkVouches(ctx context.Context, c util.LexClient, actor string, cursor string, limit int64) (*GraphListNetworkVouches_Output, error) { + var out GraphListNetworkVouches_Output + + params := map[string]interface{}{} + params["actor"] = actor + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.graph.listNetworkVouches", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/graphlistVouches.go b/api/tangled/graphlistVouches.go index e44fe594f..47b58daf2 100644 --- a/api/tangled/graphlistVouches.go +++ b/api/tangled/graphlistVouches.go @@ -26,14 +26,17 @@ type GraphListVouches_ListItem struct { type GraphListVouches_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*GraphListVouches_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // GraphListVouches calls the XRPC method "sh.tangled.graph.listVouches". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Vouchee DID whose inbound vouches to list. -func GraphListVouches(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*GraphListVouches_Output, error) { +func GraphListVouches(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*GraphListVouches_Output, error) { var out GraphListVouches_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func GraphListVouches(ctx context.Context, c util.LexClient, cursor string, limi if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/graphlistVouchesBy.go b/api/tangled/graphlistVouchesBy.go index 501bd6ace..222baf5b6 100644 --- a/api/tangled/graphlistVouchesBy.go +++ b/api/tangled/graphlistVouchesBy.go @@ -18,14 +18,17 @@ const ( type GraphListVouchesBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*GraphListVouches_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // GraphListVouchesBy calls the XRPC method "sh.tangled.graph.listVouchesBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose vouch authorings to list. -func GraphListVouchesBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*GraphListVouchesBy_Output, error) { +func GraphListVouchesBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*GraphListVouchesBy_Output, error) { var out GraphListVouchesBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func GraphListVouchesBy(ctx context.Context, c util.LexClient, cursor string, li if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/knotlistKnots.go b/api/tangled/knotlistKnots.go index 98afeeb17..951be8813 100644 --- a/api/tangled/knotlistKnots.go +++ b/api/tangled/knotlistKnots.go @@ -26,14 +26,17 @@ type KnotListKnots_ListItem struct { type KnotListKnots_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*KnotListKnots_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // KnotListKnots calls the XRPC method "sh.tangled.knot.listKnots". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Owner DID whose knot records to list. -func KnotListKnots(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*KnotListKnots_Output, error) { +func KnotListKnots(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*KnotListKnots_Output, error) { var out KnotListKnots_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func KnotListKnots(ctx context.Context, c util.LexClient, cursor string, limit i if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/knotlistMembers.go b/api/tangled/knotlistMembers.go index 77f111c3c..d45e8b65a 100644 --- a/api/tangled/knotlistMembers.go +++ b/api/tangled/knotlistMembers.go @@ -32,14 +32,17 @@ type KnotListMembers_ListItem struct { type KnotListMembers_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*KnotListMembers_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // KnotListMembers calls the XRPC method "sh.tangled.knot.listMembers". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Knot identifier whose member records to list. -func KnotListMembers(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*KnotListMembers_Output, error) { +func KnotListMembers(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*KnotListMembers_Output, error) { var out KnotListMembers_Output params := map[string]interface{}{} @@ -49,6 +52,9 @@ func KnotListMembers(ctx context.Context, c util.LexClient, cursor string, limit if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/knotlistMembersBy.go b/api/tangled/knotlistMembersBy.go index 114f3d4c7..0f50e8030 100644 --- a/api/tangled/knotlistMembersBy.go +++ b/api/tangled/knotlistMembersBy.go @@ -18,14 +18,17 @@ const ( type KnotListMembersBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*KnotListMembers_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // KnotListMembersBy calls the XRPC method "sh.tangled.knot.listMembersBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose knot-member authorings to list. -func KnotListMembersBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*KnotListMembersBy_Output, error) { +func KnotListMembersBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*KnotListMembersBy_Output, error) { var out KnotListMembersBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func KnotListMembersBy(ctx context.Context, c util.LexClient, cursor string, lim if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/labellistDefinitions.go b/api/tangled/labellistDefinitions.go index 3a5ef442e..c0405f995 100644 --- a/api/tangled/labellistDefinitions.go +++ b/api/tangled/labellistDefinitions.go @@ -26,14 +26,17 @@ type LabelListDefinitions_ListItem struct { type LabelListDefinitions_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*LabelListDefinitions_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // LabelListDefinitions calls the XRPC method "sh.tangled.label.listDefinitions". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Scope identifier whose label definitions to list. -func LabelListDefinitions(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*LabelListDefinitions_Output, error) { +func LabelListDefinitions(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*LabelListDefinitions_Output, error) { var out LabelListDefinitions_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func LabelListDefinitions(ctx context.Context, c util.LexClient, cursor string, if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/labellistOps.go b/api/tangled/labellistOps.go index d3269cd76..6232a8a56 100644 --- a/api/tangled/labellistOps.go +++ b/api/tangled/labellistOps.go @@ -26,14 +26,17 @@ type LabelListOps_ListItem struct { type LabelListOps_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*LabelListOps_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // LabelListOps calls the XRPC method "sh.tangled.label.listOps". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Scope identifier whose label op records to list. -func LabelListOps(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*LabelListOps_Output, error) { +func LabelListOps(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*LabelListOps_Output, error) { var out LabelListOps_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func LabelListOps(ctx context.Context, c util.LexClient, cursor string, limit in if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/labellistOpsBy.go b/api/tangled/labellistOpsBy.go index 0afc92d75..ea0ba2096 100644 --- a/api/tangled/labellistOpsBy.go +++ b/api/tangled/labellistOpsBy.go @@ -18,14 +18,17 @@ const ( type LabelListOpsBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*LabelListOps_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // LabelListOpsBy calls the XRPC method "sh.tangled.label.listOpsBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose label-op authorings to list. -func LabelListOpsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*LabelListOpsBy_Output, error) { +func LabelListOpsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*LabelListOpsBy_Output, error) { var out LabelListOpsBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func LabelListOpsBy(ctx context.Context, c util.LexClient, cursor string, limit if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/notificationdeleteNotification.go b/api/tangled/notificationdeleteNotification.go deleted file mode 100644 index ebf10bf8e..000000000 --- a/api/tangled/notificationdeleteNotification.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.notification.deleteNotification - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempNotificationDeleteNotificationNSID = "org.tangled.temp.notification.deleteNotification" -) - -// TempNotificationDeleteNotification_Input is the input argument to a org.tangled.temp.notification.deleteNotification call. -type TempNotificationDeleteNotification_Input struct { - // uri: at-uri of the notification to delete. - Uri string `json:"uri" cborgen:"uri"` -} - -// TempNotificationDeleteNotification calls the XRPC method "org.tangled.temp.notification.deleteNotification". -func TempNotificationDeleteNotification(ctx context.Context, c util.LexClient, input *TempNotificationDeleteNotification_Input) error { - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.notification.deleteNotification", nil, input, nil); err != nil { - return err - } - - return nil -} diff --git a/api/tangled/notificationgetPreferences.go b/api/tangled/notificationgetPreferences.go deleted file mode 100644 index 171413bb7..000000000 --- a/api/tangled/notificationgetPreferences.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.notification.getPreferences - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempNotificationGetPreferencesNSID = "org.tangled.temp.notification.getPreferences" -) - -// TempNotificationGetPreferences_Preferences is a "preferences" in the org.tangled.temp.notification.getPreferences schema. -type TempNotificationGetPreferences_Preferences struct { - EmailNotifications bool `json:"emailNotifications" cborgen:"emailNotifications"` - Followed bool `json:"followed" cborgen:"followed"` - IssueClosed bool `json:"issueClosed" cborgen:"issueClosed"` - IssueCommented bool `json:"issueCommented" cborgen:"issueCommented"` - IssueCreated bool `json:"issueCreated" cborgen:"issueCreated"` - PullCommented bool `json:"pullCommented" cborgen:"pullCommented"` - PullCreated bool `json:"pullCreated" cborgen:"pullCreated"` - PullMerged bool `json:"pullMerged" cborgen:"pullMerged"` - RepoStarred bool `json:"repoStarred" cborgen:"repoStarred"` - UserMentioned bool `json:"userMentioned" cborgen:"userMentioned"` -} - -// TempNotificationGetPreferences calls the XRPC method "org.tangled.temp.notification.getPreferences". -func TempNotificationGetPreferences(ctx context.Context, c util.LexClient) (*TempNotificationGetPreferences_Preferences, error) { - var out TempNotificationGetPreferences_Preferences - if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.notification.getPreferences", nil, nil, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/tangled/notificationgetUnreadCount.go b/api/tangled/notificationgetUnreadCount.go deleted file mode 100644 index 679083828..000000000 --- a/api/tangled/notificationgetUnreadCount.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.notification.getUnreadCount - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempNotificationGetUnreadCountNSID = "org.tangled.temp.notification.getUnreadCount" -) - -// TempNotificationGetUnreadCount_Output is the output of a org.tangled.temp.notification.getUnreadCount call. -type TempNotificationGetUnreadCount_Output struct { - Count int64 `json:"count" cborgen:"count"` -} - -// TempNotificationGetUnreadCount calls the XRPC method "org.tangled.temp.notification.getUnreadCount". -func TempNotificationGetUnreadCount(ctx context.Context, c util.LexClient) (*TempNotificationGetUnreadCount_Output, error) { - var out TempNotificationGetUnreadCount_Output - if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.notification.getUnreadCount", nil, nil, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/tangled/notificationlistNotifications.go b/api/tangled/notificationlistNotifications.go deleted file mode 100644 index 0345dbe86..000000000 --- a/api/tangled/notificationlistNotifications.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.notification.listNotifications - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempNotificationListNotificationsNSID = "org.tangled.temp.notification.listNotifications" -) - -// TempNotificationListNotifications_Notification is a "notification" in the org.tangled.temp.notification.listNotifications schema. -type TempNotificationListNotifications_Notification struct { - // actorDid: DID of the user who triggered this notification. - ActorDid string `json:"actorDid" cborgen:"actorDid"` - // category: Broad category: 'social' or 'work'. - Category string `json:"category" cborgen:"category"` - CreatedAt string `json:"createdAt" cborgen:"createdAt"` - // issueAt: AT-URI of the related org.tangled.issue.issue record, if applicable. - IssueAt *string `json:"issueAt,omitempty" cborgen:"issueAt,omitempty"` - // pullAt: AT-URI of the related org.tangled.pulls.pull record, if applicable. - PullAt *string `json:"pullAt,omitempty" cborgen:"pullAt,omitempty"` - Read bool `json:"read" cborgen:"read"` - // repoDid: DID of the related repository, if applicable. - RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` - // type: Notification type: repo_starred, issue_created, issue_commented, issue_closed, issue_reopen, issue_assigned, issue_unassigned, pull_created, pull_commented, pull_merged, pull_closed, pull_reopen, pull_assigned, pull_unassigned, followed, user_mentioned. - Type string `json:"type" cborgen:"type"` - // uri: at-uri of this notification; the stable key for read/unread state. - Uri string `json:"uri" cborgen:"uri"` -} - -// TempNotificationListNotifications_Output is the output of a org.tangled.temp.notification.listNotifications call. -type TempNotificationListNotifications_Output struct { - Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` - Notifications []*TempNotificationListNotifications_Notification `json:"notifications" cborgen:"notifications"` - SocialUnreadCount int64 `json:"socialUnreadCount" cborgen:"socialUnreadCount"` - WorkUnreadCount int64 `json:"workUnreadCount" cborgen:"workUnreadCount"` -} - -// TempNotificationListNotifications calls the XRPC method "org.tangled.temp.notification.listNotifications". -// -// category: Filter by category: 'all', 'social', or 'work'. -// limit: Max notifications per category to return. -// read: Filter by read state: 'all' or 'unread'. -func TempNotificationListNotifications(ctx context.Context, c util.LexClient, category string, cursor string, limit int64, read string) (*TempNotificationListNotifications_Output, error) { - var out TempNotificationListNotifications_Output - - params := map[string]interface{}{} - if category != "" { - params["category"] = category - } - if cursor != "" { - params["cursor"] = cursor - } - if limit != 0 { - params["limit"] = limit - } - if read != "" { - params["read"] = read - } - if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.notification.listNotifications", params, nil, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/tangled/notificationlistRecipients.go b/api/tangled/notificationlistRecipients.go deleted file mode 100644 index e67a3f8a8..000000000 --- a/api/tangled/notificationlistRecipients.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.notification.listRecipients - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempNotificationListRecipientsNSID = "org.tangled.temp.notification.listRecipients" -) - -// TempNotificationListRecipients_Output is the output of a org.tangled.temp.notification.listRecipients call. -type TempNotificationListRecipients_Output struct { - Dids []string `json:"dids" cborgen:"dids"` -} - -// TempNotificationListRecipients calls the XRPC method "org.tangled.temp.notification.listRecipients". -// -// collection: Optional collection NSID to filter subscribers by subscription scope. Only subscribers with no collection filter or a filter containing this NSID are returned. -// subject: at-uri of the entity (for entity-level subscribers) or a repo DID (for repo-level subscribers). -func TempNotificationListRecipients(ctx context.Context, c util.LexClient, collection string, subject string) (*TempNotificationListRecipients_Output, error) { - var out TempNotificationListRecipients_Output - - params := map[string]interface{}{} - if collection != "" { - params["collection"] = collection - } - params["subject"] = subject - if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.notification.listRecipients", params, nil, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/tangled/notificationmarkAllRead.go b/api/tangled/notificationmarkAllRead.go deleted file mode 100644 index 239bc1fe4..000000000 --- a/api/tangled/notificationmarkAllRead.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.notification.markAllRead - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempNotificationMarkAllReadNSID = "org.tangled.temp.notification.markAllRead" -) - -// TempNotificationMarkAllRead calls the XRPC method "org.tangled.temp.notification.markAllRead". -func TempNotificationMarkAllRead(ctx context.Context, c util.LexClient) error { - if err := c.LexDo(ctx, util.Procedure, "", "org.tangled.temp.notification.markAllRead", nil, nil, nil); err != nil { - return err - } - - return nil -} diff --git a/api/tangled/notificationmarkEntityRead.go b/api/tangled/notificationmarkEntityRead.go deleted file mode 100644 index 8c6a952c1..000000000 --- a/api/tangled/notificationmarkEntityRead.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.notification.markEntityRead - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempNotificationMarkEntityReadNSID = "org.tangled.temp.notification.markEntityRead" -) - -// TempNotificationMarkEntityRead_Input is the input argument to a org.tangled.temp.notification.markEntityRead call. -type TempNotificationMarkEntityRead_Input struct { - // entityAt: at-uri of the issue or pull whose notifications should be marked read. - EntityAt string `json:"entityAt" cborgen:"entityAt"` -} - -// TempNotificationMarkEntityRead calls the XRPC method "org.tangled.temp.notification.markEntityRead". -func TempNotificationMarkEntityRead(ctx context.Context, c util.LexClient, input *TempNotificationMarkEntityRead_Input) error { - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.notification.markEntityRead", nil, input, nil); err != nil { - return err - } - - return nil -} diff --git a/api/tangled/notificationupdatePreferences.go b/api/tangled/notificationupdatePreferences.go deleted file mode 100644 index f356fbc3b..000000000 --- a/api/tangled/notificationupdatePreferences.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.notification.updatePreferences - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempNotificationUpdatePreferencesNSID = "org.tangled.temp.notification.updatePreferences" -) - -// TempNotificationUpdatePreferences_Input is the input argument to a org.tangled.temp.notification.updatePreferences call. -type TempNotificationUpdatePreferences_Input struct { - EmailNotifications *bool `json:"emailNotifications,omitempty" cborgen:"emailNotifications,omitempty"` - Followed *bool `json:"followed,omitempty" cborgen:"followed,omitempty"` - IssueClosed *bool `json:"issueClosed,omitempty" cborgen:"issueClosed,omitempty"` - IssueCommented *bool `json:"issueCommented,omitempty" cborgen:"issueCommented,omitempty"` - IssueCreated *bool `json:"issueCreated,omitempty" cborgen:"issueCreated,omitempty"` - PullCommented *bool `json:"pullCommented,omitempty" cborgen:"pullCommented,omitempty"` - PullCreated *bool `json:"pullCreated,omitempty" cborgen:"pullCreated,omitempty"` - PullMerged *bool `json:"pullMerged,omitempty" cborgen:"pullMerged,omitempty"` - RepoStarred *bool `json:"repoStarred,omitempty" cborgen:"repoStarred,omitempty"` - UserMentioned *bool `json:"userMentioned,omitempty" cborgen:"userMentioned,omitempty"` -} - -// TempNotificationUpdatePreferences calls the XRPC method "org.tangled.temp.notification.updatePreferences". -func TempNotificationUpdatePreferences(ctx context.Context, c util.LexClient, input *TempNotificationUpdatePreferences_Input) error { - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.notification.updatePreferences", nil, input, nil); err != nil { - return err - } - - return nil -} diff --git a/api/tangled/notificationupdateSeen.go b/api/tangled/notificationupdateSeen.go deleted file mode 100644 index 9e24c1284..000000000 --- a/api/tangled/notificationupdateSeen.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.notification.updateSeen - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempNotificationUpdateSeenNSID = "org.tangled.temp.notification.updateSeen" -) - -// TempNotificationUpdateSeen_Input is the input argument to a org.tangled.temp.notification.updateSeen call. -type TempNotificationUpdateSeen_Input struct { - Read bool `json:"read" cborgen:"read"` - // uri: at-uri of the notification to update. - Uri string `json:"uri" cborgen:"uri"` -} - -// TempNotificationUpdateSeen calls the XRPC method "org.tangled.temp.notification.updateSeen". -func TempNotificationUpdateSeen(ctx context.Context, c util.LexClient, input *TempNotificationUpdateSeen_Input) error { - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.notification.updateSeen", nil, input, nil); err != nil { - return err - } - - return nil -} diff --git a/api/tangled/pipelinelistPipelines.go b/api/tangled/pipelinelistPipelines.go index 799b7504b..05176796e 100644 --- a/api/tangled/pipelinelistPipelines.go +++ b/api/tangled/pipelinelistPipelines.go @@ -26,14 +26,17 @@ type PipelineListPipelines_ListItem struct { type PipelineListPipelines_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*PipelineListPipelines_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // PipelineListPipelines calls the XRPC method "sh.tangled.pipeline.listPipelines". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Repo or spindle identifier whose pipeline records to list. -func PipelineListPipelines(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*PipelineListPipelines_Output, error) { +func PipelineListPipelines(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*PipelineListPipelines_Output, error) { var out PipelineListPipelines_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func PipelineListPipelines(ctx context.Context, c util.LexClient, cursor string, if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/pipelinelistPipelinesBy.go b/api/tangled/pipelinelistPipelinesBy.go index 9e5dbd32e..41ca37e75 100644 --- a/api/tangled/pipelinelistPipelinesBy.go +++ b/api/tangled/pipelinelistPipelinesBy.go @@ -18,14 +18,17 @@ const ( type PipelineListPipelinesBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*PipelineListPipelines_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // PipelineListPipelinesBy calls the XRPC method "sh.tangled.pipeline.listPipelinesBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose pipeline authorings to list. -func PipelineListPipelinesBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*PipelineListPipelinesBy_Output, error) { +func PipelineListPipelinesBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*PipelineListPipelinesBy_Output, error) { var out PipelineListPipelinesBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func PipelineListPipelinesBy(ctx context.Context, c util.LexClient, cursor strin if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/pipelinelistStatuses.go b/api/tangled/pipelinelistStatuses.go index 6ef36fc0d..ad0d3edf4 100644 --- a/api/tangled/pipelinelistStatuses.go +++ b/api/tangled/pipelinelistStatuses.go @@ -26,14 +26,17 @@ type PipelineListStatuses_ListItem struct { type PipelineListStatuses_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*PipelineListStatuses_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // PipelineListStatuses calls the XRPC method "sh.tangled.pipeline.listStatuses". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Pipeline AT-URI whose status records to list. -func PipelineListStatuses(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*PipelineListStatuses_Output, error) { +func PipelineListStatuses(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*PipelineListStatuses_Output, error) { var out PipelineListStatuses_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func PipelineListStatuses(ctx context.Context, c util.LexClient, cursor string, if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/pipelinelistStatusesBy.go b/api/tangled/pipelinelistStatusesBy.go index cf16c1ed6..7200bd7c0 100644 --- a/api/tangled/pipelinelistStatusesBy.go +++ b/api/tangled/pipelinelistStatusesBy.go @@ -18,14 +18,17 @@ const ( type PipelineListStatusesBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*PipelineListStatuses_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // PipelineListStatusesBy calls the XRPC method "sh.tangled.pipeline.listStatusesBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose pipeline-status authorings to list. -func PipelineListStatusesBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*PipelineListStatusesBy_Output, error) { +func PipelineListStatusesBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*PipelineListStatusesBy_Output, error) { var out PipelineListStatusesBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func PipelineListStatusesBy(ctx context.Context, c util.LexClient, cursor string if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/publicKeylistKeys.go b/api/tangled/publicKeylistKeys.go index cc1806b83..ab6c3b512 100644 --- a/api/tangled/publicKeylistKeys.go +++ b/api/tangled/publicKeylistKeys.go @@ -26,14 +26,17 @@ type PublicKeyListKeys_ListItem struct { type PublicKeyListKeys_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*PublicKeyListKeys_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // PublicKeyListKeys calls the XRPC method "sh.tangled.publicKey.listKeys". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Owner DID whose public-key records to list. -func PublicKeyListKeys(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*PublicKeyListKeys_Output, error) { +func PublicKeyListKeys(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*PublicKeyListKeys_Output, error) { var out PublicKeyListKeys_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func PublicKeyListKeys(ctx context.Context, c util.LexClient, cursor string, lim if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/pulldefs.go b/api/tangled/pulldefs.go new file mode 100644 index 000000000..beb3fc901 --- /dev/null +++ b/api/tangled/pulldefs.go @@ -0,0 +1,48 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.pull.defs + +const () + +// PullDefs_PatchView is a "patchView" in the sh.tangled.pull.defs schema. +type PullDefs_PatchView struct { + Base string `json:"base" cborgen:"base"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + Head string `json:"head" cborgen:"head"` +} + +// PullDefs_PullView is a "pullView" in the sh.tangled.pull.defs schema. +type PullDefs_PullView struct { + Author *ActorDefs_ProfileViewBasic `json:"author" cborgen:"author"` + Cid string `json:"cid" cborgen:"cid"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + Repo *RepoDefs_RepoViewBasic `json:"repo" cborgen:"repo"` + State *string `json:"state,omitempty" cborgen:"state,omitempty"` + TargetBranch string `json:"targetBranch" cborgen:"targetBranch"` + Title string `json:"title" cborgen:"title"` + Uri string `json:"uri" cborgen:"uri"` +} + +// PullDefs_PullViewDetailed is a "pullViewDetailed" in the sh.tangled.pull.defs schema. +type PullDefs_PullViewDetailed struct { + Author *ActorDefs_ProfileViewBasic `json:"author" cborgen:"author"` + Body *MarkupMarkdown `json:"body,omitempty" cborgen:"body,omitempty"` + Cid string `json:"cid" cborgen:"cid"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + Repo *RepoDefs_RepoViewBasic `json:"repo" cborgen:"repo"` + Source *PullDefs_Source `json:"source,omitempty" cborgen:"source,omitempty"` + State *string `json:"state,omitempty" cborgen:"state,omitempty"` + TargetBranch string `json:"targetBranch" cborgen:"targetBranch"` + Title string `json:"title" cborgen:"title"` + Uri string `json:"uri" cborgen:"uri"` + // versions: TODO: this should be paginated maybe even as a separate `listPatches` method + Versions []*PullDefs_PatchView `json:"versions" cborgen:"versions"` +} + +// PullDefs_Source is a "source" in the sh.tangled.pull.defs schema. +type PullDefs_Source struct { + Branch string `json:"branch" cborgen:"branch"` + Repo *RepoDefs_RepoViewBasic `json:"repo,omitempty" cborgen:"repo,omitempty"` +} diff --git a/api/tangled/pullgetPullView.go b/api/tangled/pullgetPullView.go new file mode 100644 index 000000000..79e9493f2 --- /dev/null +++ b/api/tangled/pullgetPullView.go @@ -0,0 +1,28 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.pull.getPullView + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + PullGetPullViewNSID = "sh.tangled.pull.getPullView" +) + +// PullGetPullView calls the XRPC method "sh.tangled.pull.getPullView". +func PullGetPullView(ctx context.Context, c util.LexClient, uri string) (*PullDefs_PullViewDetailed, error) { + var out PullDefs_PullViewDetailed + + params := map[string]interface{}{} + params["uri"] = uri + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.pull.getPullView", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/pulllistPullViews.go b/api/tangled/pulllistPullViews.go new file mode 100644 index 000000000..daf39845c --- /dev/null +++ b/api/tangled/pulllistPullViews.go @@ -0,0 +1,46 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.pull.listPullViews + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + PullListPullViewsNSID = "sh.tangled.pull.listPullViews" +) + +// PullListPullViews_Output is the output of a sh.tangled.pull.listPullViews call. +type PullListPullViews_Output struct { + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` + Items []*PullDefs_PullView `json:"items" cborgen:"items"` +} + +// PullListPullViews calls the XRPC method "sh.tangled.pull.listPullViews". +// +// cursor: Pagination cursor +// subject: Repo DID to list pulls for +func PullListPullViews(ctx context.Context, c util.LexClient, cursor string, limit int64, state string, subject string) (*PullListPullViews_Output, error) { + var out PullListPullViews_Output + + params := map[string]interface{}{} + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + if state != "" { + params["state"] = state + } + params["subject"] = subject + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.pull.listPullViews", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/queryenrichResponse.go b/api/tangled/queryenrichResponse.go index 2dd5a2768..6a5b06334 100644 --- a/api/tangled/queryenrichResponse.go +++ b/api/tangled/queryenrichResponse.go @@ -20,8 +20,6 @@ type QueryEnrichResponse_Input struct { Enrich []*QueryEnrichResponse_LinkDescriptor `json:"enrich" cborgen:"enrich"` // params: Parameters for the inner query, exactly as it declares them. Params *util.LexiconTypeDecoder `json:"params,omitempty" cborgen:"params,omitempty"` - // sources: Record paths into the inner response restricting which references get payloads. All references are enriched when omitted. - Sources []string `json:"sources,omitempty" cborgen:"sources,omitempty"` // viewer: DID whose own relation to each reference is looked up for viewer payloads. Required when any descriptor requests one. Viewer *string `json:"viewer,omitempty" cborgen:"viewer,omitempty"` // xrpc: NSID of the inner query to run, e.g. sh.tangled.repo.listRepos. @@ -34,6 +32,8 @@ type QueryEnrichResponse_Input struct { type QueryEnrichResponse_LinkDescriptor struct { // source: Collection whose records are linked, a colon, then an index-backed path (subject or .repo). Source string `json:"source" cborgen:"source"` + // targets: Record paths into the inner response selecting references for this payload. All references are considered when omitted. + Targets []string `json:"targets,omitempty" cborgen:"targets,omitempty"` // type: NSID of the payload type to produce, which also defines the payload's shape. Results land at data[ref][source][type]. Type string `json:"type" cborgen:"type"` } diff --git a/api/tangled/quotadefs.go b/api/tangled/quotadefs.go deleted file mode 100644 index efbe90606..000000000 --- a/api/tangled/quotadefs.go +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.spindle.quota.defs - -const () - -// TempSpindleQuotaDefs_Limit is a "limit" in the org.tangled.temp.spindle.quota.defs schema. -// -// a per-subject override for one quota resource -type TempSpindleQuotaDefs_Limit struct { - // did: DID whose quota is overridden, either a repository or an account owner - Did string `json:"did" cborgen:"did"` - // limit: maximum amount in the resource's native units; -1 means unlimited - Limit int64 `json:"limit" cborgen:"limit"` - // resource: quota resource name - Resource string `json:"resource" cborgen:"resource"` -} - -// TempSpindleQuotaDefs_Usage is a "usage" in the org.tangled.temp.spindle.quota.defs schema. -// -// current usage aggregated for one subject and resource -type TempSpindleQuotaDefs_Usage struct { - // did: DID for the user or repository scope - Did string `json:"did" cborgen:"did"` - // resource: quota resource name - Resource string `json:"resource" cborgen:"resource"` - // scope: aggregation axis for this row: user or repo - Scope string `json:"scope" cborgen:"scope"` - // used: amount currently allocated or reserved in native resource units - Used int64 `json:"used" cborgen:"used"` -} diff --git a/api/tangled/quotaget.go b/api/tangled/quotaget.go deleted file mode 100644 index afb0d5884..000000000 --- a/api/tangled/quotaget.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.spindle.quota.get - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempSpindleQuotaGetNSID = "org.tangled.temp.spindle.quota.get" -) - -// TempSpindleQuotaGet_Output is the output of a org.tangled.temp.spindle.quota.get call. -type TempSpindleQuotaGet_Output struct { - // limit: quota override for the requested DID and resource - Limit *TempSpindleQuotaDefs_Limit `json:"limit" cborgen:"limit"` -} - -// TempSpindleQuotaGet calls the XRPC method "org.tangled.temp.spindle.quota.get". -// -// did: DID of the repository or account owner -// resource: quota resource to look up -func TempSpindleQuotaGet(ctx context.Context, c util.LexClient, did string, resource string) (*TempSpindleQuotaGet_Output, error) { - var out TempSpindleQuotaGet_Output - - params := map[string]interface{}{} - params["did"] = did - params["resource"] = resource - if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.spindle.quota.get", params, nil, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/tangled/quotalist.go b/api/tangled/quotalist.go deleted file mode 100644 index e66e080a2..000000000 --- a/api/tangled/quotalist.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.spindle.quota.list - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempSpindleQuotaListNSID = "org.tangled.temp.spindle.quota.list" -) - -// TempSpindleQuotaList_Output is the output of a org.tangled.temp.spindle.quota.list call. -type TempSpindleQuotaList_Output struct { - // limits: quota overrides ordered by DID and resource - Limits []*TempSpindleQuotaDefs_Limit `json:"limits" cborgen:"limits"` -} - -// TempSpindleQuotaList calls the XRPC method "org.tangled.temp.spindle.quota.list". -func TempSpindleQuotaList(ctx context.Context, c util.LexClient) (*TempSpindleQuotaList_Output, error) { - var out TempSpindleQuotaList_Output - if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.spindle.quota.list", nil, nil, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/tangled/quotaset.go b/api/tangled/quotaset.go deleted file mode 100644 index 65bfb31f9..000000000 --- a/api/tangled/quotaset.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.spindle.quota.set - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempSpindleQuotaSetNSID = "org.tangled.temp.spindle.quota.set" -) - -// TempSpindleQuotaSet_Input is the input argument to a org.tangled.temp.spindle.quota.set call. -type TempSpindleQuotaSet_Input struct { - // did: DID of the repository or account owner - Did string `json:"did" cborgen:"did"` - // limit: positive maximum in the resource's native units; cannot be combined with unlimited - Limit *int64 `json:"limit,omitempty" cborgen:"limit,omitempty"` - // resource: quota resource name, such as workflows, vcpus, memory_mib, disk_mib, or cache_storage_bytes - Resource string `json:"resource" cborgen:"resource"` - // unlimited: store an unlimited override; cannot be combined with limit - Unlimited *bool `json:"unlimited,omitempty" cborgen:"unlimited,omitempty"` -} - -// TempSpindleQuotaSet calls the XRPC method "org.tangled.temp.spindle.quota.set". -func TempSpindleQuotaSet(ctx context.Context, c util.LexClient, input *TempSpindleQuotaSet_Input) error { - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.spindle.quota.set", nil, input, nil); err != nil { - return err - } - - return nil -} diff --git a/api/tangled/quotaunset.go b/api/tangled/quotaunset.go deleted file mode 100644 index bb3b810f8..000000000 --- a/api/tangled/quotaunset.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.spindle.quota.unset - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempSpindleQuotaUnsetNSID = "org.tangled.temp.spindle.quota.unset" -) - -// TempSpindleQuotaUnset_Input is the input argument to a org.tangled.temp.spindle.quota.unset call. -type TempSpindleQuotaUnset_Input struct { - // did: DID of the repository or account owner - Did string `json:"did" cborgen:"did"` - // resource: quota resource whose override to remove - Resource string `json:"resource" cborgen:"resource"` -} - -// TempSpindleQuotaUnset calls the XRPC method "org.tangled.temp.spindle.quota.unset". -func TempSpindleQuotaUnset(ctx context.Context, c util.LexClient, input *TempSpindleQuotaUnset_Input) error { - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.spindle.quota.unset", nil, input, nil); err != nil { - return err - } - - return nil -} diff --git a/api/tangled/quotausage.go b/api/tangled/quotausage.go deleted file mode 100644 index b7003ff7e..000000000 --- a/api/tangled/quotausage.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.spindle.quota.usage - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempSpindleQuotaUsageNSID = "org.tangled.temp.spindle.quota.usage" -) - -// TempSpindleQuotaUsage_Output is the output of a org.tangled.temp.spindle.quota.usage call. -type TempSpindleQuotaUsage_Output struct { - // usages: non-zero usage rows, including active reservations and committed allocations - Usages []*TempSpindleQuotaDefs_Usage `json:"usages" cborgen:"usages"` -} - -// TempSpindleQuotaUsage calls the XRPC method "org.tangled.temp.spindle.quota.usage". -// -// did: limit results to rows for this subject DID -// scope: limit results to one aggregation axis: user or repo -func TempSpindleQuotaUsage(ctx context.Context, c util.LexClient, did string, scope string) (*TempSpindleQuotaUsage_Output, error) { - var out TempSpindleQuotaUsage_Output - - params := map[string]interface{}{} - if did != "" { - params["did"] = did - } - if scope != "" { - params["scope"] = scope - } - if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.spindle.quota.usage", params, nil, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/tangled/repocreateWebhook.go b/api/tangled/repocreateWebhook.go deleted file mode 100644 index d38172d0b..000000000 --- a/api/tangled/repocreateWebhook.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.repo.createWebhook - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempRepoCreateWebhookNSID = "org.tangled.temp.repo.createWebhook" -) - -// TempRepoCreateWebhook_Input is the input argument to a org.tangled.temp.repo.createWebhook call. -type TempRepoCreateWebhook_Input struct { - // active: Whether the webhook should be active immediately. Defaults to true. - Active *bool `json:"active,omitempty" cborgen:"active,omitempty"` - // events: Event types to subscribe to (e.g. 'push', 'repository:renamed'). - Events []string `json:"events" cborgen:"events"` - // repoDid: DID of the repository as minted by the knot. - RepoDid string `json:"repoDid" cborgen:"repoDid"` - // secret: Optional HMAC secret used to sign payloads. If omitted, payloads are not signed. - Secret *string `json:"secret,omitempty" cborgen:"secret,omitempty"` - // url: Endpoint URL that will receive webhook payloads. - Url string `json:"url" cborgen:"url"` -} - -// TempRepoCreateWebhook_Output is the output of a org.tangled.temp.repo.createWebhook call. -type TempRepoCreateWebhook_Output struct { - // id: ID of the newly created webhook. - Id int64 `json:"id" cborgen:"id"` -} - -// TempRepoCreateWebhook calls the XRPC method "org.tangled.temp.repo.createWebhook". -func TempRepoCreateWebhook(ctx context.Context, c util.LexClient, input *TempRepoCreateWebhook_Input) (*TempRepoCreateWebhook_Output, error) { - var out TempRepoCreateWebhook_Output - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.repo.createWebhook", nil, input, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/tangled/repodefs.go b/api/tangled/repodefs.go index e14b83b3f..f95814521 100644 --- a/api/tangled/repodefs.go +++ b/api/tangled/repodefs.go @@ -11,6 +11,7 @@ type RepoDefs_RepoViewBasic struct { CreatedAt string `json:"createdAt" cborgen:"createdAt"` Description *string `json:"description,omitempty" cborgen:"description,omitempty"` Did string `json:"did" cborgen:"did"` + ForkCount *int64 `json:"forkCount,omitempty" cborgen:"forkCount,omitempty"` IsStarred *bool `json:"isStarred,omitempty" cborgen:"isStarred,omitempty"` Owner *ActorDefs_ProfileViewBasic `json:"owner" cborgen:"owner"` Slug string `json:"slug" cborgen:"slug"` @@ -22,5 +23,6 @@ type RepoDefs_RepoViewBasic struct { // // Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests. type RepoDefs_ViewerState struct { + Fork *string `json:"fork,omitempty" cborgen:"fork,omitempty"` Star *string `json:"star,omitempty" cborgen:"star,omitempty"` } diff --git a/api/tangled/repodeleteWebhook.go b/api/tangled/repodeleteWebhook.go deleted file mode 100644 index 3f4bd6a5a..000000000 --- a/api/tangled/repodeleteWebhook.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.repo.deleteWebhook - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempRepoDeleteWebhookNSID = "org.tangled.temp.repo.deleteWebhook" -) - -// TempRepoDeleteWebhook_Input is the input argument to a org.tangled.temp.repo.deleteWebhook call. -type TempRepoDeleteWebhook_Input struct { - // id: Webhook ID to delete. - Id int64 `json:"id" cborgen:"id"` - // repoDid: DID of the repository as minted by the knot. - RepoDid string `json:"repoDid" cborgen:"repoDid"` -} - -// TempRepoDeleteWebhook calls the XRPC method "org.tangled.temp.repo.deleteWebhook". -func TempRepoDeleteWebhook(ctx context.Context, c util.LexClient, input *TempRepoDeleteWebhook_Input) error { - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.repo.deleteWebhook", nil, input, nil); err != nil { - return err - } - - return nil -} diff --git a/api/tangled/repodisableSite.go b/api/tangled/repodisableSite.go deleted file mode 100644 index 110e405f1..000000000 --- a/api/tangled/repodisableSite.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.repo.disableSite - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempRepoDisableSiteNSID = "org.tangled.temp.repo.disableSite" -) - -// TempRepoDisableSite_Input is the input argument to a org.tangled.temp.repo.disableSite call. -type TempRepoDisableSite_Input struct { - // repoDid: DID of the repository as minted by the knot. - RepoDid string `json:"repoDid" cborgen:"repoDid"` -} - -// TempRepoDisableSite calls the XRPC method "org.tangled.temp.repo.disableSite". -func TempRepoDisableSite(ctx context.Context, c util.LexClient, input *TempRepoDisableSite_Input) error { - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.repo.disableSite", nil, input, nil); err != nil { - return err - } - - return nil -} diff --git a/api/tangled/repogetSiteConfig.go b/api/tangled/repogetSiteConfig.go deleted file mode 100644 index a07b1bb7c..000000000 --- a/api/tangled/repogetSiteConfig.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.repo.getSiteConfig - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempRepoGetSiteConfigNSID = "org.tangled.temp.repo.getSiteConfig" -) - -// TempRepoGetSiteConfig_Output is the output of a org.tangled.temp.repo.getSiteConfig call. -type TempRepoGetSiteConfig_Output struct { - // config: Site config for the repository. Absent if no site is configured. - Config *TempRepoGetSiteConfig_SiteConfig `json:"config,omitempty" cborgen:"config,omitempty"` -} - -// TempRepoGetSiteConfig_SiteConfig is a "siteConfig" in the org.tangled.temp.repo.getSiteConfig schema. -type TempRepoGetSiteConfig_SiteConfig struct { - // branch: Branch to deploy from. - Branch string `json:"branch" cborgen:"branch"` - // dir: Directory within the repository to deploy (e.g. '/' or '/docs'). - Dir string `json:"dir" cborgen:"dir"` - // isIndex: Whether this repo serves as the index (root) for the domain. - IsIndex bool `json:"isIndex" cborgen:"isIndex"` -} - -// TempRepoGetSiteConfig calls the XRPC method "org.tangled.temp.repo.getSiteConfig". -// -// repoDid: DID of the repository as minted by the knot. -func TempRepoGetSiteConfig(ctx context.Context, c util.LexClient, repoDid string) (*TempRepoGetSiteConfig_Output, error) { - var out TempRepoGetSiteConfig_Output - - params := map[string]interface{}{} - params["repoDid"] = repoDid - if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.repo.getSiteConfig", params, nil, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/tangled/repolistArtifacts.go b/api/tangled/repolistArtifacts.go index 44a07c7fe..e067523f1 100644 --- a/api/tangled/repolistArtifacts.go +++ b/api/tangled/repolistArtifacts.go @@ -26,14 +26,17 @@ type RepoListArtifacts_ListItem struct { type RepoListArtifacts_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*RepoListArtifacts_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // RepoListArtifacts calls the XRPC method "sh.tangled.repo.listArtifacts". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Repo or release identifier whose artifacts to list. -func RepoListArtifacts(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*RepoListArtifacts_Output, error) { +func RepoListArtifacts(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*RepoListArtifacts_Output, error) { var out RepoListArtifacts_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func RepoListArtifacts(ctx context.Context, c util.LexClient, cursor string, lim if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/repolistArtifactsBy.go b/api/tangled/repolistArtifactsBy.go index cb13156f6..3cd43cd45 100644 --- a/api/tangled/repolistArtifactsBy.go +++ b/api/tangled/repolistArtifactsBy.go @@ -18,14 +18,17 @@ const ( type RepoListArtifactsBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*RepoListArtifacts_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // RepoListArtifactsBy calls the XRPC method "sh.tangled.repo.listArtifactsBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose artifact authorings to list. -func RepoListArtifactsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*RepoListArtifactsBy_Output, error) { +func RepoListArtifactsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*RepoListArtifactsBy_Output, error) { var out RepoListArtifactsBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func RepoListArtifactsBy(ctx context.Context, c util.LexClient, cursor string, l if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/repolistCollaborators.go b/api/tangled/repolistCollaborators.go index d86db48ed..f2eb55617 100644 --- a/api/tangled/repolistCollaborators.go +++ b/api/tangled/repolistCollaborators.go @@ -32,14 +32,17 @@ type RepoListCollaborators_ListItem struct { type RepoListCollaborators_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*RepoListCollaborators_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // RepoListCollaborators calls the XRPC method "sh.tangled.repo.listCollaborators". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Repo DID whose collaborator records to list. -func RepoListCollaborators(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*RepoListCollaborators_Output, error) { +func RepoListCollaborators(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*RepoListCollaborators_Output, error) { var out RepoListCollaborators_Output params := map[string]interface{}{} @@ -49,6 +52,9 @@ func RepoListCollaborators(ctx context.Context, c util.LexClient, cursor string, if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/repolistCollaboratorsBy.go b/api/tangled/repolistCollaboratorsBy.go index 7fec8b50c..0bdbaf7b3 100644 --- a/api/tangled/repolistCollaboratorsBy.go +++ b/api/tangled/repolistCollaboratorsBy.go @@ -18,14 +18,17 @@ const ( type RepoListCollaboratorsBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*RepoListCollaborators_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // RepoListCollaboratorsBy calls the XRPC method "sh.tangled.repo.listCollaboratorsBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose collaborator authorings to list. -func RepoListCollaboratorsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*RepoListCollaboratorsBy_Output, error) { +func RepoListCollaboratorsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*RepoListCollaboratorsBy_Output, error) { var out RepoListCollaboratorsBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func RepoListCollaboratorsBy(ctx context.Context, c util.LexClient, cursor strin if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/repolistIssues.go b/api/tangled/repolistIssues.go index 297f83e89..4c4f6f37e 100644 --- a/api/tangled/repolistIssues.go +++ b/api/tangled/repolistIssues.go @@ -32,16 +32,19 @@ type RepoListIssues_IssueListItem struct { type RepoListIssues_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*RepoListIssues_IssueListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // RepoListIssues calls the XRPC method "sh.tangled.repo.listIssues". // // author: Restrict to issues authored by this user DID. // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // state: Restrict to issues whose latest derived state matches. // subject: Repo DID to list issues for -func RepoListIssues(ctx context.Context, c util.LexClient, author string, cursor string, limit int64, order string, state string, subject string) (*RepoListIssues_Output, error) { +func RepoListIssues(ctx context.Context, c util.LexClient, author string, cursor string, limit int64, offset int64, order string, state string, subject string) (*RepoListIssues_Output, error) { var out RepoListIssues_Output params := map[string]interface{}{} @@ -54,6 +57,9 @@ func RepoListIssues(ctx context.Context, c util.LexClient, author string, cursor if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/repolistIssuesBy.go b/api/tangled/repolistIssuesBy.go index c05ea7cef..7091b37c8 100644 --- a/api/tangled/repolistIssuesBy.go +++ b/api/tangled/repolistIssuesBy.go @@ -18,15 +18,18 @@ const ( type RepoListIssuesBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*RepoListIssues_IssueListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // RepoListIssuesBy calls the XRPC method "sh.tangled.repo.listIssuesBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // state: Restrict to issues whose latest derived state matches. // subject: Actor DID whose issue authorings to list -func RepoListIssuesBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, state string, subject string) (*RepoListIssuesBy_Output, error) { +func RepoListIssuesBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, state string, subject string) (*RepoListIssuesBy_Output, error) { var out RepoListIssuesBy_Output params := map[string]interface{}{} @@ -36,6 +39,9 @@ func RepoListIssuesBy(ctx context.Context, c util.LexClient, cursor string, limi if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/repolistPulls.go b/api/tangled/repolistPulls.go index 8ba707ac7..d5e516f90 100644 --- a/api/tangled/repolistPulls.go +++ b/api/tangled/repolistPulls.go @@ -18,6 +18,8 @@ const ( type RepoListPulls_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*RepoListPulls_PullListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // RepoListPulls_PullListItem is a "pullListItem" in the sh.tangled.repo.listPulls schema. @@ -38,10 +40,11 @@ type RepoListPulls_PullListItem struct { // // author: Restrict to pulls authored by this user DID. // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // status: Restrict to pulls whose latest derived status matches. // subject: Repo DID to list pulls for -func RepoListPulls(ctx context.Context, c util.LexClient, author string, cursor string, limit int64, order string, status string, subject string) (*RepoListPulls_Output, error) { +func RepoListPulls(ctx context.Context, c util.LexClient, author string, cursor string, limit int64, offset int64, order string, status string, subject string) (*RepoListPulls_Output, error) { var out RepoListPulls_Output params := map[string]interface{}{} @@ -54,6 +57,9 @@ func RepoListPulls(ctx context.Context, c util.LexClient, author string, cursor if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/repolistPullsBy.go b/api/tangled/repolistPullsBy.go index 6b2b93e6a..c10c59bc5 100644 --- a/api/tangled/repolistPullsBy.go +++ b/api/tangled/repolistPullsBy.go @@ -18,15 +18,18 @@ const ( type RepoListPullsBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*RepoListPulls_PullListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // RepoListPullsBy calls the XRPC method "sh.tangled.repo.listPullsBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // status: Restrict to pulls whose latest derived status matches. // subject: Actor DID whose pull authorings to list -func RepoListPullsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, status string, subject string) (*RepoListPullsBy_Output, error) { +func RepoListPullsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, status string, subject string) (*RepoListPullsBy_Output, error) { var out RepoListPullsBy_Output params := map[string]interface{}{} @@ -36,6 +39,9 @@ func RepoListPullsBy(ctx context.Context, c util.LexClient, cursor string, limit if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/repolistRepos.go b/api/tangled/repolistRepos.go index c507d136f..c6cb3883f 100644 --- a/api/tangled/repolistRepos.go +++ b/api/tangled/repolistRepos.go @@ -26,14 +26,17 @@ type RepoListRepos_ListItem struct { type RepoListRepos_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*RepoListRepos_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // RepoListRepos calls the XRPC method "sh.tangled.repo.listRepos". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Owner DID whose repo records to list. -func RepoListRepos(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*RepoListRepos_Output, error) { +func RepoListRepos(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*RepoListRepos_Output, error) { var out RepoListRepos_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func RepoListRepos(ctx context.Context, c util.LexClient, cursor string, limit i if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/repolistWebhookDeliveries.go b/api/tangled/repolistWebhookDeliveries.go deleted file mode 100644 index d46a5c12f..000000000 --- a/api/tangled/repolistWebhookDeliveries.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.repo.listWebhookDeliveries - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempRepoListWebhookDeliveriesNSID = "org.tangled.temp.repo.listWebhookDeliveries" -) - -// TempRepoListWebhookDeliveries_Delivery is a "delivery" in the org.tangled.temp.repo.listWebhookDeliveries schema. -type TempRepoListWebhookDeliveries_Delivery struct { - CreatedAt string `json:"createdAt" cborgen:"createdAt"` - // deliveryId: UUID for tracking this delivery attempt. - DeliveryId string `json:"deliveryId" cborgen:"deliveryId"` - // event: Event type that triggered the delivery. - Event string `json:"event" cborgen:"event"` - Id int64 `json:"id" cborgen:"id"` - RequestBody *string `json:"requestBody,omitempty" cborgen:"requestBody,omitempty"` - ResponseBody *string `json:"responseBody,omitempty" cborgen:"responseBody,omitempty"` - ResponseCode *int64 `json:"responseCode,omitempty" cborgen:"responseCode,omitempty"` - Success bool `json:"success" cborgen:"success"` - Url string `json:"url" cborgen:"url"` -} - -// TempRepoListWebhookDeliveries_Output is the output of a org.tangled.temp.repo.listWebhookDeliveries call. -type TempRepoListWebhookDeliveries_Output struct { - Deliveries []*TempRepoListWebhookDeliveries_Delivery `json:"deliveries" cborgen:"deliveries"` -} - -// TempRepoListWebhookDeliveries calls the XRPC method "org.tangled.temp.repo.listWebhookDeliveries". -// -// id: Webhook ID. -// repoDid: DID of the repository as minted by the knot. -func TempRepoListWebhookDeliveries(ctx context.Context, c util.LexClient, id int64, limit int64, repoDid string) (*TempRepoListWebhookDeliveries_Output, error) { - var out TempRepoListWebhookDeliveries_Output - - params := map[string]interface{}{} - params["id"] = id - if limit != 0 { - params["limit"] = limit - } - params["repoDid"] = repoDid - if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.repo.listWebhookDeliveries", params, nil, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/tangled/repolistWebhooks.go b/api/tangled/repolistWebhooks.go deleted file mode 100644 index 719ca25e5..000000000 --- a/api/tangled/repolistWebhooks.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.repo.listWebhooks - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempRepoListWebhooksNSID = "org.tangled.temp.repo.listWebhooks" -) - -// TempRepoListWebhooks_Output is the output of a org.tangled.temp.repo.listWebhooks call. -type TempRepoListWebhooks_Output struct { - Webhooks []*TempRepoListWebhooks_Webhook `json:"webhooks" cborgen:"webhooks"` -} - -// TempRepoListWebhooks_Webhook is a "webhook" in the org.tangled.temp.repo.listWebhooks schema. -type TempRepoListWebhooks_Webhook struct { - // active: Whether the webhook is currently enabled. - Active bool `json:"active" cborgen:"active"` - CreatedAt string `json:"createdAt" cborgen:"createdAt"` - // events: Event types this webhook is subscribed to (e.g. 'push', 'repository:renamed'). - Events []string `json:"events" cborgen:"events"` - // id: Webhook identifier. - Id int64 `json:"id" cborgen:"id"` - UpdatedAt *string `json:"updatedAt,omitempty" cborgen:"updatedAt,omitempty"` - // url: Endpoint URL that receives webhook payloads. - Url string `json:"url" cborgen:"url"` -} - -// TempRepoListWebhooks calls the XRPC method "org.tangled.temp.repo.listWebhooks". -// -// repoDid: DID of the repository as minted by the knot. -func TempRepoListWebhooks(ctx context.Context, c util.LexClient, repoDid string) (*TempRepoListWebhooks_Output, error) { - var out TempRepoListWebhooks_Output - - params := map[string]interface{}{} - params["repoDid"] = repoDid - if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.repo.listWebhooks", params, nil, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/tangled/repopull.go b/api/tangled/repopull.go index 1530d96fd..5925d98b3 100644 --- a/api/tangled/repopull.go +++ b/api/tangled/repopull.go @@ -55,8 +55,8 @@ type RepoPull_Target struct { // RepoPull_Version is a "version" in the sh.tangled.repo.pull schema. type RepoPull_Version struct { // base: merge-base commit ID for combined interdiff - Base *string `json:"base,omitempty" cborgen:"base,omitempty"` - CreatedAt string `json:"createdAt" cborgen:"createdAt"` + Base string `json:"base" cborgen:"base"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` // head: HEAD commit ID Head string `json:"head" cborgen:"head"` } diff --git a/api/tangled/reporetryWebhookDelivery.go b/api/tangled/reporetryWebhookDelivery.go deleted file mode 100644 index d5e3f118b..000000000 --- a/api/tangled/reporetryWebhookDelivery.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.repo.retryWebhookDelivery - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempRepoRetryWebhookDeliveryNSID = "org.tangled.temp.repo.retryWebhookDelivery" -) - -// TempRepoRetryWebhookDelivery_Input is the input argument to a org.tangled.temp.repo.retryWebhookDelivery call. -type TempRepoRetryWebhookDelivery_Input struct { - // deliveryId: UUID of the delivery to retry. - DeliveryId string `json:"deliveryId" cborgen:"deliveryId"` - // repoDid: DID of the repository as minted by the knot. - RepoDid string `json:"repoDid" cborgen:"repoDid"` - // webhookId: Webhook ID that owns the delivery. - WebhookId int64 `json:"webhookId" cborgen:"webhookId"` -} - -// TempRepoRetryWebhookDelivery calls the XRPC method "org.tangled.temp.repo.retryWebhookDelivery". -func TempRepoRetryWebhookDelivery(ctx context.Context, c util.LexClient, input *TempRepoRetryWebhookDelivery_Input) error { - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.repo.retryWebhookDelivery", nil, input, nil); err != nil { - return err - } - - return nil -} diff --git a/api/tangled/repotoggleWebhook.go b/api/tangled/repotoggleWebhook.go deleted file mode 100644 index 69c2d292a..000000000 --- a/api/tangled/repotoggleWebhook.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.repo.toggleWebhook - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempRepoToggleWebhookNSID = "org.tangled.temp.repo.toggleWebhook" -) - -// TempRepoToggleWebhook_Input is the input argument to a org.tangled.temp.repo.toggleWebhook call. -type TempRepoToggleWebhook_Input struct { - // id: Webhook ID to toggle. - Id int64 `json:"id" cborgen:"id"` - // repoDid: DID of the repository as minted by the knot. - RepoDid string `json:"repoDid" cborgen:"repoDid"` -} - -// TempRepoToggleWebhook_Output is the output of a org.tangled.temp.repo.toggleWebhook call. -type TempRepoToggleWebhook_Output struct { - // active: New active state of the webhook. - Active bool `json:"active" cborgen:"active"` -} - -// TempRepoToggleWebhook calls the XRPC method "org.tangled.temp.repo.toggleWebhook". -func TempRepoToggleWebhook(ctx context.Context, c util.LexClient, input *TempRepoToggleWebhook_Input) (*TempRepoToggleWebhook_Output, error) { - var out TempRepoToggleWebhook_Output - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.repo.toggleWebhook", nil, input, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/tangled/repoupdateSiteConfig.go b/api/tangled/repoupdateSiteConfig.go deleted file mode 100644 index 850aa7c0d..000000000 --- a/api/tangled/repoupdateSiteConfig.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.repo.updateSiteConfig - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempRepoUpdateSiteConfigNSID = "org.tangled.temp.repo.updateSiteConfig" -) - -// TempRepoUpdateSiteConfig_Input is the input argument to a org.tangled.temp.repo.updateSiteConfig call. -type TempRepoUpdateSiteConfig_Input struct { - // branch: Branch to deploy from. - Branch string `json:"branch" cborgen:"branch"` - // dir: Directory within the repository to deploy (e.g. '/' or '/docs'). - Dir string `json:"dir" cborgen:"dir"` - // isIndex: Whether this repo should serve as the index (root) for the claimed domain. - IsIndex *bool `json:"isIndex,omitempty" cborgen:"isIndex,omitempty"` - // repoDid: DID of the repository as minted by the knot. - RepoDid string `json:"repoDid" cborgen:"repoDid"` -} - -// TempRepoUpdateSiteConfig calls the XRPC method "org.tangled.temp.repo.updateSiteConfig". -func TempRepoUpdateSiteConfig(ctx context.Context, c util.LexClient, input *TempRepoUpdateSiteConfig_Input) error { - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.repo.updateSiteConfig", nil, input, nil); err != nil { - return err - } - - return nil -} diff --git a/api/tangled/repoupdateWebhook.go b/api/tangled/repoupdateWebhook.go deleted file mode 100644 index 9d654c5b8..000000000 --- a/api/tangled/repoupdateWebhook.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.repo.updateWebhook - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempRepoUpdateWebhookNSID = "org.tangled.temp.repo.updateWebhook" -) - -// TempRepoUpdateWebhook_Input is the input argument to a org.tangled.temp.repo.updateWebhook call. -type TempRepoUpdateWebhook_Input struct { - Active *bool `json:"active,omitempty" cborgen:"active,omitempty"` - Events []string `json:"events,omitempty" cborgen:"events,omitempty"` - // id: Webhook ID to update. - Id int64 `json:"id" cborgen:"id"` - // repoDid: DID of the repository as minted by the knot. - RepoDid string `json:"repoDid" cborgen:"repoDid"` - Secret *string `json:"secret,omitempty" cborgen:"secret,omitempty"` - Url *string `json:"url,omitempty" cborgen:"url,omitempty"` -} - -// TempRepoUpdateWebhook calls the XRPC method "org.tangled.temp.repo.updateWebhook". -func TempRepoUpdateWebhook(ctx context.Context, c util.LexClient, input *TempRepoUpdateWebhook_Input) error { - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.repo.updateWebhook", nil, input, nil); err != nil { - return err - } - - return nil -} diff --git a/api/tangled/searchquery.go b/api/tangled/searchquery.go index 3aede6533..6045d5f63 100644 --- a/api/tangled/searchquery.go +++ b/api/tangled/searchquery.go @@ -37,11 +37,12 @@ type SearchQuery_Output struct { // author: Restrict to records authored by this DID. // cursor: Pagination cursor // nsid: Restrict to records of this collection. +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // q: Full-text search query. // repo: Restrict to records under this repo DID. // since: Restrict to records created at or after this time. // until: Restrict to records created at or before this time. -func SearchQuery(ctx context.Context, c util.LexClient, author string, cursor string, limit int64, nsid string, q string, repo string, since string, until string) (*SearchQuery_Output, error) { +func SearchQuery(ctx context.Context, c util.LexClient, author string, cursor string, limit int64, nsid string, offset int64, q string, repo string, since string, until string) (*SearchQuery_Output, error) { var out SearchQuery_Output params := map[string]interface{}{} @@ -57,6 +58,9 @@ func SearchQuery(ctx context.Context, c util.LexClient, author string, cursor st if nsid != "" { params["nsid"] = nsid } + if offset != 0 { + params["offset"] = offset + } params["q"] = q if repo != "" { params["repo"] = repo diff --git a/api/tangled/searchsearchCode.go b/api/tangled/searchsearchCode.go deleted file mode 100644 index 0950f65f2..000000000 --- a/api/tangled/searchsearchCode.go +++ /dev/null @@ -1,79 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.search.searchCode - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempSearchSearchCodeNSID = "org.tangled.temp.search.searchCode" -) - -// TempSearchSearchCode_Chunk is a "chunk" in the org.tangled.temp.search.searchCode schema. -type TempSearchSearchCode_Chunk struct { - // content: Source lines for this match chunk. - Content string `json:"content" cborgen:"content"` - // highlights: Byte-offset ranges within content that match the query. - Highlights []*TempSearchSearchCode_Highlight `json:"highlights,omitempty" cborgen:"highlights,omitempty"` - // lineStart: 1-based line number of the first line in content. - LineStart int64 `json:"lineStart" cborgen:"lineStart"` -} - -// TempSearchSearchCode_FileResult is a "fileResult" in the org.tangled.temp.search.searchCode schema. -type TempSearchSearchCode_FileResult struct { - Chunks []*TempSearchSearchCode_Chunk `json:"chunks" cborgen:"chunks"` - // language: Detected programming language. - Language *string `json:"language,omitempty" cborgen:"language,omitempty"` - // path: File path relative to repository root. - Path string `json:"path" cborgen:"path"` - // repoDid: DID of the repository as minted by the knot. - RepoDid string `json:"repoDid" cborgen:"repoDid"` -} - -// TempSearchSearchCode_Highlight is a "highlight" in the org.tangled.temp.search.searchCode schema. -type TempSearchSearchCode_Highlight struct { - // end: End byte offset (exclusive) within the chunk content string. - End int64 `json:"end" cborgen:"end"` - // start: Start byte offset within the chunk content string. - Start int64 `json:"start" cborgen:"start"` -} - -// TempSearchSearchCode_Output is the output of a org.tangled.temp.search.searchCode call. -type TempSearchSearchCode_Output struct { - Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` - Results []*TempSearchSearchCode_FileResult `json:"results" cborgen:"results"` -} - -// TempSearchSearchCode calls the XRPC method "org.tangled.temp.search.searchCode". -// -// lang: Restrict search to a specific programming language (e.g. 'go', 'rust'). -// q: Search query string. -// repoDid: Restrict search to a specific repository, by its DID. -func TempSearchSearchCode(ctx context.Context, c util.LexClient, cursor string, lang string, limit int64, q string, repoDid string) (*TempSearchSearchCode_Output, error) { - var out TempSearchSearchCode_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if lang != "" { - params["lang"] = lang - } - if limit != 0 { - params["limit"] = limit - } - params["q"] = q - if repoDid != "" { - params["repoDid"] = repoDid - } - if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.search.searchCode", params, nil, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/tangled/siteclaimDomain.go b/api/tangled/siteclaimDomain.go deleted file mode 100644 index 990edd09a..000000000 --- a/api/tangled/siteclaimDomain.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.site.claimDomain - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempSiteClaimDomainNSID = "org.tangled.temp.site.claimDomain" -) - -// TempSiteClaimDomain_Input is the input argument to a org.tangled.temp.site.claimDomain call. -type TempSiteClaimDomain_Input struct { - // subdomain: Desired subdomain label (lowercase letters, digits, and hyphens; 4–63 characters). - Subdomain string `json:"subdomain" cborgen:"subdomain"` -} - -// TempSiteClaimDomain calls the XRPC method "org.tangled.temp.site.claimDomain". -func TempSiteClaimDomain(ctx context.Context, c util.LexClient, input *TempSiteClaimDomain_Input) error { - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.site.claimDomain", nil, input, nil); err != nil { - return err - } - - return nil -} diff --git a/api/tangled/sitegetDomainClaim.go b/api/tangled/sitegetDomainClaim.go deleted file mode 100644 index f0e1b9a9d..000000000 --- a/api/tangled/sitegetDomainClaim.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.site.getDomainClaim - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempSiteGetDomainClaimNSID = "org.tangled.temp.site.getDomainClaim" -) - -// TempSiteGetDomainClaim_Output is the output of a org.tangled.temp.site.getDomainClaim call. -type TempSiteGetDomainClaim_Output struct { - // domain: The claimed domain (e.g. 'alice.sites.tangled.sh'). Absent if no active claim. - Domain *string `json:"domain,omitempty" cborgen:"domain,omitempty"` -} - -// TempSiteGetDomainClaim calls the XRPC method "org.tangled.temp.site.getDomainClaim". -func TempSiteGetDomainClaim(ctx context.Context, c util.LexClient) (*TempSiteGetDomainClaim_Output, error) { - var out TempSiteGetDomainClaim_Output - if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.site.getDomainClaim", nil, nil, &out); err != nil { - return nil, err - } - - return &out, nil -} diff --git a/api/tangled/sitereleaseDomain.go b/api/tangled/sitereleaseDomain.go deleted file mode 100644 index d1b6dcd10..000000000 --- a/api/tangled/sitereleaseDomain.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. - -package tangled - -// schema: org.tangled.temp.site.releaseDomain - -import ( - "context" - - "github.com/bluesky-social/indigo/lex/util" -) - -const ( - TempSiteReleaseDomainNSID = "org.tangled.temp.site.releaseDomain" -) - -// TempSiteReleaseDomain_Input is the input argument to a org.tangled.temp.site.releaseDomain call. -type TempSiteReleaseDomain_Input struct { - // domain: Full domain to release (must match the user's active claim). - Domain string `json:"domain" cborgen:"domain"` -} - -// TempSiteReleaseDomain calls the XRPC method "org.tangled.temp.site.releaseDomain". -func TempSiteReleaseDomain(ctx context.Context, c util.LexClient, input *TempSiteReleaseDomain_Input) error { - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.site.releaseDomain", nil, input, nil); err != nil { - return err - } - - return nil -} diff --git a/api/tangled/spindlelistMembers.go b/api/tangled/spindlelistMembers.go index 53771a78b..d6b2a9b36 100644 --- a/api/tangled/spindlelistMembers.go +++ b/api/tangled/spindlelistMembers.go @@ -26,14 +26,17 @@ type SpindleListMembers_ListItem struct { type SpindleListMembers_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*SpindleListMembers_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // SpindleListMembers calls the XRPC method "sh.tangled.spindle.listMembers". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Spindle identifier whose member records to list. -func SpindleListMembers(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*SpindleListMembers_Output, error) { +func SpindleListMembers(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*SpindleListMembers_Output, error) { var out SpindleListMembers_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func SpindleListMembers(ctx context.Context, c util.LexClient, cursor string, li if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/spindlelistMembersBy.go b/api/tangled/spindlelistMembersBy.go index b8fb86118..2eb60d375 100644 --- a/api/tangled/spindlelistMembersBy.go +++ b/api/tangled/spindlelistMembersBy.go @@ -18,14 +18,17 @@ const ( type SpindleListMembersBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*SpindleListMembers_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // SpindleListMembersBy calls the XRPC method "sh.tangled.spindle.listMembersBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose spindle-member authorings to list. -func SpindleListMembersBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*SpindleListMembersBy_Output, error) { +func SpindleListMembersBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*SpindleListMembersBy_Output, error) { var out SpindleListMembersBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func SpindleListMembersBy(ctx context.Context, c util.LexClient, cursor string, if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/spindlelistSpindles.go b/api/tangled/spindlelistSpindles.go index 5b8cbaaaf..6a52aee08 100644 --- a/api/tangled/spindlelistSpindles.go +++ b/api/tangled/spindlelistSpindles.go @@ -26,14 +26,17 @@ type SpindleListSpindles_ListItem struct { type SpindleListSpindles_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*SpindleListSpindles_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // SpindleListSpindles calls the XRPC method "sh.tangled.spindle.listSpindles". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Owner DID whose spindle records to list. -func SpindleListSpindles(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*SpindleListSpindles_Output, error) { +func SpindleListSpindles(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*SpindleListSpindles_Output, error) { var out SpindleListSpindles_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func SpindleListSpindles(ctx context.Context, c util.LexClient, cursor string, l if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/stringlistStrings.go b/api/tangled/stringlistStrings.go index 3f79d87e9..e623281ef 100644 --- a/api/tangled/stringlistStrings.go +++ b/api/tangled/stringlistStrings.go @@ -26,14 +26,17 @@ type StringListStrings_ListItem struct { type StringListStrings_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*StringListStrings_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // StringListStrings calls the XRPC method "sh.tangled.string.listStrings". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Scope identifier whose string records to list. -func StringListStrings(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*StringListStrings_Output, error) { +func StringListStrings(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*StringListStrings_Output, error) { var out StringListStrings_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func StringListStrings(ctx context.Context, c util.LexClient, cursor string, lim if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/temp2getDiff.go b/api/tangled/temp2getDiff.go new file mode 100644 index 000000000..760cb8331 --- /dev/null +++ b/api/tangled/temp2getDiff.go @@ -0,0 +1,36 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.git.temp2.getDiff + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitTemp2GetDiffNSID = "sh.tangled.git.temp2.getDiff" +) + +// GitTemp2GetDiff_Output is the output of a sh.tangled.git.temp2.getDiff call. +type GitTemp2GetDiff_Output struct { + Diffs []*GitDefs_FileDiff `json:"diffs" cborgen:"diffs"` +} + +// GitTemp2GetDiff calls the XRPC method "sh.tangled.git.temp2.getDiff". +func GitTemp2GetDiff(ctx context.Context, c util.LexClient, baseCommit string, baseRepo string, headCommit string, headRepo string) (*GitTemp2GetDiff_Output, error) { + var out GitTemp2GetDiff_Output + + params := map[string]interface{}{} + params["baseCommit"] = baseCommit + params["baseRepo"] = baseRepo + params["headCommit"] = headCommit + params["headRepo"] = headRepo + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.git.temp2.getDiff", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/temp2getInterdiff.go b/api/tangled/temp2getInterdiff.go new file mode 100644 index 000000000..9ff4c96cb --- /dev/null +++ b/api/tangled/temp2getInterdiff.go @@ -0,0 +1,38 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.git.temp2.getInterdiff + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitTemp2GetInterdiffNSID = "sh.tangled.git.temp2.getInterdiff" +) + +// GitTemp2GetInterdiff_Output is the output of a sh.tangled.git.temp2.getInterdiff call. +type GitTemp2GetInterdiff_Output struct { + Diffs []*GitDefs_FileDiff `json:"diffs" cborgen:"diffs"` +} + +// GitTemp2GetInterdiff calls the XRPC method "sh.tangled.git.temp2.getInterdiff". +func GitTemp2GetInterdiff(ctx context.Context, c util.LexClient, baseCommit1 string, baseCommit2 string, baseRepo string, headCommit1 string, headCommit2 string, headRepo string) (*GitTemp2GetInterdiff_Output, error) { + var out GitTemp2GetInterdiff_Output + + params := map[string]interface{}{} + params["baseCommit1"] = baseCommit1 + params["baseCommit2"] = baseCommit2 + params["baseRepo"] = baseRepo + params["headCommit1"] = headCommit1 + params["headCommit2"] = headCommit2 + params["headRepo"] = headRepo + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.git.temp2.getInterdiff", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/temp2listCommits.go b/api/tangled/temp2listCommits.go new file mode 100644 index 000000000..c95bd6c9b --- /dev/null +++ b/api/tangled/temp2listCommits.go @@ -0,0 +1,72 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.git.temp2.listCommits + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitTemp2ListCommitsNSID = "sh.tangled.git.temp2.listCommits" +) + +// GitTemp2ListCommits_Commit is a "commit" in the sh.tangled.git.temp2.listCommits schema. +type GitTemp2ListCommits_Commit struct { + Author *GitDefs_Signature `json:"author" cborgen:"author"` + Committer *GitDefs_Signature `json:"committer" cborgen:"committer"` + ExtraHeaders []*GitTemp2ListCommits_Header `json:"extraHeaders" cborgen:"extraHeaders"` + Message string `json:"message" cborgen:"message"` + Oid string `json:"oid" cborgen:"oid"` + Parents []string `json:"parents" cborgen:"parents"` + Tree string `json:"tree" cborgen:"tree"` +} + +// GitTemp2ListCommits_Header is a "header" in the sh.tangled.git.temp2.listCommits schema. +type GitTemp2ListCommits_Header struct { + Key string `json:"key" cborgen:"key"` + Value string `json:"value" cborgen:"value"` +} + +// GitTemp2ListCommits_Output is the output of a sh.tangled.git.temp2.listCommits call. +type GitTemp2ListCommits_Output struct { + Commits []*GitTemp2ListCommits_Commit `json:"commits" cborgen:"commits"` +} + +// GitTemp2ListCommits calls the XRPC method "sh.tangled.git.temp2.listCommits". +// +// limit: Maximum number of commits to return +// repo: DID of the repository +// skip: Number of matching commits to skip. A poor man's pagination. +func GitTemp2ListCommits(ctx context.Context, c util.LexClient, after string, allRefs bool, before string, limit int64, ranges []string, repo string, skip int64) (*GitTemp2ListCommits_Output, error) { + var out GitTemp2ListCommits_Output + + params := map[string]interface{}{} + if after != "" { + params["after"] = after + } + if allRefs { + params["allRefs"] = allRefs + } + if before != "" { + params["before"] = before + } + if limit != 0 { + params["limit"] = limit + } + if len(ranges) != 0 { + params["ranges"] = ranges + } + params["repo"] = repo + if skip != 0 { + params["skip"] = skip + } + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.git.temp2.listCommits", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/temp2mergeCheck.go b/api/tangled/temp2mergeCheck.go new file mode 100644 index 000000000..73fa54eb6 --- /dev/null +++ b/api/tangled/temp2mergeCheck.go @@ -0,0 +1,51 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.git.temp2.mergeCheck + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitTemp2MergeCheckNSID = "sh.tangled.git.temp2.mergeCheck" +) + +// GitTemp2MergeCheck_Conflict is a "conflict" in the sh.tangled.git.temp2.mergeCheck schema. +type GitTemp2MergeCheck_Conflict struct { + // filename: Path of the conflicted file + Filename string `json:"filename" cborgen:"filename"` + // reason: Short classification of the conflict + Reason string `json:"reason" cborgen:"reason"` +} + +// GitTemp2MergeCheck_Output is the output of a sh.tangled.git.temp2.mergeCheck call. +type GitTemp2MergeCheck_Output struct { + Conflicts []*GitTemp2MergeCheck_Conflict `json:"conflicts" cborgen:"conflicts"` + // isConflicted: Whether the merge has unresolved conflicts + IsConflicted bool `json:"isConflicted" cborgen:"isConflicted"` + // message: Additional detail, e.g. unrelated histories + Message *string `json:"message,omitempty" cborgen:"message,omitempty"` +} + +// GitTemp2MergeCheck calls the XRPC method "sh.tangled.git.temp2.mergeCheck". +// +// sourceCommit: Source commit to merge (theirs) +// targetCommit: Target branch tip to merge into (ours) +func GitTemp2MergeCheck(ctx context.Context, c util.LexClient, sourceCommit string, sourceRepo string, targetCommit string, targetRepo string) (*GitTemp2MergeCheck_Output, error) { + var out GitTemp2MergeCheck_Output + + params := map[string]interface{}{} + params["sourceCommit"] = sourceCommit + params["sourceRepo"] = sourceRepo + params["targetCommit"] = targetCommit + params["targetRepo"] = targetRepo + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.git.temp2.mergeCheck", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/cmd/cborgen/cborgen.go b/cmd/cborgen/cborgen.go index 4cbd5edc6..7c501a48a 100644 --- a/cmd/cborgen/cborgen.go +++ b/cmd/cborgen/cborgen.go @@ -2,6 +2,7 @@ package main import ( cbg "github.com/whyrusleeping/cbor-gen" + "tangled.org/core/api/org_tangled" "tangled.org/core/api/tangled" ) @@ -23,14 +24,13 @@ func main() { tangled.CiTrigger_Pair{}, tangled.CiTrigger_PullRequest{}, tangled.CiTrigger_Push{}, + tangled.EmbedCommit{}, tangled.FeedComment{}, tangled.FeedReaction{}, tangled.FeedStar{}, tangled.FeedStar_Repo{}, tangled.FeedStar_String{}, - tangled.FeedSubscription{}, - tangled.FeedSubscription_Uri{}, - tangled.FeedSubscription_Repo{}, + tangled.GitOid{}, tangled.GitRefUpdate{}, tangled.GitRefUpdate_CommitCountBreakdown{}, tangled.GitRefUpdate_IndividualEmailCommitCount{}, @@ -80,4 +80,14 @@ func main() { ); err != nil { panic(err) } + + if err := genCfg.WriteMapEncodersToFile( + "api/org_tangled/cbor_gen.go", + "org_tangled", + org_tangled.FeedSubscription{}, + org_tangled.FeedSubscription_Record{}, + org_tangled.FeedSubscription_Repo{}, + ); err != nil { + panic(err) + } } diff --git a/flake.nix b/flake.nix index e218e4865..b37cbf77d 100644 --- a/flake.nix +++ b/flake.nix @@ -648,7 +648,7 @@ program = (pkgs.writeShellApplication { name = "lexgen"; - runtimeInputs = [pkgs.stdenv.cc]; + runtimeInputs = [pkgs.stdenv.cc pkgs.gnused]; text = '' if ! command -v lexgen > /dev/null; then echo "error: must be executed from devshell" @@ -662,22 +662,22 @@ cd "$rootDir" # *_ext.go are hand-written extensions; never remove or mutate them - find api/tangled -maxdepth 1 -type f -not -name '*_ext.go' -delete + find api/tangled api/org_tangled -maxdepth 1 -type f -not -name '*_ext.go' -delete lexgen --build-file lexicon-build-config.json lexicons # disable type registration temporarily while running cborgen - find api/tangled -maxdepth 1 -name '*.go' -not -name '*_ext.go' -exec \ + find api/tangled api/org_tangled -maxdepth 1 -name '*.go' -not -name '*_ext.go' -exec \ sed -i.bak 's/\tutil/\/\/\tutil/' {} + # lexgen generates incomplete Marshaler/Unmarshaler for union types - find api/tangled -maxdepth 1 -name '*.go' -not -name '*_ext.go' -not -name "cbor_gen.go" -exec \ + find api/tangled api/org_tangled -maxdepth 1 -name '*.go' -not -name '*_ext.go' -not -name "cbor_gen.go" -exec \ sed -i '/^func.*\(MarshalCBOR\|UnmarshalCBOR\)/,/^}/ s/^/\/\/ /' {} + - for f in api/tangled/*_ext.go; do [ -e "''$f" ] && mv "''$f" "''$f.bak"; done - ${pkgs.gotools}/bin/goimports -w api/tangled/* + for f in api/tangled/*_ext.go api/org_tangled/*_ext.go; do [ -e "''$f" ] || continue; mv "''$f" "''$f.bak"; done + ${pkgs.gotools}/bin/goimports -w api/tangled/* api/org_tangled/* CGO_ENABLED=1 go run ./cmd/cborgen/ - for f in api/tangled/*_ext.go.bak; do [ -e "''$f" ] && mv "''$f" "''${f%.bak}"; done + for f in api/tangled/*_ext.go.bak api/org_tangled/*_ext.go.bak; do [ -e "''$f" ] || continue; mv "''$f" "''${f%.bak}"; done lexgen --build-file lexicon-build-config.json lexicons - rm api/tangled/*.bak + rm -f api/tangled/*.bak api/org_tangled/*.bak ''; }) + /bin/lexgen; diff --git a/lexicon-build-config.json b/lexicon-build-config.json index f0c905c42..8af0ae39f 100644 --- a/lexicon-build-config.json +++ b/lexicon-build-config.json @@ -13,10 +13,10 @@ "gen-server": true }, { - "package": "tangled", + "package": "org_tangled", "prefix": "org.tangled", - "outdir": "api/tangled", - "import": "tangled.org/core/api/tangled", + "outdir": "api/org_tangled", + "import": "tangled.org/core/api/org_tangled", "gen-server": true } ] diff --git a/lexicons/feed/subscription.json b/lexicons/feed/subscription.json index 6b7595da9..21856811b 100644 --- a/lexicons/feed/subscription.json +++ b/lexicons/feed/subscription.json @@ -14,14 +14,9 @@ "properties": { "subject": { "type": "union", - "refs": ["#uri", "#repo"], + "refs": ["#record", "#repo"], "closed": true }, - "collections": { - "type": "array", - "items": { "type": "string" }, - "description": "Optional collection NSIDs to filter which notifications are sent. Empty or absent means all collections." - }, "createdAt": { "type": "string", "format": "datetime" @@ -29,7 +24,7 @@ } } }, - "uri": { + "record": { "type": "object", "required": ["uri"], "properties": { -- knotmirror 0.0.1