@finos/legend-application-repl 0.0.13 → 0.0.15

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.
@@ -17,10 +17,12 @@ import { type LegendApplicationConfig, type LegendApplicationConfigurationInput,
17
17
  import { LegendREPLGridClientApplicationConfig, type LegendREPLGridClientApplicationConfigData } from './LegendREPLGridClientApplicationConfig.js';
18
18
  import { LegendREPLGridClientPluginManager } from './LegendREPLGridClientPluginManager.js';
19
19
  import type { LegendREPLGridClientApplicationStore } from '../stores/LegendREPLGridClientBaseStore.js';
20
+ import { type ExtensionsConfigurationData } from '@finos/legend-shared';
20
21
  export declare class LegendREPLGridClient extends LegendApplication {
21
22
  config: LegendREPLGridClientApplicationConfig;
22
23
  pluginManager: LegendREPLGridClientPluginManager;
23
24
  static create(): LegendREPLGridClient;
25
+ fetchApplicationConfiguration(baseUrl: string): Promise<[LegendApplicationConfig, ExtensionsConfigurationData]>;
24
26
  configureApplication(input: LegendApplicationConfigurationInput<LegendREPLGridClientApplicationConfigData>): Promise<LegendApplicationConfig>;
25
27
  loadApplication(applicationStore: LegendREPLGridClientApplicationStore): Promise<void>;
26
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"LegendREPLGridClient.d.ts","sourceRoot":"","sources":["../../src/application/LegendREPLGridClient.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,mCAAmC,EACxC,iBAAiB,EAIlB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,qCAAqC,EACrC,KAAK,yCAAyC,EAC/C,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAG3F,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AAEvG,qBAAa,oBAAqB,SAAQ,iBAAiB;IACjD,MAAM,EAAE,qCAAqC,CAAC;IAC9C,aAAa,EAAE,iCAAiC,CAAC;IAEzD,MAAM,CAAC,MAAM,IAAI,oBAAoB;IAY/B,oBAAoB,CACxB,KAAK,EAAE,mCAAmC,CAAC,yCAAyC,CAAC,GACpF,OAAO,CAAC,uBAAuB,CAAC;IAI7B,eAAe,CACnB,gBAAgB,EAAE,oCAAoC,GACrD,OAAO,CAAC,IAAI,CAAC;CAOjB"}
1
+ {"version":3,"file":"LegendREPLGridClient.d.ts","sourceRoot":"","sources":["../../src/application/LegendREPLGridClient.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,mCAAmC,EACxC,iBAAiB,EAMlB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,qCAAqC,EACrC,KAAK,yCAAyC,EAC/C,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAG3F,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,4CAA4C,CAAC;AACvG,OAAO,EACL,KAAK,2BAA2B,EAKjC,MAAM,sBAAsB,CAAC;AAE9B,qBAAa,oBAAqB,SAAQ,iBAAiB;IACjD,MAAM,EAAE,qCAAqC,CAAC;IAC9C,aAAa,EAAE,iCAAiC,CAAC;IAEzD,MAAM,CAAC,MAAM,IAAI,oBAAoB;IAYtB,6BAA6B,CAC1C,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,CAAC,uBAAuB,EAAE,2BAA2B,CAAC,CAAC;IA+C5D,oBAAoB,CACxB,KAAK,EAAE,mCAAmC,CAAC,yCAAyC,CAAC,GACpF,OAAO,CAAC,uBAAuB,CAAC;IAI7B,eAAe,CACnB,gBAAgB,EAAE,oCAAoC,GACrD,OAAO,CAAC,IAAI,CAAC;CAOjB"}
@@ -15,11 +15,12 @@ import { jsx as _jsx } from "react/jsx-runtime";
15
15
  * limitations under the License.
16
16
  */
17
17
  import { createRoot } from 'react-dom/client';
18
- import { LegendApplication, ApplicationStoreProvider, Core_LegendApplicationPlugin, getApplicationRootElement, } from '@finos/legend-application';
18
+ import { LegendApplication, ApplicationStoreProvider, Core_LegendApplicationPlugin, getApplicationRootElement, APPLICATION_EVENT, } from '@finos/legend-application';
19
19
  import { LegendREPLGridClientApplicationConfig, } from './LegendREPLGridClientApplicationConfig.js';
20
20
  import { LegendREPLGridClientPluginManager } from './LegendREPLGridClientPluginManager.js';
21
21
  import { LegendREPLGridClientWebApplication } from '../components/LegendREPLGridClientApplication.js';
22
22
  import { Core_LegendREPLGridClientApplicationPlugin } from '../components/Core_LegendREPLGridClientApplicationPlugin.js';
23
+ import { NetworkClient, assertErrorThrown, LogEvent, assertNonNullable, } from '@finos/legend-shared';
23
24
  export class LegendREPLGridClient extends LegendApplication {
24
25
  static create() {
25
26
  const application = new LegendREPLGridClient(LegendREPLGridClientPluginManager.create());
@@ -30,6 +31,39 @@ export class LegendREPLGridClient extends LegendApplication {
30
31
  application.withBasePresets([]);
31
32
  return application;
32
33
  }
34
+ async fetchApplicationConfiguration(baseUrl) {
35
+ const client = new NetworkClient();
36
+ // Resolve baseUrl relatively for application to work in vscode code-server
37
+ const relativeBaseUrl = new URL('./', window.location.href).pathname;
38
+ // app config
39
+ let configData;
40
+ try {
41
+ configData = await client.get(`${window.location.origin}${relativeBaseUrl}config.json`);
42
+ }
43
+ catch (error) {
44
+ assertErrorThrown(error);
45
+ this.logger.error(LogEvent.create(APPLICATION_EVENT.APPLICATION_CONFIGURATION__FAILURE), error);
46
+ }
47
+ assertNonNullable(configData, `Can't fetch Legend application configuration`);
48
+ // app version
49
+ let versionData;
50
+ try {
51
+ versionData = await client.get(`${window.location.origin}${relativeBaseUrl}version.json`);
52
+ }
53
+ catch (error) {
54
+ assertErrorThrown(error);
55
+ this.logger.error(LogEvent.create(APPLICATION_EVENT.APPLICATION_CONFIGURATION__FAILURE), error);
56
+ }
57
+ assertNonNullable(versionData, `Can't fetch Legend application version`);
58
+ return [
59
+ await this.configureApplication({
60
+ configData,
61
+ versionData,
62
+ baseAddress: baseUrl,
63
+ }),
64
+ configData.extensions ?? {},
65
+ ];
66
+ }
33
67
  async configureApplication(input) {
34
68
  return new LegendREPLGridClientApplicationConfig(input);
35
69
  }
@@ -1 +1 @@
1
- {"version":3,"file":"LegendREPLGridClient.js","sourceRoot":"","sources":["../../src/application/LegendREPLGridClient.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAGL,iBAAiB,EACjB,wBAAwB,EACxB,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,qCAAqC,GAEtC,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAC3F,OAAO,EAAE,kCAAkC,EAAE,MAAM,kDAAkD,CAAC;AACtG,OAAO,EAAE,0CAA0C,EAAE,MAAM,6DAA6D,CAAC;AAGzH,MAAM,OAAO,oBAAqB,SAAQ,iBAAiB;IAIzD,MAAM,CAAC,MAAM;QACX,MAAM,WAAW,GAAG,IAAI,oBAAoB,CAC1C,iCAAiC,CAAC,MAAM,EAAE,CAC3C,CAAC;QACF,WAAW,CAAC,eAAe,CAAC;YAC1B,IAAI,4BAA4B,EAAE;YAClC,IAAI,0CAA0C,EAAE;SACjD,CAAC,CAAC;QACH,WAAW,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;QAChC,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,oBAAoB,CACxB,KAAqF;QAErF,OAAO,IAAI,qCAAqC,CAAC,KAAK,CAAC,CAAC;IAC1D,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,gBAAsD;QAEtD,UAAU,CAAC,yBAAyB,EAAE,CAAC,CAAC,MAAM,CAC5C,KAAC,wBAAwB,IAAC,KAAK,EAAE,gBAAgB,YAC/C,KAAC,kCA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AAC,OAAO,EAAE,IAAI,CAAC,WAAW,GAAI,GACxC,CAC5B,CAAC;IACJ,CAAC;CACF"}
package/lib/grid.css CHANGED
@@ -1,4 +1,4 @@
1
- /** @license @finos/legend-application-repl v0.0.13
1
+ /** @license @finos/legend-application-repl v0.0.15
2
2
  * Copyright (c) 2020-present, Goldman Sachs
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
package/lib/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /** @license @finos/legend-application-repl v0.0.13
1
+ /** @license @finos/legend-application-repl v0.0.15
2
2
  * Copyright (c) 2020-present, Goldman Sachs
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-application-repl",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "description": "Legend REPL Grid client application core",
5
5
  "keywords": [
6
6
  "legend",
package/lib/repl.css CHANGED
@@ -1,4 +1,4 @@
1
- /** @license @finos/legend-application-repl v0.0.13
1
+ /** @license @finos/legend-application-repl v0.0.15
2
2
  * Copyright (c) 2020-present, Goldman Sachs
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-application-repl",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "description": "Legend REPL Grid client application core",
5
5
  "keywords": [
6
6
  "legend",
@@ -53,8 +53,8 @@
53
53
  "@ag-grid-enterprise/server-side-row-model": "30.2.0",
54
54
  "@finos/legend-application": "15.0.75",
55
55
  "@finos/legend-art": "7.1.27",
56
- "@finos/legend-graph": "31.9.13",
57
- "@finos/legend-lego": "1.2.27",
56
+ "@finos/legend-graph": "31.9.14",
57
+ "@finos/legend-lego": "1.2.28",
58
58
  "@finos/legend-shared": "10.0.34",
59
59
  "@types/react": "18.2.31",
60
60
  "@types/react-dom": "18.2.14",
@@ -67,7 +67,7 @@
67
67
  "serializr": "3.0.2"
68
68
  },
69
69
  "devDependencies": {
70
- "@finos/legend-dev-utils": "2.1.3",
70
+ "@finos/legend-dev-utils": "2.1.4",
71
71
  "@jest/globals": "29.7.0",
72
72
  "cross-env": "7.0.3",
73
73
  "eslint": "8.52.0",
@@ -22,6 +22,8 @@ import {
22
22
  ApplicationStoreProvider,
23
23
  Core_LegendApplicationPlugin,
24
24
  getApplicationRootElement,
25
+ APPLICATION_EVENT,
26
+ type LegendApplicationVersionData,
25
27
  } from '@finos/legend-application';
26
28
  import {
27
29
  LegendREPLGridClientApplicationConfig,
@@ -31,6 +33,13 @@ import { LegendREPLGridClientPluginManager } from './LegendREPLGridClientPluginM
31
33
  import { LegendREPLGridClientWebApplication } from '../components/LegendREPLGridClientApplication.js';
32
34
  import { Core_LegendREPLGridClientApplicationPlugin } from '../components/Core_LegendREPLGridClientApplicationPlugin.js';
33
35
  import type { LegendREPLGridClientApplicationStore } from '../stores/LegendREPLGridClientBaseStore.js';
36
+ import {
37
+ type ExtensionsConfigurationData,
38
+ NetworkClient,
39
+ assertErrorThrown,
40
+ LogEvent,
41
+ assertNonNullable,
42
+ } from '@finos/legend-shared';
34
43
 
35
44
  export class LegendREPLGridClient extends LegendApplication {
36
45
  declare config: LegendREPLGridClientApplicationConfig;
@@ -48,6 +57,55 @@ export class LegendREPLGridClient extends LegendApplication {
48
57
  return application;
49
58
  }
50
59
 
60
+ override async fetchApplicationConfiguration(
61
+ baseUrl: string,
62
+ ): Promise<[LegendApplicationConfig, ExtensionsConfigurationData]> {
63
+ const client = new NetworkClient();
64
+ // Resolve baseUrl relatively for application to work in vscode code-server
65
+ const relativeBaseUrl = new URL('./', window.location.href).pathname;
66
+ // app config
67
+ let configData: LegendREPLGridClientApplicationConfigData | undefined;
68
+ try {
69
+ configData = await client.get<LegendREPLGridClientApplicationConfigData>(
70
+ `${window.location.origin}${relativeBaseUrl}config.json`,
71
+ );
72
+ } catch (error) {
73
+ assertErrorThrown(error);
74
+ this.logger.error(
75
+ LogEvent.create(APPLICATION_EVENT.APPLICATION_CONFIGURATION__FAILURE),
76
+ error,
77
+ );
78
+ }
79
+ assertNonNullable(
80
+ configData,
81
+ `Can't fetch Legend application configuration`,
82
+ );
83
+
84
+ // app version
85
+ let versionData;
86
+ try {
87
+ versionData = await client.get<LegendApplicationVersionData>(
88
+ `${window.location.origin}${relativeBaseUrl}version.json`,
89
+ );
90
+ } catch (error) {
91
+ assertErrorThrown(error);
92
+ this.logger.error(
93
+ LogEvent.create(APPLICATION_EVENT.APPLICATION_CONFIGURATION__FAILURE),
94
+ error,
95
+ );
96
+ }
97
+ assertNonNullable(versionData, `Can't fetch Legend application version`);
98
+
99
+ return [
100
+ await this.configureApplication({
101
+ configData,
102
+ versionData,
103
+ baseAddress: baseUrl,
104
+ }),
105
+ configData.extensions ?? {},
106
+ ];
107
+ }
108
+
51
109
  async configureApplication(
52
110
  input: LegendApplicationConfigurationInput<LegendREPLGridClientApplicationConfigData>,
53
111
  ): Promise<LegendApplicationConfig> {