- return this.http.put(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/interfaceOperations', operationList)
- .map((res:Response) => {
- const interf = _.find(res.json().interfaces, (interf: any) => interf.type === operation.interfaceType);
- const newOperation = _.find(interf.operations, (op:OperationModel) => op.name === operation.name);
- return new OperationModel({
- ...newOperation,
- interfaceType: interf.type,
- interfaceId: interf.uniqueId
- });
- });
- }
-
- deleteInterfaceOperation(component:Component, operation:OperationModel):Observable<OperationModel> {
- return this.http.delete(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/interfaces/' + operation.interfaceId + '/operations/' + operation.uniqueId)
- .map((res:Response) => {
- return res.json();
- });
- }
-
- getInterfaceTypes(component:Component):Observable<{[id:string]: Array<string>}> {
- return this.http.get(this.baseUrl + 'interfaceLifecycleTypes')
- .map((res:Response) => {
- const interfaceMap = {};
- _.forEach(res.json(), (interf:any) => {
- interfaceMap[interf.toscaPresentation.type] = _.keys(interf.toscaPresentation.operations);
- });
- return interfaceMap;
+ return this.http.put<any>(this.baseUrl + component.getTypeUrl() + component.uniqueId + '/interfaceOperations', operationList)
+ .map((res: any) => {
+ const interf: InterfaceModel = _.find(res.interfaces, interf => interf.type === operation.interfaceType);
+ const newOperation: OperationModel = _.find(interf.operations, op => op.name === operation.name);
+ return new OperationModel({
+ ...newOperation,
+ interfaceType: interf.type,
+ interfaceId: interf.uniqueId,
+ artifactFileName: operation.artifactFileName