Skip to content

Commit a4b9ebe

Browse files
committed
Upgrade to V2 secom client
1 parent 080f514 commit a4b9ebe

File tree

12 files changed

+351
-128
lines changed

12 files changed

+351
-128
lines changed

src/app/backend-api/secom/api.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ import { Configuration } from './configuration';
33
import { HttpClient } from '@angular/common/http';
44

55

6+
import { ServiceService } from './api/service.service';
67
import { SECOMService } from './api/sECOM.service';
78

89
@NgModule({
910
imports: [],
1011
declarations: [],
1112
exports: [],
1213
providers: [
14+
ServiceService,
1315
SECOMService ]
1416
})
1517
export class ApiModule {
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
export * from './service.service';
2+
import { ServiceService } from './service.service';
13
export * from './sECOM.service';
24
import { SECOMService } from './sECOM.service';
3-
export const APIS = [SECOMService];
5+
export const APIS = [ServiceService, SECOMService];

src/app/backend-api/secom/api/sECOM.service.ts

Lines changed: 277 additions & 19 deletions
Large diffs are not rendered by default.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
export * from './crs';
2+
export * from './defaultResponseObject';
3+
export * from './inlineResponse200';
4+
export * from './organization';
5+
export * from './properties';
16
export * from './searchFilterObject';
7+
export * from './searchMessageObject';
28
export * from './searchObjectResult';
39
export * from './searchParameters';
10+
export * from './searchResult';
11+
export * from './secomDataProductTypeEnum';
12+
export * from './updateServiceObject';
Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* MCP Service Registry (MSR) - SECOM Interfaces
3-
* Maritime Connectivity Platform Service Registry, developed by the MCC MSR WG
2+
* MSR Interface definitions
3+
* Compliant with IEC 63173-2:2025 SECOM version 2
44
*
5-
* OpenAPI spec version: 1.0
6-
* Contact: [email protected]
5+
* OpenAPI spec version: v2
6+
*
77
*
88
* NOTE: This class is auto generated by the swagger code generator program.
99
* https://github.com/swagger-api/swagger-codegen.git
@@ -15,5 +15,4 @@ export interface SearchFilterObject {
1515
query?: SearchParameters;
1616
geometry?: string;
1717
includeXml?: boolean;
18-
localOnly?: boolean;
1918
}
Lines changed: 19 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,34 @@
11
/**
2-
* MCP Service Registry (MSR) - SECOM Interfaces
3-
* Maritime Connectivity Platform Service Registry, developed by the MCC MSR WG
2+
* MSR Interface definitions
3+
* Compliant with IEC 63173-2:2025 SECOM version 2
44
*
5-
* OpenAPI spec version: 1.0
6-
* Contact: [email protected]
5+
* OpenAPI spec version: v2
6+
*
77
*
88
* NOTE: This class is auto generated by the swagger code generator program.
99
* https://github.com/swagger-api/swagger-codegen.git
1010
* Do not edit the class manually.
1111
*/
1212

1313
export interface SearchObjectResult {
14-
instanceId: string;
15-
version: string;
16-
name: string;
17-
status: string;
18-
description: string;
19-
dataProductType?: SearchObjectResult.DataProductTypeEnum;
20-
organizationId: string;
21-
endpointUri: string;
22-
endpointType: string;
14+
instanceId?: string;
15+
version?: string;
16+
name?: string;
17+
status?: string;
18+
description?: string;
19+
dataProductType?: string;
20+
organizationId?: string;
21+
endpointUri?: string;
22+
endpointType?: string;
2323
keywords?: Array<string>;
2424
unlocode?: Array<string>;
25+
implementsDesigns?: Array<string>;
26+
apiDoc?: string;
2527
instanceAsXml?: string;
26-
publishedAt?: Date;
27-
lastUpdatedAt?: Date;
28-
comment?: string;
2928
mmsi?: string;
3029
imo?: string;
31-
geometry?: any;
32-
}
33-
export namespace SearchObjectResult {
34-
export type DataProductTypeEnum = 'OTHER' | 'S57' | 'S101' | 'S102' | 'S104' | 'S111' | 'S122' | 'S123' | 'S124' | 'S125' | 'S126' | 'S127' | 'S128' | 'S129' | 'S131' | 'S210' | 'S211' | 'S212' | 'S401' | 'S402' | 'S411' | 'S412' | 'S413' | 'S414' | 'S421' | 'RTZ' | 'EPC';
35-
export const DataProductTypeEnum = {
36-
OTHER: 'OTHER' as DataProductTypeEnum,
37-
S57: 'S57' as DataProductTypeEnum,
38-
S101: 'S101' as DataProductTypeEnum,
39-
S102: 'S102' as DataProductTypeEnum,
40-
S104: 'S104' as DataProductTypeEnum,
41-
S111: 'S111' as DataProductTypeEnum,
42-
S122: 'S122' as DataProductTypeEnum,
43-
S123: 'S123' as DataProductTypeEnum,
44-
S124: 'S124' as DataProductTypeEnum,
45-
S125: 'S125' as DataProductTypeEnum,
46-
S126: 'S126' as DataProductTypeEnum,
47-
S127: 'S127' as DataProductTypeEnum,
48-
S128: 'S128' as DataProductTypeEnum,
49-
S129: 'S129' as DataProductTypeEnum,
50-
S131: 'S131' as DataProductTypeEnum,
51-
S210: 'S210' as DataProductTypeEnum,
52-
S211: 'S211' as DataProductTypeEnum,
53-
S212: 'S212' as DataProductTypeEnum,
54-
S401: 'S401' as DataProductTypeEnum,
55-
S402: 'S402' as DataProductTypeEnum,
56-
S411: 'S411' as DataProductTypeEnum,
57-
S412: 'S412' as DataProductTypeEnum,
58-
S413: 'S413' as DataProductTypeEnum,
59-
S414: 'S414' as DataProductTypeEnum,
60-
S421: 'S421' as DataProductTypeEnum,
61-
RTZ: 'RTZ' as DataProductTypeEnum,
62-
EPC: 'EPC' as DataProductTypeEnum
63-
};
30+
sourceMSRs?: Array<string>;
31+
unsupportedParams?: Array<string>;
32+
coverageArea?: Array<string>;
33+
certificates?: Array<string>;
6434
}
Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* MCP Service Registry (MSR) - SECOM Interfaces
3-
* Maritime Connectivity Platform Service Registry, developed by the MCC MSR WG
2+
* MSR Interface definitions
3+
* Compliant with IEC 63173-2:2025 SECOM version 2
44
*
5-
* OpenAPI spec version: 1.0
6-
* Contact: [email protected]
5+
* OpenAPI spec version: v2
6+
*
77
*
88
* NOTE: This class is auto generated by the swagger code generator program.
99
* https://github.com/swagger-api/swagger-codegen.git
@@ -14,48 +14,17 @@ export interface SearchParameters {
1414
name?: string;
1515
status?: string;
1616
version?: string;
17-
keywords?: string[];
17+
keywords?: Array<string>;
1818
description?: string;
19-
dataProductType?: SearchParameters.DataProductTypeEnum;
2019
specificationId?: string;
2120
designId?: string;
2221
instanceId?: string;
23-
organizationId?: string;
22+
organisationId?: string;
2423
mmsi?: string;
2524
imo?: string;
2625
serviceType?: string;
2726
unlocode?: string;
2827
endpointUri?: string;
29-
}
30-
export namespace SearchParameters {
31-
export type DataProductTypeEnum = 'OTHER' | 'S57' | 'S101' | 'S102' | 'S104' | 'S111' | 'S122' | 'S123' | 'S124' | 'S125' | 'S126' | 'S127' | 'S128' | 'S129' | 'S131' | 'S210' | 'S211' | 'S212' | 'S401' | 'S402' | 'S411' | 'S412' | 'S413' | 'S414' | 'S421' | 'RTZ' | 'EPC';
32-
export const DataProductTypeEnum = {
33-
OTHER: 'OTHER' as DataProductTypeEnum,
34-
S57: 'S57' as DataProductTypeEnum,
35-
S101: 'S101' as DataProductTypeEnum,
36-
S102: 'S102' as DataProductTypeEnum,
37-
S104: 'S104' as DataProductTypeEnum,
38-
S111: 'S111' as DataProductTypeEnum,
39-
S122: 'S122' as DataProductTypeEnum,
40-
S123: 'S123' as DataProductTypeEnum,
41-
S124: 'S124' as DataProductTypeEnum,
42-
S125: 'S125' as DataProductTypeEnum,
43-
S126: 'S126' as DataProductTypeEnum,
44-
S127: 'S127' as DataProductTypeEnum,
45-
S128: 'S128' as DataProductTypeEnum,
46-
S129: 'S129' as DataProductTypeEnum,
47-
S131: 'S131' as DataProductTypeEnum,
48-
S210: 'S210' as DataProductTypeEnum,
49-
S211: 'S211' as DataProductTypeEnum,
50-
S212: 'S212' as DataProductTypeEnum,
51-
S401: 'S401' as DataProductTypeEnum,
52-
S402: 'S402' as DataProductTypeEnum,
53-
S411: 'S411' as DataProductTypeEnum,
54-
S412: 'S412' as DataProductTypeEnum,
55-
S413: 'S413' as DataProductTypeEnum,
56-
S414: 'S414' as DataProductTypeEnum,
57-
S421: 'S421' as DataProductTypeEnum,
58-
RTZ: 'RTZ' as DataProductTypeEnum,
59-
EPC: 'EPC' as DataProductTypeEnum
60-
};
28+
dataProductType?: string;
29+
localOnly?: boolean;
6130
}
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
/**
2-
* MCP Service Registry (MSR) - SECOM Interfaces
3-
* Maritime Connectivity Platform Service Registry, developed by the MCC MSR WG
2+
* MSR Interface definitions
3+
* Compliant with IEC 63173-2:2025 SECOM version 2
44
*
5-
* OpenAPI spec version: 1.0
6-
* Contact: [email protected]
5+
* OpenAPI spec version: v2
6+
*
77
*
88
* NOTE: This class is auto generated by the swagger code generator program.
99
* https://github.com/swagger-api/swagger-codegen.git
1010
* Do not edit the class manually.
1111
*/
1212
import { SearchObjectResult } from './searchObjectResult';
1313

14-
export interface SearchResult {
15-
services: Array<SearchObjectResult>
14+
export interface SearchResult {
15+
transactionId: string;
16+
services?: Array<SearchObjectResult>;
1617
}

src/app/common/shared/item-manager.service.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class ItemManagerService {
4242
private xmlService: XmlControllerService,
4343
) { }
4444

45-
fetchListOfData = async (itemType: ItemType, orgMrn: string, pageNumber: number, elementsPerPage: number, secomSearchFilterobj?: SearchFilterObject): Promise<FetchedItems> => {
45+
fetchListOfData = async (itemType: ItemType, orgMrn: string, pageNumber: number, elementsPerPage: number, secomSearchFilterobj?: SearchFilterObject, xactId? : string): Promise<FetchedItems> => {
4646
let page;
4747

4848
if(itemType === ItemType.Instance) {
@@ -55,7 +55,16 @@ export class ItemManagerService {
5555

5656
} else if(itemType === ItemType.SearchObjectResult && secomSearchFilterobj) {
5757

58-
page = await firstValueFrom(this.secomService.search(secomSearchFilterobj, pageNumber, elementsPerPage, 'response'));
58+
page = await firstValueFrom(this.secomService.search(secomSearchFilterobj, 'response'));
59+
const totalElements = parseInt(page.headers.get('X-Total-Count')!) || 10;
60+
return { data: (page.body?.services! as SearchObjectResult[]).map(i => preprocess(i, itemType)),
61+
totalPages: Math.ceil( totalElements / elementsPerPage),
62+
totalElements};
63+
64+
// Case: we want to call retrievereults with xactId only
65+
} else if(itemType === ItemType.SearchObjectResult && xactId) {
66+
67+
page = await firstValueFrom(this.secomService.v2RetrieveResultsTransactionIdGet(xactId, 'response'));
5968
const totalElements = parseInt(page.headers.get('X-Total-Count')!) || 10;
6069
return { data: (page.body?.services! as SearchObjectResult[]).map(i => preprocess(i, itemType)),
6170
totalPages: Math.ceil( totalElements / elementsPerPage),

src/app/pages/list-view/list-view.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export class ListViewComponent {
125125
if (itemType === ItemType.Role) {
126126
return await this.itemManagerService.fetchAllRolesInOrg(this.orgMrn);
127127
}
128-
const fetchedItems = await this.itemManagerService.fetchListOfData(itemType, this.orgMrn, pageNumber, elementsPerPage, secomSearchParam);
128+
const fetchedItems = await this.itemManagerService.fetchListOfData(itemType, this.orgMrn, pageNumber, elementsPerPage, secomSearchParam, xactId);
129129
if (!fetchedItems) {
130130
return [];
131131
}

0 commit comments

Comments
 (0)