@finos/legend-application-marketplace 0.0.11
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.
- package/LICENSE +201 -0
- package/README.md +3 -0
- package/lib/__lib__/LegendMarketplaceEventHelper.d.ts +20 -0
- package/lib/__lib__/LegendMarketplaceEventHelper.d.ts.map +1 -0
- package/lib/__lib__/LegendMarketplaceEventHelper.js +22 -0
- package/lib/__lib__/LegendMarketplaceEventHelper.js.map +1 -0
- package/lib/__lib__/LegendMarketplaceNavigation.d.ts +19 -0
- package/lib/__lib__/LegendMarketplaceNavigation.d.ts.map +1 -0
- package/lib/__lib__/LegendMarketplaceNavigation.js +19 -0
- package/lib/__lib__/LegendMarketplaceNavigation.js.map +1 -0
- package/lib/__lib__/LegendMarketplaceTesting.d.ts +19 -0
- package/lib/__lib__/LegendMarketplaceTesting.d.ts.map +1 -0
- package/lib/__lib__/LegendMarketplaceTesting.js +20 -0
- package/lib/__lib__/LegendMarketplaceTesting.js.map +1 -0
- package/lib/application/LegendMarketplace.d.ts +27 -0
- package/lib/application/LegendMarketplace.d.ts.map +1 -0
- package/lib/application/LegendMarketplace.js +39 -0
- package/lib/application/LegendMarketplace.js.map +1 -0
- package/lib/application/LegendMarketplaceApplicationConfig.d.ts +53 -0
- package/lib/application/LegendMarketplaceApplicationConfig.d.ts.map +1 -0
- package/lib/application/LegendMarketplaceApplicationConfig.js +65 -0
- package/lib/application/LegendMarketplaceApplicationConfig.js.map +1 -0
- package/lib/application/LegendMarketplacePluginManager.d.ts +22 -0
- package/lib/application/LegendMarketplacePluginManager.d.ts.map +1 -0
- package/lib/application/LegendMarketplacePluginManager.js +25 -0
- package/lib/application/LegendMarketplacePluginManager.js.map +1 -0
- package/lib/application/__test-utils__/LegendMarketplaceApplicationTestUtils.d.ts +18 -0
- package/lib/application/__test-utils__/LegendMarketplaceApplicationTestUtils.d.ts.map +1 -0
- package/lib/application/__test-utils__/LegendMarketplaceApplicationTestUtils.js +46 -0
- package/lib/application/__test-utils__/LegendMarketplaceApplicationTestUtils.js.map +1 -0
- package/lib/components/LegendMarketplaceFrameworkProvider.d.ts +22 -0
- package/lib/components/LegendMarketplaceFrameworkProvider.d.ts.map +1 -0
- package/lib/components/LegendMarketplaceFrameworkProvider.js +31 -0
- package/lib/components/LegendMarketplaceFrameworkProvider.js.map +1 -0
- package/lib/components/LegendMarketplaceWebApplication.d.ts +24 -0
- package/lib/components/LegendMarketplaceWebApplication.d.ts.map +1 -0
- package/lib/components/LegendMarketplaceWebApplication.js +43 -0
- package/lib/components/LegendMarketplaceWebApplication.js.map +1 -0
- package/lib/components/__test-utils__/LegendMarketplaceStoreTestUtils.d.ts +30 -0
- package/lib/components/__test-utils__/LegendMarketplaceStoreTestUtils.d.ts.map +1 -0
- package/lib/components/__test-utils__/LegendMarketplaceStoreTestUtils.js +56 -0
- package/lib/components/__test-utils__/LegendMarketplaceStoreTestUtils.js.map +1 -0
- package/lib/components/extensions/Core_LegendMarketplaceApplicationPlugin.d.ts +21 -0
- package/lib/components/extensions/Core_LegendMarketplaceApplicationPlugin.d.ts.map +1 -0
- package/lib/components/extensions/Core_LegendMarketplaceApplicationPlugin.js +24 -0
- package/lib/components/extensions/Core_LegendMarketplaceApplicationPlugin.js.map +1 -0
- package/lib/components/header/LegendMarketplaceAppInfo.d.ts +21 -0
- package/lib/components/header/LegendMarketplaceAppInfo.d.ts.map +1 -0
- package/lib/components/header/LegendMarketplaceAppInfo.js +28 -0
- package/lib/components/header/LegendMarketplaceAppInfo.js.map +1 -0
- package/lib/components/header/LegendMarketplaceHeader.d.ts +19 -0
- package/lib/components/header/LegendMarketplaceHeader.d.ts.map +1 -0
- package/lib/components/header/LegendMarketplaceHeader.js +36 -0
- package/lib/components/header/LegendMarketplaceHeader.js.map +1 -0
- package/lib/components/home/LegendMarketplaceHome.d.ts +19 -0
- package/lib/components/home/LegendMarketplaceHome.d.ts.map +1 -0
- package/lib/components/home/LegendMarketplaceHome.js +22 -0
- package/lib/components/home/LegendMarketplaceHome.js.map +1 -0
- package/lib/index.css +17 -0
- package/lib/index.css.map +1 -0
- package/lib/index.d.ts +22 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +24 -0
- package/lib/index.js.map +1 -0
- package/lib/package.json +87 -0
- package/lib/stores/LegendMarketplaceApplicationPlugin.d.ts +26 -0
- package/lib/stores/LegendMarketplaceApplicationPlugin.d.ts.map +1 -0
- package/lib/stores/LegendMarketplaceApplicationPlugin.js +27 -0
- package/lib/stores/LegendMarketplaceApplicationPlugin.js.map +1 -0
- package/lib/stores/LegendMarketplaceBaseStore.d.ts +30 -0
- package/lib/stores/LegendMarketplaceBaseStore.d.ts.map +1 -0
- package/lib/stores/LegendMarketplaceBaseStore.js +63 -0
- package/lib/stores/LegendMarketplaceBaseStore.js.map +1 -0
- package/package.json +87 -0
- package/src/__lib__/LegendMarketplaceEventHelper.ts +26 -0
- package/src/__lib__/LegendMarketplaceNavigation.ts +19 -0
- package/src/__lib__/LegendMarketplaceTesting.ts +19 -0
- package/src/application/LegendMarketplace.tsx +65 -0
- package/src/application/LegendMarketplaceApplicationConfig.ts +129 -0
- package/src/application/LegendMarketplacePluginManager.ts +28 -0
- package/src/application/__test-utils__/LegendMarketplaceApplicationTestUtils.ts +53 -0
- package/src/components/LegendMarketplaceFrameworkProvider.tsx +70 -0
- package/src/components/LegendMarketplaceWebApplication.tsx +117 -0
- package/src/components/__test-utils__/LegendMarketplaceStoreTestUtils.tsx +98 -0
- package/src/components/extensions/Core_LegendMarketplaceApplicationPlugin.tsx +26 -0
- package/src/components/header/LegendMarketplaceAppInfo.tsx +166 -0
- package/src/components/header/LegendMarketplaceHeader.tsx +68 -0
- package/src/components/home/LegendMarketplaceHome.tsx +41 -0
- package/src/index.ts +28 -0
- package/src/stores/LegendMarketplaceApplicationPlugin.ts +30 -0
- package/src/stores/LegendMarketplaceBaseStore.ts +105 -0
- package/tsconfig.json +81 -0
- package/tsconfig.package.json +56 -0
|
@@ -0,0 +1,30 @@
|
|
|
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 { LegendApplicationPlugin } from '@finos/legend-application';
|
|
18
|
+
import type { LegendMarketplacePluginManager } from '../application/LegendMarketplacePluginManager.js';
|
|
19
|
+
|
|
20
|
+
export abstract class LegendMarketplaceApplicationPlugin extends LegendApplicationPlugin {
|
|
21
|
+
/**
|
|
22
|
+
* This helps to better type-check for this empty abtract type
|
|
23
|
+
* See https://github.com/finos/legend-studio/blob/master/docs/technical/typescript-usage.md#understand-typescript-structual-type-system
|
|
24
|
+
*/
|
|
25
|
+
private readonly _$nominalTypeBrand!: 'LegendMarketplaceApplicationPlugin';
|
|
26
|
+
|
|
27
|
+
install(pluginManager: LegendMarketplacePluginManager): void {
|
|
28
|
+
pluginManager.registerApplicationPlugin(this);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
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 {
|
|
18
|
+
type GeneratorFn,
|
|
19
|
+
ActionState,
|
|
20
|
+
LogEvent,
|
|
21
|
+
assertErrorThrown,
|
|
22
|
+
} from '@finos/legend-shared';
|
|
23
|
+
import {
|
|
24
|
+
type ApplicationStore,
|
|
25
|
+
LegendApplicationTelemetryHelper,
|
|
26
|
+
APPLICATION_EVENT,
|
|
27
|
+
} from '@finos/legend-application';
|
|
28
|
+
import { flow, makeObservable } from 'mobx';
|
|
29
|
+
import { DepotServerClient } from '@finos/legend-server-depot';
|
|
30
|
+
import { getCurrentUserIDFromEngineServer } from '@finos/legend-graph';
|
|
31
|
+
import type { LegendMarketplaceApplicationConfig } from '../application/LegendMarketplaceApplicationConfig.js';
|
|
32
|
+
import type { LegendMarketplacePluginManager } from '../application/LegendMarketplacePluginManager.js';
|
|
33
|
+
import { LegendMarketplaceEventHelper } from '../__lib__/LegendMarketplaceEventHelper.js';
|
|
34
|
+
|
|
35
|
+
export type LegendMarketplaceApplicationStore = ApplicationStore<
|
|
36
|
+
LegendMarketplaceApplicationConfig,
|
|
37
|
+
LegendMarketplacePluginManager
|
|
38
|
+
>;
|
|
39
|
+
|
|
40
|
+
export class LegendMarketplaceBaseStore {
|
|
41
|
+
readonly applicationStore: LegendMarketplaceApplicationStore;
|
|
42
|
+
readonly depotServerClient: DepotServerClient;
|
|
43
|
+
readonly pluginManager: LegendMarketplacePluginManager;
|
|
44
|
+
|
|
45
|
+
readonly initState = ActionState.create();
|
|
46
|
+
|
|
47
|
+
constructor(applicationStore: LegendMarketplaceApplicationStore) {
|
|
48
|
+
makeObservable<LegendMarketplaceBaseStore>(this, {
|
|
49
|
+
initialize: flow,
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
this.applicationStore = applicationStore;
|
|
53
|
+
this.pluginManager = applicationStore.pluginManager;
|
|
54
|
+
|
|
55
|
+
// depot
|
|
56
|
+
this.depotServerClient = new DepotServerClient({
|
|
57
|
+
serverUrl: this.applicationStore.config.depotServerUrl,
|
|
58
|
+
});
|
|
59
|
+
this.depotServerClient.setTracerService(
|
|
60
|
+
this.applicationStore.tracerService,
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
*initialize(): GeneratorFn<void> {
|
|
65
|
+
if (!this.initState.isInInitialState) {
|
|
66
|
+
this.applicationStore.notificationService.notifyIllegalState(
|
|
67
|
+
'Base store is re-initialized',
|
|
68
|
+
);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
this.initState.inProgress();
|
|
72
|
+
|
|
73
|
+
// retrieved the user identity is not already configured
|
|
74
|
+
if (this.applicationStore.identityService.isAnonymous) {
|
|
75
|
+
try {
|
|
76
|
+
this.applicationStore.identityService.setCurrentUser(
|
|
77
|
+
(yield getCurrentUserIDFromEngineServer(
|
|
78
|
+
this.applicationStore.config.engineServerUrl,
|
|
79
|
+
)) as string,
|
|
80
|
+
);
|
|
81
|
+
} catch (error) {
|
|
82
|
+
assertErrorThrown(error);
|
|
83
|
+
this.applicationStore.logService.error(
|
|
84
|
+
LogEvent.create(APPLICATION_EVENT.IDENTITY_AUTO_FETCH__FAILURE),
|
|
85
|
+
error,
|
|
86
|
+
);
|
|
87
|
+
this.applicationStore.notificationService.notifyWarning(error.message);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// setup telemetry service
|
|
92
|
+
this.applicationStore.telemetryService.setup();
|
|
93
|
+
|
|
94
|
+
LegendApplicationTelemetryHelper.logEvent_ApplicationInitializationSucceeded(
|
|
95
|
+
this.applicationStore.telemetryService,
|
|
96
|
+
this.applicationStore,
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
LegendMarketplaceEventHelper.notify_ApplicationLoadSucceeded(
|
|
100
|
+
this.applicationStore.eventService,
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
this.initState.complete();
|
|
104
|
+
}
|
|
105
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": [
|
|
4
|
+
"dom",
|
|
5
|
+
"dom.iterable",
|
|
6
|
+
"esnext",
|
|
7
|
+
"webworker",
|
|
8
|
+
"scripthost"
|
|
9
|
+
],
|
|
10
|
+
"composite": true,
|
|
11
|
+
"declaration": true,
|
|
12
|
+
"declarationMap": true,
|
|
13
|
+
"sourceMap": true,
|
|
14
|
+
"target": "esnext",
|
|
15
|
+
"module": "nodenext",
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
"resolveJsonModule": true,
|
|
18
|
+
"verbatimModuleSyntax": true,
|
|
19
|
+
"strict": true,
|
|
20
|
+
"noImplicitOverride": true,
|
|
21
|
+
"noUncheckedIndexedAccess": true,
|
|
22
|
+
"exactOptionalPropertyTypes": true,
|
|
23
|
+
"forceConsistentCasingInFileNames": true,
|
|
24
|
+
"outDir": "./lib",
|
|
25
|
+
"tsBuildInfoFile": "./build/prod.tsbuildinfo",
|
|
26
|
+
"rootDir": "./src",
|
|
27
|
+
"jsx": "react-jsx",
|
|
28
|
+
"moduleResolution": "nodenext",
|
|
29
|
+
"moduleDetection": "force",
|
|
30
|
+
"isolatedModules": true,
|
|
31
|
+
"esModuleInterop": true,
|
|
32
|
+
"allowSyntheticDefaultImports": true,
|
|
33
|
+
"resolvePackageJsonExports": true,
|
|
34
|
+
"resolvePackageJsonImports": true,
|
|
35
|
+
"preserveConstEnums": true,
|
|
36
|
+
"incremental": true,
|
|
37
|
+
"useDefineForClassFields": true,
|
|
38
|
+
"noImplicitAny": true,
|
|
39
|
+
"noImplicitThis": true,
|
|
40
|
+
"strictNullChecks": true,
|
|
41
|
+
"strictFunctionTypes": true,
|
|
42
|
+
"strictBindCallApply": true,
|
|
43
|
+
"strictPropertyInitialization": true,
|
|
44
|
+
"strictBuiltinIteratorReturn": true,
|
|
45
|
+
"alwaysStrict": true,
|
|
46
|
+
"useUnknownInCatchVariables": true
|
|
47
|
+
},
|
|
48
|
+
"references": [
|
|
49
|
+
{
|
|
50
|
+
"path": "./tsconfig.package.json"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"files": [
|
|
54
|
+
"./src/index.ts",
|
|
55
|
+
"./src/__lib__/LegendMarketplaceEventHelper.ts",
|
|
56
|
+
"./src/__lib__/LegendMarketplaceNavigation.ts",
|
|
57
|
+
"./src/__lib__/LegendMarketplaceTesting.ts",
|
|
58
|
+
"./src/application/LegendMarketplaceApplicationConfig.ts",
|
|
59
|
+
"./src/application/LegendMarketplacePluginManager.ts",
|
|
60
|
+
"./src/application/__test-utils__/LegendMarketplaceApplicationTestUtils.ts",
|
|
61
|
+
"./src/stores/LegendMarketplaceApplicationPlugin.ts",
|
|
62
|
+
"./src/stores/LegendMarketplaceBaseStore.ts",
|
|
63
|
+
"./src/application/LegendMarketplace.tsx",
|
|
64
|
+
"./src/components/LegendMarketplaceFrameworkProvider.tsx",
|
|
65
|
+
"./src/components/LegendMarketplaceWebApplication.tsx",
|
|
66
|
+
"./src/components/__test-utils__/LegendMarketplaceStoreTestUtils.tsx",
|
|
67
|
+
"./src/components/extensions/Core_LegendMarketplaceApplicationPlugin.tsx",
|
|
68
|
+
"./src/components/header/LegendMarketplaceAppInfo.tsx",
|
|
69
|
+
"./src/components/header/LegendMarketplaceHeader.tsx",
|
|
70
|
+
"./src/components/home/LegendMarketplaceHome.tsx"
|
|
71
|
+
],
|
|
72
|
+
"include": [
|
|
73
|
+
"src/**/*.ts",
|
|
74
|
+
"src/**/*.tsx",
|
|
75
|
+
"src/**/*.json"
|
|
76
|
+
],
|
|
77
|
+
"exclude": [
|
|
78
|
+
"src/**/__tests__/**/*.*",
|
|
79
|
+
"src/**/__mocks__/**/*.*"
|
|
80
|
+
]
|
|
81
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": [
|
|
4
|
+
"dom",
|
|
5
|
+
"dom.iterable",
|
|
6
|
+
"esnext",
|
|
7
|
+
"webworker",
|
|
8
|
+
"scripthost"
|
|
9
|
+
],
|
|
10
|
+
"composite": true,
|
|
11
|
+
"declaration": true,
|
|
12
|
+
"declarationMap": true,
|
|
13
|
+
"sourceMap": true,
|
|
14
|
+
"target": "esnext",
|
|
15
|
+
"module": "nodenext",
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
"resolveJsonModule": true,
|
|
18
|
+
"verbatimModuleSyntax": true,
|
|
19
|
+
"strict": true,
|
|
20
|
+
"noImplicitOverride": true,
|
|
21
|
+
"noUncheckedIndexedAccess": true,
|
|
22
|
+
"exactOptionalPropertyTypes": true,
|
|
23
|
+
"forceConsistentCasingInFileNames": true,
|
|
24
|
+
"outDir": "./lib",
|
|
25
|
+
"tsBuildInfoFile": "./build/package.tsbuildinfo",
|
|
26
|
+
"rootDir": "./",
|
|
27
|
+
"moduleResolution": "nodenext",
|
|
28
|
+
"moduleDetection": "force",
|
|
29
|
+
"isolatedModules": true,
|
|
30
|
+
"esModuleInterop": true,
|
|
31
|
+
"allowSyntheticDefaultImports": true,
|
|
32
|
+
"resolvePackageJsonExports": true,
|
|
33
|
+
"resolvePackageJsonImports": true,
|
|
34
|
+
"preserveConstEnums": true,
|
|
35
|
+
"incremental": true,
|
|
36
|
+
"useDefineForClassFields": true,
|
|
37
|
+
"noImplicitAny": true,
|
|
38
|
+
"noImplicitThis": true,
|
|
39
|
+
"strictNullChecks": true,
|
|
40
|
+
"strictFunctionTypes": true,
|
|
41
|
+
"strictBindCallApply": true,
|
|
42
|
+
"strictPropertyInitialization": true,
|
|
43
|
+
"strictBuiltinIteratorReturn": true,
|
|
44
|
+
"alwaysStrict": true,
|
|
45
|
+
"useUnknownInCatchVariables": true
|
|
46
|
+
},
|
|
47
|
+
"files": [
|
|
48
|
+
"./package.json"
|
|
49
|
+
],
|
|
50
|
+
"include": [
|
|
51
|
+
"package.json"
|
|
52
|
+
],
|
|
53
|
+
"exclude": [
|
|
54
|
+
"/home/runner/work/legend-studio/legend-studio/packages/legend-application-marketplace/lib"
|
|
55
|
+
]
|
|
56
|
+
}
|