UNPKG

@finos/legend-graph

Version:
125 lines 3.59 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. */ export class QueryTaggedValue { profile; tag; value; } export class QueryStereotype { profile; stereotype; } export class QueryParameterValue { name; content; } export class QueryExecutionContext { } export class QueryExplicitExecutionContext extends QueryExecutionContext { mapping; runtime; } export class QueryDataSpaceExecutionContext extends QueryExecutionContext { dataSpacePath; executionKey; } export class Query { name; id; versionId; originalVersionId; groupId; artifactId; // We enforce a single owner, for collaboration on query, use Studio // if not owner is specified, any user can own the query // NOTE: the owner is managed automatically by the backend owner; // NOTE: these are different from metamodel tagged values and stereotypes // because we don't process them taggedValues; stereotypes; defaultParameterValues; // Store query in text to be more compact and stable content; executionContext; /** * mapping, runtime have been deprecated in favor of `V1_QueryExecutionContext` * @deprecated */ mapping; /** * mapping, runtime have been deprecated in favor of `V1_QueryExecutionContext` * @deprecated */ runtime; lastUpdatedAt; createdAt; lastOpenAt; isCurrentUserQuery = false; gridConfig; } export class LightQuery { name; id; versionId; originalVersionId; groupId; artifactId; owner; lastUpdatedAt; createdAt; lastOpenAt; isCurrentUserQuery = false; } export const toLightQuery = (query) => { const lightQuery = new LightQuery(); lightQuery.name = query.name; lightQuery.id = query.id; lightQuery.groupId = query.groupId; lightQuery.artifactId = query.artifactId; lightQuery.versionId = query.versionId; lightQuery.originalVersionId = query.originalVersionId; lightQuery.owner = query.owner; lightQuery.isCurrentUserQuery = query.isCurrentUserQuery; lightQuery.lastOpenAt = query.lastOpenAt; lightQuery.createdAt = query.createdAt; lightQuery.lastUpdatedAt = query.lastUpdatedAt; return lightQuery; }; export const cloneQueryTaggedValue = (val) => { const queryTaggedVal = new QueryTaggedValue(); queryTaggedVal.profile = val.profile; queryTaggedVal.tag = val.tag; queryTaggedVal.value = val.value; return queryTaggedVal; }; export const cloneQueryStereotype = (val) => { const queryStereotype = new QueryStereotype(); queryStereotype.profile = val.profile; queryStereotype.stereotype = val.stereotype; return queryStereotype; }; export class QueryExecutionContextInfo { } export class QueryExplicitExecutionContextInfo extends QueryExecutionContextInfo { mapping; runtime; } export class QueryDataSpaceExecutionContextInfo extends QueryExecutionContextInfo { dataSpacePath; executionKey; } //# sourceMappingURL=Query.js.map