this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add existing 'agnostic' helpers

+333
+28
api/agnostic/actorgetPreferences.go
··· 1 + // Copied from indigo:api/atproto/actorgetPreferences.go 2 + 3 + package agnostic 4 + 5 + // schema: app.bsky.actor.getPreferences 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ActorGetPreferences_Output is the output of a app.bsky.actor.getPreferences call. 14 + type ActorGetPreferences_Output struct { 15 + Preferences []map[string]any `json:"preferences" cborgen:"preferences"` 16 + } 17 + 18 + // ActorGetPreferences calls the XRPC method "app.bsky.actor.getPreferences". 19 + func ActorGetPreferences(ctx context.Context, c *xrpc.Client) (*ActorGetPreferences_Output, error) { 20 + var out ActorGetPreferences_Output 21 + 22 + params := map[string]interface{}{} 23 + if err := c.Do(ctx, xrpc.Query, "", "app.bsky.actor.getPreferences", params, nil, &out); err != nil { 24 + return nil, err 25 + } 26 + 27 + return &out, nil 28 + }
+25
api/agnostic/actorputPreferences.go
··· 1 + // Copied from indigo:api/atproto/actorputPreferences.go 2 + 3 + package agnostic 4 + 5 + // schema: app.bsky.actor.putPreferences 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // ActorPutPreferences_Input is the input argument to a app.bsky.actor.putPreferences call. 14 + type ActorPutPreferences_Input struct { 15 + Preferences []map[string]any `json:"preferences" cborgen:"preferences"` 16 + } 17 + 18 + // ActorPutPreferences calls the XRPC method "app.bsky.actor.putPreferences". 19 + func ActorPutPreferences(ctx context.Context, c *xrpc.Client, input *ActorPutPreferences_Input) error { 20 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "app.bsky.actor.putPreferences", nil, input, nil); err != nil { 21 + return err 22 + } 23 + 24 + return nil 25 + }
+23
api/agnostic/identitygetRecommendedDidCredentials.go
··· 1 + // Copied from indigo:api/atproto/identitygetRecommendedDidCredentials.go 2 + 3 + package agnostic 4 + 5 + // schema: com.atproto.identity.getRecommendedDidCredentials 6 + 7 + import ( 8 + "context" 9 + "encoding/json" 10 + 11 + "github.com/bluesky-social/indigo/xrpc" 12 + ) 13 + 14 + // IdentityGetRecommendedDidCredentials calls the XRPC method "com.atproto.identity.getRecommendedDidCredentials". 15 + func IdentityGetRecommendedDidCredentials(ctx context.Context, c *xrpc.Client) (*json.RawMessage, error) { 16 + var out json.RawMessage 17 + 18 + if err := c.Do(ctx, xrpc.Query, "", "com.atproto.identity.getRecommendedDidCredentials", nil, nil, &out); err != nil { 19 + return nil, err 20 + } 21 + 22 + return &out, nil 23 + }
+38
api/agnostic/identitysignPlcOperation.go
··· 1 + // Copied from indigo:api/atproto/identitysignPlcOperation.go 2 + 3 + package agnostic 4 + 5 + // schema: com.atproto.identity.signPlcOperation 6 + 7 + import ( 8 + "context" 9 + "encoding/json" 10 + 11 + "github.com/bluesky-social/indigo/xrpc" 12 + ) 13 + 14 + // IdentitySignPlcOperation_Input is the input argument to a com.atproto.identity.signPlcOperation call. 15 + type IdentitySignPlcOperation_Input struct { 16 + AlsoKnownAs []string `json:"alsoKnownAs,omitempty" cborgen:"alsoKnownAs,omitempty"` 17 + RotationKeys []string `json:"rotationKeys,omitempty" cborgen:"rotationKeys,omitempty"` 18 + Services *json.RawMessage `json:"services,omitempty" cborgen:"services,omitempty"` 19 + // token: A token received through com.atproto.identity.requestPlcOperationSignature 20 + Token *string `json:"token,omitempty" cborgen:"token,omitempty"` 21 + VerificationMethods *json.RawMessage `json:"verificationMethods,omitempty" cborgen:"verificationMethods,omitempty"` 22 + } 23 + 24 + // IdentitySignPlcOperation_Output is the output of a com.atproto.identity.signPlcOperation call. 25 + type IdentitySignPlcOperation_Output struct { 26 + // operation: A signed DID PLC operation. 27 + Operation *json.RawMessage `json:"operation" cborgen:"operation"` 28 + } 29 + 30 + // IdentitySignPlcOperation calls the XRPC method "com.atproto.identity.signPlcOperation". 31 + func IdentitySignPlcOperation(ctx context.Context, c *xrpc.Client, input *IdentitySignPlcOperation_Input) (*IdentitySignPlcOperation_Output, error) { 32 + var out IdentitySignPlcOperation_Output 33 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.identity.signPlcOperation", nil, input, &out); err != nil { 34 + return nil, err 35 + } 36 + 37 + return &out, nil 38 + }
+26
api/agnostic/identitysubmitPlcOperation.go
··· 1 + // Copied from indigo:api/atproto/identitysubmitPlcOperation.go 2 + 3 + package agnostic 4 + 5 + // schema: com.atproto.identity.submitPlcOperation 6 + 7 + import ( 8 + "context" 9 + "encoding/json" 10 + 11 + "github.com/bluesky-social/indigo/xrpc" 12 + ) 13 + 14 + // IdentitySubmitPlcOperation_Input is the input argument to a com.atproto.identity.submitPlcOperation call. 15 + type IdentitySubmitPlcOperation_Input struct { 16 + Operation *json.RawMessage `json:"operation" cborgen:"operation"` 17 + } 18 + 19 + // IdentitySubmitPlcOperation calls the XRPC method "com.atproto.identity.submitPlcOperation". 20 + func IdentitySubmitPlcOperation(ctx context.Context, c *xrpc.Client, input *IdentitySubmitPlcOperation_Input) error { 21 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.identity.submitPlcOperation", nil, input, nil); err != nil { 22 + return err 23 + } 24 + 25 + return nil 26 + }
+51
api/agnostic/repocreateRecord.go
··· 1 + // Copied from indigo:api/atproto/repocreateRecords.go 2 + 3 + package agnostic 4 + 5 + // schema: com.atproto.repo.createRecord 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // RepoDefs_CommitMeta is a "commitMeta" in the com.atproto.repo.defs schema. 14 + type RepoDefs_CommitMeta struct { 15 + Cid string `json:"cid" cborgen:"cid"` 16 + Rev string `json:"rev" cborgen:"rev"` 17 + } 18 + 19 + // RepoCreateRecord_Input is the input argument to a com.atproto.repo.createRecord call. 20 + type RepoCreateRecord_Input struct { 21 + // collection: The NSID of the record collection. 22 + Collection string `json:"collection" cborgen:"collection"` 23 + // record: The record itself. Must contain a $type field. 24 + Record map[string]any `json:"record" cborgen:"record"` 25 + // repo: The handle or DID of the repo (aka, current account). 26 + Repo string `json:"repo" cborgen:"repo"` 27 + // rkey: The Record Key. 28 + Rkey *string `json:"rkey,omitempty" cborgen:"rkey,omitempty"` 29 + // swapCommit: Compare and swap with the previous commit by CID. 30 + SwapCommit *string `json:"swapCommit,omitempty" cborgen:"swapCommit,omitempty"` 31 + // validate: Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons. 32 + Validate *bool `json:"validate,omitempty" cborgen:"validate,omitempty"` 33 + } 34 + 35 + // RepoCreateRecord_Output is the output of a com.atproto.repo.createRecord call. 36 + type RepoCreateRecord_Output struct { 37 + Cid string `json:"cid" cborgen:"cid"` 38 + Commit *RepoDefs_CommitMeta `json:"commit,omitempty" cborgen:"commit,omitempty"` 39 + Uri string `json:"uri" cborgen:"uri"` 40 + ValidationStatus *string `json:"validationStatus,omitempty" cborgen:"validationStatus,omitempty"` 41 + } 42 + 43 + // RepoCreateRecord calls the XRPC method "com.atproto.repo.createRecord". 44 + func RepoCreateRecord(ctx context.Context, c *xrpc.Client, input *RepoCreateRecord_Input) (*RepoCreateRecord_Output, error) { 45 + var out RepoCreateRecord_Output 46 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.repo.createRecord", nil, input, &out); err != nil { 47 + return nil, err 48 + } 49 + 50 + return &out, nil 51 + }
+42
api/agnostic/repogetRecord.go
··· 1 + // Copied from indigo:api/atproto/repolistRecords.go 2 + 3 + package agnostic 4 + 5 + // schema: com.atproto.repo.getRecord 6 + 7 + import ( 8 + "context" 9 + "encoding/json" 10 + 11 + "github.com/bluesky-social/indigo/xrpc" 12 + ) 13 + 14 + // RepoGetRecord_Output is the output of a com.atproto.repo.getRecord call. 15 + type RepoGetRecord_Output struct { 16 + Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"` 17 + Uri string `json:"uri" cborgen:"uri"` 18 + // NOTE: changed from lex decoder to json.RawMessage 19 + Value *json.RawMessage `json:"value" cborgen:"value"` 20 + } 21 + 22 + // RepoGetRecord calls the XRPC method "com.atproto.repo.getRecord". 23 + // 24 + // cid: The CID of the version of the record. If not specified, then return the most recent version. 25 + // collection: The NSID of the record collection. 26 + // repo: The handle or DID of the repo. 27 + // rkey: The Record Key. 28 + func RepoGetRecord(ctx context.Context, c *xrpc.Client, cid string, collection string, repo string, rkey string) (*RepoGetRecord_Output, error) { 29 + var out RepoGetRecord_Output 30 + 31 + params := map[string]interface{}{ 32 + "cid": cid, 33 + "collection": collection, 34 + "repo": repo, 35 + "rkey": rkey, 36 + } 37 + if err := c.Do(ctx, xrpc.Query, "", "com.atproto.repo.getRecord", params, nil, &out); err != nil { 38 + return nil, err 39 + } 40 + 41 + return &out, nil 42 + }
+53
api/agnostic/repolistRecords.go
··· 1 + // Copied from indigo:api/atproto/repolistRecords.go 2 + 3 + package agnostic 4 + 5 + // schema: com.atproto.repo.listRecords 6 + 7 + import ( 8 + "context" 9 + "encoding/json" 10 + 11 + "github.com/bluesky-social/indigo/xrpc" 12 + ) 13 + 14 + // RepoListRecords_Output is the output of a com.atproto.repo.listRecords call. 15 + type RepoListRecords_Output struct { 16 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 17 + Records []*RepoListRecords_Record `json:"records" cborgen:"records"` 18 + } 19 + 20 + // RepoListRecords_Record is a "record" in the com.atproto.repo.listRecords schema. 21 + type RepoListRecords_Record struct { 22 + Cid string `json:"cid" cborgen:"cid"` 23 + Uri string `json:"uri" cborgen:"uri"` 24 + // NOTE: changed from lex decoder to json.RawMessage 25 + Value *json.RawMessage `json:"value" cborgen:"value"` 26 + } 27 + 28 + // RepoListRecords calls the XRPC method "com.atproto.repo.listRecords". 29 + // 30 + // collection: The NSID of the record type. 31 + // limit: The number of records to return. 32 + // repo: The handle or DID of the repo. 33 + // reverse: Flag to reverse the order of the returned records. 34 + // rkeyEnd: DEPRECATED: The highest sort-ordered rkey to stop at (exclusive) 35 + // rkeyStart: DEPRECATED: The lowest sort-ordered rkey to start from (exclusive) 36 + func RepoListRecords(ctx context.Context, c *xrpc.Client, collection string, cursor string, limit int64, repo string, reverse bool, rkeyEnd string, rkeyStart string) (*RepoListRecords_Output, error) { 37 + var out RepoListRecords_Output 38 + 39 + params := map[string]interface{}{ 40 + "collection": collection, 41 + "cursor": cursor, 42 + "limit": limit, 43 + "repo": repo, 44 + "reverse": reverse, 45 + "rkeyEnd": rkeyEnd, 46 + "rkeyStart": rkeyStart, 47 + } 48 + if err := c.Do(ctx, xrpc.Query, "", "com.atproto.repo.listRecords", params, nil, &out); err != nil { 49 + return nil, err 50 + } 51 + 52 + return &out, nil 53 + }
+47
api/agnostic/repoputRecord.go
··· 1 + // Copied from indigo:api/atproto/repoputRecords.go 2 + 3 + package agnostic 4 + 5 + // schema: com.atproto.repo.putRecord 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // RepoPutRecord_Input is the input argument to a com.atproto.repo.putRecord call. 14 + type RepoPutRecord_Input struct { 15 + // collection: The NSID of the record collection. 16 + Collection string `json:"collection" cborgen:"collection"` 17 + // record: The record to write. 18 + Record map[string]any `json:"record" cborgen:"record"` 19 + // repo: The handle or DID of the repo (aka, current account). 20 + Repo string `json:"repo" cborgen:"repo"` 21 + // rkey: The Record Key. 22 + Rkey string `json:"rkey" cborgen:"rkey"` 23 + // swapCommit: Compare and swap with the previous commit by CID. 24 + SwapCommit *string `json:"swapCommit,omitempty" cborgen:"swapCommit,omitempty"` 25 + // swapRecord: Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation 26 + SwapRecord *string `json:"swapRecord" cborgen:"swapRecord"` 27 + // validate: Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons. 28 + Validate *bool `json:"validate,omitempty" cborgen:"validate,omitempty"` 29 + } 30 + 31 + // RepoPutRecord_Output is the output of a com.atproto.repo.putRecord call. 32 + type RepoPutRecord_Output struct { 33 + Cid string `json:"cid" cborgen:"cid"` 34 + Commit *RepoDefs_CommitMeta `json:"commit,omitempty" cborgen:"commit,omitempty"` 35 + Uri string `json:"uri" cborgen:"uri"` 36 + ValidationStatus *string `json:"validationStatus,omitempty" cborgen:"validationStatus,omitempty"` 37 + } 38 + 39 + // RepoPutRecord calls the XRPC method "com.atproto.repo.putRecord". 40 + func RepoPutRecord(ctx context.Context, c *xrpc.Client, input *RepoPutRecord_Input) (*RepoPutRecord_Output, error) { 41 + var out RepoPutRecord_Output 42 + if err := c.Do(ctx, xrpc.Procedure, "application/json", "com.atproto.repo.putRecord", nil, input, &out); err != nil { 43 + return nil, err 44 + } 45 + 46 + return &out, nil 47 + }