-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
971072e
commit aaa6aa2
Showing
70 changed files
with
3,882 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.DS_Store | ||
.history | ||
node_modules | ||
dist | ||
examples | ||
node_modules | ||
output |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Examples - TypeScript OpenApi/Swagger Generator | ||
|
||
- [Examples - TypeScript OpenApi/Swagger Generator](#examples---typescript-openapiswagger-generator) | ||
- [Generating Examples](#generating-examples) | ||
- [Passport Escape Room](#passport-escape-room) | ||
|
||
Here you can view some examples of Swagger -> converted files without pain! | ||
|
||
> Take in mind that those files can be modified and generated files can be removed for exampling purposes. | ||
You can also try to use `the original files` from each source or test with `your desired` OpenApi/Swagger file | ||
|
||
## Generating Examples | ||
|
||
> Example commands are run from **source code** instead `transform-swagger` command. | ||
### Passport Escape Room | ||
|
||
**OpenAPI URL:** [pasaporteescaperoom.com API](http://api.pasaporteescaperoom.com/swagger/) | ||
|
||
**Local file command:** | ||
```bash | ||
npm start -- -f examples/openApiFiles/passportescaperoom.com.json -o examples/generated/angular2 -t angular2 | ||
``` | ||
|
||
**Generate from url** | ||
```bash | ||
npm start -- -f http://api.pasaporteescaperoom.com/swagger/ -o examples/generated/angular2 -t angular2 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// THIS IS FILE IS AUTO-GENERATED | ||
// PLEASE, NOT MODIFY MANUALLY | ||
|
||
// Angular dependences | ||
import { Injectable } from '@angular/core'; | ||
import { Observable } from 'rxjs/Observable'; | ||
|
||
// Main dependences | ||
import { ApiBaseService } from '../../ApiBase/api-base.service'; | ||
|
||
// Models dependences | ||
import { LoginRequest } from '../models/login-request'; | ||
import { SocialLoginRequest } from '../models/social-login-request'; | ||
import { UserAuthResponse } from '../models/user-auth-response'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class AuthService { | ||
|
||
constructor( | ||
private apiService: ApiBaseService | ||
) { | ||
} | ||
|
||
/** | ||
* Retrieve login user info response | ||
*/ | ||
public getUserProfile( | ||
): Observable<UserAuthResponse> { | ||
return this.apiService.doGet( | ||
'/auth/profile', | ||
null, | ||
null | ||
); | ||
} | ||
|
||
/** | ||
* Login user endpoint | ||
*/ | ||
public login( | ||
requestBody: LoginRequest, | ||
): Observable<UserAuthResponse> { | ||
return this.apiService.doPost( | ||
'/auth/login', | ||
null, | ||
requestBody | ||
); | ||
} | ||
|
||
/** | ||
* Login with Social Networks | ||
*/ | ||
public socialLogin( | ||
requestBody: SocialLoginRequest, | ||
): Observable<UserAuthResponse> { | ||
return this.apiService.doPost( | ||
'/auth/social', | ||
null, | ||
requestBody | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// THIS IS FILE IS AUTO-GENERATED | ||
// PLEASE, NOT MODIFY MANUALLY | ||
|
||
// Angular dependences | ||
import { Injectable } from '@angular/core'; | ||
import { Observable } from 'rxjs/Observable'; | ||
|
||
// Main dependences | ||
import { ApiBaseService } from '../../ApiBase/api-base.service'; | ||
|
||
// Models dependences | ||
import { BookBookingRequest } from '../models/book-booking-request'; | ||
import { BookingRoomsDTO } from '../models/booking-rooms-dto'; | ||
import { CancelBookingRequest } from '../models/cancel-booking-request'; | ||
import { ListBookingRequest } from '../models/list-booking-request'; | ||
import { StatusBookingRequest } from '../models/status-booking-request'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class BookingManageService { | ||
|
||
constructor( | ||
private apiService: ApiBaseService | ||
) { | ||
} | ||
|
||
/** | ||
* Books a new Booking | ||
*/ | ||
public book( | ||
requestBody: BookBookingRequest, | ||
): Observable<BookingRoomsDTO> { | ||
return this.apiService.doPost( | ||
'/private/booking/manage/book', | ||
null, | ||
requestBody | ||
); | ||
} | ||
|
||
/** | ||
* Cancel a Booking | ||
*/ | ||
public cancel( | ||
requestBody: CancelBookingRequest, | ||
): Observable<BookingRoomsDTO> { | ||
return this.apiService.doPost( | ||
'/private/booking/manage/cancel', | ||
null, | ||
requestBody | ||
); | ||
} | ||
|
||
/** | ||
* List a Booking | ||
*/ | ||
public list( | ||
requestBody: ListBookingRequest, | ||
): Observable<BookingRoomsDTO> { | ||
return this.apiService.doPost( | ||
'/private/booking/manage/list', | ||
null, | ||
requestBody | ||
); | ||
} | ||
|
||
/** | ||
* Status of a Booking | ||
*/ | ||
public status( | ||
requestBody: StatusBookingRequest, | ||
): Observable<BookingRoomsDTO> { | ||
return this.apiService.doPost( | ||
'/private/booking/manage/status', | ||
null, | ||
requestBody | ||
); | ||
} | ||
|
||
} |
52 changes: 52 additions & 0 deletions
52
examples/generated/angular2/apis/BookingManageAvailability.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// THIS IS FILE IS AUTO-GENERATED | ||
// PLEASE, NOT MODIFY MANUALLY | ||
|
||
// Angular dependences | ||
import { Injectable } from '@angular/core'; | ||
import { Observable } from 'rxjs/Observable'; | ||
|
||
// Main dependences | ||
import { ApiBaseService } from '../../ApiBase/api-base.service'; | ||
|
||
// Models dependences | ||
import { ListDefaultBookingRequest } from '../models/list-default-booking-request'; | ||
import { RoomPriceSectionDTO } from '../models/room-price-section-dto'; | ||
import { SaveDefaultBookingRequest } from '../models/save-default-booking-request'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class BookingManageAvailabilityService { | ||
|
||
constructor( | ||
private apiService: ApiBaseService | ||
) { | ||
} | ||
|
||
/** | ||
* Default List of available rooms | ||
*/ | ||
public listDefault( | ||
requestBody: ListDefaultBookingRequest, | ||
): Observable<any> { | ||
return this.apiService.doPost( | ||
'/private/booking/manage/availability/listDefault', | ||
null, | ||
requestBody | ||
); | ||
} | ||
|
||
/** | ||
* Save the available rooms | ||
*/ | ||
public saveDefault( | ||
requestBody: SaveDefaultBookingRequest, | ||
): Observable<RoomPriceSectionDTO> { | ||
return this.apiService.doPost( | ||
'/private/booking/manage/availability/saveDefault', | ||
null, | ||
requestBody | ||
); | ||
} | ||
|
||
} |
66 changes: 66 additions & 0 deletions
66
examples/generated/angular2/apis/BookingManageDiscounts.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// THIS IS FILE IS AUTO-GENERATED | ||
// PLEASE, NOT MODIFY MANUALLY | ||
|
||
// Angular dependences | ||
import { Injectable } from '@angular/core'; | ||
import { Observable } from 'rxjs/Observable'; | ||
|
||
// Main dependences | ||
import { ApiBaseService } from '../../ApiBase/api-base.service'; | ||
|
||
// Models dependences | ||
import { BookingElementsWithDiscount } from '../models/booking-elements-with-discount'; | ||
import { CreateDiscountBookingRequest } from '../models/create-discount-booking-request'; | ||
import { GetDiscountBookingRequest } from '../models/get-discount-booking-request'; | ||
import { RemoveDiscountBookingRequest } from '../models/remove-discount-booking-request'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class BookingManageDiscountsService { | ||
|
||
constructor( | ||
private apiService: ApiBaseService | ||
) { | ||
} | ||
|
||
/** | ||
* Creates a new Discount | ||
*/ | ||
public create( | ||
requestBody: CreateDiscountBookingRequest, | ||
): Observable<void> { | ||
return this.apiService.doPost( | ||
'/private/booking/manage/discounts/create', | ||
null, | ||
requestBody | ||
); | ||
} | ||
|
||
/** | ||
* Gets Discounts | ||
*/ | ||
public getDiscount( | ||
requestBody: GetDiscountBookingRequest, | ||
): Observable<BookingElementsWithDiscount> { | ||
return this.apiService.doPost( | ||
'/private/booking/manage/discounts/', | ||
null, | ||
requestBody | ||
); | ||
} | ||
|
||
/** | ||
* Removes a Discount | ||
*/ | ||
public remove( | ||
requestBody: RemoveDiscountBookingRequest, | ||
): Observable<void> { | ||
return this.apiService.doPost( | ||
'/private/booking/manage/discounts/remove', | ||
null, | ||
requestBody | ||
); | ||
} | ||
|
||
} |
95 changes: 95 additions & 0 deletions
95
examples/generated/angular2/apis/BookingManageRoomPrices.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
// THIS IS FILE IS AUTO-GENERATED | ||
// PLEASE, NOT MODIFY MANUALLY | ||
|
||
// Angular dependences | ||
import { Injectable } from '@angular/core'; | ||
import { Observable } from 'rxjs/Observable'; | ||
|
||
// Main dependences | ||
import { ApiBaseService } from '../../ApiBase/api-base.service'; | ||
|
||
// Models dependences | ||
import { CreateSectionsBookingRequest } from '../models/create-sections-booking-request'; | ||
import { DeleteBookingRequest } from '../models/delete-booking-request'; | ||
import { GetSectionsBookingRequest } from '../models/get-sections-booking-request'; | ||
import { ListSectionsBookingRequest } from '../models/list-sections-booking-request'; | ||
import { RoomPriceSectionDTO } from '../models/room-price-section-dto'; | ||
import { RoomsPricesDTO } from '../models/rooms-prices-dto'; | ||
import { UpdateSectionsBookingRequest } from '../models/update-sections-booking-request'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class BookingManageRoomPricesService { | ||
|
||
constructor( | ||
private apiService: ApiBaseService | ||
) { | ||
} | ||
|
||
/** | ||
* List of room prices from Bookings | ||
*/ | ||
public create( | ||
requestBody: CreateSectionsBookingRequest, | ||
): Observable<RoomPriceSectionDTO> { | ||
return this.apiService.doPost( | ||
'/private/booking/manage/roomPrices/create', | ||
null, | ||
requestBody | ||
); | ||
} | ||
|
||
/** | ||
* Delete | ||
*/ | ||
public delete( | ||
requestBody: DeleteBookingRequest, | ||
): Observable<void> { | ||
return this.apiService.doPost( | ||
'/private/booking/manage/roomPrices/delete', | ||
null, | ||
requestBody | ||
); | ||
} | ||
|
||
/** | ||
* Get Sections | ||
*/ | ||
public getSection( | ||
requestBody: GetSectionsBookingRequest, | ||
): Observable<RoomPriceSectionDTO> { | ||
return this.apiService.doPost( | ||
'/private/booking/manage/roomPrices/', | ||
null, | ||
requestBody | ||
); | ||
} | ||
|
||
/** | ||
* List of room prices from Bookings | ||
*/ | ||
public listSection( | ||
requestBody: ListSectionsBookingRequest, | ||
): Observable<RoomsPricesDTO> { | ||
return this.apiService.doPost( | ||
'/private/booking/manage/roomPrices/listSection', | ||
null, | ||
requestBody | ||
); | ||
} | ||
|
||
/** | ||
* List of room prices from Bookings | ||
*/ | ||
public update( | ||
requestBody: UpdateSectionsBookingRequest, | ||
): Observable<void> { | ||
return this.apiService.doPost( | ||
'/private/booking/manage/roomPrices/update', | ||
null, | ||
requestBody | ||
); | ||
} | ||
|
||
} |
Oops, something went wrong.