review app
This commit is contained in:
parent
4a35a3211f
commit
f525a76f6e
38 changed files with 268 additions and 229 deletions
BIN
.DS_Store
vendored
Normal file
BIN
.DS_Store
vendored
Normal file
Binary file not shown.
3
server/.gitignore
vendored
3
server/.gitignore
vendored
|
@ -7,4 +7,5 @@ coverage
|
||||||
package-lock.json
|
package-lock.json
|
||||||
.*.swp
|
.*.swp
|
||||||
build/
|
build/
|
||||||
model_create.ts
|
model_create.ts
|
||||||
|
public
|
|
@ -6,7 +6,7 @@ import { createServer } from "http";
|
||||||
import { SocketSubscriber } from "./socket_controller";
|
import { SocketSubscriber } from "./socket_controller";
|
||||||
import { dirname } from "path";
|
import { dirname } from "path";
|
||||||
import fileUpload from "express-fileupload";
|
import fileUpload from "express-fileupload";
|
||||||
import { SetLastActivePipelineToRealTimeServiceUseCase } from "../usecases/set_active_pipeline_to_realtime_service_usecase";
|
import { SetLastActivePipelineToRealTimeServiceScenario } from "../scenarios/set_active_pipeline_to_realtime_service_scenario";
|
||||||
import { CheckAndCreateStaticFilesFolderUseCase } from "../usecases/check_and_create_static_files_folder_usecase";
|
import { CheckAndCreateStaticFilesFolderUseCase } from "../usecases/check_and_create_static_files_folder_usecase";
|
||||||
import { DataBaseConnectUseCase } from "../usecases/database_connect_usecase";
|
import { DataBaseConnectUseCase } from "../usecases/database_connect_usecase";
|
||||||
|
|
||||||
|
@ -61,6 +61,7 @@ export class App {
|
||||||
this.app.use(express.json());
|
this.app.use(express.json());
|
||||||
this.app.use(express.urlencoded({ extended: true }));
|
this.app.use(express.urlencoded({ extended: true }));
|
||||||
this.app.use(express.static("public"));
|
this.app.use(express.static("public"));
|
||||||
|
|
||||||
this.app.use(
|
this.app.use(
|
||||||
fileUpload({
|
fileUpload({
|
||||||
createParentPath: true,
|
createParentPath: true,
|
||||||
|
@ -76,7 +77,7 @@ export class App {
|
||||||
async loadAppDependencies() {
|
async loadAppDependencies() {
|
||||||
await new DataBaseConnectUseCase().call();
|
await new DataBaseConnectUseCase().call();
|
||||||
await new CheckAndCreateStaticFilesFolderUseCase().call();
|
await new CheckAndCreateStaticFilesFolderUseCase().call();
|
||||||
await new SetLastActivePipelineToRealTimeServiceUseCase().call();
|
await new SetLastActivePipelineToRealTimeServiceScenario().call();
|
||||||
}
|
}
|
||||||
|
|
||||||
static staticFilesStoreDir = () => {
|
static staticFilesStoreDir = () => {
|
||||||
|
|
|
@ -12,7 +12,6 @@ declare global {
|
||||||
interface String {
|
interface String {
|
||||||
isEmpty(): boolean;
|
isEmpty(): boolean;
|
||||||
isNotEmpty(): boolean;
|
isNotEmpty(): boolean;
|
||||||
fixToPath(): string;
|
|
||||||
lastElement(): string;
|
lastElement(): string;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,16 +16,4 @@ export const StringExtensions = () => {
|
||||||
return this[this.length - 1];
|
return this[this.length - 1];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if ("".fixToPath === undefined) {
|
|
||||||
// eslint-disable-next-line no-extend-native
|
|
||||||
String.prototype.fixToPath = function () {
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
||||||
let result = this;
|
|
||||||
const symbolPath = "/";
|
|
||||||
if (this.lastElement != symbolPath) {
|
|
||||||
result = result.slice(0, -1);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
3
server/src/core/interfaces/file.ts
Normal file
3
server/src/core/interfaces/file.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export interface IFile extends File {
|
||||||
|
data: Buffer;
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
import { Trigger } from "../../features/triggers/trigger_model";
|
import { Trigger } from "../../features/triggers/models/trigger_database_model";
|
||||||
import { EXEC_TYPE } from "./exec_error_model";
|
import { EXEC_TYPE } from "./exec_error_model";
|
||||||
|
|
||||||
export interface IPipeline {
|
export interface IPipeline {
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
import { IProjectInstanceModel, ProjectInstanceDbModel } from "../../features/project_instance/project_instance_model";
|
import {
|
||||||
|
IProjectInstanceModel,
|
||||||
|
ProjectInstanceDbModel,
|
||||||
|
} from "../../features/project_instance/models/project_instance_database_model";
|
||||||
import { pipelineRealTimeService } from "../../features/realtime/realtime_presentation";
|
import { pipelineRealTimeService } from "../../features/realtime/realtime_presentation";
|
||||||
import { App } from "../controllers/app";
|
import { App } from "../controllers/app";
|
||||||
import { CreateFolderUseCase } from "./crete_folder_usecase";
|
import { CreateFolderUseCase } from "../usecases/crete_folder_usecase";
|
||||||
import { SearchDataBaseModelUseCase } from "./search_database_model_usecase";
|
import { SearchDataBaseModelUseCase } from "../usecases/search_database_model_usecase";
|
||||||
|
|
||||||
export class SetLastActivePipelineToRealTimeServiceUseCase {
|
export class SetLastActivePipelineToRealTimeServiceScenario {
|
||||||
call = async (): Promise<void> => {
|
call = async (): Promise<void> => {
|
||||||
const result = await new SearchDataBaseModelUseCase<IProjectInstanceModel>(ProjectInstanceDbModel).call({
|
const result = await new SearchDataBaseModelUseCase<IProjectInstanceModel>(ProjectInstanceDbModel).call({
|
||||||
isActive: true,
|
isActive: true,
|
|
@ -7,7 +7,7 @@ import { Result } from "../helper/result";
|
||||||
import { ExecutorResult } from "../model/executor_result";
|
import { ExecutorResult } from "../model/executor_result";
|
||||||
import { delay } from "../helper/delay";
|
import { delay } from "../helper/delay";
|
||||||
import { TriggerService } from "./trigger_service";
|
import { TriggerService } from "./trigger_service";
|
||||||
import { Trigger } from "../../features/triggers/trigger_model";
|
import { Trigger } from "../../features/triggers/models/trigger_database_model";
|
||||||
|
|
||||||
export interface Iteration {
|
export interface Iteration {
|
||||||
hashes: IHashesCache | null;
|
hashes: IHashesCache | null;
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { IHashesCache } from "./files_change_notifier_service";
|
||||||
import { EventsFileChanger } from "../model/meta_data_file_manager_model";
|
import { EventsFileChanger } from "../model/meta_data_file_manager_model";
|
||||||
import { Result } from "../helper/result";
|
import { Result } from "../helper/result";
|
||||||
import { TypedEvent } from "../helper/typed_event";
|
import { TypedEvent } from "../helper/typed_event";
|
||||||
import { Trigger, TriggerType } from "../../features/triggers/trigger_model";
|
import { Trigger, TriggerType } from "../../features/triggers/models/trigger_database_model";
|
||||||
|
|
||||||
export class TriggerCallResult {
|
export class TriggerCallResult {
|
||||||
results: Array<TriggerSuccessResult | TriggerErrorReport>;
|
results: Array<TriggerSuccessResult | TriggerErrorReport>;
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
import { Schema, model } from "mongoose";
|
||||||
|
import { IPipeline } from "../../../core/model/process_model";
|
||||||
|
import { schemaProcess } from "../../process/models/process_database_model";
|
||||||
|
import { triggerSchema } from "../../triggers/models/trigger_database_model";
|
||||||
|
|
||||||
|
export const PipelineSchema = new Schema({
|
||||||
|
process: {
|
||||||
|
type: Schema.Types.ObjectId,
|
||||||
|
ref: schemaProcess,
|
||||||
|
autopopulate: true,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
trigger: {
|
||||||
|
type: Schema.Types.ObjectId,
|
||||||
|
ref: triggerSchema,
|
||||||
|
autopopulate: true,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
stackGenerateType: {
|
||||||
|
type: String,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
}).plugin(require("mongoose-autopopulate"));
|
||||||
|
|
||||||
|
export const schemaPipeline = "Pipeline";
|
||||||
|
|
||||||
|
export const PipelineDBModel = model<IPipeline>(schemaPipeline, PipelineSchema);
|
21
server/src/features/pipelines/models/pipeline_model.ts
Normal file
21
server/src/features/pipelines/models/pipeline_model.ts
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
import { IsOptional, ValidateNested } from "class-validator";
|
||||||
|
import { IPipeline, IProcess, StackGenerateType } from "../../../core/model/process_model";
|
||||||
|
import { Type } from "class-transformer";
|
||||||
|
import { ProcessModel } from "../../process/models/process_validation_model";
|
||||||
|
import { TriggerModel } from "../../triggers/models/trigger_validation_model";
|
||||||
|
|
||||||
|
export class PipelineModel implements IPipeline {
|
||||||
|
@ValidateNested()
|
||||||
|
@Type(() => ProcessModel)
|
||||||
|
public process: IProcess;
|
||||||
|
|
||||||
|
@ValidateNested()
|
||||||
|
@Type(() => TriggerModel)
|
||||||
|
public trigger: TriggerModel;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public env = null;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public stackGenerateType: StackGenerateType;
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
import { IsMongoId, IsOptional } from "class-validator";
|
||||||
|
import { IProcess, StackGenerateType } from "../../../core/model/process_model";
|
||||||
|
import { TriggerModel } from "../../triggers/models/trigger_validation_model";
|
||||||
|
|
||||||
|
export class PipelineValidationModel {
|
||||||
|
@IsMongoId()
|
||||||
|
public process: IProcess;
|
||||||
|
|
||||||
|
@IsMongoId()
|
||||||
|
public trigger: TriggerModel;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public env = null;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public stackGenerateType: StackGenerateType;
|
||||||
|
}
|
|
@ -1,57 +0,0 @@
|
||||||
import { IsMongoId, IsOptional, ValidateNested } from "class-validator";
|
|
||||||
import { Schema, model } from "mongoose";
|
|
||||||
import { IPipeline, IProcess, StackGenerateType } from "../../core/model/process_model";
|
|
||||||
import { TriggerModel, triggerSchema } from "../triggers/trigger_model";
|
|
||||||
import { ProcessModel, schemaProcess } from "../process/process_model";
|
|
||||||
import { Type } from "class-transformer";
|
|
||||||
|
|
||||||
export const PipelineSchema = new Schema({
|
|
||||||
process: {
|
|
||||||
type: Schema.Types.ObjectId,
|
|
||||||
ref: schemaProcess,
|
|
||||||
autopopulate: true,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
trigger: {
|
|
||||||
type: Schema.Types.ObjectId,
|
|
||||||
ref: triggerSchema,
|
|
||||||
autopopulate: true,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
stackGenerateType: {
|
|
||||||
type: String,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
}).plugin(require("mongoose-autopopulate"));
|
|
||||||
|
|
||||||
export const schemaPipeline = "Pipeline";
|
|
||||||
|
|
||||||
export const PipelineDBModel = model<IPipeline>(schemaPipeline, PipelineSchema);
|
|
||||||
|
|
||||||
export class PipelineValidationModel {
|
|
||||||
@IsMongoId()
|
|
||||||
public process: IProcess;
|
|
||||||
|
|
||||||
@IsMongoId()
|
|
||||||
public trigger: TriggerModel;
|
|
||||||
|
|
||||||
@IsOptional()
|
|
||||||
public env = null;
|
|
||||||
|
|
||||||
@IsOptional()
|
|
||||||
public stackGenerateType: StackGenerateType;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class PipelineModel implements IPipeline {
|
|
||||||
@ValidateNested()
|
|
||||||
@Type(() => ProcessModel)
|
|
||||||
public process: IProcess;
|
|
||||||
|
|
||||||
@ValidateNested()
|
|
||||||
@Type(() => TriggerModel)
|
|
||||||
public trigger: TriggerModel;
|
|
||||||
@IsOptional()
|
|
||||||
public env = null;
|
|
||||||
@IsOptional()
|
|
||||||
public stackGenerateType: StackGenerateType;
|
|
||||||
}
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { CrudController } from "../../core/controllers/crud_controller";
|
import { CrudController } from "../../core/controllers/crud_controller";
|
||||||
import { PipelineDBModel, PipelineValidationModel } from "./pipeline_model";
|
import { PipelineDBModel } from "./models/pipeline_database_model";
|
||||||
|
import { PipelineValidationModel } from "./models/pipeline_validation_model";
|
||||||
|
|
||||||
export class PipelinePresentation extends CrudController<PipelineValidationModel, typeof PipelineDBModel> {
|
export class PipelinePresentation extends CrudController<PipelineValidationModel, typeof PipelineDBModel> {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
35
server/src/features/process/models/process_database_model.ts
Normal file
35
server/src/features/process/models/process_database_model.ts
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
import { Schema, model } from "mongoose";
|
||||||
|
import { IProcess } from "../../../core/model/process_model";
|
||||||
|
|
||||||
|
export const ProcessSchema = new Schema({
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
description: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
command: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
isGenerating: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
isLocaleCode: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
issueType: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
timeout: {
|
||||||
|
type: Number,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
commit: {
|
||||||
|
type: String,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export const schemaProcess = "Process";
|
||||||
|
|
||||||
|
export const ProcessDBModel = model<IProcess>(schemaProcess, ProcessSchema);
|
|
@ -0,0 +1,31 @@
|
||||||
|
import { IsBoolean, IsEnum, IsNumber, IsOptional, IsString } from "class-validator";
|
||||||
|
import { EXEC_TYPE } from "../../../core/model/exec_error_model";
|
||||||
|
import { IProcess, IssueType } from "../../../core/model/process_model";
|
||||||
|
|
||||||
|
export class ProcessModel implements IProcess {
|
||||||
|
@IsEnum(EXEC_TYPE)
|
||||||
|
public type: EXEC_TYPE;
|
||||||
|
|
||||||
|
@IsString()
|
||||||
|
public description: string;
|
||||||
|
|
||||||
|
@IsString()
|
||||||
|
public command: string;
|
||||||
|
|
||||||
|
@IsBoolean()
|
||||||
|
public isGenerating: boolean;
|
||||||
|
|
||||||
|
@IsBoolean()
|
||||||
|
public isLocaleCode: boolean;
|
||||||
|
|
||||||
|
@IsEnum(IssueType)
|
||||||
|
public issueType: IssueType;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
@IsNumber()
|
||||||
|
public timeout?: number;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
@IsString()
|
||||||
|
public commit?: string;
|
||||||
|
}
|
|
@ -1,65 +0,0 @@
|
||||||
import { IsString, IsOptional, IsEnum, IsNumber, IsBoolean } from "class-validator";
|
|
||||||
import { Schema, model } from "mongoose";
|
|
||||||
import { IProcess, IssueType } from "../../core/model/process_model";
|
|
||||||
import { EXEC_TYPE } from "../../core/model/exec_error_model";
|
|
||||||
|
|
||||||
export const ProcessSchema = new Schema({
|
|
||||||
type: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
description: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
command: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
isGenerating: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
isLocaleCode: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
issueType: {
|
|
||||||
type: String,
|
|
||||||
},
|
|
||||||
timeout: {
|
|
||||||
type: Number,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
commit: {
|
|
||||||
type: String,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export const schemaProcess = "Process";
|
|
||||||
|
|
||||||
export const ProcessDBModel = model<IProcess>(schemaProcess, ProcessSchema);
|
|
||||||
|
|
||||||
export class ProcessModel implements IProcess {
|
|
||||||
@IsEnum(EXEC_TYPE)
|
|
||||||
public type: EXEC_TYPE;
|
|
||||||
|
|
||||||
@IsString()
|
|
||||||
public description: string;
|
|
||||||
|
|
||||||
@IsString()
|
|
||||||
public command: string;
|
|
||||||
|
|
||||||
@IsBoolean()
|
|
||||||
public isGenerating: boolean;
|
|
||||||
|
|
||||||
@IsBoolean()
|
|
||||||
public isLocaleCode: boolean;
|
|
||||||
|
|
||||||
@IsEnum(IssueType)
|
|
||||||
public issueType: IssueType;
|
|
||||||
|
|
||||||
@IsOptional()
|
|
||||||
@IsNumber()
|
|
||||||
public timeout?: number;
|
|
||||||
|
|
||||||
@IsOptional()
|
|
||||||
@IsString()
|
|
||||||
public commit?: string;
|
|
||||||
}
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { CrudController } from "../../core/controllers/crud_controller";
|
import { CrudController } from "../../core/controllers/crud_controller";
|
||||||
import { ProcessDBModel, ProcessModel } from "./process_model";
|
import { ProcessDBModel } from "./models/process_database_model";
|
||||||
|
import { ProcessModel } from "./models/process_validation_model";
|
||||||
|
|
||||||
export class ProcessPresentation extends CrudController<ProcessModel, typeof ProcessDBModel> {
|
export class ProcessPresentation extends CrudController<ProcessModel, typeof ProcessDBModel> {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import { App } from "../../core/controllers/app";
|
import { App } from "../../../core/controllers/app";
|
||||||
import { Result } from "../../core/helper/result";
|
import { Result } from "../../../core/helper/result";
|
||||||
import { CreateDataBaseModelUseCase } from "../../core/usecases/create_database_model_usecase";
|
import { CreateDataBaseModelUseCase } from "../../../core/usecases/create_database_model_usecase";
|
||||||
import { CreateFolderUseCase } from "../../core/usecases/crete_folder_usecase";
|
import { CreateFolderUseCase } from "../../../core/usecases/crete_folder_usecase";
|
||||||
import { ProjectInstanceDbModel, ProjectInstanceValidationModel } from "./project_instance_model";
|
import { ProjectInstanceDbModel } from "../models/project_instance_database_model";
|
||||||
|
import { ProjectInstanceValidationModel } from "../models/project_instance_validation_model";
|
||||||
import { v4 as uuidv4 } from "uuid";
|
import { v4 as uuidv4 } from "uuid";
|
||||||
|
|
||||||
export class CreateNewProjectInstanceScenario {
|
export class CreateNewProjectInstanceScenario {
|
|
@ -1,15 +1,11 @@
|
||||||
import { App } from "../../core/controllers/app";
|
import { CallbackStrategyWithFileUpload, ResponseBase } from "../../../core/controllers/http_controller";
|
||||||
import { CallbackStrategyWithFileUpload, ResponseBase } from "../../core/controllers/http_controller";
|
import { Result } from "../../../core/helper/result";
|
||||||
import { Result } from "../../core/helper/result";
|
import { IFile } from "../../../core/interfaces/file";
|
||||||
import { CreateFileUseCase } from "../../core/usecases/create_file_usecase";
|
import { CreateFileUseCase } from "../../../core/usecases/create_file_usecase";
|
||||||
import { PipelineStatusUseCase } from "../realtime/usecases/pipeline_status_usecase";
|
import { PipelineStatusUseCase } from "../../realtime/domain/pipeline_status_usecase";
|
||||||
|
|
||||||
export interface IFile extends File {
|
|
||||||
data: Buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class UploadCadFileToProjectScenario extends CallbackStrategyWithFileUpload {
|
export class UploadCadFileToProjectScenario extends CallbackStrategyWithFileUpload {
|
||||||
checkingFileExpression: RegExp = RegExp(".pages");
|
checkingFileExpression: RegExp = RegExp(".FCStd");
|
||||||
|
|
||||||
async call(file: IFile): ResponseBase {
|
async call(file: IFile): ResponseBase {
|
||||||
const pipelineStatusUseCase = await new PipelineStatusUseCase().call();
|
const pipelineStatusUseCase = await new PipelineStatusUseCase().call();
|
||||||
|
@ -17,7 +13,6 @@ export class UploadCadFileToProjectScenario extends CallbackStrategyWithFileUplo
|
||||||
return pipelineStatusUseCase.forward();
|
return pipelineStatusUseCase.forward();
|
||||||
}
|
}
|
||||||
const projectFolder = pipelineStatusUseCase.value.path;
|
const projectFolder = pipelineStatusUseCase.value.path;
|
||||||
// TODO:
|
|
||||||
const createFileUseCase = await new CreateFileUseCase().call(projectFolder + file.name, file.data);
|
const createFileUseCase = await new CreateFileUseCase().call(projectFolder + file.name, file.data);
|
||||||
if (createFileUseCase.isFailure()) {
|
if (createFileUseCase.isFailure()) {
|
||||||
return createFileUseCase.forward();
|
return createFileUseCase.forward();
|
|
@ -1,6 +1,5 @@
|
||||||
import { Schema, model } from "mongoose";
|
import { Schema, model } from "mongoose";
|
||||||
import { IProjectModel, projectSchema } from "../projects/projects_model";
|
import { IProjectModel, projectSchema } from "../../projects/models/project_database_model";
|
||||||
import { IsMongoId, IsOptional, IsString } from "class-validator";
|
|
||||||
|
|
||||||
export interface IProjectInstanceModel {
|
export interface IProjectInstanceModel {
|
||||||
_id: string;
|
_id: string;
|
||||||
|
@ -32,12 +31,3 @@ export const ProjectInstanceSchema = new Schema({
|
||||||
export const schemaProjectInstance = "instance_project";
|
export const schemaProjectInstance = "instance_project";
|
||||||
|
|
||||||
export const ProjectInstanceDbModel = model<IProjectInstanceModel>(schemaProjectInstance, ProjectInstanceSchema);
|
export const ProjectInstanceDbModel = model<IProjectInstanceModel>(schemaProjectInstance, ProjectInstanceSchema);
|
||||||
|
|
||||||
export class ProjectInstanceValidationModel {
|
|
||||||
@IsMongoId()
|
|
||||||
public project: string;
|
|
||||||
@IsString()
|
|
||||||
public description: string;
|
|
||||||
@IsOptional()
|
|
||||||
public rootDir: string;
|
|
||||||
}
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
import { IsMongoId, IsOptional, IsString } from "class-validator";
|
||||||
|
|
||||||
|
export class ProjectInstanceValidationModel {
|
||||||
|
@IsMongoId()
|
||||||
|
public project: string;
|
||||||
|
|
||||||
|
@IsString()
|
||||||
|
public description: string;
|
||||||
|
|
||||||
|
@IsOptional()
|
||||||
|
public rootDir: string;
|
||||||
|
}
|
|
@ -1,7 +1,8 @@
|
||||||
import { CrudController } from "../../core/controllers/crud_controller";
|
import { CrudController } from "../../core/controllers/crud_controller";
|
||||||
import { CreateNewProjectInstanceScenario } from "./create_new_project_scenario";
|
import { CreateNewProjectInstanceScenario } from "./domain/create_new_project_scenario";
|
||||||
import { ProjectInstanceDbModel, ProjectInstanceValidationModel } from "./project_instance_model";
|
import { UploadCadFileToProjectScenario } from "./domain/upload_file_to_to_project_scenario";
|
||||||
import { UploadCadFileToProjectScenario } from "./upload_file_to_to_project_scenario";
|
import { ProjectInstanceDbModel } from "./models/project_instance_database_model";
|
||||||
|
import { ProjectInstanceValidationModel } from "./models/project_instance_validation_model";
|
||||||
|
|
||||||
export class ProjectInstancePresentation extends CrudController<
|
export class ProjectInstancePresentation extends CrudController<
|
||||||
ProjectInstanceValidationModel,
|
ProjectInstanceValidationModel,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { Schema, model } from "mongoose";
|
import { Schema, model } from "mongoose";
|
||||||
import { PipelineValidationModel, schemaPipeline } from "../pipelines/pipeline_model";
|
import { schemaPipeline } from "../../pipelines/models/pipeline_database_model";
|
||||||
import { IsArray, IsString } from "class-validator";
|
import { PipelineValidationModel } from "../../pipelines/models/pipeline_validation_model";
|
||||||
|
|
||||||
export interface IProjectModel {
|
export interface IProjectModel {
|
||||||
_id?: string;
|
_id?: string;
|
||||||
|
@ -29,10 +29,3 @@ export const ProjectSchema = new Schema({
|
||||||
export const projectSchema = "Projects";
|
export const projectSchema = "Projects";
|
||||||
|
|
||||||
export const ProjectDBModel = model<IProjectModel>(projectSchema, ProjectSchema);
|
export const ProjectDBModel = model<IProjectModel>(projectSchema, ProjectSchema);
|
||||||
|
|
||||||
export class ProjectValidationModel {
|
|
||||||
@IsArray()
|
|
||||||
public pipelines: [string];
|
|
||||||
@IsString()
|
|
||||||
public description: string;
|
|
||||||
}
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
import { IsArray, IsString } from "class-validator";
|
||||||
|
|
||||||
|
export class ProjectValidationModel {
|
||||||
|
@IsArray()
|
||||||
|
public pipelines: [string];
|
||||||
|
|
||||||
|
@IsString()
|
||||||
|
public description: string;
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
import { CrudController } from "../../core/controllers/crud_controller";
|
import { CrudController } from "../../core/controllers/crud_controller";
|
||||||
import { ProjectDBModel, ProjectValidationModel } from "./projects_model";
|
import { ProjectDBModel } from "./models/project_database_model";
|
||||||
|
import { ProjectValidationModel } from "./models/project_validation_model";
|
||||||
|
|
||||||
export class ProjectsPresentation extends CrudController<ProjectValidationModel, typeof ProjectDBModel> {
|
export class ProjectsPresentation extends CrudController<ProjectValidationModel, typeof ProjectDBModel> {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -2,7 +2,10 @@ import { App } from "../../../core/controllers/app";
|
||||||
import { Result } from "../../../core/helper/result";
|
import { Result } from "../../../core/helper/result";
|
||||||
import { ReadByIdDataBaseModelUseCase } from "../../../core/usecases/read_by_id_database_model_usecase";
|
import { ReadByIdDataBaseModelUseCase } from "../../../core/usecases/read_by_id_database_model_usecase";
|
||||||
import { UpdateDataBaseModelUseCase } from "../../../core/usecases/update_database_model_usecase";
|
import { UpdateDataBaseModelUseCase } from "../../../core/usecases/update_database_model_usecase";
|
||||||
import { IProjectInstanceModel, ProjectInstanceDbModel } from "../../project_instance/project_instance_model";
|
import {
|
||||||
|
IProjectInstanceModel,
|
||||||
|
ProjectInstanceDbModel,
|
||||||
|
} from "../../project_instance/models/project_instance_database_model";
|
||||||
import { RealTimeValidationModel, pipelineRealTimeService } from "../realtime_presentation";
|
import { RealTimeValidationModel, pipelineRealTimeService } from "../realtime_presentation";
|
||||||
|
|
||||||
export class RunInstancePipelineUseCase {
|
export class RunInstancePipelineUseCase {
|
|
@ -1,8 +1,8 @@
|
||||||
import { IsString } from "class-validator";
|
import { IsString } from "class-validator";
|
||||||
import { CoreHttpController } from "../../core/controllers/http_controller";
|
import { CoreHttpController } from "../../core/controllers/http_controller";
|
||||||
import { PipelineRealTimeService } from "../../core/services/pipeline_real_time_service";
|
import { PipelineRealTimeService } from "../../core/services/pipeline_real_time_service";
|
||||||
import { RunInstancePipelineUseCase } from "./usecases/run_instance_pipeline_usecase";
|
import { RunInstancePipelineUseCase } from "./domain/run_instance_pipeline_usecase";
|
||||||
import { PipelineStatusUseCase } from "./usecases/pipeline_status_usecase";
|
import { PipelineStatusUseCase } from "./domain/pipeline_status_usecase";
|
||||||
|
|
||||||
export const pipelineRealTimeService = new PipelineRealTimeService();
|
export const pipelineRealTimeService = new PipelineRealTimeService();
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import { IsArray, IsOptional, IsEnum, IsString } from "class-validator";
|
|
||||||
import { Schema, model } from "mongoose";
|
import { Schema, model } from "mongoose";
|
||||||
|
|
||||||
export interface ITriggerModel {
|
export interface ITriggerModel {
|
||||||
|
@ -31,17 +30,6 @@ export enum TriggerType {
|
||||||
FILE = "FILE",
|
FILE = "FILE",
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TriggerModel implements ITriggerModel {
|
|
||||||
@IsOptional()
|
|
||||||
public _id: string;
|
|
||||||
@IsString()
|
|
||||||
public description;
|
|
||||||
@IsEnum(TriggerType)
|
|
||||||
public type: TriggerType;
|
|
||||||
@IsArray()
|
|
||||||
public value: string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Trigger {
|
export interface Trigger {
|
||||||
type: TriggerType;
|
type: TriggerType;
|
||||||
value: string[];
|
value: string[];
|
|
@ -0,0 +1,16 @@
|
||||||
|
import { IsArray, IsOptional, IsEnum, IsString } from "class-validator";
|
||||||
|
import { ITriggerModel, TriggerType } from "./trigger_database_model";
|
||||||
|
|
||||||
|
export class TriggerModel implements ITriggerModel {
|
||||||
|
@IsOptional()
|
||||||
|
public _id: string;
|
||||||
|
|
||||||
|
@IsString()
|
||||||
|
public description;
|
||||||
|
|
||||||
|
@IsEnum(TriggerType)
|
||||||
|
public type: TriggerType;
|
||||||
|
|
||||||
|
@IsArray()
|
||||||
|
public value: string[];
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
import { TriggerDBModel, TriggerModel } from "./trigger_model";
|
|
||||||
import { CrudController } from "../../core/controllers/crud_controller";
|
import { CrudController } from "../../core/controllers/crud_controller";
|
||||||
|
import { TriggerDBModel } from "./models/trigger_database_model";
|
||||||
|
import { TriggerModel } from "./models/trigger_validation_model";
|
||||||
|
|
||||||
export class TriggerPresentation extends CrudController<TriggerModel, typeof TriggerDBModel> {
|
export class TriggerPresentation extends CrudController<TriggerModel, typeof TriggerDBModel> {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { EXEC_TYPE } from "../../src/core/model/exec_error_model";
|
import { EXEC_TYPE } from "../../src/core/model/exec_error_model";
|
||||||
import { IPipeline, IssueType, StackGenerateType } from "../../src/core/model/process_model";
|
import { IPipeline, IssueType, StackGenerateType } from "../../src/core/model/process_model";
|
||||||
import { TriggerType } from "../../src/features/triggers/trigger_model";
|
import { TriggerType } from "../../src/features/triggers/models/trigger_database_model";
|
||||||
|
|
||||||
export const mockSimplePipeline: IPipeline[] = [
|
export const mockSimplePipeline: IPipeline[] = [
|
||||||
{
|
{
|
||||||
|
@ -17,8 +17,8 @@ export const mockSimplePipeline: IPipeline[] = [
|
||||||
issueType: IssueType.WARNING,
|
issueType: IssueType.WARNING,
|
||||||
},
|
},
|
||||||
trigger: {
|
trigger: {
|
||||||
type: TriggerType.FILE,
|
type: TriggerType.PROCESS,
|
||||||
value: ["context"],
|
value: [""],
|
||||||
},
|
},
|
||||||
env: null,
|
env: null,
|
||||||
stackGenerateType: StackGenerateType.SINGLETON,
|
stackGenerateType: StackGenerateType.SINGLETON,
|
||||||
|
@ -41,3 +41,25 @@ export const mockSimplePipeline: IPipeline[] = [
|
||||||
stackGenerateType: StackGenerateType.SINGLETON,
|
stackGenerateType: StackGenerateType.SINGLETON,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
// const p: IPipeline[] = [
|
||||||
|
// {
|
||||||
|
// process: {
|
||||||
|
// type: EXEC_TYPE.EXEC,
|
||||||
|
// command: `nix run gitlab:robossembler/nix-robossembler-overlay#test-script '{
|
||||||
|
// "filesMeta":[
|
||||||
|
// {"type":"folder","name":"example", "path": null,"rewrite":true}
|
||||||
|
// ],
|
||||||
|
// "path":"$PATH"
|
||||||
|
// }'`,
|
||||||
|
// isGenerating: true,
|
||||||
|
// isLocaleCode: false,
|
||||||
|
// issueType: IssueType.WARNING,
|
||||||
|
// },
|
||||||
|
// trigger: {
|
||||||
|
// type: TriggerType.FILE,
|
||||||
|
// value: ["context"],
|
||||||
|
// },
|
||||||
|
// env: null,
|
||||||
|
// stackGenerateType: StackGenerateType.SINGLETON,
|
||||||
|
// },
|
||||||
|
// ]
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { EventsFileChanger, MetaDataFileManagerModel } from "../../src/core/model/meta_data_file_manager_model";
|
import { EventsFileChanger, MetaDataFileManagerModel } from "../../src/core/model/meta_data_file_manager_model";
|
||||||
|
|
||||||
import { TriggerService } from "../../src/core/services/trigger_service";
|
import { TriggerService } from "../../src/core/services/trigger_service";
|
||||||
import { TriggerType } from "../../src/features/triggers/trigger_model";
|
import { TriggerType } from "../../src/features/triggers/models/trigger_database_model";
|
||||||
import { assert } from "../test";
|
import { assert } from "../test";
|
||||||
abstract class TriggerTest {
|
abstract class TriggerTest {
|
||||||
abstract test(): Promise<boolean>;
|
abstract test(): Promise<boolean>;
|
||||||
|
|
|
@ -53,5 +53,8 @@
|
||||||
"last 1 firefox version",
|
"last 1 firefox version",
|
||||||
"last 1 safari version"
|
"last 1 safari version"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/three": "^0.158.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,21 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
|
||||||
<meta charset="utf-8" />
|
<head>
|
||||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||||
<meta name="theme-color" content="#000000" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta
|
<meta name="theme-color" content="#000000" />
|
||||||
name="description"
|
<meta name="description" content="Web site created using create-react-app" />
|
||||||
content="Web site created using create-react-app"
|
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
||||||
/>
|
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
<title>robossembler: pipeline </title>
|
||||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
</head>
|
||||||
<title>robossembler: pipeline </title>
|
|
||||||
</head>
|
<body>
|
||||||
<body>
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
<div id="root"></div>
|
||||||
<div id="root"></div>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
|
||||||
|
</html>
|
|
@ -9,9 +9,7 @@ import { SocketLister } from "./features/socket_lister/socket_lister";
|
||||||
import { extensions } from "./core/extensions/extensions";
|
import { extensions } from "./core/extensions/extensions";
|
||||||
|
|
||||||
extensions();
|
extensions();
|
||||||
const root = ReactDOM.createRoot(
|
const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement);
|
||||||
document.getElementById("root") as HTMLElement
|
|
||||||
);
|
|
||||||
|
|
||||||
root.render(
|
root.render(
|
||||||
<>
|
<>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue