Skip to content

Commit a48591f

Browse files
committed
adding comments and types
1 parent 5eaa3f0 commit a48591f

9 files changed

Lines changed: 243 additions & 58 deletions

File tree

README.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ bootstrap(App, [
4545
## API
4646

4747

48-
### IWpApiPosts
48+
### WpApiPosts
4949

5050
```
5151
getList(options?: RequestOptionsArgs): Observable<Response>;
@@ -63,18 +63,35 @@ bootstrap(App, [
6363
getTag(postId, tagId, options?: RequestOptionsArgs): Observable<Response>;
6464
```
6565

66-
### IWpApiPages
66+
### WpApiPages
6767

6868
```
6969
getList(options?: RequestOptionsArgs): Observable<Response>;
70-
get(postId, options?: RequestOptionsArgs): Observable<Response>;
70+
get(pageId: number, options?: RequestOptionsArgs): Observable<Response>;
7171
create(body: any, options?: RequestOptionsArgs): Observable<Response>;
72-
update(postId, body: any, options?: RequestOptionsArgs): Observable<Response>;
73-
delete(postId, options?: RequestOptionsArgs): Observable<Response>;
74-
getMetaList(postId, options?: RequestOptionsArgs): Observable<Response>;
75-
getMeta(postId, metaId, options?: RequestOptionsArgs): Observable<Response>;
76-
getRevisionList(postId, options?: RequestOptionsArgs): Observable<Response>;
77-
getRevision(postId, revisionId, options?: RequestOptionsArgs): Observable<Response>;
72+
update(pageId: number, body: any, options?: RequestOptionsArgs): Observable<Response>;
73+
delete(pageId: number, options?: RequestOptionsArgs): Observable<Response>;
74+
getMetaList(pageId: number, options?: RequestOptionsArgs): Observable<Response>;
75+
getMeta(pageId: number, metaId: number, options?: RequestOptionsArgs): Observable<Response>;
76+
getRevisionList(pageId: number, options?: RequestOptionsArgs): Observable<Response>;
77+
getRevision(pageId: number, revisionId: number, options?: RequestOptionsArgs): Observable<Response>;
78+
```
79+
80+
### WpApiComments
81+
82+
```
83+
getList(options?: RequestOptionsArgs): Observable<Response>;
84+
get(commentId: number, options?: RequestOptionsArgs): Observable<Response>;
85+
create(body: any, options?: RequestOptionsArgs): Observable<Response>;
86+
update(commentId: number, body: any, options?: RequestOptionsArgs): Observable<Response>;
87+
delete(commentId: number, options?: RequestOptionsArgs): Observable<Response>;
88+
```
89+
90+
### IWpApiTypes
91+
92+
```
93+
getList(options?: RequestOptionsArgs): Observable<Response>;
94+
get(postType: string, options?: RequestOptionsArgs): Observable<Response>;
7895
```
7996

8097
## Authentication

config.dist.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"getTagList": [2016],
1616
"getTag": [2016, 87]
1717
},
18-
"customMethods": {
18+
"wpApiCustom": {
1919
"movie": {
2020
"getList": [{
2121
"per_page": 1
@@ -39,43 +39,42 @@
3939
"getRevisionList": [535],
4040
"getRevision": [535, 2035]
4141
},
42-
"mediaMethods": {
42+
"wpApiMedia": {
4343
"getList": [{
4444
"per_page": 1
4545
}],
4646
"get": [2032]
4747
},
48-
"typesMethods": {
48+
"wpApiTypes": {
4949
"getList": [{
5050
"per_page": 1
5151
}],
5252
"get": ["attachment"]
5353
},
54-
"statusesMethods": {
54+
"wpApiStatuses": {
5555
"getList": [],
5656
"get": ["publish"]
5757
},
58-
"taxonomiesMethods": {
58+
"wpApiTaxonomies": {
5959
"getList": [],
6060
"get": ["category"]
6161
},
62-
"termsMethods": {
62+
"wpApiTerms": {
6363
"getCategoryList": [],
6464
"getCategory": [2],
6565
"getTagList": [],
6666
"getTag": [11],
6767
"getCustomList": ["audience"],
6868
"getCustom": ["audience", 6]
6969
},
70-
"usersMethods": {
70+
"wpApiUsers": {
7171
"getList": [],
7272
"get": [1],
7373
"me": []
7474
},
75-
"commentsMethods": {
75+
"wpApiComments": {
7676
"getList": [],
7777
"get": [686]
7878
}
7979
}
80-
8180
}

demo/app.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { Component } from '@angular/core';
22
import {
33
WpApiPosts,
4-
WpApiPages
4+
WpApiPages,
5+
WpApiComments,
6+
WpApiTypes
57
} from 'wp-api-angularjs';
68
let config = require('../config.json');
79

@@ -38,7 +40,9 @@ export class App {
3840
requests = [];
3941
constructor(
4042
private wpApiPosts: WpApiPosts,
41-
private wpApiPages: WpApiPages
43+
private wpApiPages: WpApiPages,
44+
private wpApiComments: WpApiComments,
45+
private wpApiTypes: WpApiTypes
4246
) {
4347
const serviceNames = Object.keys(config.api);
4448
for (let i = 0, len = serviceNames.length; i <= len; i++) {

dist/wp-api-angularjs.js

Lines changed: 121 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)