@omnia/tooling-composers 8.0.128-dev → 8.0.129-dev

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 (24) hide show
  1. package/internal-do-not-import-from-here/BlockingRegistry.js +33 -33
  2. package/internal-do-not-import-from-here/BuildConfigurationRegistry.js +19 -19
  3. package/internal-do-not-import-from-here/ComponentRegistry.js +83 -83
  4. package/internal-do-not-import-from-here/Composer.js +30 -30
  5. package/internal-do-not-import-from-here/ConfigurationClientServiceRegistry.js +15 -15
  6. package/internal-do-not-import-from-here/DevelopmentBuildConfiguration.js +8 -8
  7. package/internal-do-not-import-from-here/DevelopmentEnvironment.js +3 -3
  8. package/internal-do-not-import-from-here/DevelopmentHostingEnvironment.js +8 -8
  9. package/internal-do-not-import-from-here/ImportManifestRegistry.js +18 -18
  10. package/internal-do-not-import-from-here/LoadableManifestRegistry.js +247 -249
  11. package/internal-do-not-import-from-here/LocalizationComposer.js +15 -15
  12. package/internal-do-not-import-from-here/ManifestGroupRegistry.js +87 -87
  13. package/internal-do-not-import-from-here/ManifestRegistry.js +83 -83
  14. package/internal-do-not-import-from-here/RequestedResourcesRegistry.js +54 -54
  15. package/internal-do-not-import-from-here/RequiredAzureAdAppPermissionRegistry.js +12 -12
  16. package/internal-do-not-import-from-here/ResourceRegistry.js +136 -136
  17. package/internal-do-not-import-from-here/SecurityProviderManifestRegistry.js +24 -24
  18. package/internal-do-not-import-from-here/ServiceAppRegistry.js +26 -26
  19. package/internal-do-not-import-from-here/ServiceFeatureRegistry.js +27 -27
  20. package/internal-do-not-import-from-here/ServiceManifestRegistry.js +29 -29
  21. package/internal-do-not-import-from-here/ServiceRoleRegistry.js +26 -26
  22. package/internal-do-not-import-from-here/Utils.js +79 -79
  23. package/internal-do-not-import-from-here/task.js +1 -1
  24. package/package.json +3 -3
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- var _a;
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  exports.LoadableManifestRegistry = exports.StaticClientLoadableManifestProviderProxy = void 0;
5
4
  //import { DomMatchingRule, LoadByUrlMatchingRule, LoadableBundleManifest, BundleIdentity } from './models';
@@ -75,268 +74,267 @@ class CircularDependencyValidator {
75
74
  }
76
75
  }
