@finos/legend-graph 14.0.2 → 14.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/lib/graphManager/AbstractPureGraphManager.d.ts +2 -4
  2. package/lib/graphManager/AbstractPureGraphManager.d.ts.map +1 -1
  3. package/lib/graphManager/AbstractPureGraphManager.js.map +1 -1
  4. package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.d.ts +2 -4
  5. package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.d.ts.map +1 -1
  6. package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.js +8 -11
  7. package/lib/graphManager/protocol/pure/v1/V1_PureGraphManager.js.map +1 -1
  8. package/lib/graphManager/protocol/pure/v1/engine/V1_Engine.d.ts +0 -3
  9. package/lib/graphManager/protocol/pure/v1/engine/V1_Engine.d.ts.map +1 -1
  10. package/lib/graphManager/protocol/pure/v1/engine/V1_Engine.js +1 -12
  11. package/lib/graphManager/protocol/pure/v1/engine/V1_Engine.js.map +1 -1
  12. package/lib/graphManager/protocol/pure/v1/engine/V1_EngineHelper.d.ts +0 -3
  13. package/lib/graphManager/protocol/pure/v1/engine/V1_EngineHelper.d.ts.map +1 -1
  14. package/lib/graphManager/protocol/pure/v1/engine/V1_EngineHelper.js +0 -8
  15. package/lib/graphManager/protocol/pure/v1/engine/V1_EngineHelper.js.map +1 -1
  16. package/lib/graphManager/protocol/pure/v1/engine/V1_EngineServerClient.d.ts +0 -3
  17. package/lib/graphManager/protocol/pure/v1/engine/V1_EngineServerClient.d.ts.map +1 -1
  18. package/lib/graphManager/protocol/pure/v1/engine/V1_EngineServerClient.js +0 -1
  19. package/lib/graphManager/protocol/pure/v1/engine/V1_EngineServerClient.js.map +1 -1
  20. package/lib/graphManager/protocol/pure/v1/engine/externalFormat/V1_ExternalFormatModelGeneration.d.ts +8 -2
  21. package/lib/graphManager/protocol/pure/v1/engine/externalFormat/V1_ExternalFormatModelGeneration.d.ts.map +1 -1
  22. package/lib/graphManager/protocol/pure/v1/engine/externalFormat/V1_ExternalFormatModelGeneration.js +18 -6
  23. package/lib/graphManager/protocol/pure/v1/engine/externalFormat/V1_ExternalFormatModelGeneration.js.map +1 -1
  24. package/lib/index.d.ts +0 -1
  25. package/lib/index.d.ts.map +1 -1
  26. package/lib/index.js +0 -1
  27. package/lib/index.js.map +1 -1
  28. package/lib/package.json +1 -1
  29. package/package.json +1 -1
  30. package/src/graphManager/AbstractPureGraphManager.ts +3 -13
  31. package/src/graphManager/protocol/pure/v1/V1_PureGraphManager.ts +14 -24
  32. package/src/graphManager/protocol/pure/v1/engine/V1_Engine.ts +0 -39
  33. package/src/graphManager/protocol/pure/v1/engine/V1_EngineHelper.ts +0 -26
  34. package/src/graphManager/protocol/pure/v1/engine/V1_EngineServerClient.ts +0 -17
  35. package/src/graphManager/protocol/pure/v1/engine/externalFormat/V1_ExternalFormatModelGeneration.ts +25 -7
  36. package/src/index.ts +0 -1
  37. package/tsconfig.json +0 -1
  38. package/lib/graphManager/action/generation/ImportConfigurationDescription.d.ts +0 -26
  39. package/lib/graphManager/action/generation/ImportConfigurationDescription.d.ts.map +0 -1
  40. package/lib/graphManager/action/generation/ImportConfigurationDescription.js +0 -28
  41. package/lib/graphManager/action/generation/ImportConfigurationDescription.js.map +0 -1
  42. package/src/graphManager/action/generation/ImportConfigurationDescription.ts +0 -34
@@ -27,10 +27,6 @@ import {
27
27
  returnUndefOnError,
28
28
  deserializeMap,
29
29
  } from '@finos/legend-shared';
30
- import {
31
- type ImportConfigurationDescription,
32
- ImportMode,
33
- } from '../../../../../graphManager/action/generation/ImportConfigurationDescription.js';
34
30
  import type { RawLambda } from '../../../../../graph/metamodel/pure/rawValueSpecification/RawLambda.js';
