From 408b95ec8b21dfb9b0a849e4c07bddd48cd14ad2 Mon Sep 17 00:00:00 2001 From: wing328 Date: Mon, 23 May 2016 16:54:36 +0800 Subject: [PATCH] add ci for typescript angular2 client --- .gitignore | 4 ++ pom.xml | 13 ++++ .../npm/.swagger-codegen-ignore | 23 +++++++ .../typescript-angular2/npm/README.md | 4 +- .../typescript-angular2/npm/api/PetApi.ts | 6 +- .../typescript-angular2/npm/api/UserApi.ts | 4 +- .../typescript-angular2/npm/api/api.ts | 8 +-- .../typescript-angular2/npm/model/Category.ts | 2 +- .../typescript-angular2/npm/model/Order.ts | 2 +- .../typescript-angular2/npm/model/Pet.ts | 2 +- .../typescript-angular2/npm/model/Tag.ts | 2 +- .../typescript-angular2/npm/model/User.ts | 2 +- .../typescript-angular2/npm/model/models.ts | 3 - .../typescript-angular2/npm/package.json | 11 +--- .../petstore/typescript-angular2/npm/pom.xml | 60 +++++++++++++++++++ 15 files changed, 117 insertions(+), 29 deletions(-) create mode 100644 samples/client/petstore/typescript-angular2/npm/.swagger-codegen-ignore create mode 100644 samples/client/petstore/typescript-angular2/npm/pom.xml diff --git a/.gitignore b/.gitignore index be288357f94..af366913c3b 100644 --- a/.gitignore +++ b/.gitignore @@ -121,4 +121,8 @@ samples/client/petstore/typescript-node/**/typings samples/client/petstore/typescript-angular/**/typings samples/client/petstore/typescript-fetch/**/dist/ samples/client/petstore/typescript-fetch/**/typings +samples/client/petstore/typescript-angular2/*/lib/ +samples/client/petstore/typescript-angular2/*/node_modules/ +samples/client/petstore/typescript-angular2/*/typings/ + diff --git a/pom.xml b/pom.xml index 4dfd8c6fdcd..724010cc776 100644 --- a/pom.xml +++ b/pom.xml @@ -510,6 +510,18 @@ samples/client/petstore/typescript-node/npm + + typescript-angular2-npm-client + + + env + java + + + + samples/client/petstore/typescript-angular2/npm + + ruby-client @@ -550,6 +562,7 @@ samples/client/petstore/ruby + samples/client/petstore/typescript-angular2/npm samples/client/petstore/typescript-angular samples/client/petstore/typescript-node/npm samples/client/petstore/android/volley diff --git a/samples/client/petstore/typescript-angular2/npm/.swagger-codegen-ignore b/samples/client/petstore/typescript-angular2/npm/.swagger-codegen-ignore new file mode 100644 index 00000000000..19d3377182e --- /dev/null +++ b/samples/client/petstore/typescript-angular2/npm/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# Thsi matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-angular2/npm/README.md b/samples/client/petstore/typescript-angular2/npm/README.md index 0fdbf4a4ded..64b2b8f520e 100644 --- a/samples/client/petstore/typescript-angular2/npm/README.md +++ b/samples/client/petstore/typescript-angular2/npm/README.md @@ -1,4 +1,4 @@ -## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201605120027 +## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201605231647 ### Building @@ -19,7 +19,7 @@ navigate to the folder of your consuming project and run one of next commando's. _published:_ ``` -npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201605120027 --save +npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201605231647 --save ``` _unPublished (not recommended):_ diff --git a/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts b/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts index a708d49e9f9..d26d19e2cb8 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/PetApi.ts @@ -73,7 +73,7 @@ export class PetApi { * Multiple status values can be provided with comma seperated strings * @param status Status values that need to be considered for filter */ - public findPetsByStatus (status?: models.Array, extraHttpRequestParams?: any ) : Observable> { + public findPetsByStatus (status?: Array, extraHttpRequestParams?: any ) : Observable> { const path = this.basePath + '/pet/findByStatus'; let queryParameters: any = ""; // This should probably be an object in the future @@ -97,7 +97,7 @@ export class PetApi { * Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by */ - public findPetsByTags (tags?: models.Array, extraHttpRequestParams?: any ) : Observable> { + public findPetsByTags (tags?: Array, extraHttpRequestParams?: any ) : Observable> { const path = this.basePath + '/pet/findByTags'; let queryParameters: any = ""; // This should probably be an object in the future @@ -205,7 +205,7 @@ export class PetApi { * @param additionalMetadata Additional data to pass to server * @param file file to upload */ - public uploadFile (petId: number, additionalMetadata?: string, file?: models.any, extraHttpRequestParams?: any ) : Observable<{}> { + public uploadFile (petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any ) : Observable<{}> { const path = this.basePath + '/pet/{petId}/uploadImage' .replace('{' + 'petId' + '}', String(petId)); diff --git a/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts b/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts index 04d2e8155d5..fe36f3dd6c3 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/UserApi.ts @@ -45,7 +45,7 @@ export class UserApi { * * @param body List of user object */ - public createUsersWithArrayInput (body?: models.Array, extraHttpRequestParams?: any ) : Observable<{}> { + public createUsersWithArrayInput (body?: Array, extraHttpRequestParams?: any ) : Observable<{}> { const path = this.basePath + '/user/createWithArray'; let queryParameters: any = ""; // This should probably be an object in the future @@ -66,7 +66,7 @@ export class UserApi { * * @param body List of user object */ - public createUsersWithListInput (body?: models.Array, extraHttpRequestParams?: any ) : Observable<{}> { + public createUsersWithListInput (body?: Array, extraHttpRequestParams?: any ) : Observable<{}> { const path = this.basePath + '/user/createWithList'; let queryParameters: any = ""; // This should probably be an object in the future diff --git a/samples/client/petstore/typescript-angular2/npm/api/api.ts b/samples/client/petstore/typescript-angular2/npm/api/api.ts index a7020497be6..056206bfaca 100644 --- a/samples/client/petstore/typescript-angular2/npm/api/api.ts +++ b/samples/client/petstore/typescript-angular2/npm/api/api.ts @@ -1,5 +1,3 @@ -export * from '../api/PetApi'; -export * from '../api/StoreApi'; -export * from '../api/UserApi'; - - +export * from './PetApi'; +export * from './StoreApi'; +export * from './UserApi'; diff --git a/samples/client/petstore/typescript-angular2/npm/model/Category.ts b/samples/client/petstore/typescript-angular2/npm/model/Category.ts index 3a9eb603184..e3080b62f97 100644 --- a/samples/client/petstore/typescript-angular2/npm/model/Category.ts +++ b/samples/client/petstore/typescript-angular2/npm/model/Category.ts @@ -2,9 +2,9 @@ import * as models from './models'; export interface Category { + id?: number; name?: string; } - diff --git a/samples/client/petstore/typescript-angular2/npm/model/Order.ts b/samples/client/petstore/typescript-angular2/npm/model/Order.ts index ed557b454d4..4507b05bb5b 100644 --- a/samples/client/petstore/typescript-angular2/npm/model/Order.ts +++ b/samples/client/petstore/typescript-angular2/npm/model/Order.ts @@ -2,6 +2,7 @@ import * as models from './models'; export interface Order { + id?: number; @@ -18,7 +19,6 @@ export interface Order { complete?: boolean; } - export namespace Order { export enum StatusEnum { diff --git a/samples/client/petstore/typescript-angular2/npm/model/Pet.ts b/samples/client/petstore/typescript-angular2/npm/model/Pet.ts index e1235c90052..1fbd617a35e 100644 --- a/samples/client/petstore/typescript-angular2/npm/model/Pet.ts +++ b/samples/client/petstore/typescript-angular2/npm/model/Pet.ts @@ -2,6 +2,7 @@ import * as models from './models'; export interface Pet { + id?: number; @@ -18,7 +19,6 @@ export interface Pet { */ status?: Pet.StatusEnum; } - export namespace Pet { export enum StatusEnum { diff --git a/samples/client/petstore/typescript-angular2/npm/model/Tag.ts b/samples/client/petstore/typescript-angular2/npm/model/Tag.ts index fba08175c1e..489e7b5d51a 100644 --- a/samples/client/petstore/typescript-angular2/npm/model/Tag.ts +++ b/samples/client/petstore/typescript-angular2/npm/model/Tag.ts @@ -2,9 +2,9 @@ import * as models from './models'; export interface Tag { + id?: number; name?: string; } - diff --git a/samples/client/petstore/typescript-angular2/npm/model/User.ts b/samples/client/petstore/typescript-angular2/npm/model/User.ts index 3f14a356307..40711a0f677 100644 --- a/samples/client/petstore/typescript-angular2/npm/model/User.ts +++ b/samples/client/petstore/typescript-angular2/npm/model/User.ts @@ -2,6 +2,7 @@ import * as models from './models'; export interface User { + id?: number; @@ -22,4 +23,3 @@ export interface User { */ userStatus?: number; } - diff --git a/samples/client/petstore/typescript-angular2/npm/model/models.ts b/samples/client/petstore/typescript-angular2/npm/model/models.ts index cd7700a649e..92dac02846c 100644 --- a/samples/client/petstore/typescript-angular2/npm/model/models.ts +++ b/samples/client/petstore/typescript-angular2/npm/model/models.ts @@ -3,6 +3,3 @@ export * from './Order'; export * from './Pet'; export * from './Tag'; export * from './User'; - - - diff --git a/samples/client/petstore/typescript-angular2/npm/package.json b/samples/client/petstore/typescript-angular2/npm/package.json index 8447881dafc..1b9c511138b 100644 --- a/samples/client/petstore/typescript-angular2/npm/package.json +++ b/samples/client/petstore/typescript-angular2/npm/package.json @@ -1,6 +1,6 @@ { "name": "@swagger/angular2-typescript-petstore", - "version": "0.0.1-SNAPSHOT.201605120027", + "version": "0.0.1-SNAPSHOT.201605231647", "description": "swagger client for @swagger/angular2-typescript-petstore", "author": "Swagger Codegen Contributors", "keywords": [ @@ -16,15 +16,8 @@ "build": "typings install && tsc" }, "peerDependencies": { - "@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" + "@angular/http": "^2.0.0-rc.1" }, "devDependencies": { "@angular/common": "^2.0.0-rc.1", diff --git a/samples/client/petstore/typescript-angular2/npm/pom.xml b/samples/client/petstore/typescript-angular2/npm/pom.xml new file mode 100644 index 00000000000..5844ba35616 --- /dev/null +++ b/samples/client/petstore/typescript-angular2/npm/pom.xml @@ -0,0 +1,60 @@ + + 4.0.0 + com.wordnik + TypeScriptAngular2NPMPestoreClientTests + pom + 1.0-SNAPSHOT + TS Angualr2 npm Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + npm-install + pre-integration-test + + exec + + + npm + + install + + + + + npm-run-build + integration-test + + exec + + + npm + + run + build + + + + + + + +