1
0
mirror of https://github.com/writeas/go-writeas.git synced 2025-07-26 20:38:13 +00:00
Commit Graph

115 Commits

Author SHA1 Message Date
bbe9a57d56 Move to h12.io/socks library
Our Code.as site is periodically down, so this should cause fewer problems
2025-01-07 20:20:41 -05:00
a8d0bf8fa2 Update Onion site address 2023-03-16 14:27:46 -04:00
c692cb4988 Gracefully catch 401 error in Client.GetMe method 2023-03-16 14:26:19 -04:00
3bfdf5c4f2 Use /v2 path in README examples 2023-03-16 14:23:51 -04:00
5bac9f14f7 Link to V2 docs in README 2023-03-16 14:22:15 -04:00
a8ae32056c Add SetClient method 2021-11-26 18:46:56 -05:00
89c047d266 Support setting categories on posts 2021-11-26 18:39:20 -05:00
a22b52a231 Add Client.GetMe() method
This allows client to view authenticated user's information.
2021-11-15 10:30:35 -05:00
9d2c8e0dd4 Support setting application key on requests 2021-10-15 18:18:09 -04:00
3ef92c5819 Add basic organization structs 2021-10-15 15:57:25 -04:00
c00064f688 Support author parameter on posts 2021-10-15 15:55:59 -04:00
22e135ac8a Support creating an organization contributor
Ref T734
2021-10-14 13:47:34 -04:00
91e1f9124d Add Client.BaseURL() method
This allows applications to verify the environment they're interacting
with.
2021-10-13 14:19:35 -04:00
Matt Baer
155a236724
Merge pull request #23 from writeas/markdown
Support Markdown endpoint
2020-10-14 19:02:55 -04:00
8d0200bd5c Support Markdown endpoint 2020-10-14 19:00:49 -04:00
645de842c4 Add post types 2020-06-08 17:41:07 -04:00
b9117cab2c Update README now that v2 is merged 2019-08-15 13:47:20 -04:00
64c4bcf8fc Change version to 2
from 2-dev
2019-08-15 13:46:53 -04:00
b35223f930 Update developer.write.as -> developers.write.as 2019-08-15 13:46:30 -04:00
e6d5a2e79c Tweak "too many login reqs" error message
This explains what happened, instead of telling the user what to do.
2019-06-26 14:07:51 -04:00
ada6b850c1 Revert "Merge pull request #18 from writeas/include-coll"
This reverts commit 8463946e2d, reversing
changes made to 8cf5d50560.
2019-06-13 10:00:04 -04:00
Rob j Loranger
8463946e2d
Merge pull request #18 from writeas/include-coll
include collection and id in postparams
2019-06-12 19:41:32 -07:00
Rob Loranger
3e525f7a24
include collection and id in postparams
this changes the JSON tags to include both the ID and Collection
in PostParams. Both will be omitted when empty to maintain any unknown
backwards compatibility.
2019-06-11 19:42:54 -07:00
8cf5d50560 Merge branch 'v2' 2019-06-10 18:10:37 -04:00
Rob Loranger
064e8a36c8
do not exclude ID in OwnedPostParams 2019-06-10 14:14:38 -07:00
Rob Loranger
268710536d
use POST for claim posts endpoint 2019-06-10 12:51:20 -07:00
Rob Loranger
de8ce4dcd2
closes T589 update tests to use dev client
this changes tests to only use the dev client as all code is shared
between that and the write.as client, just the host changes.

also updated post tests to round trip and test over sub tests
2019-05-28 14:52:30 -07:00
Rob Loranger
7c3a6949d5
fixes failing tests
tests were failing on expected write.as blog title
previously the title was 'write.as' and it is now 'write.as blog'

also removed test case ExampleClient_GetCollection as was a duplicate of
TestGetCollection
2019-05-27 09:07:29 -07:00
Rob Loranger
a853522f69
adds GetCollectionPost
this adds a client method to retrieve a collection post along with basic
tests - phabricator task T588
2019-05-27 09:04:23 -07:00
8728275c31 Set User-Agent header instead of Adding it 2019-05-26 14:39:04 -04:00
Matt Baer
801952e0b5
Merge pull request #13 from abhinav/delete-collection
collection: Add support for deletion
2019-05-26 14:16:07 -04:00
7a2c93ae6d Revert "DeleteCollection: Make params a struct"
This reverts commit 1d34eede72.
2019-05-26 14:08:05 -04:00
Matt Baer
1a39cf8c38
Merge pull request #15 from SamWhited/support_modules_v2
Support modules
2019-05-26 09:04:06 -04:00
Matt Baer
68e987de6e
Merge pull request #12 from abhinav/goimports
style: Run goimports on everything
2019-05-21 14:04:02 -04:00
062df41a63 Add Slug, Created, and Updated to PostParams
for creating or updating posts.
2019-02-09 07:11:45 -05:00
d4fd65f9c0 Add Description to CollectionParams
for creating a new collection.
2019-02-09 07:10:47 -05:00
Matt Baer
ec51782fe3
Merge pull request #10 from SamWhited/support_modules
Support Go Modules
2019-01-14 09:09:01 -05:00
Sam Whited
3fb123eead Support Go Modules 2019-01-13 10:14:14 -06:00
Sam Whited
d577f3277f Support Go Modules 2019-01-13 10:10:40 -06:00
Abhinav Gupta
1d34eede72 DeleteCollection: Make params a struct
Rather than accepting a naked string, accept a DeleteCollectionParams
struct so that new optional parameters can be added in the future
without breaking the API.
2018-12-28 06:42:42 -08:00
Abhinav Gupta
f962e5052b collection: Add support for deletion
This adds support for deleting collections.

Resolves #1.
2018-12-27 23:53:03 -08:00
Abhinav Gupta
993ee50b3d style: Run goimports on everything
Similar to writeas/writeas-cli#22, this change runs goimports on all
files and changes the recommendation in the Contributing section to do
the same.
2018-12-25 09:27:00 -08:00
Matt Baer
68cbee8f4a
Merge pull request #9 from abhinav/v2
Add NewClientWith constructor
2018-12-16 18:51:56 -05:00
Abhinav Gupta
2ad70a7602 Add NewClientWith constructor
This adds a new constructor to build Clients which operates on a Config
struct rather than positional parameters. This will enable adding new
parameters in the future without breaking the API.

To begin with, this introduces a new URL parameter that wasn't
previously available. An example of another parameter that could be
added in the future is the timeout (to override the default timeout).

Existing constructors have been transitioned to the new one because it
implements a superset of their functionality.

Minor note: The Tor constructor wasn't respecting the default timeout
but with this version, it does.

Resolves #8
2018-12-16 13:44:29 -08:00
cbbd4ec209 Pass along edit token on post update
Fixes bug introduced when we moved `Token` into the func's parameters,
out of PostParams.
2018-10-08 20:21:37 -04:00
9f0a63ee86 Add Version constant 2018-10-08 20:15:30 -04:00
470dc287c6 Move update params in Update|DeletePost
Moves the ID and token params out of PostParams and into the func's
parameters. A currently-unused `collection` parameter is left in for the
future, when the backend supports updating and deleting collection posts
via slug, not post ID.
2018-10-08 20:03:22 -04:00
2564207297 Return actual error message when request fails 2018-09-25 12:28:25 -04:00
5d3a329a7a Rearrange status checks in CreatePost 2018-09-25 12:27:24 -04:00
ca804e86e2 Fix "problem {x}ing post" copy-pasted error messages
Previously, they all said the same thing
2018-09-25 12:11:25 -04:00