2022-08-27 17:46:43 +00:00
|
|
|
import * as RSProject from "../rescript/ForTS/ForTS_ReducerProject.gen";
|
|
|
|
import { reducerErrorValue } from "../rescript/ForTS/ForTS_Reducer_ErrorValue.gen";
|
|
|
|
import { environment } from "../rescript/ForTS/ForTS_Distribution/ForTS_Distribution_Environment.gen";
|
2022-08-28 16:19:44 +00:00
|
|
|
import { SqError } from "./SqError";
|
|
|
|
import { SqModule } from "./SqModule";
|
|
|
|
import { wrapValue } from "./SqValue";
|
2022-08-27 17:46:43 +00:00
|
|
|
import { resultMap2 } from "./types";
|
|
|
|
|
2022-08-28 16:19:44 +00:00
|
|
|
export class SqProject {
|
2022-08-27 17:46:43 +00:00
|
|
|
_value: RSProject.reducerProject;
|
|
|
|
|
|
|
|
constructor(_value: RSProject.reducerProject) {
|
|
|
|
this._value = _value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static create() {
|
2022-08-28 16:19:44 +00:00
|
|
|
return new SqProject(RSProject.createProject());
|
2022-08-27 17:46:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
getSourceIds() {
|
|
|
|
return RSProject.getSourceIds(this._value);
|
|
|
|
}
|
|
|
|
|
|
|
|
setSource(sourceId: string, value: string) {
|
|
|
|
return RSProject.setSource(this._value, sourceId, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
getSource(sourceId: string) {
|
|
|
|
return RSProject.getSource(this._value, sourceId);
|
|
|
|
}
|
|
|
|
|
|
|
|
touchSource(sourceId: string) {
|
|
|
|
return RSProject.touchSource(this._value, sourceId);
|
|
|
|
}
|
|
|
|
|
|
|
|
clean(sourceId: string) {
|
|
|
|
return RSProject.clean(this._value, sourceId);
|
|
|
|
}
|
|
|
|
|
|
|
|
cleanAll() {
|
|
|
|
return RSProject.cleanAll(this._value);
|
|
|
|
}
|
|
|
|
|
|
|
|
cleanResults(sourceId: string) {
|
|
|
|
return RSProject.cleanResults(this._value, sourceId);
|
|
|
|
}
|
|
|
|
|
|
|
|
cleanAllResults() {
|
|
|
|
return RSProject.cleanAllResults(this._value);
|
|
|
|
}
|
|
|
|
|
|
|
|
getIncludes(sourceId: string) {
|
|
|
|
return resultMap2(
|
|
|
|
RSProject.getIncludes(this._value, sourceId),
|
|
|
|
(a) => a,
|
2022-08-28 16:19:44 +00:00
|
|
|
(v: reducerErrorValue) => new SqError(v)
|
2022-08-27 17:46:43 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
getContinues(sourceId: string) {
|
|
|
|
return RSProject.getContinues(this._value, sourceId);
|
|
|
|
}
|
|
|
|
|
|
|
|
setContinues(sourceId: string, continues: string[]) {
|
|
|
|
return RSProject.setContinues(this._value, sourceId, continues);
|
|
|
|
}
|
|
|
|
|
|
|
|
getDependencies(sourceId: string) {
|
|
|
|
return RSProject.getDependencies(this._value, sourceId);
|
|
|
|
}
|
|
|
|
|
|
|
|
getDependents(sourceId: string) {
|
|
|
|
return RSProject.getDependents(this._value, sourceId);
|
|
|
|
}
|
|
|
|
|
|
|
|
getRunOrder() {
|
|
|
|
return RSProject.getRunOrder(this._value);
|
|
|
|
}
|
|
|
|
|
|
|
|
getRunOrderFor(sourceId: string) {
|
|
|
|
return RSProject.getRunOrderFor(this._value, sourceId);
|
|
|
|
}
|
|
|
|
|
|
|
|
parseIncludes(sourceId: string) {
|
|
|
|
return RSProject.parseIncludes(this._value, sourceId);
|
|
|
|
}
|
|
|
|
|
|
|
|
run(sourceId: string) {
|
|
|
|
return RSProject.run(this._value, sourceId);
|
|
|
|
}
|
|
|
|
|
|
|
|
runAll() {
|
|
|
|
return RSProject.runAll(this._value);
|
|
|
|
}
|
|
|
|
|
|
|
|
getBindings(sourceId: string) {
|
2022-08-28 16:19:44 +00:00
|
|
|
return new SqModule(RSProject.getBindings(this._value, sourceId));
|
2022-08-27 17:46:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
getResult(sourceId: string) {
|
|
|
|
const innerResult = RSProject.getResult(this._value, sourceId);
|
|
|
|
return resultMap2(
|
|
|
|
innerResult,
|
2022-08-28 16:19:44 +00:00
|
|
|
wrapValue,
|
|
|
|
(v: reducerErrorValue) => new SqError(v)
|
2022-08-27 17:46:43 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
setEnvironment(environment: environment) {
|
|
|
|
RSProject.setEnvironment(this._value, environment);
|
|
|
|
}
|
|
|
|
}
|