1
0
mirror of https://github.com/writeas/go-writeas.git synced 2025-07-27 23:59:44 +00:00
Commit Graph

108 Commits

Author SHA1 Message Date
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
cffca70254 Add v2 warning in README 2018-09-24 11:41:04 -04:00
b88b7e4e51 Reflect breaking v2 changes in examples and tests 2018-09-24 11:40:22 -04:00
b7c23e245e Version 1, with a better README
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJbp/4UAAoJEJxM46J9Yqb7mYUP/RT3bfmwkYxQuo37eTpRICLh
 F4i+mTfVIpgZtxIp8q3TFQxaTYC4rVqT5Cpld4mFE3WDlSQvQW/CeWygLuVMA8v1
 ifd4iIruymw/avqauDcG1XUYQHksr0czFVE7PEvWLTvPznOLjgIOrnQOGAWoWx5P
 Pw3k0UU9bjiDd8+wjwfZDIBLrMcR3wtZwuiUWnqN+jKIaLUHM/GHr/qaD4j9xGK5
 /65/y1giDUoBYcIAt3xJzw3LkH15JXdkUsX3z5ZR4Z0ymbjC5Tatc2O0/PN4rQdP
 ZH/MzSbnTVX6BsgVr3DyvvcdtWndOa0xyvT97ZKtEz8Ca2O2Jo3A1vwFXddBqmqu
 649c3oza75wDWkI4NqW7Xb9+rWpvsYeHi46QQhxTM2PFjvQ91pL3csBGqhtTqlOv
 LMG/0UIed/vbGqEUw+XKRdeIG+mtxbhBO1mfqGlcq/6kkawBH8aUV/hHi+XwuO/M
 VFz9D1FSIZyu1DhAnsmBDz20UmbE5xBAEd57h/1dB2fkNY8f2GUuvqB5qVbTeuT/
 QxpW6Cg4SWWkdgc+Ytnh2YwTk5DYVcB/RARqnWDtLyWlQl00EJjzuDQdIKHxS2Rt
 DdA0CxQeh8RnuBD6nHUzJuFT/kEtwqvCm8jvNv1BrAoz0aiFiSwL2WBgqEyBXxCL
 Jcm/0UNbuyZ0GY0W+oz2
 =Mdk/
 -----END PGP SIGNATURE-----

Merge tag 'v1.1'

Version 1, with a better README
2018-09-23 16:57:29 -04:00
cf3c150ac9 Fix examples in README 2018-09-23 16:54:42 -04:00
50941b5d00 Use versioned library URL 2018-09-23 16:50:23 -04:00
2915667895 Rearrange status checks in UpdatePost 2018-09-22 23:23:02 +02:00
f8191a8ea4 Rearrange status checks in LogIn 2018-09-22 22:59:12 +02:00