35
31
  import {
36
32
  GenerationMode,
@@ -49,7 +45,6 @@ import {
49
45
  import { V1_serializeRawValueSpecification } from '../transformation/pureProtocol/serializationHelpers/V1_RawValueSpecificationSerializationHelper.js';
50
46
  import { V1_transformRawLambda } from '../transformation/pureGraph/from/V1_RawValueSpecificationTransformer.js';
51
47
  import { V1_GenerateFileInput } from '../engine/generation/V1_FileGenerationInput.js';
52
- import { V1_ImportConfigurationDescription } from '../engine/import/V1_ImportConfigurationDescription.js';
53
48
  import { V1_GenerationConfigurationDescription } from '../engine/generation/V1_GenerationConfigurationDescription.js';
54
49
  import { V1_GenerationOutput } from '../engine/generation/V1_GenerationOutput.js';
55
50
  import { V1_ParserError } from '../engine/grammar/V1_ParserError.js';
@@ -63,7 +58,6 @@ import {
63
58
  V1_buildExecutionError,
64
59
  V1_buildExternalFormatDescription,
65
60
  V1_buildGenerationConfigurationDescription,
66
- V1_buildImportConfigurationDescription,
67
61
  V1_buildParserError,
68
62
  } from './V1_EngineHelper.js';
69
63
  import { V1_LightQuery, V1_Query } from './query/V1_Query.js';
@@ -603,39 +597,6 @@ export class V1_Engine {
603
597
  return pureCode;
604
598
  }
605
599
 
606
- // ------------------------------------------- Schema Import -------------------------------------------
607
-
608
- async transformExternalFormatToProtocol(
609
- externalFormat: string,
610
- type: string,
611
- mode: ImportMode,
612
- ): Promise<V1_PureModelContextData> {
613
- return V1_deserializePureModelContextData(
614
- await this.engineServerClient.transformExternalFormatToProtocol(
615
- JSON.parse(externalFormat),
616
- type,
617
- mode,
618
- ),
619
- );
620
- }
621
-
622
- async getAvailableImportConfigurationDescriptions(): Promise<
623
- ImportConfigurationDescription[]
624
- > {
625
- const schemaImportDescriptions = (
626
- await this.engineServerClient.getAvailableSchemaImportDescriptions()
627
- ).map((gen) => ({ ...gen, modelImportMode: ImportMode.SCHEMA_IMPORT }));
628
- const codeImportDescriptions = (
629
- await this.engineServerClient.getAvailableCodeImportDescriptions()
630
- ).map((gen) => ({ ...gen, modelImportMode: ImportMode.CODE_IMPORT }));
631
- return [...schemaImportDescriptions, ...codeImportDescriptions].map(
632
- (description) =>
633
- V1_buildImportConfigurationDescription(
634
- V1_ImportConfigurationDescription.serialization.fromJson(description),
635
- ),
636
- );
637
- }
638
-
639
600
  // ------------------------------------------- Service -------------------------------------------
640
601
 
641
602
  async getServerServiceInfo(): Promise<V1_ServiceConfigurationInfo> {
@@ -32,11 +32,6 @@ import { DEPRECATED__ServiceTestResult } from '../../../../../graphManager/actio
32
32
  import type { V1_DEPRECATED__ServiceTestResult } from './service/V1_DEPRECATED__ServiceTestResult.js';
33
33
  import type { V1_ServiceRegistrationResult } from './service/V1_ServiceRegistrationResult.js';
34
34
  import { ServiceRegistrationResult } from '../../../../../graphManager/action/service/ServiceRegistrationResult.js';
35
- import {
36
- getImportMode,
37
- ImportConfigurationDescription,
38
- } from '../../../../../graphManager/action/generation/ImportConfigurationDescription.js';
39
- import type { V1_ImportConfigurationDescription } from './import/V1_ImportConfigurationDescription.js';
40
35
  import { GenerationOutput } from '../../../../../graphManager/action/generation/GenerationOutput.js';
41
36
  import type { V1_GenerationOutput } from './generation/V1_GenerationOutput.js';
42
37
  import {
@@ -284,27 +279,6 @@ export const V1_buildServiceRegistrationResult = (
284
279
  );
285
280
  };
286
281
 
287
- export const V1_buildImportConfigurationDescription = (
288
- protocol: V1_ImportConfigurationDescription,
289
- ): ImportConfigurationDescription => {
290
- const metamodel = new ImportConfigurationDescription();
291
- metamodel.key = guaranteeNonNullable(
292
- protocol.key,
293
- `Import configuration description 'key' field is missing`,
294
- );
295
- metamodel.label = guaranteeNonNullable(
296
- protocol.label,
297
- `Import configuration description 'label' field is missing`,
298
- );
299
- metamodel.modelImportMode = getImportMode(
300
- guaranteeNonNullable(
301
- protocol.modelImportMode,
302
- `Import configuration description 'modelImportMode' field is missing`,
303
- ),
304
- );
305
- return metamodel;
306
- };
307
-
308
282
  export const V1_buildGenerationProperty = (
309
283
  protocol: V1_GenerationProperty,
310
284
  ): GenerationProperty => {
@@ -22,14 +22,12 @@ import {
22
22
  type TraceData,
23
23
  HttpHeader,
24
24
  } from '@finos/legend-shared';
25
- import type { ImportMode } from '../../../../../graphManager/action/generation/ImportConfigurationDescription.js';
26
25
  import type { V1_PureModelContextData } from '../model/context/V1_PureModelContextData.js';
27
26
  import type { V1_LambdaReturnTypeResult } from './compilation/V1_LambdaReturnTypeResult.js';
28
27
  import type { V1_ServiceRegistrationResult } from './service/V1_ServiceRegistrationResult.js';
29
28
  import type { V1_ServiceConfigurationInfo } from './service/V1_ServiceConfiguration.js';
30
29
  import type { V1_CompileResult } from './compilation/V1_CompileResult.js';
31
30
  import type { V1_RawLambda } from '../model/rawValueSpecification/V1_RawLambda.js';
32
- import type { V1_PureModelContextGenerationInput } from './import/V1_PureModelContextGenerationInput.js';
33
31
  import type { V1_GenerateFileInput } from './generation/V1_FileGenerationInput.js';
34
32
  import type { V1_ExecutionResult } from './execution/V1_ExecutionResult.js';
35
33
  import type { V1_ImportConfigurationDescription } from './import/V1_ImportConfigurationDescription.js';
@@ -369,21 +367,6 @@ export class V1_EngineServerClient extends AbstractServerClient {
369
367
  getAvailableSchemaImportDescriptions = (): Promise<
370
368
  PlainObject<V1_ImportConfigurationDescription>[]
371
369
  > => this.get(`${this._pure()}/schemaImport/availableImports`);
372
- transformExternalFormatToProtocol = (
373
- input: PlainObject<V1_PureModelContextGenerationInput>,
374
- type: string,
375
- mode: ImportMode,
376
- ): Promise<PlainObject<V1_PureModelContextData>> =>
377
- this.postWithTracing(
378
- this.getTraceData(CORE_ENGINE_ACTIVITY_TRACE.EXTERNAL_FORMAT_TO_PROTOCOL),
379
- `${this._pure()}/${mode}/${type}`,
380
- input,
381
- {},
382
- undefined,
383
- undefined,
384
- { enableCompression: true },
385
- );
386
-
387
370
  // ------------------------------------------- Code Generation -------------------------------------------
388
371
 
389
372
  getAvailableCodeGenerationDescriptions = (): Promise<
@@ -14,19 +14,37 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- import { createModelSchema, object, primitive, raw } from 'serializr';
17
+ import { createModelSchema, optional, primitive, raw } from 'serializr';
18
18
  import { SerializationFactory } from '@finos/legend-shared';
19
- import { V1_GenerationInput } from '../generation/V1_GenerationInput.js';
20
- import { V1_PureModelContextData } from '../../model/context/V1_PureModelContextData.js';
19
+ import type { V1_PureModelContext } from '../../model/context/V1_PureModelContext.js';
20
+ import { V1_pureModelContextPropSchema } from '../../transformation/pureProtocol/V1_PureProtocolSerialization.js';
21
21
 
22
- export class V1_ExternalFormatModelGenerationInput extends V1_GenerationInput {
22
+ export class V1_ExternalFormatModelGenerationInput {
23
+ clientVersion?: string | undefined;
24
+ sourceSchemaSet: string;
25
+ model: V1_PureModelContext;
23
26
  config?: Record<PropertyKey, unknown> | undefined;
27
+ generateBinding: boolean | undefined;
28
+ targetBindingPath: string | undefined;
24
29
 
25
- static override readonly serialization = new SerializationFactory(
30
+ constructor(
31
+ sourceSchemaSet: string,
32
+ model: V1_PureModelContext,
33
+ config?: Record<PropertyKey, unknown>,
34
+ ) {
35
+ this.model = model;
36
+ this.sourceSchemaSet = sourceSchemaSet;
37
+ this.config = config;
38
+ }
39
+
40
+ static readonly serialization = new SerializationFactory(
26
41
  createModelSchema(V1_ExternalFormatModelGenerationInput, {
27
- clientVersion: primitive(),
28
- model: object(V1_PureModelContextData),
42
+ clientVersion: optional(primitive()),
29
43
  config: raw(),
44
+ model: V1_pureModelContextPropSchema,
45
+ generateBinding: optional(primitive()),
46
+ targetBindingPath: optional(primitive()),
47
+ sourceSchemaSet: primitive(),
30
48
  }),
31
49
  );
32
50
  }
package/src/index.ts CHANGED
@@ -226,7 +226,6 @@ export * from './graphManager/action/query/Query.js';
226
226
  export * from './graphManager/action/query/QuerySearchSpecification.js';
227
227
  export * from './graphManager/action/EngineError.js';
228
228
  export * from './graphManager/action/SourceInformationHelper.js';
229
- export * from './graphManager/action/generation/ImportConfigurationDescription.js';
230
229
  export * from './graphManager/action/generation/DatabaseBuilderInput.js';
231
230
  export * from './graphManager/action/generation/GenerationConfigurationDescription.js';
232
231
  export { GenerationOutput } from './graphManager/action/generation/GenerationOutput.js';
package/tsconfig.json CHANGED
@@ -296,7 +296,6 @@
296
296
  "./src/graphManager/action/generation/DatabaseBuilderInput.ts",
297
297
  "./src/graphManager/action/generation/GenerationConfigurationDescription.ts",
298
298
  "./src/graphManager/action/generation/GenerationOutput.ts",
299
- "./src/graphManager/action/generation/ImportConfigurationDescription.ts",
300
299
  "./src/graphManager/action/query/Query.ts",
301
300
  "./src/graphManager/action/query/QuerySearchSpecification.ts",
302
301
  "./src/graphManager/action/service/DEPRECATED__ServiceTestResult.ts",
@@ -1,26 +0,0 @@
1
- /**
2
- * Copyright (c) 2020-present, Goldman Sachs
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- export declare enum ImportMode {
17
- CODE_IMPORT = "codeImport",
18
- SCHEMA_IMPORT = "schemaImport"
19
- }
20
- export declare const getImportMode: (value: string) => ImportMode;
21
- export declare class ImportConfigurationDescription {
22
- key: string;
23
- label: string;
24
- modelImportMode: ImportMode;
25
- }
26
- //# sourceMappingURL=ImportConfigurationDescription.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ImportConfigurationDescription.d.ts","sourceRoot":"","sources":["../../../../src/graphManager/action/generation/ImportConfigurationDescription.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,oBAAY,UAAU;IACpB,WAAW,eAAe;IAC1B,aAAa,iBAAiB;CAC/B;AAED,eAAO,MAAM,aAAa,UAAW,MAAM,KAAG,UAI3C,CAAC;AAEJ,qBAAa,8BAA8B;IACzC,GAAG,EAAG,MAAM,CAAC;IACb,KAAK,EAAG,MAAM,CAAC;IACf,eAAe,EAAG,UAAU,CAAC;CAC9B"}
@@ -1,28 +0,0 @@
1
- /**
2
- * Copyright (c) 2020-present, Goldman Sachs
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { guaranteeNonNullable } from '@finos/legend-shared';
17
- export var ImportMode;
18
- (function (ImportMode) {
19
- ImportMode["CODE_IMPORT"] = "codeImport";
20
- ImportMode["SCHEMA_IMPORT"] = "schemaImport";
21
- })(ImportMode = ImportMode || (ImportMode = {}));
22
- export const getImportMode = (value) => guaranteeNonNullable(Object.values(ImportMode).find((mode) => mode === value), `Encountered unsupported import mode '${value}'`);
23
- export class ImportConfigurationDescription {
24
- key;
25
- label;
26
- modelImportMode;
27
- }
28
- //# sourceMappingURL=ImportConfigurationDescription.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ImportConfigurationDescription.js","sourceRoot":"","sources":["../../../../src/graphManager/action/generation/ImportConfigurationDescription.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,wCAA0B,CAAA;IAC1B,4CAA8B,CAAA;AAChC,CAAC,EAHW,UAAU,GAAV,UAAU,KAAV,UAAU,QAGrB;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAa,EAAc,EAAE,CACzD,oBAAoB,CAClB,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,EACxD,wCAAwC,KAAK,GAAG,CACjD,CAAC;AAEJ,MAAM,OAAO,8BAA8B;IACzC,GAAG,CAAU;IACb,KAAK,CAAU;IACf,eAAe,CAAc;CAC9B"}
@@ -1,34 +0,0 @@
1
- /**
2
- * Copyright (c) 2020-present, Goldman Sachs
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- import { guaranteeNonNullable } from '@finos/legend-shared';
18
-
19
- export enum ImportMode {
20
- CODE_IMPORT = 'codeImport',
21
- SCHEMA_IMPORT = 'schemaImport',
22
- }
23
-
24
- export const getImportMode = (value: string): ImportMode =>
25
- guaranteeNonNullable(
26
- Object.values(ImportMode).find((mode) => mode === value),
27
- `Encountered unsupported import mode '${value}'`,
28
- );
29
-
30
- export class ImportConfigurationDescription {
31
- key!: string;
32
- label!: string;
33
- modelImportMode!: ImportMode;
34
- }