@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.
- 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
|
@@ -62,99 +62,99 @@ class ManifestGroupRegistry {
|
|
|
62
62
|
ManifestGroupRegistry._registeredManifestProvider = false;
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
ManifestGroupRegistry._registeredManifestProvider = false;
|
|
69
|
-
ManifestGroupRegistry.registerManifestGroup = (manifest, groupOptions) => {
|
|
70
|
-
ManifestGroupRegistry.ensureCorrectManifest(manifest);
|
|
71
|
-
if (!groupOptions) {
|
|
72
|
-
throw new Error("Can't register component with missing groupOptions");
|
|
73
|
-
}
|
|
74
|
-
if (!groupOptions.webComponentManifestIds) {
|
|
75
|
-
groupOptions.webComponentManifestIds = [];
|
|
76
|
-
}
|
|
77
|
-
if (!groupOptions.resourceManifestIds) {
|
|
78
|
-
groupOptions.resourceManifestIds = [];
|
|
79
|
-
}
|
|
80
|
-
if (groupOptions.webComponentManifestIds.length <= 0 &&
|
|
81
|
-
groupOptions.resourceManifestIds.length <= 0) {
|
|
82
|
-
throw new Error("Can't register manifest group with missing mandatory attributes, select either webcomponents or resources to include in group: " + JSON.stringify(groupOptions));
|
|
83
|
-
}
|
|
84
|
-
if (ManifestGroupRegistry.ManifestGroupRegistrations.get(manifest.resourceId)) {
|
|
85
|
-
throw new Error("Can't re-register resource manifest group on manifest with id: " + manifest.resourceId +
|
|
86
|
-
" current info: " + JSON.stringify(ManifestGroupRegistry.ManifestGroupRegistrations.get(manifest.resourceId)));
|
|
87
|
-
}
|
|
88
|
-
try {
|
|
89
|
-
ManifestGroupRegistry.ManifestGroupRegistrations.set(manifest.resourceId, new ManifestGroupRegistration(groupOptions, ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath(), manifest));
|
|
90
|
-
}
|
|
91
|
-
catch (e) {
|
|
92
|
-
ManifestGroupRegistry.ManifestGroupRegistrations.set(manifest.resourceId, null);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
ManifestGroupRegistry.newCombinedRules = (manifest, rules) => {
|
|
96
|
-
if (rules) {
|
|
65
|
+
static { this.ManifestGroupRegistrations = new Map(); }
|
|
66
|
+
static { this._registeredManifestProvider = false; }
|
|
67
|
+
static { this.registerManifestGroup = (manifest, groupOptions) => {
|
|
97
68
|
ManifestGroupRegistry.ensureCorrectManifest(manifest);
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (registration != null) {
|
|
101
|
-
registration.loadRules = rules;
|
|
69
|
+
if (!groupOptions) {
|
|
70
|
+
throw new Error("Can't register component with missing groupOptions");
|
|
102
71
|
}
|
|
103
|
-
|
|
104
|
-
|
|
72
|
+
if (!groupOptions.webComponentManifestIds) {
|
|
73
|
+
groupOptions.webComponentManifestIds = [];
|
|
105
74
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
75
|
+
if (!groupOptions.resourceManifestIds) {
|
|
76
|
+
groupOptions.resourceManifestIds = [];
|
|
77
|
+
}
|
|
78
|
+
if (groupOptions.webComponentManifestIds.length <= 0 &&
|
|
79
|
+
groupOptions.resourceManifestIds.length <= 0) {
|
|
80
|
+
throw new Error("Can't register manifest group with missing mandatory attributes, select either webcomponents or resources to include in group: " + JSON.stringify(groupOptions));
|
|
81
|
+
}
|
|
82
|
+
if (ManifestGroupRegistry.ManifestGroupRegistrations.get(manifest.resourceId)) {
|
|
83
|
+
throw new Error("Can't re-register resource manifest group on manifest with id: " + manifest.resourceId +
|
|
84
|
+
" current info: " + JSON.stringify(ManifestGroupRegistry.ManifestGroupRegistrations.get(manifest.resourceId)));
|
|
85
|
+
}
|
|
86
|
+
try {
|
|
87
|
+
ManifestGroupRegistry.ManifestGroupRegistrations.set(manifest.resourceId, new ManifestGroupRegistration(groupOptions, ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath(), manifest));
|
|
88
|
+
}
|
|
89
|
+
catch (e) {
|
|
90
|
+
ManifestGroupRegistry.ManifestGroupRegistrations.set(manifest.resourceId, null);
|
|
91
|
+
}
|
|
92
|
+
}; }
|
|
93
|
+
static { this.newCombinedRules = (manifest, rules) => {
|
|
94
|
+
if (rules) {
|
|
95
|
+
ManifestGroupRegistry.ensureCorrectManifest(manifest);
|
|
96
|
+
Utils_1.Utils.validateSupportedLoadRuleTypes(rules);
|
|
97
|
+
let registration = ManifestGroupRegistry.ManifestGroupRegistrations.get(manifest.resourceId);
|
|
98
|
+
if (registration != null) {
|
|
99
|
+
registration.loadRules = rules;
|
|
123
100
|
}
|
|
124
|
-
|
|
125
|
-
throw new Error("
|
|
101
|
+
else {
|
|
102
|
+
throw new Error("Can't add load rules for component group manifest with id: " + manifest.resourceId + " a component group has not been registered");
|
|
126
103
|
}
|
|
127
104
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
105
|
+
}; }
|
|
106
|
+
static { this.getManifestGroupRegistrations = () => {
|
|
107
|
+
let registrations = new Map();
|
|
108
|
+
for (const regis of ManifestGroupRegistry.ManifestGroupRegistrations) {
|
|
109
|
+
registrations.set(regis[0], regis[1]);
|
|
110
|
+
}
|
|
111
|
+
return registrations;
|
|
112
|
+
}; }
|
|
113
|
+
static { this.getRegistrations = () => {
|
|
114
|
+
let groupRegistrations = [];
|
|
115
|
+
for (const regis of ManifestGroupRegistry.ManifestGroupRegistrations) {
|
|
116
|
+
const groupRegistration = regis[1];
|
|
117
|
+
for (let webComponentManifestIdToInclude of groupRegistration.manifestGroupOptions.webComponentManifestIds) {
|
|
118
|
+
let registeredManifest = LoadableManifestRegistry_1.LoadableManifestRegistry.getRegisteredManifest(webComponentManifestIdToInclude);
|
|
119
|
+
if (!registeredManifest) {
|
|
120
|
+
throw new Error("Error, manifest: " + groupRegistration.manifestPath + " is referencing manifest id: " + webComponentManifestIdToInclude + " which has not been registered.");
|
|
121
|
+
}
|
|
122
|
+
if (registeredManifest.manifestType != Enums_1.ClientManifestTypes.Component) {
|
|
123
|
+
throw new Error("Error, manifest: " + groupRegistration.manifestPath + " is adding manifest id: " + webComponentManifestIdToInclude + " as a web component to group manifest, but it's not of webcomponent type.");
|
|
124
|
+
}
|
|
132
125
|
}
|
|
133
|
-
|
|
134
|
-
|
|
126
|
+
for (let resourceManifestIdToInclude of groupRegistration.manifestGroupOptions.resourceManifestIds) {
|
|
127
|
+
let registeredManifest = LoadableManifestRegistry_1.LoadableManifestRegistry.getRegisteredManifest(resourceManifestIdToInclude);
|
|
128
|
+
if (!registeredManifest) {
|
|
129
|
+
throw new Error("Error, manifest: " + groupRegistration.manifestPath + " is referencing manifest id: " + resourceManifestIdToInclude + " which has not been registered.");
|
|
130
|
+
}
|
|
131
|
+
if (registeredManifest.manifestType != Enums_1.ClientManifestTypes.Resource) {
|
|
132
|
+
throw new Error("Error, manifest: " + groupRegistration.manifestPath + " is adding manifest id: " + resourceManifestIdToInclude + " as a resource to group manifest, but it's not of rescource type.");
|
|
133
|
+
}
|
|
135
134
|
}
|
|
135
|
+
groupRegistrations.push({
|
|
136
|
+
resourceId: groupRegistration.manifest.resourceId,
|
|
137
|
+
resourceName: groupRegistration.manifest.resourceName,
|
|
138
|
+
manifestIdsInGroup: groupRegistration.manifestGroupOptions.webComponentManifestIds.concat(groupRegistration.manifestGroupOptions.resourceManifestIds),
|
|
139
|
+
});
|
|
136
140
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
ManifestGroupRegistry.clearManifestGroupRegistrations = () => {
|
|
158
|
-
ManifestGroupRegistry.ManifestGroupRegistrations = new Map();
|
|
159
|
-
};
|
|
160
|
-
ManifestGroupRegistry.ServerSubscription = ManifestRegistry_1.ManifestRegistry.registerServerManifestProvider(new ManifestRegistry_1.StaticServerManifestProviderProxy(() => { return new Array(); }, ManifestGroupRegistry.clearManifestGroupRegistrations));
|
|
141
|
+
if (!ManifestGroupRegistry._registeredManifestProvider) {
|
|
142
|
+
ManifestGroupRegistry._registeredManifestProvider = true;
|
|
143
|
+
LoadableManifestRegistry_1.LoadableManifestRegistry.registerManifestProvider(new ManifestGroupRegistry());
|
|
144
|
+
}
|
|
145
|
+
return groupRegistrations;
|
|
146
|
+
}; }
|
|
147
|
+
static { this.ensureCorrectManifest = (manifest) => {
|
|
148
|
+
if (!manifest ||
|
|
149
|
+
!manifest.manifestType ||
|
|
150
|
+
manifest.manifestType !== Enums_1.ClientManifestTypes.ManifestGroup) {
|
|
151
|
+
throw new Error("Manifest :" + JSON.stringify(manifest) + " can't be used as component manifest. Mandatory properties maybe missing or the manifest is not of component type");
|
|
152
|
+
}
|
|
153
|
+
manifest.resourceId = Utils_1.Utils.ensureValidManifestId(manifest.resourceId);
|
|
154
|
+
}; }
|
|
155
|
+
static { this.clearManifestGroupRegistrations = () => {
|
|
156
|
+
ManifestGroupRegistry.ManifestGroupRegistrations = new Map();
|
|
157
|
+
}; }
|
|
158
|
+
static { this.ServerSubscription = ManifestRegistry_1.ManifestRegistry.registerServerManifestProvider(new ManifestRegistry_1.StaticServerManifestProviderProxy(() => { return new Array(); }, ManifestGroupRegistry.clearManifestGroupRegistrations)); }
|
|
159
|
+
}
|
|
160
|
+
exports.ManifestGroupRegistry = ManifestGroupRegistry;
|
|
@@ -18,94 +18,94 @@ class StaticServerManifestProviderProxy {
|
|
|
18
18
|
}
|
|
19
19
|
exports.StaticServerManifestProviderProxy = StaticServerManifestProviderProxy;
|
|
20
20
|
class ManifestRegistry {
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (!provider) {
|
|
36
|
-
throw new Error("Unexpected state, server manifest provider can't be null/undefined");
|
|
37
|
-
}
|
|
38
|
-
ManifestRegistry.ServerManifestProviders.push(provider);
|
|
39
|
-
ManifestRegistry.addResetableProvider(provider);
|
|
40
|
-
};
|
|
41
|
-
ManifestRegistry.setCurrentManifestPath = (manifestPath = null) => {
|
|
42
|
-
ManifestRegistry.CurrentManifestPath = manifestPath;
|
|
43
|
-
};
|
|
44
|
-
ManifestRegistry.getCurrentManifestPath = () => {
|
|
45
|
-
if (!ManifestRegistry.CurrentManifestPath) {
|
|
46
|
-
throw new Error("Unexpected usage, build step should set CurrentManifestPath before triggering manifest registration (build configuration error)");
|
|
47
|
-
}
|
|
48
|
-
return ManifestRegistry.CurrentManifestPath;
|
|
49
|
-
};
|
|
50
|
-
ManifestRegistry.getClientManifests = (currentServiceId) => {
|
|
51
|
-
currentServiceId = Utils_1.Utils.ensureValidServiceId(currentServiceId, "Can't get client manifests for service id undefined/empty/null");
|
|
52
|
-
const manifestsByTarget = {
|
|
53
|
-
[models_1.ClientManifestTargetTypes.public]: {
|
|
54
|
-
target: models_1.ClientManifestTargetTypes.public,
|
|
55
|
-
omniaServiceId: currentServiceId
|
|
21
|
+
static { this.CurrentManifestPath = null; }
|
|
22
|
+
static { this.ClientManifestProviders = []; }
|
|
23
|
+
static { this.ServerManifestProviders = []; }
|
|
24
|
+
static { this.ResetableManifestProviders = []; }
|
|
25
|
+
static { this.registerClientManifestProvider = (provider) => {
|
|
26
|
+
if (!provider) {
|
|
27
|
+
throw new Error("Unexpected state, client manifest provider can't be null/undefined");
|
|
28
|
+
}
|
|
29
|
+
ManifestRegistry.ClientManifestProviders.push(provider);
|
|
30
|
+
ManifestRegistry.addResetableProvider(provider);
|
|
31
|
+
}; }
|
|
32
|
+
static { this.registerServerManifestProvider = (provider) => {
|
|
33
|
+
if (!provider) {
|
|
34
|
+
throw new Error("Unexpected state, server manifest provider can't be null/undefined");
|
|
56
35
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
36
|
+
ManifestRegistry.ServerManifestProviders.push(provider);
|
|
37
|
+
ManifestRegistry.addResetableProvider(provider);
|
|
38
|
+
}; }
|
|
39
|
+
static { this.setCurrentManifestPath = (manifestPath = null) => {
|
|
40
|
+
ManifestRegistry.CurrentManifestPath = manifestPath;
|
|
41
|
+
}; }
|
|
42
|
+
static { this.getCurrentManifestPath = () => {
|
|
43
|
+
if (!ManifestRegistry.CurrentManifestPath) {
|
|
44
|
+
throw new Error("Unexpected usage, build step should set CurrentManifestPath before triggering manifest registration (build configuration error)");
|
|
45
|
+
}
|
|
46
|
+
return ManifestRegistry.CurrentManifestPath;
|
|
47
|
+
}; }
|
|
48
|
+
static { this.getClientManifests = (currentServiceId) => {
|
|
49
|
+
currentServiceId = Utils_1.Utils.ensureValidServiceId(currentServiceId, "Can't get client manifests for service id undefined/empty/null");
|
|
50
|
+
const manifestsByTarget = {
|
|
51
|
+
[models_1.ClientManifestTargetTypes.public]: {
|
|
52
|
+
target: models_1.ClientManifestTargetTypes.public,
|
|
53
|
+
omniaServiceId: currentServiceId
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
for (let provider of ManifestRegistry.ClientManifestProviders) {
|
|
57
|
+
let providerManifests = provider.getClientManifests(currentServiceId);
|
|
58
|
+
for (let m of providerManifests) {
|
|
59
|
+
let target = manifestsByTarget[models_1.ClientManifestTargetTypes.public]; // default is public target
|
|
60
|
+
if (m.target) {
|
|
61
|
+
if (manifestsByTarget[m.target] === undefined) {
|
|
62
|
+
manifestsByTarget[m.target] = { target: m.target, omniaServiceId: currentServiceId };
|
|
63
|
+
}
|
|
64
|
+
target = manifestsByTarget[m.target];
|
|
65
|
+
delete m.target;
|
|
66
|
+
}
|
|
67
|
+
if (target[m.manifestType] == null) {
|
|
68
|
+
target[m.manifestType] = [];
|
|
65
69
|
}
|
|
66
|
-
target
|
|
67
|
-
delete m.target;
|
|
70
|
+
target[m.manifestType].push(m);
|
|
68
71
|
}
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
}
|
|
73
|
+
return manifestsByTarget;
|
|
74
|
+
}; }
|
|
75
|
+
static { this.getServerManifests = (currentOmniaServiceId) => {
|
|
76
|
+
currentOmniaServiceId = Utils_1.Utils.ensureValidServiceId(currentOmniaServiceId, "Can't get server manifests for omnia service id undefined/empty/null");
|
|
77
|
+
let manifestsByType = {};
|
|
78
|
+
for (let provider of ManifestRegistry.ServerManifestProviders) {
|
|
79
|
+
let providerManifests = provider.getServerManifests(currentOmniaServiceId);
|
|
80
|
+
for (let m of providerManifests) {
|
|
81
|
+
if (manifestsByType[m.manifestType] == null) {
|
|
82
|
+
manifestsByType[m.manifestType] = [];
|
|
83
|
+
}
|
|
84
|
+
manifestsByType[m.manifestType].push(m);
|
|
71
85
|
}
|
|
72
|
-
target[m.manifestType].push(m);
|
|
73
86
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
ManifestRegistry.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
return manifestsByType;
|
|
88
|
+
}; }
|
|
89
|
+
static { this.clearState = () => {
|
|
90
|
+
for (let p of ManifestRegistry.ResetableManifestProviders) {
|
|
91
|
+
p.clearState();
|
|
92
|
+
}
|
|
93
|
+
}; }
|
|
94
|
+
static { this.addResetableProvider = (provider) => {
|
|
95
|
+
if (!provider ||
|
|
96
|
+
provider.clearState == null) {
|
|
97
|
+
throw new Error("Unexpected state, manifest provider can't have clearstate null/undefined");
|
|
98
|
+
}
|
|
99
|
+
let alreadyRegistered = false;
|
|
100
|
+
for (let p of ManifestRegistry.ResetableManifestProviders) {
|
|
101
|
+
if (p.clearState === provider.clearState) {
|
|
102
|
+
alreadyRegistered = true;
|
|
103
|
+
break;
|
|
85
104
|
}
|
|
86
|
-
manifestsByType[m.manifestType].push(m);
|
|
87
105
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
};
|
|
91
|
-
ManifestRegistry.clearState = () => {
|
|
92
|
-
for (let p of ManifestRegistry.ResetableManifestProviders) {
|
|
93
|
-
p.clearState();
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
ManifestRegistry.addResetableProvider = (provider) => {
|
|
97
|
-
if (!provider ||
|
|
98
|
-
provider.clearState == null) {
|
|
99
|
-
throw new Error("Unexpected state, manifest provider can't have clearstate null/undefined");
|
|
100
|
-
}
|
|
101
|
-
let alreadyRegistered = false;
|
|
102
|
-
for (let p of ManifestRegistry.ResetableManifestProviders) {
|
|
103
|
-
if (p.clearState === provider.clearState) {
|
|
104
|
-
alreadyRegistered = true;
|
|
105
|
-
break;
|
|
106
|
+
if (!alreadyRegistered) {
|
|
107
|
+
ManifestRegistry.ResetableManifestProviders.push(provider);
|
|
106
108
|
}
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
};
|
|
109
|
+
}; }
|
|
110
|
+
}
|
|
111
|
+
exports.ManifestRegistry = ManifestRegistry;
|
|
@@ -7,59 +7,59 @@ 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 RequestedResourcesRegistry {
|
|
10
|
+
static { this.RequestedResources = {}; }
|
|
11
|
+
static { this.AddSql = (option) => {
|
|
12
|
+
if (!models_1.Guid.isValid(option.uniqueId)) {
|
|
13
|
+
throw new Error("Can't add request for sql resource, without valid guid as unqieId: " + JSON.stringify(option));
|
|
14
|
+
}
|
|
15
|
+
if (RequestedResourcesRegistry.RequestedResources[option.uniqueId.toString()] != null) {
|
|
16
|
+
throw new Error("Can't add request for sql resource, the uniqueid has already been added." + JSON.stringify(option));
|
|
17
|
+
}
|
|
18
|
+
let manifest = {
|
|
19
|
+
manifestType: index_1.ServerManifestTypes.ResourceRequest,
|
|
20
|
+
resourceType: index_1.RequestedResourceTypes.SqlDatabase
|
|
21
|
+
};
|
|
22
|
+
let sqlResourceManifest = (0, deep_extend_1.default)(manifest, option);
|
|
23
|
+
RequestedResourcesRegistry.RequestedResources[option.uniqueId.toString()] = sqlResourceManifest;
|
|
24
|
+
}; }
|
|
25
|
+
static { this.AddPersistentDisk = (option) => {
|
|
26
|
+
if (!models_1.Guid.isValid(option.uniqueId)) {
|
|
27
|
+
throw new Error("Can't add request for persistent disk resource, without valid guid as unqieId: " + JSON.stringify(option));
|
|
28
|
+
}
|
|
29
|
+
if (RequestedResourcesRegistry.RequestedResources[option.uniqueId.toString()] != null) {
|
|
30
|
+
throw new Error("Can't add request for persistent disk resource, the uniqueid has already been added." + JSON.stringify(option));
|
|
31
|
+
}
|
|
32
|
+
let manifest = {
|
|
33
|
+
manifestType: index_1.ServerManifestTypes.ResourceRequest,
|
|
34
|
+
resourceType: index_1.RequestedResourceTypes.PersistentDisk
|
|
35
|
+
};
|
|
36
|
+
let persistentDiskResourceManifest = (0, deep_extend_1.default)(manifest, option);
|
|
37
|
+
RequestedResourcesRegistry.RequestedResources[option.uniqueId.toString()] = persistentDiskResourceManifest;
|
|
38
|
+
}; }
|
|
39
|
+
static { this.AddSqlElasticPool = (option) => {
|
|
40
|
+
if (!models_1.Guid.isValid(option.uniqueId)) {
|
|
41
|
+
throw new Error("Can't add request for sql elastic pool resource, without valid guid as unqieId: " + JSON.stringify(option));
|
|
42
|
+
}
|
|
43
|
+
if (RequestedResourcesRegistry.RequestedResources[option.uniqueId.toString()] != null) {
|
|
44
|
+
throw new Error("Can't add request for sql elastic pool resource, the uniqueid has already been added." + JSON.stringify(option));
|
|
45
|
+
}
|
|
46
|
+
let manifest = {
|
|
47
|
+
manifestType: index_1.ServerManifestTypes.ResourceRequest,
|
|
48
|
+
resourceType: index_1.RequestedResourceTypes.SqlElasticPoolDatabase
|
|
49
|
+
};
|
|
50
|
+
let sqlElasticPoolResourceManifest = (0, deep_extend_1.default)(manifest, option);
|
|
51
|
+
RequestedResourcesRegistry.RequestedResources[option.uniqueId.toString()] = sqlElasticPoolResourceManifest;
|
|
52
|
+
}; }
|
|
53
|
+
static { this.getServerManifests = (currentServiceId) => {
|
|
54
|
+
let serverManifests = new Array();
|
|
55
|
+
for (let key in RequestedResourcesRegistry.RequestedResources) {
|
|
56
|
+
serverManifests.push(RequestedResourcesRegistry.RequestedResources[key]);
|
|
57
|
+
}
|
|
58
|
+
return serverManifests;
|
|
59
|
+
}; }
|
|
60
|
+
static { this.clearState = () => {
|
|
61
|
+
RequestedResourcesRegistry.RequestedResources = {};
|
|
62
|
+
}; }
|
|
63
|
+
static { this.ServerSubscription = ManifestRegistry_1.ManifestRegistry.registerServerManifestProvider(new ManifestRegistry_1.StaticServerManifestProviderProxy(RequestedResourcesRegistry.getServerManifests, RequestedResourcesRegistry.clearState)); }
|
|
10
64
|
}
|
|
11
65
|
exports.RequestedResourcesRegistry = RequestedResourcesRegistry;
|
|
12
|
-
RequestedResourcesRegistry.RequestedResources = {};
|
|
13
|
-
RequestedResourcesRegistry.AddSql = (option) => {
|
|
14
|
-
if (!models_1.Guid.isValid(option.uniqueId)) {
|
|
15
|
-
throw new Error("Can't add request for sql resource, without valid guid as unqieId: " + JSON.stringify(option));
|
|
16
|
-
}
|
|
17
|
-
if (RequestedResourcesRegistry.RequestedResources[option.uniqueId.toString()] != null) {
|
|
18
|
-
throw new Error("Can't add request for sql resource, the uniqueid has already been added." + JSON.stringify(option));
|
|
19
|
-
}
|
|
20
|
-
let manifest = {
|
|
21
|
-
manifestType: index_1.ServerManifestTypes.ResourceRequest,
|
|
22
|
-
resourceType: index_1.RequestedResourceTypes.SqlDatabase
|
|
23
|
-
};
|
|
24
|
-
let sqlResourceManifest = (0, deep_extend_1.default)(manifest, option);
|
|
25
|
-
RequestedResourcesRegistry.RequestedResources[option.uniqueId.toString()] = sqlResourceManifest;
|
|
26
|
-
};
|
|
27
|
-
RequestedResourcesRegistry.AddPersistentDisk = (option) => {
|
|
28
|
-
if (!models_1.Guid.isValid(option.uniqueId)) {
|
|
29
|
-
throw new Error("Can't add request for persistent disk resource, without valid guid as unqieId: " + JSON.stringify(option));
|
|
30
|
-
}
|
|
31
|
-
if (RequestedResourcesRegistry.RequestedResources[option.uniqueId.toString()] != null) {
|
|
32
|
-
throw new Error("Can't add request for persistent disk resource, the uniqueid has already been added." + JSON.stringify(option));
|
|
33
|
-
}
|
|
34
|
-
let manifest = {
|
|
35
|
-
manifestType: index_1.ServerManifestTypes.ResourceRequest,
|
|
36
|
-
resourceType: index_1.RequestedResourceTypes.PersistentDisk
|
|
37
|
-
};
|
|
38
|
-
let persistentDiskResourceManifest = (0, deep_extend_1.default)(manifest, option);
|
|
39
|
-
RequestedResourcesRegistry.RequestedResources[option.uniqueId.toString()] = persistentDiskResourceManifest;
|
|
40
|
-
};
|
|
41
|
-
RequestedResourcesRegistry.AddSqlElasticPool = (option) => {
|
|
42
|
-
if (!models_1.Guid.isValid(option.uniqueId)) {
|
|
43
|
-
throw new Error("Can't add request for sql elastic pool resource, without valid guid as unqieId: " + JSON.stringify(option));
|
|
44
|
-
}
|
|
45
|
-
if (RequestedResourcesRegistry.RequestedResources[option.uniqueId.toString()] != null) {
|
|
46
|
-
throw new Error("Can't add request for sql elastic pool resource, the uniqueid has already been added." + JSON.stringify(option));
|
|
47
|
-
}
|
|
48
|
-
let manifest = {
|
|
49
|
-
manifestType: index_1.ServerManifestTypes.ResourceRequest,
|
|
50
|
-
resourceType: index_1.RequestedResourceTypes.SqlElasticPoolDatabase
|
|
51
|
-
};
|
|
52
|
-
let sqlElasticPoolResourceManifest = (0, deep_extend_1.default)(manifest, option);
|
|
53
|
-
RequestedResourcesRegistry.RequestedResources[option.uniqueId.toString()] = sqlElasticPoolResourceManifest;
|
|
54
|
-
};
|
|
55
|
-
RequestedResourcesRegistry.getServerManifests = (currentServiceId) => {
|
|
56
|
-
let serverManifests = new Array();
|
|
57
|
-
for (let key in RequestedResourcesRegistry.RequestedResources) {
|
|
58
|
-
serverManifests.push(RequestedResourcesRegistry.RequestedResources[key]);
|
|
59
|
-
}
|
|
60
|
-
return serverManifests;
|
|
61
|
-
};
|
|
62
|
-
RequestedResourcesRegistry.clearState = () => {
|
|
63
|
-
RequestedResourcesRegistry.RequestedResources = {};
|
|
64
|
-
};
|
|
65
|
-
RequestedResourcesRegistry.ServerSubscription = ManifestRegistry_1.ManifestRegistry.registerServerManifestProvider(new ManifestRegistry_1.StaticServerManifestProviderProxy(RequestedResourcesRegistry.getServerManifests, RequestedResourcesRegistry.clearState));
|
|
@@ -4,6 +4,7 @@ exports.RequiredAzureAdAppPermissionRegistry = void 0;
|
|
|
4
4
|
const index_1 = require("./models/index");
|
|
5
5
|
const ManifestRegistry_1 = require("./ManifestRegistry");
|
|
6
6
|
class RequiredAzureAdAppPermissionRegistry {
|
|
7
|
+
static { this.RequiredApis = {}; }
|
|
7
8
|
static addApiPermission(customApiPermisisonInfo) {
|
|
8
9
|
if (customApiPermisisonInfo == null) {
|
|
9
10
|
return this;
|
|
@@ -20,17 +21,16 @@ class RequiredAzureAdAppPermissionRegistry {
|
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
}
|
|
24
|
+
static { this.getServerManifests = (currentServiceId) => {
|
|
25
|
+
let serverManifests = new Array();
|
|
26
|
+
for (let key in RequiredAzureAdAppPermissionRegistry.RequiredApis) {
|
|
27
|
+
serverManifests.push(RequiredAzureAdAppPermissionRegistry.RequiredApis[key]);
|
|
28
|
+
}
|
|
29
|
+
return serverManifests;
|
|
30
|
+
}; }
|
|
31
|
+
static { this.clearState = () => {
|
|
32
|
+
RequiredAzureAdAppPermissionRegistry.RequiredApis = {};
|
|
33
|
+
}; }
|
|
34
|
+
static { this.ServerSubscription = ManifestRegistry_1.ManifestRegistry.registerServerManifestProvider(new ManifestRegistry_1.StaticServerManifestProviderProxy(RequiredAzureAdAppPermissionRegistry.getServerManifests, RequiredAzureAdAppPermissionRegistry.clearState)); }
|
|
23
35
|
}
|
|
24
36
|
exports.RequiredAzureAdAppPermissionRegistry = RequiredAzureAdAppPermissionRegistry;
|
|
25
|
-
RequiredAzureAdAppPermissionRegistry.RequiredApis = {};
|
|
26
|
-
RequiredAzureAdAppPermissionRegistry.getServerManifests = (currentServiceId) => {
|
|
27
|
-
let serverManifests = new Array();
|
|
28
|
-
for (let key in RequiredAzureAdAppPermissionRegistry.RequiredApis) {
|
|
29
|
-
serverManifests.push(RequiredAzureAdAppPermissionRegistry.RequiredApis[key]);
|
|
30
|
-
}
|
|
31
|
-
return serverManifests;
|
|
32
|
-
};
|
|
33
|
-
RequiredAzureAdAppPermissionRegistry.clearState = () => {
|
|
34
|
-
RequiredAzureAdAppPermissionRegistry.RequiredApis = {};
|
|
35
|
-
};
|
|
36
|
-
RequiredAzureAdAppPermissionRegistry.ServerSubscription = ManifestRegistry_1.ManifestRegistry.registerServerManifestProvider(new ManifestRegistry_1.StaticServerManifestProviderProxy(RequiredAzureAdAppPermissionRegistry.getServerManifests, RequiredAzureAdAppPermissionRegistry.clearState));
|