@finos/legend-extension-dsl-data-quality
Version:
Legend extension for Data Quality
156 lines • 5.08 kB
JavaScript
/**
* Copyright (c) 2026-present, Goldman Sachs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { action, isObservableObject, makeObservable, observable } from 'mobx';
import { DataQualityValidationCustomHelperFunction, DataQualityValidationFilterFunction, } from '../utils/DataQualityValidationFunction.js';
import { skipObserved, } from '@finos/legend-graph';
export const observe_values = (values) => {
values.forEach((param) => {
if (!isObservableObject(param)) {
makeObservable(param, {
values: observable,
});
}
});
};
const observe_FilterConditionParameters = skipObserved((func) => {
makeObservable(func.parameters, {
otherParams: observable,
property: observable,
});
return func;
});
const observe_FilterConditionFunc = skipObserved((func) => {
makeObservable(func, {
parameters: observable,
name: observable,
});
return func;
});
export const observe_DataQualityValidationFilterCondition = skipObserved((func) => {
observe_values(func.parameters.otherParams);
observe_FilterConditionParameters(func);
observe_FilterConditionFunc(func);
return func;
});
const observe_PropertyGuaranteeParameters = skipObserved((func) => {
makeObservable(func.parameters, {
property: observable,
});
return func;
});
const observe_PropertyGuaranteeFunc = skipObserved((func) => {
makeObservable(func, {
parameters: observable,
name: observable,
});
return func;
});
export const observe_DataQualityValidationPropertyGuarantee = skipObserved((func) => {
observe_PropertyGuaranteeParameters(func);
observe_PropertyGuaranteeFunc(func);
return func;
});
const observe_LogicalGroupParameters = skipObserved((func) => {
makeObservable(func.parameters, {
left: observable,
right: observable,
});
return func;
});
const observe_LogicalGroupFunc = skipObserved((func) => {
makeObservable(func, {
parameters: observable,
name: observable,
changeName: action,
});
return func;
});
export const observe_DataQualityValidationLogicalGroupFunction = skipObserved((func) => {
observe_LogicalGroupParameters(func);
observe_LogicalGroupFunc(func);
return func;
});
const observe_AssertionParameters = skipObserved((assertFunc) => {
makeObservable(assertFunc.parameters, {
columns: observable,
otherParam: observable,
});
return assertFunc;
});
const observe_AssertionFunc = skipObserved((assertFunc) => {
makeObservable(assertFunc, {
parameters: observable,
});
return assertFunc;
});
export const observe_AssertionFunction = skipObserved((assertFunc) => {
observe_AssertionParameters(assertFunc);
observe_AssertionFunc(assertFunc);
return assertFunc;
});
const observe_FilterFunctionLambda = skipObserved((func) => {
makeObservable(func.parameters.lambda, {
body: observable,
});
return func;
});
const observe_FilterFunctionParameters = skipObserved((func) => {
makeObservable(func.parameters, {
lambda: observable,
});
return func;
});
const observe_FilterFunctionFunc = skipObserved((func) => {
makeObservable(func, {
parameters: observable,
});
return func;
});
export const observe_DataQualityValidationFilterFunction = skipObserved((func) => {
observe_FilterFunctionLambda(func);
observe_FilterFunctionParameters(func);
observe_FilterFunctionFunc(func);
return func;
});
const observe_CustomHelperParameters = skipObserved((func) => {
makeObservable(func.parameters, {
column: observable,
otherParams: observable,
});
return func;
});
const observe_CustomHelperFunc = skipObserved((func) => {
makeObservable(func, {
parameters: observable,
});
return func;
});
export const observe_DataQualityValidationCustomHelperFunction = skipObserved((func) => {
observe_values(func.parameters.otherParams);
observe_CustomHelperParameters(func);
observe_CustomHelperFunc(func);
return func;
});
export const observe_FilterFunction = skipObserved((func) => {
if (func instanceof DataQualityValidationCustomHelperFunction) {
observe_DataQualityValidationCustomHelperFunction(func);
}
if (func instanceof DataQualityValidationFilterFunction) {
observe_DataQualityValidationFilterFunction(func);
}
return func;
});
//# sourceMappingURL=DataQualityValidationFunctionObserver.js.map