Skip to content

Commit 1bedf7f

Browse files
authored
Merge pull request #6 from skyverge/ch63258/update-the-memberships-rest-api-documentation
2 parents 20e5e5d + 8ad5bc2 commit 1bedf7f

File tree

7 files changed

+57
-9
lines changed

7 files changed

+57
-9
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build/
2+
.github/

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM ruby:2.6-slim
2+
3+
WORKDIR /srv/docs
4+
5+
VOLUME /srv/docs/source
6+
EXPOSE 4567
7+
8+
COPY . /srv/docs
9+
10+
RUN apt-get update \
11+
&& apt-get install -y --no-install-recommends \
12+
build-essential \
13+
nodejs \
14+
&& gem install bundler \
15+
&& bundle install \
16+
&& apt-get remove -y build-essential \
17+
&& apt-get autoremove -y \
18+
&& rm -rf /var/lib/apt/lists/*
19+
20+
CMD ["bundle", "exec", "middleman", "server", "--watcher-force-polling"]

README.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,9 @@ You can contribute to this documentation by:
1515

1616
> Please **do not submit feature requests or support requests for the REST API** here. You can use the [WooIdeas board](http://ideas.woocommerce.com/forums/133476-woocommerce?category_id=125014) or [Contact SkyVerge support](https://www.skyverge.com/support/).
1717
18-
## Updating pages
19-
20-
This project uses [Slate](https://github.com/lord/slate) for building the documentation pages.
18+
## Running locally
2119

22-
Follow [Slate readme](https://github.com/lord/slate/blob/master/README.md) and [wiki](https://github.com/lord/slate/wiki) for instructions on how to edit files and make changes.
23-
24-
## Deploying an update
25-
26-
To install locally use:
20+
### Natively
2721

2822
```shell
2923
bundle install
@@ -37,7 +31,33 @@ Then, to test changes locally run:
3731
bundle exec middleman server
3832
```
3933

40-
Finally, after pushing changes and you are ready to deploy use the script:
34+
### Via Docker
35+
36+
1. Build the docker image:
37+
```shell
38+
docker build . -t docs
39+
```
40+
1. Start the image:
41+
```shell
42+
docker run -d --rm --name docs -p 4567:4567 -v $(pwd)/build:/srv/docs/build -v $(pwd)/source:/srv/docs/source docs
43+
```
44+
45+
You will be able to access your site at http://localhost:4567.
46+
47+
To build your sources while the container is running, run:
48+
```shell
49+
docker exec -it docs /bin/bash -c "bundle exec middleman build"
50+
```
51+
52+
## Updating pages
53+
54+
This project uses [Slate](https://github.com/lord/slate) for building the documentation pages.
55+
56+
Follow [Slate readme](https://github.com/lord/slate/blob/master/README.md) and [wiki](https://github.com/lord/slate/wiki) for instructions on how to edit files and make changes.
57+
58+
## Deploying an update
59+
60+
After pushing changes and you are ready to deploy use the script:
4161

4262
```shell
4363
bash deploy.sh

source/includes/_user_memberships.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Property | Type | Description
2828
`cancelled_date` | <code>datetime&#124;null</code> | The date (in Atom format) when the membership was cancelled, in the local timezone. This is `null` if the membership was not cancelled.
2929
`cancelled_date_gmt` | <code>datetime&#124;null</code> | The date (in Atom format) when the membership was cancelled, in UTC. This is `null` if the membership was not cancelled.
3030
`view_url` | <code>string</code> | _`read-only`_<br><br>URL pointing to the site's Members Area accessible to the membership's owner.
31+
`profile_fields` | <code>array&#124;object</code> | Holds any profile fields set on the membership. Each array item has a "slug" _`(string)`_ and a "value" (either a _`boolean`_, an _`integer`_, _`float`_, _`string`_, or _`array`_).
3132
`meta_data` | <code>array&#124;object</code> | Holds any WordPress meta data set on the membership. Each array item has an "id" _`(integer)`_, a "key" _`(string)`_ and a "value" (either a _`boolean`_, an _`integer`_, or _`string`_, which could also represent serialized data).
3233
`links` | <code>array</code> | _`read-only`_<br><br>An array of items linking to related objects accessible through the REST API.
3334

source/includes/user_memberships/_create.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ $woocommerce->post( 'memberships/members', $user_membership_data );
3535
"cancelled_date": null,
3636
"cancelled_date_gmt": null,
3737
"view_url": "http://skyverge.test/my-account/members-area/222/my-membership-content/",
38+
"profile_fields": [],
3839
"meta_data": [],
3940
"_links": {
4041
"self": [
@@ -78,5 +79,6 @@ Attribute | Type | Description
7879
`end_date_gmt` | <code>datetime</code> | _Optional_. The date when the membership will end, in UTC. If status is expired, defaults to the present time when the request is issued.
7980
`paused_date_gmt` | <code>datetime</code> | _Optional_. The date when the membership has been paused since, in UTC. If status is paused, defaults to the present time when the request is issued.
8081
`cancelled_date_gmt` | <code>datetime</code> | _Optional_. The date when the membership has been cancelled, in UTC. If status is cancelled, defaults to the present time when the request is issued.
82+
`profile_fields` | <code>array&#124;object</code> | _Optional_. Pass any profile fields to be set on the membership. Each array item has a "slug" _`(string)`_ and a "value" (either a _`boolean`_, an _`integer`_, _`float`_, _`string`_, or _`array`_).
8183
`meta_data` | <code>array</code> | _Optional_. Pass any WordPress post meta data to be set on the membership. Each array item has an "id" _`(integer)`_, a "key" _`(string)`_ and a "value" (either a _`boolean`_, an _`integer`_, or _`string`_, which could also represent serialized data).
8284

source/includes/user_memberships/_read.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ $woocommerce->get( 'memberships/members' );
3131
"cancelled_date": null,
3232
"cancelled_date_gmt": null,
3333
"view_url": "http://skyverge.test/my-account/members-area/10/my-membership-content/",
34+
"profile_fields": [],
3435
"meta_data": [],
3536
"_links": {
3637
"self": [
@@ -117,6 +118,7 @@ $woocommerce->get( 'memberships/members/<id>' );
117118
"cancelled_date": null,
118119
"cancelled_date_gmt": null,
119120
"view_url": "http://skyverge.test/my-account/members-area/10/my-membership-content/",
121+
"profile_fields": [],
120122
"meta_data": [],
121123
"_links": {
122124
"self": [

source/includes/user_memberships/_update.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ $woocommerce->put( 'memberships/members', $user_membership_data );
3434
"cancelled_date": null,
3535
"cancelled_date_gmt": null,
3636
"view_url": "http://skyverge.test/my-account/members-area/222/my-membership-content/",
37+
"profile_fields": [],
3738
"meta_data": [],
3839
"_links": {
3940
"self": [

0 commit comments

Comments
 (0)