@equinor/fusion-framework-module-app 1.0.11 → 1.1.0
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/CHANGELOG.md +9 -128
- package/LICENSE +21 -0
- package/dist/esm/configurator.js +57 -0
- package/dist/esm/configurator.js.map +1 -0
- package/dist/esm/helpers.js +2 -0
- package/dist/esm/helpers.js.map +1 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/module.js +26 -0
- package/dist/esm/module.js.map +1 -0
- package/dist/esm/provider.js +72 -0
- package/dist/esm/provider.js.map +1 -0
- package/dist/esm/types.js +1 -19
- package/dist/esm/types.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/configurator.d.ts +24 -0
- package/dist/types/helpers.d.ts +2 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/module.d.ts +13 -0
- package/dist/types/provider.d.ts +35 -0
- package/dist/types/types.d.ts +13 -39
- package/package.json +35 -31
- package/src/configurator.ts +75 -0
- package/src/helpers.ts +4 -0
- package/src/index.ts +6 -0
- package/src/module.ts +35 -0
- package/src/provider.ts +121 -0
- package/src/types.ts +13 -44
- package/tsconfig.json +6 -0
- package/yarn-error.log +66 -0
- package/TODO.md +0 -5
- package/dist/esm/app-configurator.js +0 -2
- package/dist/esm/app-configurator.js.map +0 -1
- package/dist/esm/app-provider.js +0 -25
- package/dist/esm/app-provider.js.map +0 -1
- package/dist/types/app-configurator.d.ts +0 -0
- package/dist/types/app-provider.d.ts +0 -11
- package/src/app-configurator.ts +0 -0
- package/src/app-provider.ts +0 -34
package/CHANGELOG.md
CHANGED
|
@@ -3,265 +3,146 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## 1.0
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
## 1.1.0 (2022-11-01)
|
|
11
7
|
|
|
8
|
+
### Features
|
|
12
9
|
|
|
10
|
+
- **module-app:** initial app module ([ce5aed1](https://github.com/equinor/fusion-framework/commit/ce5aed124431afbe55b9cf11a50a5c8d5499260e))
|
|
13
11
|
|
|
14
|
-
##
|
|
12
|
+
## 1.0.12 (2022-10-27)
|
|
15
13
|
|
|
16
14
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
17
15
|
|
|
16
|
+
## 1.0.11 (2022-10-21)
|
|
18
17
|
|
|
18
|
+
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
19
19
|
|
|
20
|
+
## [1.0.10](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-app@1.0.9...@equinor/fusion-framework-module-app@1.0.10) (2022-10-17)
|
|
20
21
|
|
|
22
|
+
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
21
23
|
|
|
22
24
|
## 1.0.9 (2022-10-03)
|
|
23
25
|
|
|
24
26
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
28
|
## [1.0.8](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-app@1.0.7...@equinor/fusion-framework-module-app@1.0.8) (2022-09-29)
|
|
31
29
|
|
|
32
30
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
32
|
## 1.0.7 (2022-09-27)
|
|
39
33
|
|
|
40
34
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
41
35
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
36
|
## 1.0.6 (2022-09-20)
|
|
47
37
|
|
|
48
38
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
49
39
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
40
|
## [1.0.5](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-app@1.0.4...@equinor/fusion-framework-module-app@1.0.5) (2022-09-14)
|
|
55
41
|
|
|
56
42
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
57
43
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
44
|
## [1.0.4](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-app@1.0.3...@equinor/fusion-framework-module-app@1.0.4) (2022-09-13)
|
|
63
45
|
|
|
64
46
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
65
47
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
48
|
## [1.0.3](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-app@1.0.2...@equinor/fusion-framework-module-app@1.0.3) (2022-09-13)
|
|
71
49
|
|
|
72
50
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
73
51
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
52
|
## [1.0.2](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-app@1.0.1...@equinor/fusion-framework-module-app@1.0.2) (2022-09-13)
|
|
79
53
|
|
|
80
54
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
81
55
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
56
|
## [1.0.1](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-app@1.0.1-next.1...@equinor/fusion-framework-module-app@1.0.1) (2022-09-12)
|
|
87
57
|
|
|
88
58
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
89
59
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
60
|
## [1.0.1-next.1](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-app@1.0.1-next.0...@equinor/fusion-framework-module-app@1.0.1-next.1) (2022-09-12)
|
|
95
61
|
|
|
96
62
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
97
63
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
64
|
## [1.0.1-next.0](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-app@1.0.0...@equinor/fusion-framework-module-app@1.0.1-next.0) (2022-09-12)
|
|
103
65
|
|
|
104
66
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
105
67
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
68
|
## 1.0.0 (2022-09-12)
|
|
111
69
|
|
|
112
70
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
113
71
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
72
|
## [1.0.0-alpha.0](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-app@0.1.17...@equinor/fusion-framework-module-app@1.0.0-alpha.0) (2022-09-12)
|
|
119
73
|
|
|
120
74
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
121
75
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
76
|
## 0.1.17 (2022-09-05)
|
|
127
77
|
|
|
128
78
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
129
79
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
80
|
## 0.1.16 (2022-09-05)
|
|
135
81
|
|
|
136
82
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
137
83
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
84
|
## 0.1.15 (2022-08-19)
|
|
143
85
|
|
|
144
86
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
145
87
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
88
|
## [0.1.14](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-app@0.1.13...@equinor/fusion-framework-module-app@0.1.14) (2022-08-15)
|
|
151
89
|
|
|
152
90
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
153
91
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
92
|
## 0.1.13 (2022-08-11)
|
|
159
93
|
|
|
160
94
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
161
95
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
96
|
## [0.1.12](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-app@0.1.11...@equinor/fusion-framework-module-app@0.1.12) (2022-08-04)
|
|
167
97
|
|
|
168
98
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
169
99
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
100
|
## 0.1.11 (2022-08-01)
|
|
175
101
|
|
|
176
102
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
177
103
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
104
|
## [0.1.10](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-app@0.1.9...@equinor/fusion-framework-module-app@0.1.10) (2022-07-01)
|
|
183
105
|
|
|
184
106
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
185
107
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
108
|
## [0.1.9](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-app@0.1.8...@equinor/fusion-framework-module-app@0.1.9) (2022-06-30)
|
|
191
109
|
|
|
192
110
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
193
111
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
112
|
## [0.1.8](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-app@0.1.7...@equinor/fusion-framework-module-app@0.1.8) (2022-06-30)
|
|
199
113
|
|
|
200
114
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
201
115
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
116
|
## [0.1.7](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-app@0.1.6...@equinor/fusion-framework-module-app@0.1.7) (2022-06-28)
|
|
207
117
|
|
|
208
118
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
209
119
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
120
|
## [0.1.6](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-app@0.1.5...@equinor/fusion-framework-module-app@0.1.6) (2022-06-28)
|
|
215
121
|
|
|
216
122
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
217
123
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
124
|
## [0.1.5](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module-app@0.1.4...@equinor/fusion-framework-module-app@0.1.5) (2022-06-28)
|
|
223
125
|
|
|
224
126
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
225
127
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
128
|
## 0.1.4 (2022-06-28)
|
|
231
129
|
|
|
232
130
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
233
131
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
132
|
## 0.1.3 (2022-06-13)
|
|
239
133
|
|
|
240
134
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
241
135
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
136
|
## 0.1.2 (2022-06-10)
|
|
247
137
|
|
|
248
138
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
249
139
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
140
|
## 0.1.1 (2022-02-09)
|
|
255
141
|
|
|
256
142
|
**Note:** Version bump only for package @equinor/fusion-framework-module-app
|
|
257
143
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
144
|
# 0.1.0 (2022-02-07)
|
|
263
145
|
|
|
264
|
-
|
|
265
146
|
### Features
|
|
266
147
|
|
|
267
|
-
|
|
148
|
+
- add module for application loading ([61d4e5f](https://github.com/equinor/fusion-framework/commit/61d4e5fa0df6308155bf830e68d902cecb8146c2))
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Equinor
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { moduleKey } from './module';
|
|
11
|
+
export class AppConfigurator {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.defaultExpireTime = 1 * 60 * 1000;
|
|
14
|
+
}
|
|
15
|
+
_createHttpClient(init) {
|
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
const http = yield init.requireInstance('http');
|
|
18
|
+
if (http.hasClient(moduleKey)) {
|
|
19
|
+
return http.createClient(moduleKey);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
const serviceDiscovery = yield init.requireInstance('serviceDiscovery');
|
|
23
|
+
return yield serviceDiscovery.createClient('portal');
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
createConfig(args) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
const httpClient = yield this._createHttpClient(args);
|
|
30
|
+
const config = {
|
|
31
|
+
getApp: {
|
|
32
|
+
client: {
|
|
33
|
+
fn: ({ appKey }) => httpClient.json$(`/api/apps/${appKey}`),
|
|
34
|
+
},
|
|
35
|
+
key: ({ appKey }) => appKey,
|
|
36
|
+
},
|
|
37
|
+
getApps: {
|
|
38
|
+
client: {
|
|
39
|
+
fn: () => httpClient.json$(`/api/apps`),
|
|
40
|
+
},
|
|
41
|
+
key: () => 'apps',
|
|
42
|
+
},
|
|
43
|
+
getConfig: {
|
|
44
|
+
client: {
|
|
45
|
+
fn: ({ appKey, tag }) => httpClient.json$(`/api/apps/${appKey}/config${tag ? `?tag=${tag}` : ''}`),
|
|
46
|
+
},
|
|
47
|
+
key: (args) => JSON.stringify(args),
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
return this.processConfig(config);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
processConfig(config) {
|
|
54
|
+
return config;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=configurator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator.js","sourceRoot":"","sources":["../../src/configurator.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAiBrC,MAAM,OAAO,eAAe;IAA5B;QAGI,sBAAiB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;IAmDtC,CAAC;IA9CmB,iBAAiB,CAC7B,IAA2D;;YAE3D,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;YAEhD,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE;gBAC3B,OAAO,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;aACvC;iBAAM;gBAEH,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;gBAExE,OAAO,MAAM,gBAAgB,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;aACxD;QACL,CAAC;KAAA;IAEY,YAAY,CAC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AAS,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAsC,MAAM,gBAAgB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAgB,MAAM,YAAY,CAAC;AAEvD,cAAc,SAAS,CAAC;AAExB,OAAO,EAAE,OAAO,EAAa,MAAM,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { AppConfigurator } from './configurator';
|
|
11
|
+
import { AppProvider } from './provider';
|
|
12
|
+
export const moduleKey = 'app';
|
|
13
|
+
export const module = {
|
|
14
|
+
name: moduleKey,
|
|
15
|
+
configure: () => new AppConfigurator(),
|
|
16
|
+
initialize: (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
+
const config = yield args.config.createConfig(args);
|
|
18
|
+
const event = yield args.requireInstance('event').catch(() => undefined);
|
|
19
|
+
return new AppProvider({ config, event });
|
|
20
|
+
}),
|
|
21
|
+
dispose: (args) => {
|
|
22
|
+
args.instance.dispose();
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
export default module;
|
|
26
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/module.ts"],"names":[],"mappings":";;;;;;;;;AAGA,OAAO,EAAoB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAgB,MAAM,YAAY,CAAC;AAEvD,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC;AAS/B,MAAM,CAAC,MAAM,MAAM,GAAc;IAC7B,IAAI,EAAE,SAAS;IACf,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,eAAe,EAAE;IACtC,UAAU,EAAE,CAAO,IAAI,EAAE,EAAE;QACvB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QACpD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QACzE,OAAO,IAAI,WAAW,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9C,CAAC,CAAA;IACD,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;QACb,IAAI,CAAC,QAAmC,CAAC,OAAO,EAAE,CAAC;IACxD,CAAC;CACJ,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _AppProvider_appClient, _AppProvider_appsClient, _AppProvider_configClient, _AppProvider_current$, _AppProvider_subscription;
|
|
13
|
+
import { BehaviorSubject, distinctUntilChanged, Observable, pairwise, Subscription, takeWhile, } from 'rxjs';
|
|
14
|
+
import { Query, queryValue } from '@equinor/fusion-observable/query';
|
|
15
|
+
import { compareAppManifest } from './helpers';
|
|
16
|
+
export class AppProvider extends Observable {
|
|
17
|
+
constructor(args) {
|
|
18
|
+
super((observer) => this.current$.subscribe(observer));
|
|
19
|
+
_AppProvider_appClient.set(this, void 0);
|
|
20
|
+
_AppProvider_appsClient.set(this, void 0);
|
|
21
|
+
_AppProvider_configClient.set(this, void 0);
|
|
22
|
+
_AppProvider_current$.set(this, void 0);
|
|
23
|
+
_AppProvider_subscription.set(this, new Subscription());
|
|
24
|
+
const { event, config } = args;
|
|
25
|
+
__classPrivateFieldSet(this, _AppProvider_current$, new BehaviorSubject(undefined), "f");
|
|
26
|
+
__classPrivateFieldSet(this, _AppProvider_appClient, new Query(config.getApp), "f");
|
|
27
|
+
__classPrivateFieldSet(this, _AppProvider_appsClient, new Query(config.getApps), "f");
|
|
28
|
+
__classPrivateFieldSet(this, _AppProvider_configClient, new Query(config.getConfig), "f");
|
|
29
|
+
__classPrivateFieldGet(this, _AppProvider_subscription, "f").add(__classPrivateFieldGet(this, _AppProvider_appClient, "f").complete);
|
|
30
|
+
__classPrivateFieldGet(this, _AppProvider_subscription, "f").add(__classPrivateFieldGet(this, _AppProvider_appsClient, "f").complete);
|
|
31
|
+
__classPrivateFieldGet(this, _AppProvider_subscription, "f").add(__classPrivateFieldGet(this, _AppProvider_configClient, "f").complete);
|
|
32
|
+
__classPrivateFieldGet(this, _AppProvider_subscription, "f").add(this.current$
|
|
33
|
+
.pipe(pairwise(), takeWhile(() => !!event))
|
|
34
|
+
.subscribe(([previous, next]) => {
|
|
35
|
+
event === null || event === void 0 ? void 0 : event.dispatchEvent('onCurrentAppChanged', {
|
|
36
|
+
source: this,
|
|
37
|
+
detail: { previous, next },
|
|
38
|
+
});
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
get current() {
|
|
42
|
+
return __classPrivateFieldGet(this, _AppProvider_current$, "f").value;
|
|
43
|
+
}
|
|
44
|
+
get current$() {
|
|
45
|
+
return __classPrivateFieldGet(this, _AppProvider_current$, "f").pipe(distinctUntilChanged(compareAppManifest));
|
|
46
|
+
}
|
|
47
|
+
getApp(appKey) {
|
|
48
|
+
return queryValue(__classPrivateFieldGet(this, _AppProvider_appClient, "f").query({ appKey }));
|
|
49
|
+
}
|
|
50
|
+
getAllApps() {
|
|
51
|
+
return queryValue(__classPrivateFieldGet(this, _AppProvider_appsClient, "f").query());
|
|
52
|
+
}
|
|
53
|
+
getAppConfig(appKey, tag) {
|
|
54
|
+
return queryValue(__classPrivateFieldGet(this, _AppProvider_configClient, "f").query({ appKey, tag }));
|
|
55
|
+
}
|
|
56
|
+
setCurrentApp(appKey) {
|
|
57
|
+
return new Promise((complete, error) => {
|
|
58
|
+
const query$ = __classPrivateFieldGet(this, _AppProvider_appClient, "f").query({ appKey }, { skipQueue: true });
|
|
59
|
+
__classPrivateFieldGet(this, _AppProvider_subscription, "f").add(queryValue(query$).subscribe({
|
|
60
|
+
next: (x) => __classPrivateFieldGet(this, _AppProvider_current$, "f").next(x),
|
|
61
|
+
error,
|
|
62
|
+
complete,
|
|
63
|
+
}));
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
dispose() {
|
|
67
|
+
__classPrivateFieldGet(this, _AppProvider_subscription, "f").unsubscribe();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
_AppProvider_appClient = new WeakMap(), _AppProvider_appsClient = new WeakMap(), _AppProvider_configClient = new WeakMap(), _AppProvider_current$ = new WeakMap(), _AppProvider_subscription = new WeakMap();
|
|
71
|
+
export default AppProvider;
|
|
72
|
+
//# sourceMappingURL=provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/provider.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACH,eAAe,EACf,oBAAoB,EACpB,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,SAAS,GACZ,MAAM,MAAM,CAAC;AAId,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AASrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAY/C,MAAM,OAAO,WAAY,SAAQ,UAAmC;IAkBhE,YAAY,IAAmE;QAC3E,KAAK,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;QAlB3D,yCAAmD;QACnD,0CAAwC;QAExC,4CAAuE;QAEvE,wCAAoD;QAEpD,oCAAgB,IAAI,YAAY,EAAE,EAAC;QAa/B,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAE/B,uBAAA,IAAI,yBAAa,IAAI,eAAe,CAA0B,SAAS,CAAC,MAAA,CAAC;QAEzE,uBAAA,IAAI,0BAAc,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,MAAA,CAAC;QAC3C,uBAAA,IAAI,2BAAe,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,MAAA,CAAC;QAC7C,uBAAA,IAAI,6BAAiB,IAAI,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,MAAA,CAAC;QAEjD,uBAAA,IAAI,iCAAc,CAAC,GAAG,CAAC,uBAAA,IAA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AAC;IAEM,aAAa,CAAC,MAAc;QAC/B,OAAO,IAAI,OAAO,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;YACnC,MAAM,MAAM,GAAG,uBAAA,IAAI,8BAAW,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACtE,uBAAA,IAAI,iCAAc,CAAC,GAAG,CAClB,UAAU,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC;gBACzB,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,uBAAA,IAAI,6BAAU,CAAC,IAAI,CAAC,CAAC,CAAC;gBACnC,KAAK;gBACL,QAAQ;aACX,CAAC,CACL,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;IAEM,OAAO;QACV,uBAAA,IAAI,iCAAc,CAAC,WAAW,EAAE,CAAC;IACrC,CAAC;CACJ;;AAUD,eAAe,WAAW,CAAC"}
|
package/dist/esm/types.js
CHANGED
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
(function (ContextTypes) {
|
|
3
|
-
ContextTypes["Contract"] = "Contract";
|
|
4
|
-
ContextTypes["OrgChart"] = "OrgChart";
|
|
5
|
-
ContextTypes["PDP"] = "PDP";
|
|
6
|
-
ContextTypes["PimsDomain"] = "PimsDomain";
|
|
7
|
-
ContextTypes["Portfolio"] = "Portfolio";
|
|
8
|
-
ContextTypes["Project"] = "Project";
|
|
9
|
-
ContextTypes["ProjectMaster"] = "ProjectMaster";
|
|
10
|
-
ContextTypes["Facility"] = "Facility";
|
|
11
|
-
ContextTypes["TpdPortfolio"] = "TpdPortfolio";
|
|
12
|
-
})(ContextTypes || (ContextTypes = {}));
|
|
13
|
-
export class ContextType {
|
|
14
|
-
constructor(id, isChildType, parentTypeIds = []) {
|
|
15
|
-
this.id = id;
|
|
16
|
-
this.isChildType = isChildType;
|
|
17
|
-
this.parentTypeIds = parentTypeIds;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
1
|
+
export {};
|
|
20
2
|
//# sourceMappingURL=types.js.map
|
package/dist/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
|