@omnia/tooling-composers 8.0.128-dev → 8.0.130-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.
- package/internal-do-not-import-from-here/BlockingRegistry.js +33 -33
- package/internal-do-not-import-from-here/BuildConfigurationRegistry.js +19 -19
- package/internal-do-not-import-from-here/ComponentRegistry.js +83 -83
- package/internal-do-not-import-from-here/Composer.js +30 -30
- package/internal-do-not-import-from-here/ConfigurationClientServiceRegistry.js +15 -15
- package/internal-do-not-import-from-here/DevelopmentBuildConfiguration.js +8 -8
- package/internal-do-not-import-from-here/DevelopmentEnvironment.js +3 -3
- package/internal-do-not-import-from-here/DevelopmentHostingEnvironment.js +8 -8
- package/internal-do-not-import-from-here/ImportManifestRegistry.js +18 -18
- package/internal-do-not-import-from-here/LoadableManifestRegistry.js +247 -249
- package/internal-do-not-import-from-here/LocalizationComposer.js +15 -15
- package/internal-do-not-import-from-here/ManifestGroupRegistry.js +87 -87
- package/internal-do-not-import-from-here/ManifestRegistry.js +83 -83
- package/internal-do-not-import-from-here/RequestedResourcesRegistry.js +54 -54
- package/internal-do-not-import-from-here/RequiredAzureAdAppPermissionRegistry.js +12 -12
- package/internal-do-not-import-from-here/ResourceRegistry.js +136 -136
- package/internal-do-not-import-from-here/SecurityProviderManifestRegistry.js +24 -24
- package/internal-do-not-import-from-here/ServiceAppRegistry.js +26 -26
- package/internal-do-not-import-from-here/ServiceFeatureRegistry.js +27 -27
- package/internal-do-not-import-from-here/ServiceManifestRegistry.js +29 -29
- package/internal-do-not-import-from-here/ServiceRoleRegistry.js +26 -26
- package/internal-do-not-import-from-here/Utils.js +79 -79
- package/internal-do-not-import-from-here/task.js +1 -1
- package/package.json +3 -3
|
@@ -74,150 +74,150 @@ class ResourceRegistry {
|
|
|
74
74
|
ResourceRegistry.ResourceRegistrations = new Map();
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
ResourceRegistry.
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (!resourceDescription) {
|
|
83
|
-
throw new Error("Can't register resource with missing resourceDescription");
|
|
84
|
-
}
|
|
85
|
-
if (!resourceDescription.resourcePaths ||
|
|
86
|
-
(resourceDescription.resourcePaths && resourceDescription.resourcePaths.length <= 0)) {
|
|
87
|
-
throw new Error("Can't register resources with missing mandatory attributes: " + JSON.stringify(resourceDescription));
|
|
88
|
-
}
|
|
89
|
-
if (ResourceRegistry.ResourceRegistrations.get(manifest.resourceId) == null) {
|
|
90
|
-
ResourceRegistry.ResourceRegistrations.set(manifest.resourceId, new Array());
|
|
91
|
-
}
|
|
92
|
-
ResourceRegistry.ResourceRegistrations.get(manifest.resourceId).push(new ResourceRegistration(resourceDescription, ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath(), manifest));
|
|
93
|
-
};
|
|
94
|
-
ResourceRegistry.addOrdering = (manifest, orderOption) => {
|
|
95
|
-
ResourceRegistry.ensureCorrectManifest(manifest);
|
|
96
|
-
if (orderOption &&
|
|
97
|
-
orderOption.priority) {
|
|
98
|
-
let registrationsForBundle = ResourceRegistry.ResourceRegistrations.get(manifest.resourceId);
|
|
99
|
-
if (registrationsForBundle == null) {
|
|
100
|
-
throw new Error("Unexpected state, ordering should apply to the last registered resource description");
|
|
101
|
-
}
|
|
102
|
-
let lastAdded = registrationsForBundle.pop();
|
|
103
|
-
if (!lastAdded ||
|
|
104
|
-
(lastAdded &&
|
|
105
|
-
lastAdded.manifest !== manifest)) {
|
|
106
|
-
throw new Error("Unexpected state, ordering should apply to the last registered resource description");
|
|
107
|
-
}
|
|
108
|
-
lastAdded.orderOptions = orderOption;
|
|
109
|
-
let index = -1;
|
|
110
|
-
for (let i = 0; i < registrationsForBundle.length; i++) {
|
|
111
|
-
if (registrationsForBundle[i].orderOptions == null ||
|
|
112
|
-
(registrationsForBundle[i].orderOptions &&
|
|
113
|
-
registrationsForBundle[i].orderOptions.priority &&
|
|
114
|
-
lastAdded.orderOptions.priority > registrationsForBundle[i].orderOptions.priority)) {
|
|
115
|
-
//Found registration without priority or a registration with lower priority
|
|
116
|
-
index = i;
|
|
117
|
-
break;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
if (index > -1) {
|
|
121
|
-
registrationsForBundle.splice(index, 0, lastAdded);
|
|
77
|
+
static { this.ResourceRegistrations = new Map(); }
|
|
78
|
+
static { this.registerResource = (manifest, resourceDescription) => {
|
|
79
|
+
ResourceRegistry.ensureCorrectManifest(manifest);
|
|
80
|
+
if (!resourceDescription) {
|
|
81
|
+
throw new Error("Can't register resource with missing resourceDescription");
|
|
122
82
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
83
|
+
if (!resourceDescription.resourcePaths ||
|
|
84
|
+
(resourceDescription.resourcePaths && resourceDescription.resourcePaths.length <= 0)) {
|
|
85
|
+
throw new Error("Can't register resources with missing mandatory attributes: " + JSON.stringify(resourceDescription));
|
|
126
86
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
ResourceRegistry.addBuildOptions = (manifest, buildOptions) => {
|
|
130
|
-
ResourceRegistry.ensureCorrectManifest(manifest);
|
|
131
|
-
if (buildOptions) {
|
|
132
|
-
let registrationsForBundle = ResourceRegistry.ResourceRegistrations.get(manifest.resourceId);
|
|
133
|
-
if (registrationsForBundle == null) {
|
|
134
|
-
throw new Error("Unexpected state, build options should apply be applied to a registered manifest, no registrations found for manifest id:" + manifest.resourceId);
|
|
87
|
+
if (ResourceRegistry.ResourceRegistrations.get(manifest.resourceId) == null) {
|
|
88
|
+
ResourceRegistry.ResourceRegistrations.set(manifest.resourceId, new Array());
|
|
135
89
|
}
|
|
136
|
-
|
|
137
|
-
|
|
90
|
+
ResourceRegistry.ResourceRegistrations.get(manifest.resourceId).push(new ResourceRegistration(resourceDescription, ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath(), manifest));
|
|
91
|
+
}; }
|
|
92
|
+
static { this.addOrdering = (manifest, orderOption) => {
|
|
93
|
+
ResourceRegistry.ensureCorrectManifest(manifest);
|
|
94
|
+
if (orderOption &&
|
|
95
|
+
orderOption.priority) {
|
|
96
|
+
let registrationsForBundle = ResourceRegistry.ResourceRegistrations.get(manifest.resourceId);
|
|
97
|
+
if (registrationsForBundle == null) {
|
|
98
|
+
throw new Error("Unexpected state, ordering should apply to the last registered resource description");
|
|
99
|
+
}
|
|
100
|
+
let lastAdded = registrationsForBundle.pop();
|
|
101
|
+
if (!lastAdded ||
|
|
102
|
+
(lastAdded &&
|
|
103
|
+
lastAdded.manifest !== manifest)) {
|
|
104
|
+
throw new Error("Unexpected state, ordering should apply to the last registered resource description");
|
|
105
|
+
}
|
|
106
|
+
lastAdded.orderOptions = orderOption;
|
|
107
|
+
let index = -1;
|
|
108
|
+
for (let i = 0; i < registrationsForBundle.length; i++) {
|
|
109
|
+
if (registrationsForBundle[i].orderOptions == null ||
|
|
110
|
+
(registrationsForBundle[i].orderOptions &&
|
|
111
|
+
registrationsForBundle[i].orderOptions.priority &&
|
|
112
|
+
lastAdded.orderOptions.priority > registrationsForBundle[i].orderOptions.priority)) {
|
|
113
|
+
//Found registration without priority or a registration with lower priority
|
|
114
|
+
index = i;
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
if (index > -1) {
|
|
119
|
+
registrationsForBundle.splice(index, 0, lastAdded);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
//Add last again
|
|
123
|
+
registrationsForBundle.push(lastAdded);
|
|
124
|
+
}
|
|
138
125
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
126
|
+
}; }
|
|
127
|
+
static { this.addBuildOptions = (manifest, buildOptions) => {
|
|
128
|
+
ResourceRegistry.ensureCorrectManifest(manifest);
|
|
129
|
+
if (buildOptions) {
|
|
130
|
+
let registrationsForBundle = ResourceRegistry.ResourceRegistrations.get(manifest.resourceId);
|
|
131
|
+
if (registrationsForBundle == null) {
|
|
132
|
+
throw new Error("Unexpected state, build options should apply be applied to a registered manifest, no registrations found for manifest id:" + manifest.resourceId);
|
|
133
|
+
}
|
|
134
|
+
if (registrationsForBundle.length > 1) {
|
|
135
|
+
throw new Error("Unexpected state, build options should only be applied to first registration, not if manifest is reopened");
|
|
136
|
+
}
|
|
137
|
+
registrationsForBundle[0].buildOptions = buildOptions;
|
|
149
138
|
}
|
|
150
|
-
|
|
151
|
-
|
|
139
|
+
}; }
|
|
140
|
+
static { this.newCombinedRules = (manifest, rules) => {
|
|
141
|
+
ResourceRegistry.ensureCorrectManifest(manifest);
|
|
142
|
+
if (rules) {
|
|
143
|
+
Utils_1.Utils.validateSupportedLoadRuleTypes(rules);
|
|
144
|
+
let registrationsForBundle = ResourceRegistry.ResourceRegistrations.get(manifest.resourceId);
|
|
145
|
+
if (registrationsForBundle == null) {
|
|
146
|
+
throw new Error("Unexpected state, load rule should apply be applied to a registered manifest, no registrations found for manifest id:" + manifest.resourceId);
|
|
147
|
+
}
|
|
148
|
+
if (registrationsForBundle.length > 1) {
|
|
149
|
+
throw new Error("Unexpected state, load rules should only be applied to first registration, not if manifest is reopened");
|
|
150
|
+
}
|
|
151
|
+
//let lastAdded = registrationsForBundle[registrationsForBundle.length - 1];
|
|
152
|
+
//if (!lastAdded ||
|
|
153
|
+
// (lastAdded &&
|
|
154
|
+
// lastAdded.manifest !== manifest)) {
|
|
155
|
+
// throw new Error("Unexpected state, load rules should be added to the last registered resource description");
|
|
156
|
+
//}
|
|
157
|
+
//lastAdded.loadRules = rules;
|
|
158
|
+
registrationsForBundle[0].loadRules = rules;
|
|
152
159
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
Utils_1.Utils.validateSupportedLoadRuleTypes(rules);
|
|
167
|
-
let registrationsForBundle = ResourceRegistry.ResourceRegistrations.get(manifest.resourceId);
|
|
168
|
-
if (registrationsForBundle == null) {
|
|
169
|
-
throw new Error("Unexpected state, load rule should apply be applied to a registered manifest, no registrations found for manifest id:" + manifest.resourceId);
|
|
160
|
+
}; }
|
|
161
|
+
static { this.addExtendApiRules = (manifest, rules) => {
|
|
162
|
+
ResourceRegistry.ensureCorrectManifest(manifest);
|
|
163
|
+
if (rules) {
|
|
164
|
+
Utils_1.Utils.validateSupportedLoadRuleTypes(rules);
|
|
165
|
+
let registrationsForBundle = ResourceRegistry.ResourceRegistrations.get(manifest.resourceId);
|
|
166
|
+
if (registrationsForBundle == null) {
|
|
167
|
+
throw new Error("Unexpected state, load rule should apply be applied to a registered manifest, no registrations found for manifest id:" + manifest.resourceId);
|
|
168
|
+
}
|
|
169
|
+
if (registrationsForBundle.length > 1) {
|
|
170
|
+
throw new Error("Unexpected state, load rules should only be applied to first registration, not if manifest is reopened");
|
|
171
|
+
}
|
|
172
|
+
registrationsForBundle[0].extendApiRules = rules;
|
|
170
173
|
}
|
|
171
|
-
|
|
172
|
-
|
|
174
|
+
}; }
|
|
175
|
+
static { this.getRegisteredResourceBundles = (pathJoiner) => {
|
|
176
|
+
const bundleResources = new Map();
|
|
177
|
+
if (!pathJoiner) {
|
|
178
|
+
throw new Error("Missing path joiner method");
|
|
173
179
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
pathsWithOtions.
|
|
194
|
-
}
|
|
195
|
-
if (r.manifest.resourceId !== regis[0]) {
|
|
196
|
-
throw new Error("Unexpected state, sanity check failed, all resources should belong to same bundle, expected:" + regis[0] + " found: " + r.manifest.resourceId);
|
|
180
|
+
//Resource manifests should have been ordered on insert
|
|
181
|
+
for (const regis of ResourceRegistry.ResourceRegistrations) {
|
|
182
|
+
let bundleRegistrations = regis[1];
|
|
183
|
+
if (bundleRegistrations &&
|
|
184
|
+
bundleRegistrations.length > 0) {
|
|
185
|
+
let pathsWithOtions = {
|
|
186
|
+
buildOptions: null,
|
|
187
|
+
paths: []
|
|
188
|
+
};
|
|
189
|
+
for (let r of bundleRegistrations) {
|
|
190
|
+
if (r.buildOptions) {
|
|
191
|
+
pathsWithOtions.buildOptions = r.buildOptions;
|
|
192
|
+
}
|
|
193
|
+
if (r.manifest.resourceId !== regis[0]) {
|
|
194
|
+
throw new Error("Unexpected state, sanity check failed, all resources should belong to same bundle, expected:" + regis[0] + " found: " + r.manifest.resourceId);
|
|
195
|
+
}
|
|
196
|
+
//for (let p of r.description.resourcePaths) {
|
|
197
|
+
// pathsWithOtions.paths = pathsWithOtions.paths.concat(pathJoiner(r.manifestPath, p));
|
|
198
|
+
//}
|
|
199
|
+
pathsWithOtions.paths = pathsWithOtions.paths.concat(pathJoiner(r.manifestPath, r.description.resourcePaths));
|
|
197
200
|
}
|
|
198
|
-
|
|
199
|
-
// pathsWithOtions.paths = pathsWithOtions.paths.concat(pathJoiner(r.manifestPath, p));
|
|
200
|
-
//}
|
|
201
|
-
pathsWithOtions.paths = pathsWithOtions.paths.concat(pathJoiner(r.manifestPath, r.description.resourcePaths));
|
|
201
|
+
bundleResources.set(regis[0], pathsWithOtions);
|
|
202
202
|
}
|
|
203
|
-
bundleResources.set(regis[0], pathsWithOtions);
|
|
204
203
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
204
|
+
LoadableManifestRegistry_1.LoadableManifestRegistry.registerManifestProvider(new ResourceRegistry());
|
|
205
|
+
return bundleResources;
|
|
206
|
+
}; }
|
|
207
|
+
static { this.getResourceRegistrations = () => {
|
|
208
|
+
let resources = new Map();
|
|
209
|
+
for (let regis of ResourceRegistry.ResourceRegistrations) {
|
|
210
|
+
resources.set(regis[0], regis[1]);
|
|
211
|
+
}
|
|
212
|
+
return resources;
|
|
213
|
+
}; }
|
|
214
|
+
static { this.ensureCorrectManifest = (manifest) => {
|
|
215
|
+
if (!manifest ||
|
|
216
|
+
!manifest.manifestType ||
|
|
217
|
+
manifest.manifestType !== Enums_1.ClientManifestTypes.Resource) {
|
|
218
|
+
throw new Error("Manifest :" + JSON.stringify(manifest) + " can't be used as resource manifest. Mandatory properties maybe missing or the manifest is not of resource type");
|
|
219
|
+
}
|
|
220
|
+
manifest.resourceId = Utils_1.Utils.ensureValidManifestId(manifest.resourceId);
|
|
221
|
+
}; }
|
|
222
|
+
}
|
|
223
|
+
exports.ResourceRegistry = ResourceRegistry;
|
|
@@ -4,29 +4,29 @@ exports.SecurityProviderManifestRegistry = void 0;
|
|
|
4
4
|
const ManifestRegistry_1 = require("./ManifestRegistry");
|
|
5
5
|
const index_1 = require("./models/index");
|
|
6
6
|
class SecurityProviderManifestRegistry {
|
|
7
|
+
static { this.SecurityProviders = []; }
|
|
8
|
+
static { this.getServerManifests = (currentServiceId) => {
|
|
9
|
+
let result = [];
|
|
10
|
+
//Sanity check
|
|
11
|
+
for (let provider of SecurityProviderManifestRegistry.SecurityProviders) {
|
|
12
|
+
if (provider.type == index_1.SecurityProviderTypes.Combined &&
|
|
13
|
+
provider.securityProviderRules.length == 0) {
|
|
14
|
+
throw new Error("Can't specify a combined security provider without any dependencies to other providers: " + JSON.stringify(provider));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
let securityProviderManifest = {
|
|
18
|
+
manifestType: index_1.ServerManifestTypes.SecurityProvider,
|
|
19
|
+
securityProviders: SecurityProviderManifestRegistry.SecurityProviders
|
|
20
|
+
};
|
|
21
|
+
result.push(securityProviderManifest);
|
|
22
|
+
return result;
|
|
23
|
+
}; }
|
|
24
|
+
static { this.AddSecurityProvider = (securityProvider) => {
|
|
25
|
+
SecurityProviderManifestRegistry.SecurityProviders.push(securityProvider);
|
|
26
|
+
}; }
|
|
27
|
+
static { this.clearState = () => {
|
|
28
|
+
SecurityProviderManifestRegistry.SecurityProviders = [];
|
|
29
|
+
}; }
|
|
30
|
+
static { this.ServerSubscription = ManifestRegistry_1.ManifestRegistry.registerServerManifestProvider(new ManifestRegistry_1.StaticServerManifestProviderProxy(SecurityProviderManifestRegistry.getServerManifests, SecurityProviderManifestRegistry.clearState)); }
|
|
7
31
|
}
|
|
8
32
|
exports.SecurityProviderManifestRegistry = SecurityProviderManifestRegistry;
|
|
9
|
-
SecurityProviderManifestRegistry.SecurityProviders = [];
|
|
10
|
-
SecurityProviderManifestRegistry.getServerManifests = (currentServiceId) => {
|
|
11
|
-
let result = [];
|
|
12
|
-
//Sanity check
|
|
13
|
-
for (let provider of SecurityProviderManifestRegistry.SecurityProviders) {
|
|
14
|
-
if (provider.type == index_1.SecurityProviderTypes.Combined &&
|
|
15
|
-
provider.securityProviderRules.length == 0) {
|
|
16
|
-
throw new Error("Can't specify a combined security provider without any dependencies to other providers: " + JSON.stringify(provider));
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
let securityProviderManifest = {
|
|
20
|
-
manifestType: index_1.ServerManifestTypes.SecurityProvider,
|
|
21
|
-
securityProviders: SecurityProviderManifestRegistry.SecurityProviders
|
|
22
|
-
};
|
|
23
|
-
result.push(securityProviderManifest);
|
|
24
|
-
return result;
|
|
25
|
-
};
|
|
26
|
-
SecurityProviderManifestRegistry.AddSecurityProvider = (securityProvider) => {
|
|
27
|
-
SecurityProviderManifestRegistry.SecurityProviders.push(securityProvider);
|
|
28
|
-
};
|
|
29
|
-
SecurityProviderManifestRegistry.clearState = () => {
|
|
30
|
-
SecurityProviderManifestRegistry.SecurityProviders = [];
|
|
31
|
-
};
|
|
32
|
-
SecurityProviderManifestRegistry.ServerSubscription = ManifestRegistry_1.ManifestRegistry.registerServerManifestProvider(new ManifestRegistry_1.StaticServerManifestProviderProxy(SecurityProviderManifestRegistry.getServerManifests, SecurityProviderManifestRegistry.clearState));
|
|
@@ -7,31 +7,31 @@ const ManifestRegistry_1 = require("./ManifestRegistry");
|
|
|
7
7
|
const deep_extend_1 = tslib_1.__importDefault(require("deep-extend"));
|
|
8
8
|
const models_1 = require("../../fx-models");
|
|
9
9
|
class ServiceAppRegistry {
|
|
10
|
+
static { this.AddedAppDefinitions = {}; }
|
|
11
|
+
static { this.AddAppDefinition = (appDefinitionId, option) => {
|
|
12
|
+
if (appDefinitionId == models_1.Guid.empty) {
|
|
13
|
+
throw new Error("Can't add app definition with id: Guid.empty. See manifest file: " + ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath());
|
|
14
|
+
}
|
|
15
|
+
if (ServiceAppRegistry.AddedAppDefinitions[appDefinitionId.toString()] != null) {
|
|
16
|
+
throw new Error("Can't add app definition id " + appDefinitionId + ", an app definition with the same id has already been added. See manifest file: " + ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath());
|
|
17
|
+
}
|
|
18
|
+
let manifest = {
|
|
19
|
+
manifestType: index_1.ServerManifestTypes.ServiceAppDefinition
|
|
20
|
+
};
|
|
21
|
+
let appManifest = (0, deep_extend_1.default)(manifest, option);
|
|
22
|
+
appManifest.uniqueId = appDefinitionId;
|
|
23
|
+
ServiceAppRegistry.AddedAppDefinitions[appDefinitionId.toString()] = appManifest;
|
|
24
|
+
}; }
|
|
25
|
+
static { this.getServerManifests = (currentServiceId) => {
|
|
26
|
+
let serverManifests = new Array();
|
|
27
|
+
for (let key in ServiceAppRegistry.AddedAppDefinitions) {
|
|
28
|
+
serverManifests.push(ServiceAppRegistry.AddedAppDefinitions[key]);
|
|
29
|
+
}
|
|
30
|
+
return serverManifests;
|
|
31
|
+
}; }
|
|
32
|
+
static { this.clearState = () => {
|
|
33
|
+
ServiceAppRegistry.AddedAppDefinitions = {};
|
|
34
|
+
}; }
|
|
35
|
+
static { this.ServerSubscription = ManifestRegistry_1.ManifestRegistry.registerServerManifestProvider(new ManifestRegistry_1.StaticServerManifestProviderProxy(ServiceAppRegistry.getServerManifests, ServiceAppRegistry.clearState)); }
|
|
10
36
|
}
|
|
11
37
|
exports.ServiceAppRegistry = ServiceAppRegistry;
|
|
12
|
-
ServiceAppRegistry.AddedAppDefinitions = {};
|
|
13
|
-
ServiceAppRegistry.AddAppDefinition = (appDefinitionId, option) => {
|
|
14
|
-
if (appDefinitionId == models_1.Guid.empty) {
|
|
15
|
-
throw new Error("Can't add app definition with id: Guid.empty. See manifest file: " + ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath());
|
|
16
|
-
}
|
|
17
|
-
if (ServiceAppRegistry.AddedAppDefinitions[appDefinitionId.toString()] != null) {
|
|
18
|
-
throw new Error("Can't add app definition id " + appDefinitionId + ", an app definition with the same id has already been added. See manifest file: " + ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath());
|
|
19
|
-
}
|
|
20
|
-
let manifest = {
|
|
21
|
-
manifestType: index_1.ServerManifestTypes.ServiceAppDefinition
|
|
22
|
-
};
|
|
23
|
-
let appManifest = (0, deep_extend_1.default)(manifest, option);
|
|
24
|
-
appManifest.uniqueId = appDefinitionId;
|
|
25
|
-
ServiceAppRegistry.AddedAppDefinitions[appDefinitionId.toString()] = appManifest;
|
|
26
|
-
};
|
|
27
|
-
ServiceAppRegistry.getServerManifests = (currentServiceId) => {
|
|
28
|
-
let serverManifests = new Array();
|
|
29
|
-
for (let key in ServiceAppRegistry.AddedAppDefinitions) {
|
|
30
|
-
serverManifests.push(ServiceAppRegistry.AddedAppDefinitions[key]);
|
|
31
|
-
}
|
|
32
|
-
return serverManifests;
|
|
33
|
-
};
|
|
34
|
-
ServiceAppRegistry.clearState = () => {
|
|
35
|
-
ServiceAppRegistry.AddedAppDefinitions = {};
|
|
36
|
-
};
|
|
37
|
-
ServiceAppRegistry.ServerSubscription = ManifestRegistry_1.ManifestRegistry.registerServerManifestProvider(new ManifestRegistry_1.StaticServerManifestProviderProxy(ServiceAppRegistry.getServerManifests, ServiceAppRegistry.clearState));
|
|
@@ -8,32 +8,32 @@ const deep_extend_1 = tslib_1.__importDefault(require("deep-extend"));
|
|
|
8
8
|
const models_1 = require("../../fx-models");
|
|
9
9
|
const AzureAdAppPermissionHelper_1 = require("./AzureAdAppPermissionHelper");
|
|
10
10
|
class ServiceFeatureRegistry {
|
|
11
|
+
static { this.AddedFeatures = {}; }
|
|
12
|
+
static { this.AddFeature = (featureId, option) => {
|
|
13
|
+
if (featureId == models_1.Guid.empty) {
|
|
14
|
+
throw new Error("Can't add feature with id: Guid.empty. See manifest file: " + ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath());
|
|
15
|
+
}
|
|
16
|
+
if (ServiceFeatureRegistry.AddedFeatures[featureId.toString()] != null) {
|
|
17
|
+
throw new Error("Can't add feature id " + featureId + ", a feature with the same id has already been added. See manifest file: " + ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath());
|
|
18
|
+
}
|
|
19
|
+
let manifest = {
|
|
20
|
+
manifestType: index_1.ServerManifestTypes.ServiceFeature
|
|
21
|
+
};
|
|
22
|
+
let featureManifest = (0, deep_extend_1.default)(manifest, option);
|
|
23
|
+
featureManifest.uniqueId = featureId;
|
|
24
|
+
featureManifest.requiresAzureAdAppPermissions = AzureAdAppPermissionHelper_1.AzureAdAppPermissionHelper.getAzureAdAppPermissions(option.requiresAzureAdAppPermissions);
|
|
25
|
+
ServiceFeatureRegistry.AddedFeatures[featureId.toString()] = featureManifest;
|
|
26
|
+
}; }
|
|
27
|
+
static { this.getServerManifests = (currentServiceId) => {
|
|
28
|
+
let serverManifests = new Array();
|
|
29
|
+
for (let key in ServiceFeatureRegistry.AddedFeatures) {
|
|
30
|
+
serverManifests.push(ServiceFeatureRegistry.AddedFeatures[key]);
|
|
31
|
+
}
|
|
32
|
+
return serverManifests;
|
|
33
|
+
}; }
|
|
34
|
+
static { this.clearState = () => {
|
|
35
|
+
ServiceFeatureRegistry.AddedFeatures = {};
|
|
36
|
+
}; }
|
|
37
|
+
static { this.ServerSubscription = ManifestRegistry_1.ManifestRegistry.registerServerManifestProvider(new ManifestRegistry_1.StaticServerManifestProviderProxy(ServiceFeatureRegistry.getServerManifests, ServiceFeatureRegistry.clearState)); }
|
|
11
38
|
}
|
|
12
39
|
exports.ServiceFeatureRegistry = ServiceFeatureRegistry;
|
|
13
|
-
ServiceFeatureRegistry.AddedFeatures = {};
|
|
14
|
-
ServiceFeatureRegistry.AddFeature = (featureId, option) => {
|
|
15
|
-
if (featureId == models_1.Guid.empty) {
|
|
16
|
-
throw new Error("Can't add feature with id: Guid.empty. See manifest file: " + ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath());
|
|
17
|
-
}
|
|
18
|
-
if (ServiceFeatureRegistry.AddedFeatures[featureId.toString()] != null) {
|
|
19
|
-
throw new Error("Can't add feature id " + featureId + ", a feature with the same id has already been added. See manifest file: " + ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath());
|
|
20
|
-
}
|
|
21
|
-
let manifest = {
|
|
22
|
-
manifestType: index_1.ServerManifestTypes.ServiceFeature
|
|
23
|
-
};
|
|
24
|
-
let featureManifest = (0, deep_extend_1.default)(manifest, option);
|
|
25
|
-
featureManifest.uniqueId = featureId;
|
|
26
|
-
featureManifest.requiresAzureAdAppPermissions = AzureAdAppPermissionHelper_1.AzureAdAppPermissionHelper.getAzureAdAppPermissions(option.requiresAzureAdAppPermissions);
|
|
27
|
-
ServiceFeatureRegistry.AddedFeatures[featureId.toString()] = featureManifest;
|
|
28
|
-
};
|
|
29
|
-
ServiceFeatureRegistry.getServerManifests = (currentServiceId) => {
|
|
30
|
-
let serverManifests = new Array();
|
|
31
|
-
for (let key in ServiceFeatureRegistry.AddedFeatures) {
|
|
32
|
-
serverManifests.push(ServiceFeatureRegistry.AddedFeatures[key]);
|
|
33
|
-
}
|
|
34
|
-
return serverManifests;
|
|
35
|
-
};
|
|
36
|
-
ServiceFeatureRegistry.clearState = () => {
|
|
37
|
-
ServiceFeatureRegistry.AddedFeatures = {};
|
|
38
|
-
};
|
|
39
|
-
ServiceFeatureRegistry.ServerSubscription = ManifestRegistry_1.ManifestRegistry.registerServerManifestProvider(new ManifestRegistry_1.StaticServerManifestProviderProxy(ServiceFeatureRegistry.getServerManifests, ServiceFeatureRegistry.clearState));
|
|
@@ -4,34 +4,34 @@ exports.ServiceManifestRegistry = void 0;
|
|
|
4
4
|
const index_1 = require("./models/index");
|
|
5
5
|
const ManifestRegistry_1 = require("./ManifestRegistry");
|
|
6
6
|
class ServiceManifestRegistry {
|
|
7
|
+
static { this.Service = null; }
|
|
8
|
+
static { this.AddService = (service) => {
|
|
9
|
+
if (!(service.serviceType === index_1.ServiceTypes.WebApp ||
|
|
10
|
+
service.serviceType === index_1.ServiceTypes.Worker ||
|
|
11
|
+
service.serviceType === index_1.ServiceTypes.Custom)) {
|
|
12
|
+
throw new Error("Unknown service type: " + JSON.stringify(service));
|
|
13
|
+
}
|
|
14
|
+
if (ServiceManifestRegistry.Service) {
|
|
15
|
+
throw new Error("Can't add more than one service in a project, service: " + JSON.stringify(ServiceManifestRegistry.Service) + " already added.");
|
|
16
|
+
}
|
|
17
|
+
ServiceManifestRegistry.Service = service;
|
|
18
|
+
}; }
|
|
19
|
+
static { this.getServiceInfo = () => {
|
|
20
|
+
return ServiceManifestRegistry.Service;
|
|
21
|
+
}; }
|
|
22
|
+
static { this.getServerManifests = (currentServiceId) => {
|
|
23
|
+
let serverManifests = new Array();
|
|
24
|
+
if (ServiceManifestRegistry.Service != null) {
|
|
25
|
+
let serviceManifest = Object.assign({
|
|
26
|
+
manifestType: index_1.ServerManifestTypes.Service
|
|
27
|
+
}, ServiceManifestRegistry.Service);
|
|
28
|
+
serverManifests.push(serviceManifest);
|
|
29
|
+
}
|
|
30
|
+
return serverManifests;
|
|
31
|
+
}; }
|
|
32
|
+
static { this.clearState = () => {
|
|
33
|
+
ServiceManifestRegistry.Service = null;
|
|
34
|
+
}; }
|
|
35
|
+
static { this.ServerSubscription = ManifestRegistry_1.ManifestRegistry.registerServerManifestProvider(new ManifestRegistry_1.StaticServerManifestProviderProxy(ServiceManifestRegistry.getServerManifests, ServiceManifestRegistry.clearState)); }
|
|
7
36
|
}
|
|
8
37
|
exports.ServiceManifestRegistry = ServiceManifestRegistry;
|
|
9
|
-
ServiceManifestRegistry.Service = null;
|
|
10
|
-
ServiceManifestRegistry.AddService = (service) => {
|
|
11
|
-
if (!(service.serviceType === index_1.ServiceTypes.WebApp ||
|
|
12
|
-
service.serviceType === index_1.ServiceTypes.Worker ||
|
|
13
|
-
service.serviceType === index_1.ServiceTypes.Custom)) {
|
|
14
|
-
throw new Error("Unknown service type: " + JSON.stringify(service));
|
|
15
|
-
}
|
|
16
|
-
if (ServiceManifestRegistry.Service) {
|
|
17
|
-
throw new Error("Can't add more than one service in a project, service: " + JSON.stringify(ServiceManifestRegistry.Service) + " already added.");
|
|
18
|
-
}
|
|
19
|
-
ServiceManifestRegistry.Service = service;
|
|
20
|
-
};
|
|
21
|
-
ServiceManifestRegistry.getServiceInfo = () => {
|
|
22
|
-
return ServiceManifestRegistry.Service;
|
|
23
|
-
};
|
|
24
|
-
ServiceManifestRegistry.getServerManifests = (currentServiceId) => {
|
|
25
|
-
let serverManifests = new Array();
|
|
26
|
-
if (ServiceManifestRegistry.Service != null) {
|
|
27
|
-
let serviceManifest = Object.assign({
|
|
28
|
-
manifestType: index_1.ServerManifestTypes.Service
|
|
29
|
-
}, ServiceManifestRegistry.Service);
|
|
30
|
-
serverManifests.push(serviceManifest);
|
|
31
|
-
}
|
|
32
|
-
return serverManifests;
|
|
33
|
-
};
|
|
34
|
-
ServiceManifestRegistry.clearState = () => {
|
|
35
|
-
ServiceManifestRegistry.Service = null;
|
|
36
|
-
};
|
|
37
|
-
ServiceManifestRegistry.ServerSubscription = ManifestRegistry_1.ManifestRegistry.registerServerManifestProvider(new ManifestRegistry_1.StaticServerManifestProviderProxy(ServiceManifestRegistry.getServerManifests, ServiceManifestRegistry.clearState));
|
|
@@ -7,31 +7,31 @@ const ManifestRegistry_1 = require("./ManifestRegistry");
|
|
|
7
7
|
const deep_extend_1 = tslib_1.__importDefault(require("deep-extend"));
|
|
8
8
|
const models_1 = require("../../fx-models");
|
|
9
9
|
class ServiceRoleRegistry {
|
|
10
|
+
static { this.AddedRoleDefinitions = {}; }
|
|
11
|
+
static { this.AddRoleDefinition = (roleDefinitionId, option) => {
|
|
12
|
+
if (roleDefinitionId == models_1.Guid.empty) {
|
|
13
|
+
throw new Error("Can't add role definition with id: Guid.empty. See manifest file: " + ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath());
|
|
14
|
+
}
|
|
15
|
+
if (ServiceRoleRegistry.AddedRoleDefinitions[roleDefinitionId.toString()] != null) {
|
|
16
|
+
throw new Error("Can't add role definition id " + roleDefinitionId + ", an role definition with the same id has already been added. See manifest file: " + ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath());
|
|
17
|
+
}
|
|
18
|
+
let manifest = {
|
|
19
|
+
manifestType: index_1.ServerManifestTypes.ServiceRoleDefinition
|
|
20
|
+
};
|
|
21
|
+
let roleManifest = (0, deep_extend_1.default)(manifest, option);
|
|
22
|
+
roleManifest.uniqueId = roleDefinitionId;
|
|
23
|
+
ServiceRoleRegistry.AddedRoleDefinitions[roleDefinitionId.toString()] = roleManifest;
|
|
24
|
+
}; }
|
|
25
|
+
static { this.getServerManifests = (currentServiceId) => {
|
|
26
|
+
let serverManifests = new Array();
|
|
27
|
+
for (let key in ServiceRoleRegistry.AddedRoleDefinitions) {
|
|
28
|
+
serverManifests.push(ServiceRoleRegistry.AddedRoleDefinitions[key]);
|
|
29
|
+
}
|
|
30
|
+
return serverManifests;
|
|
31
|
+
}; }
|
|
32
|
+
static { this.clearState = () => {
|
|
33
|
+
ServiceRoleRegistry.AddedRoleDefinitions = {};
|
|
34
|
+
}; }
|
|
35
|
+
static { this.ServerSubscription = ManifestRegistry_1.ManifestRegistry.registerServerManifestProvider(new ManifestRegistry_1.StaticServerManifestProviderProxy(ServiceRoleRegistry.getServerManifests, ServiceRoleRegistry.clearState)); }
|
|
10
36
|
}
|
|
11
37
|
exports.ServiceRoleRegistry = ServiceRoleRegistry;
|
|
12
|
-
ServiceRoleRegistry.AddedRoleDefinitions = {};
|
|
13
|
-
ServiceRoleRegistry.AddRoleDefinition = (roleDefinitionId, option) => {
|
|
14
|
-
if (roleDefinitionId == models_1.Guid.empty) {
|
|
15
|
-
throw new Error("Can't add role definition with id: Guid.empty. See manifest file: " + ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath());
|
|
16
|
-
}
|
|
17
|
-
if (ServiceRoleRegistry.AddedRoleDefinitions[roleDefinitionId.toString()] != null) {
|
|
18
|
-
throw new Error("Can't add role definition id " + roleDefinitionId + ", an role definition with the same id has already been added. See manifest file: " + ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath());
|
|
19
|
-
}
|
|
20
|
-
let manifest = {
|
|
21
|
-
manifestType: index_1.ServerManifestTypes.ServiceRoleDefinition
|
|
22
|
-
};
|
|
23
|
-
let roleManifest = (0, deep_extend_1.default)(manifest, option);
|
|
24
|
-
roleManifest.uniqueId = roleDefinitionId;
|
|
25
|
-
ServiceRoleRegistry.AddedRoleDefinitions[roleDefinitionId.toString()] = roleManifest;
|
|
26
|
-
};
|
|
27
|
-
ServiceRoleRegistry.getServerManifests = (currentServiceId) => {
|
|
28
|
-
let serverManifests = new Array();
|
|
29
|
-
for (let key in ServiceRoleRegistry.AddedRoleDefinitions) {
|
|
30
|
-
serverManifests.push(ServiceRoleRegistry.AddedRoleDefinitions[key]);
|
|
31
|
-
}
|
|
32
|
-
return serverManifests;
|
|
33
|
-
};
|
|
34
|
-
ServiceRoleRegistry.clearState = () => {
|
|
35
|
-
ServiceRoleRegistry.AddedRoleDefinitions = {};
|
|
36
|
-
};
|
|
37
|
-
ServiceRoleRegistry.ServerSubscription = ManifestRegistry_1.ManifestRegistry.registerServerManifestProvider(new ManifestRegistry_1.StaticServerManifestProviderProxy(ServiceRoleRegistry.getServerManifests, ServiceRoleRegistry.clearState));
|