Skip to content

Commit

Permalink
refactor: HTSFA-771 - Remove the exercise flow component from the SDK (
Browse files Browse the repository at this point in the history
…#54)

* HTSFA-771

* update API
  • Loading branch information
bburgerHCAP authored Apr 25, 2024
1 parent 0a90bba commit c154594
Show file tree
Hide file tree
Showing 86 changed files with 599 additions and 7,161 deletions.
7 changes: 7 additions & 0 deletions projects/angular-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
<a name="6.3.0"></a>

# 6.3.0 (2024-04-23)

- Removed the exercise flow.
- Code cleanup.

<a name="6.2.1"></a>

# 6.2.1 (2024-04-18)
Expand Down
5 changes: 0 additions & 5 deletions projects/angular-sdk/assets/refundable-ticket.svg

This file was deleted.

2 changes: 1 addition & 1 deletion projects/angular-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hopper-cloud-airlines/angular-sdk",
"version": "6.2.1",
"version": "6.3.0",
"license": "Apache-2.0",
"author": {
"name": "HTS - Airlines Team",
Expand Down
7 changes: 1 addition & 6 deletions projects/angular-sdk/src/angular-sdk.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { TranslateModule } from '@ngx-translate/core';

import { CfarOfferBannerComponent } from './components/cfar-offer-banner/cfar-offer-banner.component';
import { CfarOfferDialogComponent } from './components/cfar-offer-dialog/cfar-offer-dialog.component';
import { CfarExerciseFlowComponent } from './components/cfar-exercise-flow/cfar-exercise-flow.component';

import {
MomentDateAdapter,
Expand Down Expand Up @@ -57,7 +56,6 @@ import { GlobalComponent } from './components/global.component';
import { HopperCfarService } from './services/hopper-cfar.service';
import { HopperEventsService } from './services/hopper-events.service';
import { GlobalEventComponent } from './components/global-event.component';
import { HopperErrorHandlerService } from './services/hopper-error-handler.service';
import { LoggerService } from './services/logger.service';

// Supported Languages for Datepicker
Expand All @@ -72,8 +70,7 @@ registerLocaleData(localeZh, 'zh', localeZhExtra);
GlobalEventComponent,
CfarOfferBannerComponent,
CfarOfferBannerLargeComponent,
CfarOfferDialogComponent,
CfarExerciseFlowComponent,
CfarOfferDialogComponent
],
imports: [
// Angular Module
Expand Down Expand Up @@ -107,7 +104,6 @@ registerLocaleData(localeZh, 'zh', localeZhExtra);
CfarOfferBannerComponent,
CfarOfferBannerLargeComponent,
CfarOfferDialogComponent,
CfarExerciseFlowComponent,
],
providers: [
{
Expand All @@ -116,7 +112,6 @@ registerLocaleData(localeZh, 'zh', localeZhExtra);
deps: [MAT_DATE_LOCALE],
},
{ provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS },
{ provide: ErrorHandler, useClass: HopperErrorHandlerService },
HopperCfarService,
HopperEventsService,
LoggerService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ import { NgModule, ModuleWithProviders, SkipSelf, Optional } from '@angular/core
import { Configuration } from './configuration';
import { HttpClient } from '@angular/common/http';

import { CustomerService } from './api/customer.service';

import { AnalyticsService } from './api/analytics.service';
import { CancelForAnyReasonCFARService } from './api/cancelForAnyReasonCFAR.service';

@NgModule({
imports: [],
declarations: [],
exports: [],
providers: [
CustomerService ]
AnalyticsService,
CancelForAnyReasonCFARService ]
})
export class ApiModule {
public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders<ApiModule> {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/**
* Airline API
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: v1.1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*//* tslint:disable:no-unused-variable member-ordering */

import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent } from '@angular/common/http';
import { CustomHttpUrlEncodingCodec } from '../encoder';

import { Observable } from 'rxjs';

import { BadRequest } from '../model/badRequest';
import { CfarEvent } from '../model/cfarEvent';
import { UnprocessableEntity } from '../model/unprocessableEntity';

import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';


@Injectable()
export class AnalyticsService {

protected basePath = '/airline/v1.1';
public defaultHeaders = new HttpHeaders();
public configuration = new Configuration();

constructor(protected httpClient: HttpClient, @Optional()@Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) {
if (basePath) {
this.basePath = basePath;
}
if (configuration) {
this.configuration = configuration;
this.basePath = basePath || configuration.basePath || this.basePath;
}
}

/**
* @param consumes string[] mime-types
* @return true: consumes contains 'multipart/form-data', false: otherwise
*/
private canConsumeForm(consumes: string[]): boolean {
const form = 'multipart/form-data';
for (const consume of consumes) {
if (form === consume) {
return true;
}
}
return false;
}


/**
* Send a Frontend Event
* Events can also be sent directly from a frontend running on end customer&#x27;s device using the session ID
* @param body
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public postCustomerEvents(body: CfarEvent, observe?: 'body', reportProgress?: boolean): Observable<any>;
public postCustomerEvents(body: CfarEvent, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public postCustomerEvents(body: CfarEvent, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public postCustomerEvents(body: CfarEvent, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

if (body === null || body === undefined) {
throw new Error('Required parameter body was null or undefined when calling postCustomerEvents.');
}

let headers = this.defaultHeaders;

// authentication (SessionAuth) required
if (this.configuration.apiKeys && this.configuration.apiKeys["HC-Session-ID"]) {
headers = headers.set('HC-Session-ID', this.configuration.apiKeys["HC-Session-ID"]);
}

// to determine the Accept header
let httpHeaderAccepts: string[] = [
'application/json'
];
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
if (httpHeaderAcceptSelected != undefined) {
headers = headers.set('Accept', httpHeaderAcceptSelected);
}

// to determine the Content-Type header
const consumes: string[] = [
'application/json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected != undefined) {
headers = headers.set('Content-Type', httpContentTypeSelected);
}

return this.httpClient.request<any>('post',`${this.basePath}/customer/events`,
{
body: body,
withCredentials: this.configuration.withCredentials,
headers: headers,
observe: observe,
reportProgress: reportProgress
}
);
}

}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export * from './customer.service';
import { CustomerService } from './customer.service';
export const APIS = [CustomerService];
export * from './analytics.service';
import { AnalyticsService } from './analytics.service';
export * from './cancelForAnyReasonCFAR.service';
import { CancelForAnyReasonCFARService } from './cancelForAnyReasonCFAR.service';
export const APIS = [AnalyticsService, CancelForAnyReasonCFARService];
Loading

0 comments on commit c154594

Please sign in to comment.