diff --git a/atproto/pdsclient/pdsclient.go b/atproto/pdsclient/pdsclient.go index 2199301..305ed55 100644 --- a/atproto/pdsclient/pdsclient.go +++ b/atproto/pdsclient/pdsclient.go @@ -13,7 +13,7 @@ import ( ) type PDSClient struct { - *client.APIClient + *atclient.APIClient AccountDID syntax.DID } @@ -63,7 +63,7 @@ type uploadBlobResp struct { func (pc *PDSClient) UploadBlob(ctx context.Context, mimeType string, input io.Reader) (*atdata.Blob, error) { endpoint := syntax.NSID("com.atproto.repo.uploadBlob") - req := client.NewAPIRequest(http.MethodPost, endpoint, input) + req := atclient.NewAPIRequest(http.MethodPost, endpoint, input) req.Headers.Set("Accept", "application/json") req.Headers.Set("Content-Type", mimeType) @@ -74,9 +74,9 @@ func (pc *PDSClient) UploadBlob(ctx context.Context, mimeType string, input io.R defer resp.Body.Close() if !(resp.StatusCode >= 200 && resp.StatusCode < 300) { - var eb client.ErrorBody + var eb atclient.ErrorBody if err := json.NewDecoder(resp.Body).Decode(&eb); err != nil { - return nil, &client.APIError{StatusCode: resp.StatusCode} + return nil, &atclient.APIError{StatusCode: resp.StatusCode} } return nil, eb.APIError(resp.StatusCode) } diff --git a/cmd/glot/publish.go b/cmd/glot/publish.go index dc4f885..8b411c1 100644 --- a/cmd/glot/publish.go +++ b/cmd/glot/publish.go @@ -78,7 +78,7 @@ func runPublish(ctx context.Context, cmd *cli.Command) error { cdir := identity.DefaultDirectory() // TODO: could defer actual login until later? - c, err := client.LoginWithPassword(ctx, cdir, *atid, pass, "", nil) + c, err := atclient.LoginWithPassword(ctx, cdir, *atid, pass, "", nil) if err != nil { return nil } @@ -214,7 +214,7 @@ func runPublish(ctx context.Context, cmd *cli.Command) error { return nil } -func publishSchema(ctx context.Context, c *client.APIClient, nsid syntax.NSID, schemaJSON json.RawMessage) error { +func publishSchema(ctx context.Context, c *atclient.APIClient, nsid syntax.NSID, schemaJSON json.RawMessage) error { d, err := atdata.UnmarshalJSON(schemaJSON) if err != nil { diff --git a/cmd/glot/pull.go b/cmd/glot/pull.go index 710e0db..a2b5e8c 100644 --- a/cmd/glot/pull.go +++ b/cmd/glot/pull.go @@ -154,7 +154,7 @@ func pullLexiconGroup(ctx context.Context, cmd *cli.Command, group string) error if err != nil { return err } - c := client.NewAPIClient(ident.PDSEndpoint()) + c := atclient.NewAPIClient(ident.PDSEndpoint()) cursor := "" for { diff --git a/cmd/glot/status.go b/cmd/glot/status.go index ff4460a..4f4fd9d 100644 --- a/cmd/glot/status.go +++ b/cmd/glot/status.go @@ -199,7 +199,7 @@ func fetchLexiconGroup(ctx context.Context, cmd *cli.Command, group string, remo if err != nil { return err } - c := client.NewAPIClient(ident.PDSEndpoint()) + c := atclient.NewAPIClient(ident.PDSEndpoint()) cursor := "" for { diff --git a/cmd/glot/unpublish.go b/cmd/glot/unpublish.go index fc333ec..cd86492 100644 --- a/cmd/glot/unpublish.go +++ b/cmd/glot/unpublish.go @@ -53,7 +53,7 @@ func runUnpublish(ctx context.Context, cmd *cli.Command) error { cdir := identity.DefaultDirectory() // TODO: could defer actual login until later? - c, err := client.LoginWithPassword(ctx, cdir, *atid, pass, "", nil) + c, err := atclient.LoginWithPassword(ctx, cdir, *atid, pass, "", nil) if err != nil { return nil } @@ -83,7 +83,7 @@ func runUnpublish(ctx context.Context, cmd *cli.Command) error { return nil } -func unpublishSchema(ctx context.Context, c *client.APIClient, nsid syntax.NSID) error { +func unpublishSchema(ctx context.Context, c *atclient.APIClient, nsid syntax.NSID) error { resp, err := comatproto.RepoDeleteRecord(ctx, c, &comatproto.RepoDeleteRecord_Input{ Collection: schemaNSID.String(), diff --git a/cmd/slinky/main.go b/cmd/slinky/main.go index f4229ba..3cf0625 100644 --- a/cmd/slinky/main.go +++ b/cmd/slinky/main.go @@ -80,7 +80,7 @@ func enumerateAccounts(cmd *cli.Command, collection syntax.NSID, tasks chan synt slog.Info("enumerating accounts", "collection", collection) defer close(tasks) - c := client.NewAPIClient(cmd.String("relay-host")) + c := atclient.NewAPIClient(cmd.String("relay-host")) c.Headers.Set("User-Agent", userAgent()) // TODO: robust HTTP client (retries, longer timeout)