Merge pull request #2771 from taxpon/issue-2770

Update typescript-angular2 client to adapt to rc (#2770)
This commit is contained in:
wing328 2016-05-16 11:37:56 +08:00
commit f60bffe484
10 changed files with 69 additions and 36 deletions

View File

@ -1,7 +1,8 @@
import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from 'angular2/http'; import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from '@angular/http';
import {Injectable} from 'angular2/core'; import {Injectable, Optional} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {Observable} from 'rxjs/Observable';
import * as models from '../model/models'; import * as models from '../model/models';
import 'rxjs/Rx';
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
@ -18,7 +19,7 @@ export class {{classname}} {
protected basePath = '{{basePath}}'; protected basePath = '{{basePath}}';
public defaultHeaders : Headers = new Headers(); public defaultHeaders : Headers = new Headers();
constructor(protected http: Http, basePath: string) { constructor(protected http: Http, @Optional() basePath: string) {
if (basePath) { if (basePath) {
this.basePath = basePath; this.basePath = basePath;
} }

View File

@ -16,17 +16,30 @@
"build": "typings install && tsc" "build": "typings install && tsc"
}, },
"peerDependencies": { "peerDependencies": {
"angular2": "^2.0.0-beta.15", "@angular/common": "^2.0.0-rc.1",
"rxjs": "^5.0.0-beta.2" "@angular/compiler": "^2.0.0-rc.1",
"@angular/core": "^2.0.0-rc.1",
"@angular/http": "^2.0.0-rc.1",
"@angular/platform-browser": "^2.0.0-rc.1",
"@angular/platform-browser-dynamic": "^2.0.0-rc.1",
"core-js": "^2.3.0",
"rxjs": "^5.0.0-beta.6",
"zone.js": "^0.6.12"
}, },
"devDependencies": { "devDependencies": {
"@angular/common": "^2.0.0-rc.1",
"@angular/compiler": "^2.0.0-rc.1",
"@angular/core": "^2.0.0-rc.1",
"@angular/http": "^2.0.0-rc.1",
"@angular/platform-browser": "^2.0.0-rc.1",
"@angular/platform-browser-dynamic": "^2.0.0-rc.1",
"core-js": "^2.3.0",
"rxjs": "^5.0.0-beta.6",
"zone.js": "^0.6.12",
"typescript": "^1.8.10", "typescript": "^1.8.10",
"typings": "^0.8.1", "typings": "^0.8.1",
"angular2": "^2.0.0-beta.15",
"es6-shim": "^0.35.0", "es6-shim": "^0.35.0",
"es7-reflect-metadata": "^1.6.0", "es7-reflect-metadata": "^1.6.0"
"rxjs": "5.0.0-beta.2",
"zone.js": "^0.6.10"
}{{#npmRepository}}, }{{#npmRepository}},
"publishConfig":{ "publishConfig":{
"registry":"{{npmRepository}}" "registry":"{{npmRepository}}"

View File

@ -1,7 +1,8 @@
import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from 'angular2/http'; import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from '@angular/http';
import {Injectable} from 'angular2/core'; import {Injectable, Optional} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {Observable} from 'rxjs/Observable';
import * as models from '../model/models'; import * as models from '../model/models';
import 'rxjs/Rx';
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
@ -12,7 +13,7 @@ export class PetApi {
protected basePath = 'http://petstore.swagger.io/v2'; protected basePath = 'http://petstore.swagger.io/v2';
public defaultHeaders : Headers = new Headers(); public defaultHeaders : Headers = new Headers();
constructor(protected http: Http, basePath: string) { constructor(protected http: Http, @Optional() basePath: string) {
if (basePath) { if (basePath) {
this.basePath = basePath; this.basePath = basePath;
} }

View File

@ -1,7 +1,8 @@
import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from 'angular2/http'; import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from '@angular/http';
import {Injectable} from 'angular2/core'; import {Injectable, Optional} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {Observable} from 'rxjs/Observable';
import * as models from '../model/models'; import * as models from '../model/models';
import 'rxjs/Rx';
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
@ -12,7 +13,7 @@ export class StoreApi {
protected basePath = 'http://petstore.swagger.io/v2'; protected basePath = 'http://petstore.swagger.io/v2';
public defaultHeaders : Headers = new Headers(); public defaultHeaders : Headers = new Headers();
constructor(protected http: Http, basePath: string) { constructor(protected http: Http, @Optional() basePath: string) {
if (basePath) { if (basePath) {
this.basePath = basePath; this.basePath = basePath;
} }

View File

@ -1,7 +1,8 @@
import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from 'angular2/http'; import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from '@angular/http';
import {Injectable} from 'angular2/core'; import {Injectable, Optional} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {Observable} from 'rxjs/Observable';
import * as models from '../model/models'; import * as models from '../model/models';
import 'rxjs/Rx';
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
@ -12,7 +13,7 @@ export class UserApi {
protected basePath = 'http://petstore.swagger.io/v2'; protected basePath = 'http://petstore.swagger.io/v2';
public defaultHeaders : Headers = new Headers(); public defaultHeaders : Headers = new Headers();
constructor(protected http: Http, basePath: string) { constructor(protected http: Http, @Optional() basePath: string) {
if (basePath) { if (basePath) {
this.basePath = basePath; this.basePath = basePath;
} }

View File

@ -1,4 +1,4 @@
## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201604282253 ## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201605120027
### Building ### Building
@ -19,7 +19,7 @@ navigate to the folder of your consuming project and run one of next commando's.
_published:_ _published:_
``` ```
npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201604282253 --save npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201605120027 --save
``` ```
_unPublished (not recommended):_ _unPublished (not recommended):_

View File

@ -1,7 +1,8 @@
import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from 'angular2/http'; import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from '@angular/http';
import {Injectable} from 'angular2/core'; import {Injectable, Optional} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {Observable} from 'rxjs/Observable';
import * as models from '../model/models'; import * as models from '../model/models';
import 'rxjs/Rx';
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
@ -12,7 +13,7 @@ export class PetApi {
protected basePath = 'http://petstore.swagger.io/v2'; protected basePath = 'http://petstore.swagger.io/v2';
public defaultHeaders : Headers = new Headers(); public defaultHeaders : Headers = new Headers();
constructor(protected http: Http, basePath: string) { constructor(protected http: Http, @Optional() basePath: string) {
if (basePath) { if (basePath) {
this.basePath = basePath; this.basePath = basePath;
} }

View File

@ -1,7 +1,8 @@
import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from 'angular2/http'; import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from '@angular/http';
import {Injectable} from 'angular2/core'; import {Injectable, Optional} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {Observable} from 'rxjs/Observable';
import * as models from '../model/models'; import * as models from '../model/models';
import 'rxjs/Rx';
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
@ -12,7 +13,7 @@ export class StoreApi {
protected basePath = 'http://petstore.swagger.io/v2'; protected basePath = 'http://petstore.swagger.io/v2';
public defaultHeaders : Headers = new Headers(); public defaultHeaders : Headers = new Headers();
constructor(protected http: Http, basePath: string) { constructor(protected http: Http, @Optional() basePath: string) {
if (basePath) { if (basePath) {
this.basePath = basePath; this.basePath = basePath;
} }

View File

@ -1,7 +1,8 @@
import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from 'angular2/http'; import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from '@angular/http';
import {Injectable} from 'angular2/core'; import {Injectable, Optional} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {Observable} from 'rxjs/Observable';
import * as models from '../model/models'; import * as models from '../model/models';
import 'rxjs/Rx';
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
@ -12,7 +13,7 @@ export class UserApi {
protected basePath = 'http://petstore.swagger.io/v2'; protected basePath = 'http://petstore.swagger.io/v2';
public defaultHeaders : Headers = new Headers(); public defaultHeaders : Headers = new Headers();
constructor(protected http: Http, basePath: string) { constructor(protected http: Http, @Optional() basePath: string) {
if (basePath) { if (basePath) {
this.basePath = basePath; this.basePath = basePath;
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@swagger/angular2-typescript-petstore", "name": "@swagger/angular2-typescript-petstore",
"version": "0.0.1-SNAPSHOT.201604282253", "version": "0.0.1-SNAPSHOT.201605120027",
"description": "swagger client for @swagger/angular2-typescript-petstore", "description": "swagger client for @swagger/angular2-typescript-petstore",
"author": "Swagger Codegen Contributors", "author": "Swagger Codegen Contributors",
"keywords": [ "keywords": [
@ -16,17 +16,30 @@
"build": "typings install && tsc" "build": "typings install && tsc"
}, },
"peerDependencies": { "peerDependencies": {
"angular2": "^2.0.0-beta.15", "@angular/common": "^2.0.0-rc.1",
"rxjs": "^5.0.0-beta.2" "@angular/compiler": "^2.0.0-rc.1",
"@angular/core": "^2.0.0-rc.1",
"@angular/http": "^2.0.0-rc.1",
"@angular/platform-browser": "^2.0.0-rc.1",
"@angular/platform-browser-dynamic": "^2.0.0-rc.1",
"core-js": "^2.3.0",
"rxjs": "^5.0.0-beta.6",
"zone.js": "^0.6.12"
}, },
"devDependencies": { "devDependencies": {
"@angular/common": "^2.0.0-rc.1",
"@angular/compiler": "^2.0.0-rc.1",
"@angular/core": "^2.0.0-rc.1",
"@angular/http": "^2.0.0-rc.1",
"@angular/platform-browser": "^2.0.0-rc.1",
"@angular/platform-browser-dynamic": "^2.0.0-rc.1",
"core-js": "^2.3.0",
"rxjs": "^5.0.0-beta.6",
"zone.js": "^0.6.12",
"typescript": "^1.8.10", "typescript": "^1.8.10",
"typings": "^0.8.1", "typings": "^0.8.1",
"angular2": "^2.0.0-beta.15",
"es6-shim": "^0.35.0", "es6-shim": "^0.35.0",
"es7-reflect-metadata": "^1.6.0", "es7-reflect-metadata": "^1.6.0"
"rxjs": "5.0.0-beta.2",
"zone.js": "^0.6.10"
}, },
"publishConfig":{ "publishConfig":{
"registry":"https://skimdb.npmjs.com/registry" "registry":"https://skimdb.npmjs.com/registry"