types: Remove temporary Service type in favour of actual compose class

Change-type: patch
Signed-off-by: Cameron Diver <cameron@resin.io>
This commit is contained in:
Cameron Diver 2018-09-21 10:33:59 +01:00
parent 892d227cc2
commit e8a5edf774
No known key found for this signature in database
GPG Key ID: 69264F9C923F55C1
5 changed files with 6 additions and 17 deletions

View File

@ -7,7 +7,7 @@ import Images = require('./compose/images');
import ServiceManager = require('./compose/service-manager');
import DB = require('./db');
import { Service } from './types/service';
import { Service } from './compose/service';
declare interface Options {
force?: boolean;

View File

@ -1,6 +1,6 @@
import { EventEmitter } from 'events';
import { Service } from '../types/service';
import { Service } from '../compose/service';
// FIXME: Unfinished definition for this class...
declare class ServiceManager extends EventEmitter {

View File

@ -1,5 +1,5 @@
import ApplicationManager from '../application-manager';
import { Service } from '../types/service';
import { Service } from '../compose/service';
export interface ServiceAction {
action: string;

View File

@ -3,8 +3,8 @@ import { Request, Response, Router } from 'express';
import * as _ from 'lodash';
import { ApplicationManager } from '../application-manager';
import { Service } from '../compose/service';
import { appNotFoundMessage, serviceNotFoundMessage } from '../lib/messages';
import Service from '../types/service';
import { doPurge, doRestart, serviceAction } from './common';
export function createV2Api(router: Router, applications: ApplicationManager) {
@ -32,13 +32,13 @@ export function createV2Api(router: Router, applications: ApplicationManager) {
return;
}
applications.setTargetVolatileForService(
service.imageId,
service.imageId!,
{ running: action !== 'stop' },
);
return applications.executeStepAction(
serviceAction(
action,
service.serviceId,
service.serviceId!,
service,
service,
{ wait: true },

View File

@ -1,11 +0,0 @@
export interface Service {
imageId: number;
serviceId: number;
appId: number;
status: string;
releaseId: number;
createdAt: Date;
serviceName: string;
}
export default Service;