Skip to content

Commit e64efdc

Browse files
Merge
1 parent 287808d commit e64efdc

15 files changed

+43
-103
lines changed

copyright.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{pkg.name}
2+
---
3+
{pkg.description}
4+
@version: v{pkg.version}
5+
@author: {pkg.author}
6+
@link: {pkg.homepage}
7+
@license: {pkg.license}

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,20 @@
3333
},
3434
"homepage": "https://github.com/shprink/wp-api-angular",
3535
"peerDependencies": {
36-
"@angular/core": "^4.0.0",
37-
"@angular/http": "^4.0.0"
36+
"@angular/core": "^4.4.6",
37+
"@angular/http": "^4.4.6"
3838
},
3939
"dependencies": {
40-
"@angular/common": "^4.0.0",
41-
"@angular/compiler": "^4.0.0",
42-
"@angular/platform-browser": "^4.0.0",
43-
"@angular/platform-browser-dynamic": "^4.0.0",
40+
"@angular/common": "^4.4.6",
41+
"@angular/compiler": "^4.4.6",
42+
"@angular/core": "^4.4.6",
43+
"@angular/http": "^4.4.6",
44+
"@angular/platform-browser": "^4.4.6",
45+
"@angular/platform-browser-dynamic": "^4.4.6",
4446
"rxjs": "^5.0.0"
4547
},
4648
"devDependencies": {
47-
"@angular/compiler-cli": "^4.0.0",
49+
"@angular/compiler-cli": "^4.4.6",
4850
"babel-core": "^6.10.4",
4951
"babel-loader": "^6.2.4",
5052
"core-js": "^2.4.0",

src/Auth.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,7 @@ import { WpApiParent } from './Parent';
1111

1212
import { WpApiLoader } from './Loaders';
1313

14-
export interface IWpApiAuth {
15-
auth(authCredentials: IAuthCredentials, options?: RequestOptionsArgs): Observable<Response>;
16-
credentials(options?: RequestOptionsArgs): Observable<Response>;
17-
}
18-
19-
export interface ICredentials {
20-
token?: string;
21-
email?: string;
22-
}
23-
24-
export interface IAuthCredentials {
25-
username: string;
26-
password: string;
27-
}
14+
import { IWpApiAuth, ICredentials, IAuthCredentials } from './interfaces';
2815

2916
@Injectable()
3017
export class WpApiAuth extends WpApiParent implements IWpApiAuth {

src/Comments.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@ import { WpApiParent } from './Parent';
1010

1111
import { WpApiLoader } from './Loaders';
1212

13-
export interface IWpApiComments {
14-
getList(options?: RequestOptionsArgs): Observable<Response>;
15-
get(commentId: number, options?: RequestOptionsArgs): Observable<Response>;
16-
create(body: any, options?: RequestOptionsArgs): Observable<Response>;
17-
update(commentId: number, body: any, options?: RequestOptionsArgs): Observable<Response>;
18-
delete(commentId: number, options?: RequestOptionsArgs): Observable<Response>;
19-
}
13+
import { IWpApiComments } from './interfaces';
2014

2115
@Injectable()
2216
export class WpApiComments extends WpApiParent implements IWpApiComments {

src/Custom.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@ import { WpApiParent } from './Parent';
1111

1212
import { WpApiLoader } from './Loaders';
1313

14-
export interface IWpApiCustom {
15-
getList(options?: RequestOptionsArgs): Observable<Response>;
16-
get(customId: number, options?: RequestOptionsArgs): Observable<Response>;
17-
create(body: any, options?: RequestOptionsArgs): Observable<Response>;
18-
update(customId: number, body: any, options?: RequestOptionsArgs): Observable<Response>;
19-
delete(customId: number, options?: RequestOptionsArgs): Observable<Response>;
20-
}
14+
import { IWpApiCustom } from './interfaces';
2115

2216
export class Custom extends WpApiParent implements IWpApiCustom {
2317
constructor(

src/Media.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@ import { WpApiParent } from './Parent';
1111

1212
import { WpApiLoader } from './Loaders';
1313

14-
export interface IWpApiMedia {
15-
getList(options?: RequestOptionsArgs): Observable<Response>;
16-
get(mediaId: number, options?: RequestOptionsArgs): Observable<Response>;
17-
create(body: any, options?: RequestOptionsArgs): Observable<Response>;
18-
update(mediaId: number, body: any, options?: RequestOptionsArgs): Observable<Response>;
19-
delete(mediaId: number, options?: RequestOptionsArgs): Observable<Response>;
20-
}
14+
import { IWpApiMedia } from './interfaces';
2115

2216
@Injectable()
2317
export class WpApiMedia extends WpApiParent implements IWpApiMedia {

src/Pages.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,7 @@ import { WpApiParent } from './Parent';
1111

1212
import { WpApiLoader } from './Loaders';
1313

14-
export interface IWpApiPages {
15-
getList(options?: RequestOptionsArgs): Observable<Response>;
16-
get(pageId: number, options?: RequestOptionsArgs): Observable<Response>;
17-
create(body: any, options?: RequestOptionsArgs): Observable<Response>;
18-
update(pageId: number, body: any, options?: RequestOptionsArgs): Observable<Response>;
19-
delete(pageId: number, options?: RequestOptionsArgs): Observable<Response>;
20-
getMetaList(pageId: number, options?: RequestOptionsArgs): Observable<Response>;
21-
getMeta(pageId: number, metaId: number, options?: RequestOptionsArgs): Observable<Response>;
22-
getRevisionList(pageId: number, options?: RequestOptionsArgs): Observable<Response>;
23-
getRevision(pageId: number, revisionId: number, options?: RequestOptionsArgs): Observable<Response>;
24-
}
14+
import { IWpApiPages } from './interfaces';
2515

2616
@Injectable()
2717
export class WpApiPages extends WpApiParent implements IWpApiPages {

src/Parent.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,8 @@ import { Response } from '@angular/http/src/static_response';
1010
import { WpApiLoader } from './Loaders';
1111
import { stripTrailingSlash } from './utils';
1212

13+
import { IParent } from './interfaces';
1314

14-
export interface IParent {
15-
httpGet(url: string, options?: RequestOptionsArgs): Observable<Response>;
16-
httpHead(url: string, options?: RequestOptionsArgs): Observable<Response>;
17-
httpDelete(url: string, options?: RequestOptionsArgs): Observable<Response>;
18-
httpPost(url: string, body: any, options?: RequestOptionsArgs): Observable<Response>;
19-
httpPut(url: string, body: any, options?: RequestOptionsArgs): Observable<Response>;
20-
httpPatch(url: string, body: any, options?: RequestOptionsArgs): Observable<Response>;
21-
}
2215

2316
@Injectable()
2417
export class WpApiParent implements IParent {

src/Posts.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,7 @@ import { WpApiParent } from './Parent';
1111

1212
import { WpApiLoader } from './Loaders';
1313

14-
export interface IWpApiPosts {
15-
getList(options?: RequestOptionsArgs): Observable<Response>;
16-
get(postId: number, options?: RequestOptionsArgs): Observable<Response>;
17-
create(body: any, options?: RequestOptionsArgs): Observable<Response>;
18-
update(postId: number, body: any, options?: RequestOptionsArgs): Observable<Response>;
19-
delete(postId: number, options?: RequestOptionsArgs): Observable<Response>;
20-
getMetaList(postId: number, options?: RequestOptionsArgs): Observable<Response>;
21-
getMeta(postId: number, metaId: number, options?: RequestOptionsArgs): Observable<Response>;
22-
getRevisionList(postId: number, options?: RequestOptionsArgs): Observable<Response>;
23-
getRevision(postId: number, revisionId: number, options?: RequestOptionsArgs): Observable<Response>;
24-
getCategoryList(postId: number, options?: RequestOptionsArgs): Observable<Response>;
25-
getCategory(postId: number, categoryId, options?: RequestOptionsArgs): Observable<Response>;
26-
getTagList(postId: number, options?: RequestOptionsArgs): Observable<Response>;
27-
getTag(postId: number, tagId, options?: RequestOptionsArgs): Observable<Response>;
28-
}
14+
import { IWpApiPosts } from './interfaces';
2915

3016
@Injectable()
3117
export class WpApiPosts extends WpApiParent implements IWpApiPosts {

src/Statuses.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ import { WpApiParent } from './Parent';
1111

1212
import { WpApiLoader } from './Loaders';
1313

14-
export interface IWpApiStatuses {
15-
getList(options?: RequestOptionsArgs): Observable<Response>;
16-
get(statusesName: string, options?: RequestOptionsArgs): Observable<Response>;
17-
}
14+
import { IWpApiStatuses } from './interfaces';
1815

1916
@Injectable()
2017
export class WpApiStatuses extends WpApiParent implements IWpApiStatuses {

src/Taxonomies.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ import { WpApiParent } from './Parent';
1111

1212
import { WpApiLoader } from './Loaders';
1313

14-
export interface IWpApiTaxonomies {
15-
getList(options?: RequestOptionsArgs): Observable<Response>;
16-
get(taxonomiesType: string, options?: RequestOptionsArgs): Observable<Response>;
17-
}
14+
import { IWpApiTaxonomies } from './interfaces';
1815

1916
@Injectable()
2017
export class WpApiTaxonomies extends WpApiParent implements IWpApiTaxonomies {

src/Terms.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@ import { WpApiParent } from './Parent';
1111

1212
import { WpApiLoader } from './Loaders';
1313

14-
export interface IWpApiTerms {
15-
getList(taxonomiesType: string, options?: RequestOptionsArgs): Observable<Response>;
16-
get(taxonomiesType: string, termId: number, options?: RequestOptionsArgs): Observable<Response>;
17-
create(taxonomiesType: string, body: any, options?: RequestOptionsArgs): Observable<Response>;
18-
update(taxonomiesType: string, termId: number, body: any, options?: RequestOptionsArgs): Observable<Response>;
19-
delete(taxonomiesType: string, termId: number, options?: RequestOptionsArgs): Observable<Response>;
20-
}
14+
import { IWpApiTerms } from './interfaces';
2115

2216
const defaultTaxoType = 'categories';
2317

src/Types.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ import { WpApiParent } from './Parent';
1111

1212
import { WpApiLoader } from './Loaders';
1313

14-
export interface IWpApiTypes {
15-
getList(options?: RequestOptionsArgs): Observable<Response>;
16-
get(postType: string, options?: RequestOptionsArgs): Observable<Response>;
17-
}
14+
import { IWpApiTypes } from './interfaces';
1815

1916
@Injectable()
2017
export class WpApiTypes extends WpApiParent implements IWpApiTypes {

src/Users.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,7 @@ import { WpApiParent } from './Parent';
1111

1212
import { WpApiLoader } from './Loaders';
1313

14-
export interface IWpApiUsers {
15-
getList(options?: RequestOptionsArgs): Observable<Response>;
16-
me(options?: RequestOptionsArgs): Observable<Response>;
17-
get(userId: number, options?: RequestOptionsArgs): Observable<Response>;
18-
create(body: any, options?: RequestOptionsArgs): Observable<Response>;
19-
update(userId: number, body: any, options?: RequestOptionsArgs): Observable<Response>;
20-
delete(userId: number, options?: RequestOptionsArgs): Observable<Response>;
21-
}
14+
import { IWpApiUsers } from './interfaces';
2215

2316
@Injectable()
2417
export class WpApiUsers extends WpApiParent implements IWpApiUsers {

src/interfaces.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,18 @@ export interface IWpApiCustom {
9595
update(customId: number, body: any, options?: RequestOptionsArgs): Observable<Response>;
9696
delete(customId: number, options?: RequestOptionsArgs): Observable<Response>;
9797
}
98+
99+
export interface ICredentials {
100+
token?: string;
101+
email?: string;
102+
}
103+
104+
export interface IAuthCredentials {
105+
username: string;
106+
password: string;
107+
}
108+
109+
export interface IWpApiAuth {
110+
auth(authCredentials: IAuthCredentials, options?: RequestOptionsArgs): Observable<Response>;
111+
credentials(options?: RequestOptionsArgs): Observable<Response>;
112+
}

0 commit comments

Comments
 (0)