UNPKG

@finos/legend-extension-dsl-persistence

Version:
71 lines 2.8 kB
/** * Copyright (c) 2020-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 { observe_Abstract_PackageableElement, observe_AtomicTest, observe_EmbeddedData, observe_TestAssertion, skipObservedWithContext, } from '@finos/legend-graph'; import { makeObservable, observable, override, computed } from 'mobx'; export const observe_Persistence = skipObservedWithContext((metamodel, context) => { observe_Abstract_PackageableElement(metamodel); makeObservable(metamodel, { documentation: observable, trigger: observable, service: observable, persister: observable, notifier: observable, tests: observable, _elementHashCode: override, }); metamodel.tests.forEach((test) => observe_AtomicTest(test, context)); return metamodel; }); export const observe_ConnectionTestData = skipObservedWithContext((metamodel, context) => { makeObservable(metamodel, { data: observable, hashCode: computed, }); observe_EmbeddedData(metamodel.data, context); return metamodel; }); export const observe_TestData = skipObservedWithContext((metamodel, context) => { makeObservable(metamodel, { connection: observable, hashCode: computed, }); observe_ConnectionTestData(metamodel.connection, context); return metamodel; }); export const observe_PersistenceTestBatch = skipObservedWithContext((metamodel, context) => { makeObservable(metamodel, { id: observable, batchId: observable, assertions: observable, testData: observable, hashCode: computed, }); observe_TestData(metamodel.testData, context); metamodel.assertions.forEach((assertion) => observe_TestAssertion(assertion)); return metamodel; }); export const observe_PersistenceTest = skipObservedWithContext((metamodel, context) => { makeObservable(metamodel, { id: observable, graphFetchPath: observable, testBatches: observable, isTestDataFromServiceOutput: observable, hashCode: computed, }); metamodel.testBatches.forEach((testBatch) => observe_PersistenceTestBatch(testBatch, context)); return metamodel; }); //# sourceMappingURL=DSL_Persistence_ObserverHelper.js.map