77
76
  class LoadableManifestRegistry {
78
- static getManifestTargetName(target) {
79
- switch (target.toString()) {
80
- case models_1.ClientManifestTargetTypes.public.toString():
81
- return "public";
82
- case models_1.ClientManifestTargetTypes.admin.toString():
83
- return "admin";
84
- case models_1.ClientManifestTargetTypes.editor.toString():
85
- return "editor";
86
- case models_1.ClientManifestTargetTypes.docs.toString():
87
- return "docs";
77
+ static { this.ManifestDependencies = new Map(); }
78
+ static { this.WithNoManifestDependencies = new Map(); }
79
+ static { this.ManifestFileTypes = new Map(); }
80
+ static { this.ManifestVersions = new Map(); }
81
+ static { this.ClientManifests = new Map(); }
82
+ static { this.RegisteredManifests = new Map(); }
83
+ static { this.ClientManifestProviders = []; }
84
+ static { this.getRegisteredManifest = (manifestId) => {
85
+ manifestId = Utils_1.Utils.ensureValidManifestId(manifestId);
86
+ return LoadableManifestRegistry.RegisteredManifests.get(manifestId);
87
+ }; }
88
+ static { this.withNoDependency = (manifestId) => {
89
+ manifestId = Utils_1.Utils.ensureValidManifestId(manifestId);
90
+ if (LoadableManifestRegistry.ManifestDependencies.get(manifestId)) {
91
+ new Error("Can't combine adding dependencies and also set withNoDependency, see manifest path: " + ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath());
88
92
  }
89
- }
90
- }
91
- exports.LoadableManifestRegistry = LoadableManifestRegistry;
92
- _a = LoadableManifestRegistry;
93
- LoadableManifestRegistry.ManifestDependencies = new Map();
94
- LoadableManifestRegistry.WithNoManifestDependencies = new Map();
95
- LoadableManifestRegistry.ManifestFileTypes = new Map();
96
- LoadableManifestRegistry.ManifestVersions = new Map();
97
- LoadableManifestRegistry.ClientManifests = new Map();
98
- LoadableManifestRegistry.RegisteredManifests = new Map();
99
- LoadableManifestRegistry.ClientManifestProviders = [];
100
- LoadableManifestRegistry.getRegisteredManifest = (manifestId) => {
101
- manifestId = Utils_1.Utils.ensureValidManifestId(manifestId);
102
- return _a.RegisteredManifests.get(manifestId);
103
- };
104
- LoadableManifestRegistry.withNoDependency = (manifestId) => {
105
- manifestId = Utils_1.Utils.ensureValidManifestId(manifestId);
106
- if (_a.ManifestDependencies.get(manifestId)) {
107
- new Error("Can't combine adding dependencies and also set withNoDependency, see manifest path: " + ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath());
108
- }
109
- _a.WithNoManifestDependencies.set(manifestId, true);
110
- };
111
- LoadableManifestRegistry.isDefineWithNoDependency = (manifestId) => {
112
- return _a.WithNoManifestDependencies.get(manifestId) === true;
113
- };
114
- LoadableManifestRegistry.addManifestDependency = (manifestId, dependentOnManifestId, dependentManifestOmniaServiceId = null) => {
115
- manifestId = Utils_1.Utils.ensureValidManifestId(manifestId);
116
- dependentOnManifestId = Utils_1.Utils.ensureValidManifestId(dependentOnManifestId, "Invalid depending manifest id");
117
- if (_a.WithNoManifestDependencies.get(manifestId) === true) {
118
- new Error("Can't combine adding dependencies and also set withNoDependency, see manifest path: " + ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath());
119
- }
120
- if (dependentManifestOmniaServiceId != null) {
121
- dependentManifestOmniaServiceId = Utils_1.Utils.ensureValidServiceId(dependentManifestOmniaServiceId, "Invalid depending omnia service id");
122
- }
123
- let dependency = new ManifestDependency(dependentOnManifestId, ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath(), dependentManifestOmniaServiceId);
124
- if (_a.ManifestDependencies.get(manifestId) == null) {
125
- _a.ManifestDependencies.set(manifestId, []);
126
- }
127
- let alreadyAdded = false;
128
- for (let currDep of _a.ManifestDependencies.get(manifestId)) {
129
- if (currDep.manifestId.toString() === dependentOnManifestId.toString()) {
130
- alreadyAdded = true;
131
- break;
93
+ LoadableManifestRegistry.WithNoManifestDependencies.set(manifestId, true);
94
+ }; }
95
+ static { this.isDefineWithNoDependency = (manifestId) => {
96
+ return LoadableManifestRegistry.WithNoManifestDependencies.get(manifestId) === true;
97
+ }; }
98
+ static { this.addManifestDependency = (manifestId, dependentOnManifestId, dependentManifestOmniaServiceId = null) => {
99
+ manifestId = Utils_1.Utils.ensureValidManifestId(manifestId);
100
+ dependentOnManifestId = Utils_1.Utils.ensureValidManifestId(dependentOnManifestId, "Invalid depending manifest id");
101
+ if (LoadableManifestRegistry.WithNoManifestDependencies.get(manifestId) === true) {
102
+ new Error("Can't combine adding dependencies and also set withNoDependency, see manifest path: " + ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath());
132
103
  }
133
- }
134
- if (!alreadyAdded) {
135
- _a.ManifestDependencies.get(manifestId).push(dependency);
136
- }
137
- };
138
- LoadableManifestRegistry.getManifestDependencies = (manifestId, currentServiceId) => {
139
- manifestId = Utils_1.Utils.ensureValidManifestId(manifestId);
140
- currentServiceId = Utils_1.Utils.ensureValidServiceId(currentServiceId);
141
- let result = [];
142
- if (!_a.WithNoManifestDependencies.get(manifestId) &&
143
- !_a.ManifestDependencies.get(manifestId)) {
144
- result = _a.getDefaultDependencies();
145
- for (let def of result) {
146
- if (def.resourceId == manifestId) {
147
- throw new Error("Cirkular (default) dependency error for manifest id " + manifestId + ". Please specify withDependency or withNoDependency, as current manifest is part of default");
104
+ if (dependentManifestOmniaServiceId != null) {
105
+ dependentManifestOmniaServiceId = Utils_1.Utils.ensureValidServiceId(dependentManifestOmniaServiceId, "Invalid depending omnia service id");
106
+ }
107
+ let dependency = new ManifestDependency(dependentOnManifestId, ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath(), dependentManifestOmniaServiceId);
108
+ if (LoadableManifestRegistry.ManifestDependencies.get(manifestId) == null) {
109
+ LoadableManifestRegistry.ManifestDependencies.set(manifestId, []);
110
+ }
111
+ let alreadyAdded = false;
112
+ for (let currDep of LoadableManifestRegistry.ManifestDependencies.get(manifestId)) {
113
+ if (currDep.manifestId.toString() === dependentOnManifestId.toString()) {
114
+ alreadyAdded = true;
115
+ break;
148
116
  }
149
117
  }
150
- }
151
- else if (_a.ManifestDependencies.get(manifestId)) {
152
- for (let dep of _a.ManifestDependencies.get(manifestId)) {
153
- const bundleIdentity = {
154
- resourceId: dep.manifestId
155
- };
156
- if (dep.externalOmniaServiceId) {
157
- bundleIdentity.omniaServiceId = dep.externalOmniaServiceId;
118
+ if (!alreadyAdded) {
119
+ LoadableManifestRegistry.ManifestDependencies.get(manifestId).push(dependency);
120
+ }
121
+ }; }
122
+ static { this.getManifestDependencies = (manifestId, currentServiceId) => {
123
+ manifestId = Utils_1.Utils.ensureValidManifestId(manifestId);
124
+ currentServiceId = Utils_1.Utils.ensureValidServiceId(currentServiceId);
125
+ let result = [];
126
+ if (!LoadableManifestRegistry.WithNoManifestDependencies.get(manifestId) &&
127
+ !LoadableManifestRegistry.ManifestDependencies.get(manifestId)) {
128
+ result = LoadableManifestRegistry.getDefaultDependencies();
129
+ for (let def of result) {
130
+ if (def.resourceId == manifestId) {
131
+ throw new Error("Cirkular (default) dependency error for manifest id " + manifestId + ". Please specify withDependency or withNoDependency, as current manifest is part of default");
132
+ }
158
133
  }
159
- result.push(bundleIdentity);
160
134
  }
161
- }
162
- return result;
163
- };
164
- //This only seems to be used for detecting changes
165
- LoadableManifestRegistry.getAllManifestDependencies = () => {
166
- const dependencies = new Map();
167
- for (const regis of _a.ManifestDependencies) {
168
- if (regis[1].length == 0 &&
169
- _a.WithNoManifestDependencies.get(regis[0]) !== true) {
170
- dependencies.set(regis[0], _a.getDefaultDependencies());
135
+ else if (LoadableManifestRegistry.ManifestDependencies.get(manifestId)) {
136
+ for (let dep of LoadableManifestRegistry.ManifestDependencies.get(manifestId)) {
137
+ const bundleIdentity = {
138
+ resourceId: dep.manifestId
139
+ };
140
+ if (dep.externalOmniaServiceId) {
141
+ bundleIdentity.omniaServiceId = dep.externalOmniaServiceId;
142
+ }
143
+ result.push(bundleIdentity);
144
+ }
171
145
  }
172
- else {
173
- dependencies.set(regis[0], regis[1]);
146
+ return result;
147
+ }; }
148
+ //This only seems to be used for detecting changes
149
+ static { this.getAllManifestDependencies = () => {
150
+ const dependencies = new Map();
151
+ for (const regis of LoadableManifestRegistry.ManifestDependencies) {
152
+ if (regis[1].length == 0 &&
153
+ LoadableManifestRegistry.WithNoManifestDependencies.get(regis[0]) !== true) {
154
+ dependencies.set(regis[0], LoadableManifestRegistry.getDefaultDependencies());
155
+ }
156
+ else {
157
+ dependencies.set(regis[0], regis[1]);
158
+ }
174
159
  }
175
- }
176
- return dependencies;
177
- };
178
- LoadableManifestRegistry.addManifestVersion = (manifestId, type, version) => {
179
- manifestId = Utils_1.Utils.ensureValidManifestId(manifestId, "Can't add manifest version to manifest id null/empty/undefined.");
180
- if (!version) {
181
- throw new Error("Can't add manifest version null/empty/undefined to manifest id: " + manifestId);
182
- }
183
- if (!_a.ManifestVersions.get(manifestId)) {
184
- _a.ManifestVersions.set(manifestId, {});
185
- }
186
- _a.ManifestVersions.get(manifestId)[type] = version;
187
- };
188
- LoadableManifestRegistry.getManifestVersion = (manifestId) => {
189
- manifestId = Utils_1.Utils.ensureValidManifestId(manifestId, "Can't get manifest version for manifest id null/empty/undefined.");
190
- let result = _a.ManifestVersions.get(manifestId);
191
- if (!result) {
192
- throw new Error(`Unexpected manifest ${manifestId}, build step has not set manifest version`);
193
- }
194
- return result;
195
- };
196
- LoadableManifestRegistry.addManifestBundleType = (manifestId, type) => {
197
- manifestId = Utils_1.Utils.ensureValidManifestId(manifestId, "Can't add manifest targetType to manifest id null/empty/undefined.");
198
- if (_a.ManifestFileTypes.get(manifestId) == null) {
199
- _a.ManifestFileTypes.set(manifestId, []);
200
- }
201
- let exists = false;
202
- for (let t of _a.ManifestFileTypes.get(manifestId)) {
203
- if (t === type) {
204
- exists = true;
205
- break;
160
+ return dependencies;
161
+ }; }
162
+ static { this.addManifestVersion = (manifestId, type, version) => {
163
+ manifestId = Utils_1.Utils.ensureValidManifestId(manifestId, "Can't add manifest version to manifest id null/empty/undefined.");
164
+ if (!version) {
165
+ throw new Error("Can't add manifest version null/empty/undefined to manifest id: " + manifestId);
206
166
  }
207
- }
208
- if (!exists) {
209
- _a.ManifestFileTypes.get(manifestId).push(type);
210
- }
211
- };
212
- LoadableManifestRegistry.getManifestBundleTypes = (manifestId) => {
213
- manifestId = Utils_1.Utils.ensureValidManifestId(manifestId, "Can't add manifest bundle target types for manifest id null/empty/undefined.");
214
- let result = _a.ManifestFileTypes.get(manifestId);
215
- if (!result ||
216
- (result &&
217
- result.length == 0)) {
218
- console.log("Manifest BundleType has not been set, using JS for now, will generate error");
219
- result = [Enums_1.BundleTargetTypes.Javascript];
220
- //throw new Error("Unexpected state, no bundle target type's have been added to manifest id:" + manifestId + " during build");
221
- }
222
- return result;
223
- };
224
- LoadableManifestRegistry.registerManifest = (manifest) => {
225
- if (!manifest ||
226
- !manifest.manifestType ||
227
- !manifest.resourceId) {
228
- throw new Error("Unexpected state, loadable client manifest does not contain all mandatory attributes " + JSON.stringify(manifest));
229
- }
230
- manifest.resourceId = Utils_1.Utils.ensureValidManifestId(manifest.resourceId);
231
- manifest.resourceName = manifest.resourceName;
232
- return _a.RegisteredManifests.set(manifest.resourceId, manifest);
233
- };
234
- LoadableManifestRegistry.registerManifestProvider = (provider) => {
235
- if (!provider) {
236
- throw new Error("Unexpected state, loadable client manifest provider can't be null/undefined");
237
- }
238
- _a.ClientManifestProviders.push(provider);
239
- };
240
- LoadableManifestRegistry.getClientManifests = (currentServiceId) => {
241
- if (!currentServiceId) {
242
- throw new Error("Missing valid omnia service id");
243
- }
244
- currentServiceId = Utils_1.Utils.ensureValidServiceId(currentServiceId);
245
- let manifests = [];
246
- //Note the order here could be important as the manifest types are ordered like this client side
247
- for (let i = _a.ClientManifestProviders.length - 1; i >= 0; i--) {
248
- let provider = _a.ClientManifestProviders[i];
249
- let providerManifests = provider.getClientLoadableManifests(currentServiceId);
250
- for (let m of providerManifests) {
251
- //Check conflict etc
252
- _a.addClientManifest(currentServiceId, m);
167
+ if (!LoadableManifestRegistry.ManifestVersions.get(manifestId)) {
168
+ LoadableManifestRegistry.ManifestVersions.set(manifestId, {});
253
169
  }
254
- }
255
- _a.validateDependencies(currentServiceId);
256
- for (const m of _a.ClientManifests.values()) {
257
- manifests.push(m);
258
- }
259
- return manifests;
260
- };
261
- LoadableManifestRegistry.clearState = () => {
262
- for (let provider of _a.ClientManifestProviders) {
263
- provider.clearState();
264
- }
265
- _a.ClientManifests = new Map();
266
- _a.ClientManifestProviders = [];
267
- _a.ManifestDependencies = new Map();
268
- };
269
- LoadableManifestRegistry.validateDependencies = (currentServiceId) => {
270
- for (let manifestIdWithDep of _a.ManifestDependencies.keys()) {
271
- const clientManifestWithDep = _a.ClientManifests.get(manifestIdWithDep);
272
- for (let dep of _a.ManifestDependencies.get(manifestIdWithDep)) {
273
- if (dep.externalOmniaServiceId == null) {
274
- const manifestDependency = _a.ClientManifests.get(dep.manifestId);
275
- // validate dependencies across manifest targets
276
- // only allow dependency to manifest the same target or is public target
277
- if (clientManifestWithDep.target !== manifestDependency.target && manifestDependency.target !== models_1.ClientManifestTargetTypes.public) {
278
- (0, tooling_1.log)(`Manifest: ${manifestIdWithDep} with target ${_a.getManifestTargetName(clientManifestWithDep.target)} has dependency to ${dep.manifestId} with target ${_a.getManifestTargetName(manifestDependency.target)}`, tooling_1.LogTypes.Error);
279
- console.log(clientManifestWithDep, manifestDependency);
280
- throw new Error("Have exception");
281
- }
170
+ LoadableManifestRegistry.ManifestVersions.get(manifestId)[type] = version;
171
+ }; }
172
+ static { this.getManifestVersion = (manifestId) => {
173
+ manifestId = Utils_1.Utils.ensureValidManifestId(manifestId, "Can't get manifest version for manifest id null/empty/undefined.");
174
+ let result = LoadableManifestRegistry.ManifestVersions.get(manifestId);
175
+ if (!result) {
176
+ throw new Error(`Unexpected manifest ${manifestId}, build step has not set manifest version`);
177
+ }
178
+ return result;
179
+ }; }
180
+ static { this.addManifestBundleType = (manifestId, type) => {
181
+ manifestId = Utils_1.Utils.ensureValidManifestId(manifestId, "Can't add manifest targetType to manifest id null/empty/undefined.");
182
+ if (LoadableManifestRegistry.ManifestFileTypes.get(manifestId) == null) {
183
+ LoadableManifestRegistry.ManifestFileTypes.set(manifestId, []);
184
+ }
185
+ let exists = false;
186
+ for (let t of LoadableManifestRegistry.ManifestFileTypes.get(manifestId)) {
187
+ if (t === type) {
188
+ exists = true;
189
+ break;
282
190
  }
283
- new CircularDependencyValidator(_a.ManifestDependencies, _a.WithNoManifestDependencies, _a.getDefaultDependencies(), manifestIdWithDep, dep);
284
- /* This check is prob not needed, as groups is just a package from which individual stuff is loaded
285
- //Check groups
286
- if (LoadableManifestRegistry.ClientManifests[manifestIdWithDep].manifestType == ClientManifestTypes.ManifestGroup) {
287
- let groupManifest = <GroupedBundleManifest>LoadableManifestRegistry.ClientManifests[manifestIdWithDep];
288
-
289
- for (let manifestIdInGroup of groupManifest.manifestIdsInGroup) {
290
-
291
- try {
292
- new CircularDependencyValidator(LoadableManifestRegistry.ManifestDependencies,
293
- LoadableManifestRegistry.WithNoManifestDependencies,
294
- LoadableManifestRegistry.getDefaultDependencies(),
295
- manifestIdInGroup,
296
- dep);
297
- } catch (e) {
298
- throw new Error("Group manifest with id: " + manifestIdWithDep + " includes manifest with id: " + manifestIdInGroup + " which causes dependency error: " + e.toString());
191
+ }
192
+ if (!exists) {
193
+ LoadableManifestRegistry.ManifestFileTypes.get(manifestId).push(type);
194
+ }
195
+ }; }
196
+ static { this.getManifestBundleTypes = (manifestId) => {
197
+ manifestId = Utils_1.Utils.ensureValidManifestId(manifestId, "Can't add manifest bundle target types for manifest id null/empty/undefined.");
198
+ let result = LoadableManifestRegistry.ManifestFileTypes.get(manifestId);
199
+ if (!result ||
200
+ (result &&
201
+ result.length == 0)) {
202
+ console.log("Manifest BundleType has not been set, using JS for now, will generate error");
203
+ result = [Enums_1.BundleTargetTypes.Javascript];
204
+ //throw new Error("Unexpected state, no bundle target type's have been added to manifest id:" + manifestId + " during build");
205
+ }
206
+ return result;
207
+ }; }
208
+ static { this.registerManifest = (manifest) => {
209
+ if (!manifest ||
210
+ !manifest.manifestType ||
211
+ !manifest.resourceId) {
212
+ throw new Error("Unexpected state, loadable client manifest does not contain all mandatory attributes " + JSON.stringify(manifest));
213
+ }
214
+ manifest.resourceId = Utils_1.Utils.ensureValidManifestId(manifest.resourceId);
215
+ manifest.resourceName = manifest.resourceName;
216
+ return LoadableManifestRegistry.RegisteredManifests.set(manifest.resourceId, manifest);
217
+ }; }
218
+ static { this.registerManifestProvider = (provider) => {
219
+ if (!provider) {
220
+ throw new Error("Unexpected state, loadable client manifest provider can't be null/undefined");
221
+ }
222
+ LoadableManifestRegistry.ClientManifestProviders.push(provider);
223
+ }; }
224
+ static { this.getClientManifests = (currentServiceId) => {
225
+ if (!currentServiceId) {
226
+ throw new Error("Missing valid omnia service id");
227
+ }
228
+ currentServiceId = Utils_1.Utils.ensureValidServiceId(currentServiceId);
229
+ let manifests = [];
230
+ //Note the order here could be important as the manifest types are ordered like this client side
231
+ for (let i = LoadableManifestRegistry.ClientManifestProviders.length - 1; i >= 0; i--) {
232
+ let provider = LoadableManifestRegistry.ClientManifestProviders[i];
233
+ let providerManifests = provider.getClientLoadableManifests(currentServiceId);
234
+ for (let m of providerManifests) {
235
+ //Check conflict etc
236
+ LoadableManifestRegistry.addClientManifest(currentServiceId, m);
237
+ }
238
+ }
239
+ LoadableManifestRegistry.validateDependencies(currentServiceId);
240
+ for (const m of LoadableManifestRegistry.ClientManifests.values()) {
241
+ manifests.push(m);
242
+ }
243
+ return manifests;
244
+ }; }
245
+ static { this.clearState = () => {
246
+ for (let provider of LoadableManifestRegistry.ClientManifestProviders) {
247
+ provider.clearState();
248
+ }
249
+ LoadableManifestRegistry.ClientManifests = new Map();
250
+ LoadableManifestRegistry.ClientManifestProviders = [];
251
+ LoadableManifestRegistry.ManifestDependencies = new Map();
252
+ }; }
253
+ static { this.validateDependencies = (currentServiceId) => {
254
+ for (let manifestIdWithDep of LoadableManifestRegistry.ManifestDependencies.keys()) {
255
+ const clientManifestWithDep = this.ClientManifests.get(manifestIdWithDep);
256
+ for (let dep of LoadableManifestRegistry.ManifestDependencies.get(manifestIdWithDep)) {
257
+ if (dep.externalOmniaServiceId == null) {
258
+ const manifestDependency = this.ClientManifests.get(dep.manifestId);
259
+ // validate dependencies across manifest targets
260
+ // only allow dependency to manifest the same target or is public target
261
+ if (clientManifestWithDep.target !== manifestDependency.target && manifestDependency.target !== models_1.ClientManifestTargetTypes.public) {
262
+ (0, tooling_1.log)(`Manifest: ${manifestIdWithDep} with target ${this.getManifestTargetName(clientManifestWithDep.target)} has dependency to ${dep.manifestId} with target ${this.getManifestTargetName(manifestDependency.target)}`, tooling_1.LogTypes.Error);
263
+ console.log(clientManifestWithDep, manifestDependency);
264
+ throw new Error("Have exception");
299
265
  }
266
+ }
267
+ new CircularDependencyValidator(LoadableManifestRegistry.ManifestDependencies, LoadableManifestRegistry.WithNoManifestDependencies, LoadableManifestRegistry.getDefaultDependencies(), manifestIdWithDep, dep);
268
+ /* This check is prob not needed, as groups is just a package from which individual stuff is loaded
269
+ //Check groups
270
+ if (LoadableManifestRegistry.ClientManifests[manifestIdWithDep].manifestType == ClientManifestTypes.ManifestGroup) {
271
+ let groupManifest = <GroupedBundleManifest>LoadableManifestRegistry.ClientManifests[manifestIdWithDep];
272
+
273
+ for (let manifestIdInGroup of groupManifest.manifestIdsInGroup) {
274
+
275
+ try {
276
+ new CircularDependencyValidator(LoadableManifestRegistry.ManifestDependencies,
277
+ LoadableManifestRegistry.WithNoManifestDependencies,
278
+ LoadableManifestRegistry.getDefaultDependencies(),
279
+ manifestIdInGroup,
280
+ dep);
281
+ } catch (e) {
282
+ throw new Error("Group manifest with id: " + manifestIdWithDep + " includes manifest with id: " + manifestIdInGroup + " which causes dependency error: " + e.toString());
283
+ }
300
284
 
285
+ }
286
+ }*/
287
+ if (dep.externalOmniaServiceId != null &&
288
+ dep.externalOmniaServiceId === currentServiceId) {
289
+ throw new Error("Manifest: " + dep.manifestPath + " has dependency to " + dep.manifestId + " which is marked as external, but the omnia service id matches the current omnia service id: " + currentServiceId + ". Add dependency as none external or insure a correct omnia service id");
290
+ }
291
+ if (dep.externalOmniaServiceId == null &&
292
+ LoadableManifestRegistry.ClientManifests.get(dep.manifestId) == null) {
293
+ throw new Error("Manifest: " + dep.manifestPath + " has dependency to " + dep.manifestId + " which could not be found. Mark the dependency as external if it's not part of the current project.");
301
294
  }
302
- }*/
303
- if (dep.externalOmniaServiceId != null &&
304
- dep.externalOmniaServiceId === currentServiceId) {
305
- throw new Error("Manifest: " + dep.manifestPath + " has dependency to " + dep.manifestId + " which is marked as external, but the omnia service id matches the current omnia service id: " + currentServiceId + ". Add dependency as none external or insure a correct omnia service id");
306
- }
307
- if (dep.externalOmniaServiceId == null &&
308
- _a.ClientManifests.get(dep.manifestId) == null) {
309
- throw new Error("Manifest: " + dep.manifestPath + " has dependency to " + dep.manifestId + " which could not be found. Mark the dependency as external if it's not part of the current project.");
310
295
  }
311
296
  }
297
+ }; }
298
+ static { this.addClientManifest = (omniaServiceId, manifest) => {
299
+ if (!manifest) {
300
+ throw new Error("Unexpected state, client manifest null cant't be added as client side manifest");
301
+ }
302
+ if (!manifest.resourceId) {
303
+ throw new Error("Unexpected state, client manifest resourceId cant't be null/empty/undefined");
304
+ }
305
+ if (manifest.omniaServiceId && manifest.omniaServiceId !== omniaServiceId) {
306
+ throw new Error("Unexpected state, client manifest omnia service id should match current omnia service id:" + omniaServiceId + " manifest: " + JSON.stringify(manifest));
307
+ }
308
+ if (LoadableManifestRegistry.ClientManifests.get(manifest.resourceId) != null) {
309
+ throw new Error("Unexpected state, client manifest id's should be unique and added once. Already added: "
310
+ + JSON.stringify(LoadableManifestRegistry.ClientManifests.get(manifest.resourceId))
311
+ + " trying to add: " +
312
+ JSON.stringify(manifest));
313
+ }
314
+ LoadableManifestRegistry.ClientManifests.set(manifest.resourceId, manifest);
315
+ }; }
316
+ static getManifestTargetName(target) {
317
+ switch (target.toString()) {
318
+ case models_1.ClientManifestTargetTypes.public.toString():
319
+ return "public";
320
+ case models_1.ClientManifestTargetTypes.admin.toString():
321
+ return "admin";
322
+ case models_1.ClientManifestTargetTypes.editor.toString():
323
+ return "editor";
324
+ case models_1.ClientManifestTargetTypes.docs.toString():
325
+ return "docs";
326
+ }
312
327
  }
313
- };
314
- LoadableManifestRegistry.addClientManifest = (omniaServiceId, manifest) => {
315
- if (!manifest) {
316
- throw new Error("Unexpected state, client manifest null cant't be added as client side manifest");
317
- }
318
- if (!manifest.resourceId) {
319
- throw new Error("Unexpected state, client manifest resourceId cant't be null/empty/undefined");
320
- }
321
- if (manifest.omniaServiceId && manifest.omniaServiceId !== omniaServiceId) {
322
- throw new Error("Unexpected state, client manifest omnia service id should match current omnia service id:" + omniaServiceId + " manifest: " + JSON.stringify(manifest));
323
- }
324
- if (_a.ClientManifests.get(manifest.resourceId) != null) {
325
- throw new Error("Unexpected state, client manifest id's should be unique and added once. Already added: "
326
- + JSON.stringify(_a.ClientManifests.get(manifest.resourceId))
327
- + " trying to add: " +
328
- JSON.stringify(manifest));
329
- }
330
- _a.ClientManifests.set(manifest.resourceId, manifest);
331
- };
332
- LoadableManifestRegistry.getDefaultDependencies = () => {
333
- return [
334
- /// <<optimize manifest.json smaller>> try to remove this hard code
335
- // {
336
- // omniaServiceId: 'bb000000-0000-bbbb-0000-0000000000bb',
337
- // resourceId: OmniaResourceManifests.FxUx.toString()
338
- // }
339
- ];
340
- };
341
- //Just dummy to register subscriber
342
- LoadableManifestRegistry.Subscription = ManifestRegistry_1.ManifestRegistry.registerClientManifestProvider(new ManifestRegistry_1.StaticClientManifestProviderProxy(_a.getClientManifests, _a.clearState));
328
+ static { this.getDefaultDependencies = () => {
329
+ return [
330
+ /// <<optimize manifest.json smaller>> try to remove this hard code
331
+ // {
332
+ // omniaServiceId: 'bb000000-0000-bbbb-0000-0000000000bb',
333
+ // resourceId: OmniaResourceManifests.FxUx.toString()
334
+ // }
335
+ ];
336
+ }; }
337
+ //Just dummy to register subscriber
338
+ static { this.Subscription = ManifestRegistry_1.ManifestRegistry.registerClientManifestProvider(new ManifestRegistry_1.StaticClientManifestProviderProxy(LoadableManifestRegistry.getClientManifests, LoadableManifestRegistry.clearState)); }
339
+ }
340
+ exports.LoadableManifestRegistry = LoadableManifestRegistry;
@@ -19,6 +19,7 @@ function getLocalizationPath(exp, ns) {
19
19
  }
20
20
  exports.getLocalizationPath = getLocalizationPath;
21
21
  class Localization {
22
+ static { this.localizationRegistrations = []; }
22
23
  constructor(localizationOptions, manifestId) {
23
24
  this.target = models_1.LocalizationTargetTypes.public;
24
25
  this.namespace = (name) => {
@@ -48,23 +49,22 @@ class Localization {
48
49
  this.target = target;
49
50
  return this;
50
51
  }
52
+ static { this.getRegistrations = () => {
53
+ return Localization.localizationRegistrations;
54
+ }; }
55
+ static { this.clearRegistrations = () => {
56
+ Localization.localizationRegistrations = [];
57
+ }; }
58
+ static { this.getClientManifests = (currentServiceId) => {
59
+ let result = [];
60
+ return result;
61
+ }; }
62
+ static { this.clearState = () => {
63
+ _localizations = {};
64
+ }; }
65
+ static { this.Subscription = ManifestRegistry_1.ManifestRegistry.registerClientManifestProvider(new ManifestRegistry_1.StaticClientManifestProviderProxy(Localization.getClientManifests, Localization.clearState)); }
51
66
  }
52
67
  exports.Localization = Localization;
53
- Localization.localizationRegistrations = [];
54
- Localization.getRegistrations = () => {
55
- return Localization.localizationRegistrations;
56
- };
57
- Localization.clearRegistrations = () => {
58
- Localization.localizationRegistrations = [];
59
- };
60
- Localization.getClientManifests = (currentServiceId) => {
61
- let result = [];
62
- return result;
63
- };
64
- Localization.clearState = () => {
65
- _localizations = {};
66
- };
67
- Localization.Subscription = ManifestRegistry_1.ManifestRegistry.registerClientManifestProvider(new ManifestRegistry_1.StaticClientManifestProviderProxy(Localization.getClientManifests, Localization.clearState));
68
68
  class LocalizationNamespaceComposer {
69
69
  constructor(root, manifestId) {
70
70
  this.add = (localizeObject) => {