@omnia/tooling-composers 8.0.192-dev → 8.0.193-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/BlockingComposer.d.ts +3 -2
- package/internal-do-not-import-from-here/BlockingRegistry.d.ts +3 -3
- package/internal-do-not-import-from-here/BlockingRegistry.js +4 -3
- package/internal-do-not-import-from-here/CombinableSecurityProviderComposer.d.ts +2 -1
- package/internal-do-not-import-from-here/CombinableSecurityProviderComposer.js +2 -2
- package/internal-do-not-import-from-here/ComponentComposer.d.ts +2 -2
- package/internal-do-not-import-from-here/ComponentRegistry.d.ts +2 -2
- package/internal-do-not-import-from-here/Composer.d.ts +7 -7
- package/internal-do-not-import-from-here/Composer.js +2 -2
- package/internal-do-not-import-from-here/ComposerBase.d.ts +3 -3
- package/internal-do-not-import-from-here/ConfigurationClientServiceRegistry.d.ts +2 -2
- package/internal-do-not-import-from-here/CustomServiceComposer.d.ts +2 -1
- package/internal-do-not-import-from-here/CustomServiceComposer.js +2 -2
- package/internal-do-not-import-from-here/DependencyComposer.d.ts +6 -6
- package/internal-do-not-import-from-here/DependencyComposer.js +3 -3
- package/internal-do-not-import-from-here/LoadableManifestRegistry.d.ts +15 -15
- package/internal-do-not-import-from-here/LoadableManifestRegistry.js +1 -1
- package/internal-do-not-import-from-here/ManifestGroupComposer.d.ts +4 -3
- package/internal-do-not-import-from-here/ManifestGroupRegistry.d.ts +3 -3
- package/internal-do-not-import-from-here/ManifestGroupRegistry.js +6 -6
- package/internal-do-not-import-from-here/ManifestRegistry.d.ts +7 -7
- package/internal-do-not-import-from-here/RequestedResourcesRegistry.js +3 -3
- package/internal-do-not-import-from-here/ResourceRegistry.d.ts +4 -4
- package/internal-do-not-import-from-here/ResourcesComposer.d.ts +5 -4
- package/internal-do-not-import-from-here/ServiceAppRegistry.d.ts +2 -2
- package/internal-do-not-import-from-here/ServiceAppRegistry.js +4 -4
- package/internal-do-not-import-from-here/ServiceComposer.d.ts +2 -1
- package/internal-do-not-import-from-here/ServiceComposer.js +2 -2
- package/internal-do-not-import-from-here/ServiceFeatureRegistry.d.ts +2 -2
- package/internal-do-not-import-from-here/ServiceFeatureRegistry.js +2 -2
- package/internal-do-not-import-from-here/ServiceRoleRegistry.d.ts +2 -2
- package/internal-do-not-import-from-here/ServiceRoleRegistry.js +2 -2
- package/internal-do-not-import-from-here/Utils.d.ts +3 -3
- package/internal-do-not-import-from-here/Utils.js +12 -7
- package/internal-do-not-import-from-here/WebAppServiceComposer.d.ts +2 -1
- package/internal-do-not-import-from-here/WebAppServiceComposer.js +7 -7
- package/internal-do-not-import-from-here/WorkerServiceComposer.d.ts +2 -1
- package/internal-do-not-import-from-here/WorkerServiceComposer.js +2 -2
- package/internal-do-not-import-from-here/models/Build.d.ts +3 -3
- package/internal-do-not-import-from-here/models/ManifestGroupComposer.d.ts +4 -4
- package/internal-do-not-import-from-here/models/ServerManifests.d.ts +18 -18
- package/internal-do-not-import-from-here/task.d.ts +3 -3
- package/package.json +3 -3
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { guid } from "@omnia/fx-models";
|
|
1
2
|
export interface IBlockingComposer {
|
|
2
3
|
/** Block a manifest.
|
|
3
4
|
E.g. Provide omnia service id and manifest id for the target manifest you want to block
|
|
4
5
|
*/
|
|
5
|
-
externalManifest: (omniaServiceId:
|
|
6
|
+
externalManifest: (omniaServiceId: guid, manifestId: guid) => IBlockingComposer;
|
|
6
7
|
}
|
|
7
8
|
export declare class BlockingComposer implements IBlockingComposer {
|
|
8
|
-
externalManifest: (omniaServiceId:
|
|
9
|
+
externalManifest: (omniaServiceId: guid, manifestId: guid) => this;
|
|
9
10
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ClientManifest,
|
|
1
|
+
import { ClientManifest, guid } from '../../fx-models';
|
|
2
2
|
export declare class BlockingRegistry {
|
|
3
3
|
private static BlockedManifests;
|
|
4
|
-
static addBlockedManifest: (omniaServiceId:
|
|
5
|
-
static getClientManifests: (currentServiceId:
|
|
4
|
+
static addBlockedManifest: (omniaServiceId: guid, manifestId: guid) => void;
|
|
5
|
+
static getClientManifests: (currentServiceId: guid) => Array<ClientManifest>;
|
|
6
6
|
static clearState: () => void;
|
|
7
7
|
private static Subscription;
|
|
8
8
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BlockingRegistry = void 0;
|
|
4
4
|
const ManifestRegistry_1 = require("./ManifestRegistry");
|
|
5
|
-
const Utils_1 = require("./Utils");
|
|
6
5
|
//import { BlockedBundleManifest, ClientManifest } from "./models";
|
|
7
6
|
const Enums_1 = require("./models/Enums");
|
|
8
7
|
class BlockInformation {
|
|
@@ -19,8 +18,10 @@ class BlockInformation {
|
|
|
19
18
|
class BlockingRegistry {
|
|
20
19
|
static { this.BlockedManifests = []; }
|
|
21
20
|
static { this.addBlockedManifest = (omniaServiceId, manifestId) => {
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
//TODO if you find this probably you found that we have som uppercase guids.
|
|
22
|
+
//The tooling should always enforce lowercase
|
|
23
|
+
//omniaServiceId = Utils.ensureValidServiceId(omniaServiceId);
|
|
24
|
+
//manifestId = Utils.ensureValidManifestId(manifestId);
|
|
24
25
|
BlockingRegistry.BlockedManifests.push(new BlockInformation({
|
|
25
26
|
omniaServiceId: omniaServiceId,
|
|
26
27
|
resourceId: manifestId,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IComposerDone } from "./Composer";
|
|
2
2
|
import { SecurityProviderRule } from "./models/index";
|
|
3
|
+
import { guid } from "@omnia/fx-models";
|
|
3
4
|
export interface ILogicalOperatorSelector<T> extends IComposerDone<T> {
|
|
4
5
|
and: () => ICompletableCombinableSecurityProviderComposer<T>;
|
|
5
6
|
or: () => ICompletableCombinableSecurityProviderComposer<T>;
|
|
@@ -19,7 +20,7 @@ export declare class SecurityProviderCombinableRuleComposer<T> implements ICombi
|
|
|
19
20
|
private selectedLogicalOperator?;
|
|
20
21
|
constructor(newRuleCb: (allRules: Array<SecurityProviderRule>) => void, composerForDone: T);
|
|
21
22
|
done: () => T;
|
|
22
|
-
hasAccessToProvider: (securityProviderId:
|
|
23
|
+
hasAccessToProvider: (securityProviderId: guid) => this;
|
|
23
24
|
and: () => this;
|
|
24
25
|
or: () => this;
|
|
25
26
|
}
|
|
@@ -17,8 +17,8 @@ class SecurityProviderCombinableRuleComposer {
|
|
|
17
17
|
if (!securityProviderId) {
|
|
18
18
|
throw new Error("Can't add security provider rule with id null/empty/undefined");
|
|
19
19
|
}
|
|
20
|
-
if (!fx_models_1.
|
|
21
|
-
throw new Error("Can't add security provider rule with id: " + securityProviderId + " must be a valid
|
|
20
|
+
if (!(0, fx_models_1.isValidGuid)(securityProviderId)) {
|
|
21
|
+
throw new Error("Can't add security provider rule with id: " + securityProviderId + " must be a valid guid");
|
|
22
22
|
}
|
|
23
23
|
if (this.selectedLogicalOperator == null &&
|
|
24
24
|
this.rules.length > 0) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ElementOptions } from "./models";
|
|
2
2
|
import { CombinableRuleComposer, ICombinableRuleComposer } from "./CombinableRuleComposer";
|
|
3
|
-
import { WebComponentDefinition, OmniaBlock } from '../../fx-models';
|
|
3
|
+
import { WebComponentDefinition, OmniaBlock, guid } from '../../fx-models';
|
|
4
4
|
import { ComposerBase, IComposerBase } from './ComposerBase';
|
|
5
5
|
export interface IWebComponentComposer extends IComposerBase<IWebComponentComposer> {
|
|
6
6
|
/**
|
|
@@ -17,7 +17,7 @@ export interface IWebComponentComposer extends IComposerBase<IWebComponentCompos
|
|
|
17
17
|
export declare class ComponentComposer extends ComposerBase<IWebComponentComposer> implements IWebComponentComposer {
|
|
18
18
|
done: () => IWebComponentComposer;
|
|
19
19
|
private ruleComposer;
|
|
20
|
-
constructor(manifestId:
|
|
20
|
+
constructor(manifestId: guid, manifestName?: string);
|
|
21
21
|
withDefinition: (definition: WebComponentDefinition) => this;
|
|
22
22
|
registerComponent: (componentOptions: ElementOptions) => this;
|
|
23
23
|
withLoadRules: () => CombinableRuleComposer<IWebComponentComposer>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IClientLoadableManifestProvider, ResourceManifest } from "./LoadableManifestRegistry";
|
|
2
2
|
import { ResourceBuildOptions, ElementOptions } from "./models/index";
|
|
3
|
-
import { ComponentBundleManifest, ClientResolvableLoadRule, WebComponentDefinition,
|
|
3
|
+
import { ComponentBundleManifest, ClientResolvableLoadRule, WebComponentDefinition, guid } from '../../fx-models';
|
|
4
4
|
export declare class ComponentRegistration {
|
|
5
5
|
componentOptions: ElementOptions;
|
|
6
6
|
manifestPath: string;
|
|
@@ -21,7 +21,7 @@ export declare class ComponentRegistry implements IClientLoadableManifestProvide
|
|
|
21
21
|
static newCombinedRules: (manifest: ResourceManifest, rules: Array<ClientResolvableLoadRule>) => void;
|
|
22
22
|
static getRegistrations: () => Array<ComponentRegistration>;
|
|
23
23
|
static getComponentRegistrations: () => Array<ComponentRegistration>;
|
|
24
|
-
getClientLoadableManifests: (currentServiceId:
|
|
24
|
+
getClientLoadableManifests: (currentServiceId: guid) => Array<ComponentBundleManifest>;
|
|
25
25
|
clearState: () => void;
|
|
26
26
|
private static ensureCorrectManifest;
|
|
27
27
|
}
|
|
@@ -4,7 +4,7 @@ import { IResourcesComposer, IReOpendedResourcesComposer } from "./ResourcesComp
|
|
|
4
4
|
import { IWebComponentComposer } from "./ComponentComposer";
|
|
5
5
|
import { IManifestGroupComposer } from "./ManifestGroupComposer";
|
|
6
6
|
import { IRegisterService } from './ServiceComposer';
|
|
7
|
-
import {
|
|
7
|
+
import { guid } from '../../fx-models';
|
|
8
8
|
import { IClientServiceConfigurator } from '.';
|
|
9
9
|
export interface IComposerDone<T> {
|
|
10
10
|
done: () => T;
|
|
@@ -33,7 +33,7 @@ export interface INewManifestComposer extends IRegisterService {
|
|
|
33
33
|
* Usage: registerResourceGroup({...}).*additionalOperations
|
|
34
34
|
* @param groupOptions the options for the defining the webcomponent group.
|
|
35
35
|
*/
|
|
36
|
-
registerResourceGroup: (groupOptions: ManifestGroupOptions
|
|
36
|
+
registerResourceGroup: (groupOptions: ManifestGroupOptions) => IManifestGroupComposer;
|
|
37
37
|
/**
|
|
38
38
|
* Registers a new localization manifest
|
|
39
39
|
* Used to add labels for localization
|
|
@@ -55,21 +55,21 @@ export declare class Composer {
|
|
|
55
55
|
* @param manifestId the unique id of the manifest, must be a valid guid.
|
|
56
56
|
* @param name a friendly name of the manifest.
|
|
57
57
|
*/
|
|
58
|
-
static registerManifest: (manifestId:
|
|
58
|
+
static registerManifest: (manifestId: guid, name?: string) => INewManifestComposer;
|
|
59
59
|
/**
|
|
60
60
|
* Re-opens resources manifest, so more resources can be included.
|
|
61
61
|
* {param}:manifestId the unique id of the resource manifest to open, must be a valid guid.
|
|
62
62
|
*/
|
|
63
|
-
static openResourceManifest: (manifestId:
|
|
63
|
+
static openResourceManifest: (manifestId: guid) => IReOpendedResourcesComposer;
|
|
64
64
|
/** Add information about things you want to block.
|
|
65
65
|
E.g. block a manifest from being loaded, so you can provide your own implementation
|
|
66
66
|
*/
|
|
67
67
|
static get block(): IBlockingComposer;
|
|
68
68
|
static importManifests: (folderPath: string) => {
|
|
69
|
-
configuration: <T extends IClientServiceConfigurator<Composer>>(omniaServiceId:
|
|
69
|
+
configuration: <T extends IClientServiceConfigurator<Composer>>(omniaServiceId: guid, configurationType: any) => T;
|
|
70
70
|
done: () => {
|
|
71
|
-
registerManifest: (manifestId:
|
|
72
|
-
openResourceManifest: (manifestId:
|
|
71
|
+
registerManifest: (manifestId: guid, name?: string) => INewManifestComposer;
|
|
72
|
+
openResourceManifest: (manifestId: guid) => IReOpendedResourcesComposer;
|
|
73
73
|
block: IBlockingComposer;
|
|
74
74
|
};
|
|
75
75
|
};
|
|
@@ -62,14 +62,14 @@ class Composer {
|
|
|
62
62
|
* @param name a friendly name of the manifest.
|
|
63
63
|
*/
|
|
64
64
|
static { this.registerManifest = (manifestId, name) => {
|
|
65
|
-
return new NewManifestComposer(manifestId
|
|
65
|
+
return new NewManifestComposer(manifestId, name);
|
|
66
66
|
}; }
|
|
67
67
|
/**
|
|
68
68
|
* Re-opens resources manifest, so more resources can be included.
|
|
69
69
|
* {param}:manifestId the unique id of the resource manifest to open, must be a valid guid.
|
|
70
70
|
*/
|
|
71
71
|
static { this.openResourceManifest = (manifestId) => {
|
|
72
|
-
return new ResourcesComposer_1.ReOpenedResourceComposer(manifestId
|
|
72
|
+
return new ResourcesComposer_1.ReOpenedResourceComposer(manifestId);
|
|
73
73
|
}; }
|
|
74
74
|
/** Add information about things you want to block.
|
|
75
75
|
E.g. block a manifest from being loaded, so you can provide your own implementation
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiPath, ClientManifestTargetTypes, IExtend, IExtendApiManifest, RegiterApiConfiguration } from "../../fx-models";
|
|
1
|
+
import { ApiPath, ClientManifestTargetTypes, guid, IExtend, IExtendApiManifest, RegiterApiConfiguration } from "../../fx-models";
|
|
2
2
|
import { ICombinableRuleComposer } from "./CombinableRuleComposer";
|
|
3
3
|
import { DependencyComposer, IDependencyComposer } from "./DependencyComposer";
|
|
4
4
|
import { ResourceManifest } from "./LoadableManifestRegistry";
|
|
@@ -14,8 +14,8 @@ export declare abstract class ComposerBase<TType extends IComposerBase<any>> imp
|
|
|
14
14
|
protected manifest: ResourceManifest;
|
|
15
15
|
withTarget(target: ClientManifestTargetTypes): TType;
|
|
16
16
|
withNoDependency(): TType;
|
|
17
|
-
withDependency(manifestId:
|
|
18
|
-
withExternalDependency(omniaServiceId:
|
|
17
|
+
withDependency(manifestId: guid): DependencyComposer<TType>;
|
|
18
|
+
withExternalDependency(omniaServiceId: guid, manifestId: guid): DependencyComposer<TType>;
|
|
19
19
|
registerApi: (exp: (extend: IExtend) => Promise<any>, configuration?: RegiterApiConfiguration) => any;
|
|
20
20
|
extendApi: (exp: (extend: IExtendApiManifest) => ApiPath, expRules?: (builder: ICombinableRuleComposer<TType>) => void) => any;
|
|
21
21
|
disableAuth: () => any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { guid, OmniaRuntimeConfiguration } from '../../fx-models';
|
|
2
2
|
import { IWebAppServiceComposer } from './WebAppServiceComposer';
|
|
3
3
|
export interface IClientServiceConfigurator<T> {
|
|
4
4
|
done: () => T;
|
|
@@ -21,7 +21,7 @@ export declare class OmniaFxConfigurator implements IClientServiceConfigurator<I
|
|
|
21
21
|
}
|
|
22
22
|
export declare class ConfigurationClientServiceRegistry {
|
|
23
23
|
private static configurations;
|
|
24
|
-
static Add<T extends IClientServiceConfigurator<any>>(omniaServiceId:
|
|
24
|
+
static Add<T extends IClientServiceConfigurator<any>>(omniaServiceId: guid, configurationType: T, constructorArgs: Array<any>): IClientServiceConfigurator<any>;
|
|
25
25
|
static getConfigurations(): {
|
|
26
26
|
[omniaServiceId: string]: IClientServiceConfigurator<any>;
|
|
27
27
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ServiceOptions } from './models';
|
|
2
2
|
import { IServiceManifestComposer, ServiceManifestComposer } from './ServiceManifestComposer';
|
|
3
|
+
import { guid } from '@omnia/fx-models';
|
|
3
4
|
export interface ICustomServiceComposer extends IServiceManifestComposer<ICustomServiceComposer> {
|
|
4
5
|
runHelm: (cmd: string) => ICustomServiceComposer;
|
|
5
6
|
}
|
|
6
7
|
export declare class CustomServiceComposer extends ServiceManifestComposer<CustomServiceComposer> implements ICustomServiceComposer {
|
|
7
8
|
private manifestId;
|
|
8
9
|
private manifestTitle;
|
|
9
|
-
constructor(manifestId:
|
|
10
|
+
constructor(manifestId: guid, manifestTitle: string, serviceOptions: ServiceOptions);
|
|
10
11
|
runHelm(cmd: string): this;
|
|
11
12
|
}
|
|
@@ -11,8 +11,8 @@ class CustomServiceComposer extends ServiceManifestComposer_1.ServiceManifestCom
|
|
|
11
11
|
super(() => { return this; });
|
|
12
12
|
this.manifestId = manifestId;
|
|
13
13
|
this.manifestTitle = manifestTitle;
|
|
14
|
-
if (!fx_models_1.
|
|
15
|
-
throw new Error("Can't register omnia service with id: " + this.manifestId + " must be a valid
|
|
14
|
+
if (!(0, fx_models_1.isValidGuid)(this.manifestId)) {
|
|
15
|
+
throw new Error("Can't register omnia service with id: " + this.manifestId + " must be a valid guid");
|
|
16
16
|
}
|
|
17
17
|
let serviceInfo = {
|
|
18
18
|
description: serviceOptions.description,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IComposerDone } from "./Composer";
|
|
2
|
-
import {
|
|
2
|
+
import { guid } from '@omnia/fx-models';
|
|
3
3
|
export interface IDependencyComposer<T> {
|
|
4
4
|
/**
|
|
5
5
|
* Add dependencies to other manifests
|
|
@@ -10,21 +10,21 @@ export interface IDependencyComposer<T> {
|
|
|
10
10
|
* Add dependencies to other manifests
|
|
11
11
|
* Dependent manifests will be loaded before the current manifest is loaded.
|
|
12
12
|
*/
|
|
13
|
-
withDependency: (manifestId:
|
|
13
|
+
withDependency: (manifestId: guid) => ICompletableDependencyComposer<T>;
|
|
14
14
|
/**
|
|
15
15
|
* Add dependencies to a manifest in another omnia service
|
|
16
16
|
* Dependent manifests will be loaded before the current manifest is loaded.
|
|
17
17
|
*/
|
|
18
|
-
withExternalDependency: (omniaServiceId:
|
|
18
|
+
withExternalDependency: (omniaServiceId: guid, manifestId: guid) => ICompletableDependencyComposer<T>;
|
|
19
19
|
}
|
|
20
20
|
export interface ICompletableDependencyComposer<T> extends IDependencyComposer<T>, IComposerDone<T> {
|
|
21
21
|
}
|
|
22
22
|
export declare class DependencyComposer<T> implements ICompletableDependencyComposer<T> {
|
|
23
23
|
private currentManifestId;
|
|
24
24
|
private composerForDone;
|
|
25
|
-
constructor(currentManifestId:
|
|
25
|
+
constructor(currentManifestId: guid, composerForDone: T);
|
|
26
26
|
done: () => T;
|
|
27
27
|
withNoDependency: () => T;
|
|
28
|
-
withDependency: (manifestId:
|
|
29
|
-
withExternalDependency: (omniaServiceId:
|
|
28
|
+
withDependency: (manifestId: guid) => this;
|
|
29
|
+
withExternalDependency: (omniaServiceId: guid, manifestId: guid) => this;
|
|
30
30
|
}
|
|
@@ -10,16 +10,16 @@ class DependencyComposer {
|
|
|
10
10
|
return this.composerForDone;
|
|
11
11
|
};
|
|
12
12
|
this.withNoDependency = () => {
|
|
13
|
-
LoadableManifestRegistry_1.LoadableManifestRegistry.withNoDependency(this.currentManifestId
|
|
13
|
+
LoadableManifestRegistry_1.LoadableManifestRegistry.withNoDependency(this.currentManifestId);
|
|
14
14
|
//Stop fluent
|
|
15
15
|
return this.composerForDone;
|
|
16
16
|
};
|
|
17
17
|
this.withDependency = (manifestId) => {
|
|
18
|
-
LoadableManifestRegistry_1.LoadableManifestRegistry.addManifestDependency(this.currentManifestId
|
|
18
|
+
LoadableManifestRegistry_1.LoadableManifestRegistry.addManifestDependency(this.currentManifestId, manifestId);
|
|
19
19
|
return this;
|
|
20
20
|
};
|
|
21
21
|
this.withExternalDependency = (omniaServiceId, manifestId) => {
|
|
22
|
-
LoadableManifestRegistry_1.LoadableManifestRegistry.addManifestDependency(this.currentManifestId
|
|
22
|
+
LoadableManifestRegistry_1.LoadableManifestRegistry.addManifestDependency(this.currentManifestId, manifestId, omniaServiceId);
|
|
23
23
|
return this;
|
|
24
24
|
};
|
|
25
25
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BundleTargetTypes } from "./models/Enums";
|
|
2
|
-
import { ClientManifest, LoadableBundleManifest, BundleIdentity, RegiterApiConfiguration,
|
|
2
|
+
import { ClientManifest, LoadableBundleManifest, BundleIdentity, RegiterApiConfiguration, guid } from '../../fx-models';
|
|
3
3
|
export interface ResourceManifest extends ClientManifest {
|
|
4
4
|
/**
|
|
5
5
|
The unique id of the manifest, this will be the id of the resources added.
|
|
6
6
|
*/
|
|
7
|
-
resourceId:
|
|
7
|
+
resourceId: guid;
|
|
8
8
|
/**
|
|
9
9
|
The friendly name of the manifest
|
|
10
10
|
*/
|
|
@@ -40,7 +40,7 @@ export declare class StaticClientLoadableManifestProviderProxy implements IClien
|
|
|
40
40
|
constructor(getClientLoadableManifestsFunc: (currentServiceId: string) => Array<LoadableBundleManifest>, clearStateFunc: () => void);
|
|
41
41
|
}
|
|
42
42
|
export interface IClientLoadableManifestProvider {
|
|
43
|
-
getClientLoadableManifests: (currentServiceId:
|
|
43
|
+
getClientLoadableManifests: (currentServiceId: guid) => Array<LoadableBundleManifest>;
|
|
44
44
|
clearState: () => void;
|
|
45
45
|
}
|
|
46
46
|
export declare class LoadableManifestRegistry {
|
|
@@ -51,21 +51,21 @@ export declare class LoadableManifestRegistry {
|
|
|
51
51
|
private static ClientManifests;
|
|
52
52
|
private static RegisteredManifests;
|
|
53
53
|
private static ClientManifestProviders;
|
|
54
|
-
static getRegisteredManifest: (manifestId:
|
|
55
|
-
static withNoDependency: (manifestId:
|
|
56
|
-
static isDefineWithNoDependency: (manifestId:
|
|
57
|
-
static addManifestDependency: (manifestId:
|
|
58
|
-
static getManifestDependencies: (manifestId:
|
|
59
|
-
static getAllManifestDependencies: () => Map<
|
|
60
|
-
static addManifestVersion: (manifestId:
|
|
61
|
-
static getManifestVersion: (manifestId:
|
|
54
|
+
static getRegisteredManifest: (manifestId: guid) => ResourceManifest;
|
|
55
|
+
static withNoDependency: (manifestId: guid) => void;
|
|
56
|
+
static isDefineWithNoDependency: (manifestId: guid) => boolean;
|
|
57
|
+
static addManifestDependency: (manifestId: guid, dependentOnManifestId: guid, dependentManifestOmniaServiceId?: guid) => void;
|
|
58
|
+
static getManifestDependencies: (manifestId: guid, currentServiceId: guid) => Array<BundleIdentity>;
|
|
59
|
+
static getAllManifestDependencies: () => Map<guid, any[]>;
|
|
60
|
+
static addManifestVersion: (manifestId: guid, type: BundleTargetTypes, version: string) => void;
|
|
61
|
+
static getManifestVersion: (manifestId: guid) => {
|
|
62
62
|
[key: string]: string;
|
|
63
63
|
};
|
|
64
|
-
static addManifestBundleType: (manifestId:
|
|
65
|
-
static getManifestBundleTypes: (manifestId:
|
|
66
|
-
static registerManifest: (manifest: ResourceManifest) => Map<
|
|
64
|
+
static addManifestBundleType: (manifestId: guid, type: BundleTargetTypes) => void;
|
|
65
|
+
static getManifestBundleTypes: (manifestId: guid) => Array<BundleTargetTypes>;
|
|
66
|
+
static registerManifest: (manifest: ResourceManifest) => Map<guid, ResourceManifest>;
|
|
67
67
|
static registerManifestProvider: (provider: IClientLoadableManifestProvider) => void;
|
|
68
|
-
static getClientManifests: (currentServiceId:
|
|
68
|
+
static getClientManifests: (currentServiceId: guid) => Array<ClientManifest>;
|
|
69
69
|
static clearState: () => void;
|
|
70
70
|
private static validateDependencies;
|
|
71
71
|
private static addClientManifest;
|
|
@@ -46,7 +46,7 @@ class CircularDependencyValidator {
|
|
|
46
46
|
console.log(this.manifestId, dependency, this.dependency);
|
|
47
47
|
throw new Error("Have a exception");
|
|
48
48
|
}
|
|
49
|
-
if (this.CurrentDependencyChain.indexOf(dependency.manifestId
|
|
49
|
+
if (this.CurrentDependencyChain.indexOf(dependency.manifestId) > -1) {
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
else {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IDependencyComposer, DependencyComposer } from "./DependencyComposer";
|
|
2
2
|
import { ISecurityComposer, ManifestGroupOptions } from "./models";
|
|
3
3
|
import { CombinableRuleComposer, ICombinableRuleComposer } from "./CombinableRuleComposer";
|
|
4
|
+
import { guid } from '../../fx-models';
|
|
4
5
|
export interface IManifestGroupComposer extends IDependencyComposer<IManifestGroupComposer>, ISecurityComposer<IManifestGroupComposer> {
|
|
5
6
|
/** Add a rule(s) when the component group should be loaded
|
|
6
7
|
Make sure to add rules which is not to generic, i.e. only load when needed
|
|
@@ -11,12 +12,12 @@ export interface IManifestGroupComposer extends IDependencyComposer<IManifestGro
|
|
|
11
12
|
export declare class ManifestGroupComposer implements IManifestGroupComposer {
|
|
12
13
|
private manifest;
|
|
13
14
|
private ruleComposer;
|
|
14
|
-
constructor(manifestId:
|
|
15
|
+
constructor(manifestId: guid, manifestName?: string);
|
|
15
16
|
registerManifestGroup: (groupOptions: ManifestGroupOptions) => this;
|
|
16
17
|
withLoadRules: () => CombinableRuleComposer<IManifestGroupComposer>;
|
|
17
18
|
withNoDependency: () => this;
|
|
18
|
-
withDependency: (manifestId:
|
|
19
|
-
withExternalDependency: (omniaServiceId:
|
|
19
|
+
withDependency: (manifestId: guid) => DependencyComposer<this>;
|
|
20
|
+
withExternalDependency: (omniaServiceId: guid, manifestId: guid) => DependencyComposer<this>;
|
|
20
21
|
disableAuth: () => any;
|
|
21
22
|
private persistCombinedRules;
|
|
22
23
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IClientLoadableManifestProvider, ResourceManifest } from "./LoadableManifestRegistry";
|
|
2
|
-
import { ClientResolvableLoadRule, GroupedBundleManifest,
|
|
2
|
+
import { ClientResolvableLoadRule, GroupedBundleManifest, guid } from '../../fx-models';
|
|
3
3
|
import { ManifestGroupOptions } from './models';
|
|
4
4
|
export declare class ManifestGroupRegistration {
|
|
5
5
|
manifestGroupOptions: ManifestGroupOptions;
|
|
@@ -9,7 +9,7 @@ export declare class ManifestGroupRegistration {
|
|
|
9
9
|
constructor(manifestGroupOptions: ManifestGroupOptions, manifestPath: string, manifest: ResourceManifest);
|
|
10
10
|
}
|
|
11
11
|
export interface ManifestGroupDescription {
|
|
12
|
-
resourceId:
|
|
12
|
+
resourceId: guid;
|
|
13
13
|
resourceName?: string;
|
|
14
14
|
manifestIdsInGroup: Array<string>;
|
|
15
15
|
}
|
|
@@ -20,7 +20,7 @@ export declare class ManifestGroupRegistry implements IClientLoadableManifestPro
|
|
|
20
20
|
static newCombinedRules: (manifest: ResourceManifest, rules: Array<ClientResolvableLoadRule>) => void;
|
|
21
21
|
static getManifestGroupRegistrations: () => any;
|
|
22
22
|
static getRegistrations: () => Array<ManifestGroupDescription>;
|
|
23
|
-
getClientLoadableManifests: (currentServiceId:
|
|
23
|
+
getClientLoadableManifests: (currentServiceId: guid) => Array<GroupedBundleManifest>;
|
|
24
24
|
clearState: () => void;
|
|
25
25
|
private static ensureCorrectManifest;
|
|
26
26
|
private static clearManifestGroupRegistrations;
|
|
@@ -13,12 +13,12 @@ class ManifestGroupRegistration {
|
|
|
13
13
|
this.manifest = manifest;
|
|
14
14
|
this.loadRules = [];
|
|
15
15
|
// ensure is string value
|
|
16
|
-
if (this.manifestGroupOptions.resourceManifestIds) {
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
if (this.manifestGroupOptions.webComponentManifestIds) {
|
|
20
|
-
|
|
21
|
-
}
|
|
16
|
+
// if (this.manifestGroupOptions.resourceManifestIds) {
|
|
17
|
+
// this.manifestGroupOptions.resourceManifestIds = this.manifestGroupOptions.resourceManifestIds
|
|
18
|
+
// }
|
|
19
|
+
// if (this.manifestGroupOptions.webComponentManifestIds) {
|
|
20
|
+
// this.manifestGroupOptions.webComponentManifestIds = this.manifestGroupOptions.webComponentManifestIds.map(r => r)
|
|
21
|
+
// }
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
exports.ManifestGroupRegistration = ManifestGroupRegistration;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { ServerManifest, ServerManifestByTypeCollection } from "./models/index";
|
|
2
|
-
import { ClientManifest, ClientManifestByTargetCollection,
|
|
2
|
+
import { ClientManifest, ClientManifestByTargetCollection, guid } from '../../fx-models';
|
|
3
3
|
export interface IResetableProvider {
|
|
4
4
|
clearState: () => void;
|
|
5
5
|
}
|
|
6
6
|
export interface IClientManifestProvider extends IResetableProvider {
|
|
7
|
-
getClientManifests: (currentServiceId:
|
|
7
|
+
getClientManifests: (currentServiceId: guid) => Array<ClientManifest>;
|
|
8
8
|
}
|
|
9
9
|
export interface IServerManifestProvider extends IResetableProvider {
|
|
10
|
-
getServerManifests: (currentServiceId:
|
|
10
|
+
getServerManifests: (currentServiceId: guid) => Array<ServerManifest>;
|
|
11
11
|
}
|
|
12
12
|
export declare class StaticClientManifestProviderProxy implements IClientManifestProvider {
|
|
13
|
-
getClientManifests: (currentServiceId:
|
|
13
|
+
getClientManifests: (currentServiceId: guid) => ClientManifest[];
|
|
14
14
|
clearState: () => void;
|
|
15
|
-
constructor(getClientManifestsFunc: (currentServiceId:
|
|
15
|
+
constructor(getClientManifestsFunc: (currentServiceId: guid) => Array<ClientManifest>, clearStateFunc: () => void);
|
|
16
16
|
}
|
|
17
17
|
export declare class StaticServerManifestProviderProxy implements IServerManifestProvider {
|
|
18
18
|
getServerManifests: (currentOmniaServiceId: string) => ServerManifest[];
|
|
@@ -28,8 +28,8 @@ export declare class ManifestRegistry {
|
|
|
28
28
|
static registerServerManifestProvider: (provider: IServerManifestProvider) => void;
|
|
29
29
|
static setCurrentManifestPath: (manifestPath?: string) => void;
|
|
30
30
|
static getCurrentManifestPath: () => string;
|
|
31
|
-
static getClientManifests: (currentServiceId:
|
|
32
|
-
static getServerManifests: (currentOmniaServiceId:
|
|
31
|
+
static getClientManifests: (currentServiceId: guid) => ClientManifestByTargetCollection;
|
|
32
|
+
static getServerManifests: (currentOmniaServiceId: guid) => ServerManifestByTypeCollection;
|
|
33
33
|
static clearState: () => void;
|
|
34
34
|
private static addResetableProvider;
|
|
35
35
|
}
|
|
@@ -9,7 +9,7 @@ const models_1 = require("../../fx-models");
|
|
|
9
9
|
class RequestedResourcesRegistry {
|
|
10
10
|
static { this.RequestedResources = {}; }
|
|
11
11
|
static { this.AddSql = (option) => {
|
|
12
|
-
if (!models_1.
|
|
12
|
+
if (!(0, models_1.isValidGuid)(option.uniqueId)) {
|
|
13
13
|
throw new Error("Can't add request for sql resource, without valid guid as unqieId: " + JSON.stringify(option));
|
|
14
14
|
}
|
|
15
15
|
if (RequestedResourcesRegistry.RequestedResources[option.uniqueId.toString()] != null) {
|
|
@@ -23,7 +23,7 @@ class RequestedResourcesRegistry {
|
|
|
23
23
|
RequestedResourcesRegistry.RequestedResources[option.uniqueId.toString()] = sqlResourceManifest;
|
|
24
24
|
}; }
|
|
25
25
|
static { this.AddPersistentDisk = (option) => {
|
|
26
|
-
if (!models_1.
|
|
26
|
+
if (!(0, models_1.isValidGuid)(option.uniqueId)) {
|
|
27
27
|
throw new Error("Can't add request for persistent disk resource, without valid guid as unqieId: " + JSON.stringify(option));
|
|
28
28
|
}
|
|
29
29
|
if (RequestedResourcesRegistry.RequestedResources[option.uniqueId.toString()] != null) {
|
|
@@ -37,7 +37,7 @@ class RequestedResourcesRegistry {
|
|
|
37
37
|
RequestedResourcesRegistry.RequestedResources[option.uniqueId.toString()] = persistentDiskResourceManifest;
|
|
38
38
|
}; }
|
|
39
39
|
static { this.AddSqlElasticPool = (option) => {
|
|
40
|
-
if (!models_1.
|
|
40
|
+
if (!(0, models_1.isValidGuid)(option.uniqueId)) {
|
|
41
41
|
throw new Error("Can't add request for sql elastic pool resource, without valid guid as unqieId: " + JSON.stringify(option));
|
|
42
42
|
}
|
|
43
43
|
if (RequestedResourcesRegistry.RequestedResources[option.uniqueId.toString()] != null) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OrderOptions, ResourcesOptions, ResourceBuildOptions } from "./models/index";
|
|
2
2
|
import { ResourceManifest, IClientLoadableManifestProvider } from "./LoadableManifestRegistry";
|
|
3
|
-
import { ClientResolvableLoadRule,
|
|
3
|
+
import { ClientResolvableLoadRule, guid, ResourcesBundleManifest } from '../../fx-models';
|
|
4
4
|
export interface ResourcePathsWithBuildOptions {
|
|
5
5
|
paths: Array<String>;
|
|
6
6
|
buildOptions: ResourceBuildOptions;
|
|
@@ -22,9 +22,9 @@ export declare class ResourceRegistry implements IClientLoadableManifestProvider
|
|
|
22
22
|
static addBuildOptions: (manifest: ResourceManifest, buildOptions: ResourceBuildOptions) => void;
|
|
23
23
|
static newCombinedRules: (manifest: ResourceManifest, rules: Array<ClientResolvableLoadRule>) => void;
|
|
24
24
|
static addExtendApiRules: (manifest: ResourceManifest, rules: Array<ClientResolvableLoadRule>) => void;
|
|
25
|
-
static getRegisteredResourceBundles: (pathJoiner: (path1: any, path2: any) => string[]) => Map<
|
|
26
|
-
static getResourceRegistrations: () => Map<
|
|
27
|
-
getClientLoadableManifests: (currentServiceId:
|
|
25
|
+
static getRegisteredResourceBundles: (pathJoiner: (path1: any, path2: any) => string[]) => Map<guid, ResourcePathsWithBuildOptions>;
|
|
26
|
+
static getResourceRegistrations: () => Map<guid, ResourceRegistration[]>;
|
|
27
|
+
getClientLoadableManifests: (currentServiceId: guid) => Array<ResourcesBundleManifest>;
|
|
28
28
|
clearState: () => void;
|
|
29
29
|
private static ensureCorrectManifest;
|
|
30
30
|
}
|
|
@@ -2,6 +2,7 @@ import { DependencyComposer } from "./DependencyComposer";
|
|
|
2
2
|
import { OrderOptions, ResourcesOptions, ILocalizationComposer, LocalizationOptions } from "./models";
|
|
3
3
|
import { ICombinableRuleComposer, CombinableRuleComposer } from "./CombinableRuleComposer";
|
|
4
4
|
import { Localization } from "./LocalizationComposer";
|
|
5
|
+
import { guid } from '../../fx-models';
|
|
5
6
|
import { ComposerBase, IComposerBase } from "./ComposerBase";
|
|
6
7
|
export interface IReOpendedResourcesComposer {
|
|
7
8
|
/** Add more resources to the opened manifest */
|
|
@@ -29,7 +30,7 @@ export interface IResourcesComposer extends IComposerBase<IResourcesComposer> {
|
|
|
29
30
|
export declare class ReOpenedResourceComposer implements IReOpendedResourcesComposer, IReOpendedResourcesOrderingComposer {
|
|
30
31
|
private manifest;
|
|
31
32
|
private manifestId;
|
|
32
|
-
constructor(manifestId:
|
|
33
|
+
constructor(manifestId: guid);
|
|
33
34
|
registerResource: (resourcesOptions: ResourcesOptions) => this;
|
|
34
35
|
orderUsing: (orderOption: OrderOptions) => void;
|
|
35
36
|
registerLocalization: (localizationOptions: LocalizationOptions) => Localization;
|
|
@@ -37,11 +38,11 @@ export declare class ReOpenedResourceComposer implements IReOpendedResourcesComp
|
|
|
37
38
|
export declare class ResourcesComposer extends ComposerBase<IResourcesComposer> implements IResourcesComposer {
|
|
38
39
|
private manifestName?;
|
|
39
40
|
private ruleComposer;
|
|
40
|
-
constructor(manifestId:
|
|
41
|
+
constructor(manifestId: guid, manifestName?: string);
|
|
41
42
|
registerResource: (resourcesOptions: ResourcesOptions) => this;
|
|
42
43
|
withLoadRules: () => CombinableRuleComposer<IResourcesComposer>;
|
|
43
44
|
withNoDependency: () => this;
|
|
44
|
-
withDependency: (manifestId:
|
|
45
|
-
withExternalDependency: (omniaServiceId:
|
|
45
|
+
withDependency: (manifestId: guid) => DependencyComposer<this>;
|
|
46
|
+
withExternalDependency: (omniaServiceId: guid, manifestId: guid) => DependencyComposer<this>;
|
|
46
47
|
private persistCombinedRules;
|
|
47
48
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ServiceAppDefinitionOption } from './models/index';
|
|
2
|
-
import {
|
|
2
|
+
import { guid } from '../../fx-models';
|
|
3
3
|
export declare class ServiceAppRegistry {
|
|
4
4
|
private static AddedAppDefinitions;
|
|
5
|
-
static AddAppDefinition: (appDefinitionId:
|
|
5
|
+
static AddAppDefinition: (appDefinitionId: guid, option: ServiceAppDefinitionOption) => void;
|
|
6
6
|
private static getServerManifests;
|
|
7
7
|
private static clearState;
|
|
8
8
|
private static ServerSubscription;
|
|
@@ -9,10 +9,10 @@ const models_1 = require("../../fx-models");
|
|
|
9
9
|
class ServiceAppRegistry {
|
|
10
10
|
static { this.AddedAppDefinitions = {}; }
|
|
11
11
|
static { this.AddAppDefinition = (appDefinitionId, option) => {
|
|
12
|
-
if (appDefinitionId
|
|
13
|
-
throw new Error("Can't add app definition with id:
|
|
12
|
+
if (appDefinitionId === models_1.emptyGuid) {
|
|
13
|
+
throw new Error("Can't add app definition with id: emptyGuid. See manifest file: " + ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath());
|
|
14
14
|
}
|
|
15
|
-
if (ServiceAppRegistry.AddedAppDefinitions[appDefinitionId
|
|
15
|
+
if (ServiceAppRegistry.AddedAppDefinitions[appDefinitionId] != null) {
|
|
16
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
17
|
}
|
|
18
18
|
let manifest = {
|
|
@@ -20,7 +20,7 @@ class ServiceAppRegistry {
|
|
|
20
20
|
};
|
|
21
21
|
let appManifest = (0, deep_extend_1.default)(manifest, option);
|
|
22
22
|
appManifest.uniqueId = appDefinitionId;
|
|
23
|
-
ServiceAppRegistry.AddedAppDefinitions[appDefinitionId
|
|
23
|
+
ServiceAppRegistry.AddedAppDefinitions[appDefinitionId] = appManifest;
|
|
24
24
|
}; }
|
|
25
25
|
static { this.getServerManifests = (currentServiceId) => {
|
|
26
26
|
let serverManifests = new Array();
|
|
@@ -2,6 +2,7 @@ import { ServiceOptions } from './models';
|
|
|
2
2
|
import { IWebAppServiceComposer } from './WebAppServiceComposer';
|
|
3
3
|
import { IWorkerServiceComposer } from './WorkerServiceComposer';
|
|
4
4
|
import { ICustomServiceComposer } from './CustomServiceComposer';
|
|
5
|
+
import { guid } from '@omnia/fx-models';
|
|
5
6
|
export interface IRegisterService {
|
|
6
7
|
/** Specify service type for this omnia service project.
|
|
7
8
|
E.g. A service could be a worker, doing simple async jobs, worker queues etc
|
|
@@ -27,7 +28,7 @@ export declare class ServiceComposer implements IServiceComposer {
|
|
|
27
28
|
private manifestId;
|
|
28
29
|
private manifestName;
|
|
29
30
|
private serviceInfo;
|
|
30
|
-
constructor(manifestId:
|
|
31
|
+
constructor(manifestId: guid, manifestName: string, serviceInfo: ServiceOptions);
|
|
31
32
|
AsWebApp: () => IWebAppServiceComposer;
|
|
32
33
|
AsWorker: () => IWorkerServiceComposer;
|
|
33
34
|
AsCustom: () => ICustomServiceComposer;
|
|
@@ -20,8 +20,8 @@ class ServiceComposer {
|
|
|
20
20
|
this.AsCustom = () => {
|
|
21
21
|
return new CustomServiceComposer_1.CustomServiceComposer(this.manifestId, this.manifestName, this.serviceInfo);
|
|
22
22
|
};
|
|
23
|
-
if (!fx_models_1.
|
|
24
|
-
throw new Error("Can't register service with id: " + this.manifestId + " must be a valid
|
|
23
|
+
if (!(0, fx_models_1.isValidGuid)(this.manifestId)) {
|
|
24
|
+
throw new Error("Can't register service with id: " + this.manifestId + " must be a valid guid");
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ServiceFeatureOption } from './models/index';
|
|
2
|
-
import {
|
|
2
|
+
import { guid } from '../../fx-models';
|
|
3
3
|
export declare class ServiceFeatureRegistry {
|
|
4
4
|
private static AddedFeatures;
|
|
5
|
-
static AddFeature: (featureId:
|
|
5
|
+
static AddFeature: (featureId: guid, option: ServiceFeatureOption) => void;
|
|
6
6
|
private static getServerManifests;
|
|
7
7
|
private static clearState;
|
|
8
8
|
private static ServerSubscription;
|
|
@@ -10,8 +10,8 @@ const AzureAdAppPermissionHelper_1 = require("./AzureAdAppPermissionHelper");
|
|
|
10
10
|
class ServiceFeatureRegistry {
|
|
11
11
|
static { this.AddedFeatures = {}; }
|
|
12
12
|
static { this.AddFeature = (featureId, option) => {
|
|
13
|
-
if (featureId
|
|
14
|
-
throw new Error("Can't add feature with id:
|
|
13
|
+
if (featureId === models_1.emptyGuid) {
|
|
14
|
+
throw new Error("Can't add feature with id: emptyGuid. See manifest file: " + ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath());
|
|
15
15
|
}
|
|
16
16
|
if (ServiceFeatureRegistry.AddedFeatures[featureId.toString()] != null) {
|
|
17
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());
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ServiceRoleDefinitionOption } from './models/index';
|
|
2
|
-
import {
|
|
2
|
+
import { guid } from '../../fx-models';
|
|
3
3
|
export declare class ServiceRoleRegistry {
|
|
4
4
|
private static AddedRoleDefinitions;
|
|
5
|
-
static AddRoleDefinition: (roleDefinitionId:
|
|
5
|
+
static AddRoleDefinition: (roleDefinitionId: guid, option: ServiceRoleDefinitionOption) => void;
|
|
6
6
|
private static getServerManifests;
|
|
7
7
|
private static clearState;
|
|
8
8
|
private static ServerSubscription;
|
|
@@ -9,8 +9,8 @@ const models_1 = require("../../fx-models");
|
|
|
9
9
|
class ServiceRoleRegistry {
|
|
10
10
|
static { this.AddedRoleDefinitions = {}; }
|
|
11
11
|
static { this.AddRoleDefinition = (roleDefinitionId, option) => {
|
|
12
|
-
if (roleDefinitionId
|
|
13
|
-
throw new Error("Can't add role definition with id:
|
|
12
|
+
if (roleDefinitionId === models_1.emptyGuid) {
|
|
13
|
+
throw new Error("Can't add role definition with id: emptyGuid. See manifest file: " + ManifestRegistry_1.ManifestRegistry.getCurrentManifestPath());
|
|
14
14
|
}
|
|
15
15
|
if (ServiceRoleRegistry.AddedRoleDefinitions[roleDefinitionId.toString()] != null) {
|
|
16
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());
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ClientResolvableLoadRule,
|
|
1
|
+
import { ClientResolvableLoadRule, guid } from '../../fx-models';
|
|
2
2
|
export declare class Utils {
|
|
3
|
-
static ensureValidManifestId: (id:
|
|
4
|
-
static ensureValidServiceId: (id:
|
|
3
|
+
static ensureValidManifestId: (id: guid, errorMsg?: string) => guid;
|
|
4
|
+
static ensureValidServiceId: (id: guid, errorMsg?: string) => guid;
|
|
5
5
|
static ensureValidElementName: (name: string, errorMsg?: string) => string;
|
|
6
6
|
static validateSupportedLoadRuleTypes: (rules: Array<ClientResolvableLoadRule>) => void;
|
|
7
7
|
static validateSupportedLoadRuleType: (rule: ClientResolvableLoadRule) => void;
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Utils = void 0;
|
|
4
|
-
const models_1 = require("../../fx-models");
|
|
5
4
|
//import { LoadByUrlMatchingRule, DomMatchingRule, ClientResolvableLoadRule, FeatureActiveRule, LoadIfManifestLoaded } from "./models";
|
|
6
5
|
class Utils {
|
|
7
6
|
static { this.ensureValidManifestId = (id, errorMsg) => {
|
|
7
|
+
console.dir(id);
|
|
8
|
+
//TODO: If you end up here looking for tolowerCase bugs of guids the toooling should handle lowercase
|
|
9
|
+
//call 911-Nhan
|
|
8
10
|
if (!id) {
|
|
9
11
|
throw new Error(errorMsg ? errorMsg : "Invalid manifest id, can't be null/empty or undefined");
|
|
10
12
|
}
|
|
11
|
-
if (!
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return id.
|
|
13
|
+
// if (!isValidGuid(guid)) {
|
|
14
|
+
// throw new Error("The manifest id must be a valid guid");
|
|
15
|
+
// }
|
|
16
|
+
return id;
|
|
17
|
+
//return id.toLowerCase();
|
|
16
18
|
}; }
|
|
17
19
|
static { this.ensureValidServiceId = (id, errorMsg) => {
|
|
20
|
+
//TODO: If you end up here looking for tolowerCase bugs of guids the toooling should handle lowercase
|
|
21
|
+
//call 911-Nhan
|
|
18
22
|
if (!id) {
|
|
19
23
|
throw new Error(errorMsg ? errorMsg : "Invalid service id, can't be null/empty or undefined");
|
|
20
24
|
}
|
|
21
|
-
return id
|
|
25
|
+
return id;
|
|
26
|
+
//return id.toLowerCase();
|
|
22
27
|
}; }
|
|
23
28
|
static { this.ensureValidElementName = (name, errorMsg) => {
|
|
24
29
|
if (!name) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BuildOptions, ServiceOptions, RoleBasedSecurityProviderOptions, CombinedSecurityProviderOptions } from './models';
|
|
2
2
|
import { ICombinableSecurityProviderComposer, SecurityProviderCombinableRuleComposer } from './CombinableSecurityProviderComposer';
|
|
3
3
|
import { IServiceManifestComposer, ServiceManifestComposer } from './ServiceManifestComposer';
|
|
4
|
+
import { guid } from '../../fx-models';
|
|
4
5
|
import { IClientServiceConfigurator } from './ConfigurationClientServiceRegistry';
|
|
5
6
|
export interface IWebAppServiceComposer extends IServiceManifestComposer<IWebAppServiceComposer> {
|
|
6
7
|
/**
|
|
@@ -32,7 +33,7 @@ export interface IWebAppServiceComposer extends IServiceManifestComposer<IWebApp
|
|
|
32
33
|
export declare class WebAppServiceComposer extends ServiceManifestComposer<WebAppServiceComposer> implements IWebAppServiceComposer {
|
|
33
34
|
private manifestId;
|
|
34
35
|
private manifestTitle;
|
|
35
|
-
constructor(manifestId:
|
|
36
|
+
constructor(manifestId: guid, manifestTitle: string, serviceOptions: ServiceOptions);
|
|
36
37
|
configuration: <T extends IClientServiceConfigurator<IWebAppServiceComposer>>(configurationType: any) => T;
|
|
37
38
|
withBuildOptions: (options: BuildOptions) => this;
|
|
38
39
|
AddRoleBasedSecurityProvider: (options: RoleBasedSecurityProviderOptions) => this;
|
|
@@ -16,7 +16,7 @@ class WebAppServiceComposer extends ServiceManifestComposer_1.ServiceManifestCom
|
|
|
16
16
|
this.manifestId = manifestId;
|
|
17
17
|
this.manifestTitle = manifestTitle;
|
|
18
18
|
this.configuration = (configurationType) => {
|
|
19
|
-
return ConfigurationClientServiceRegistry_1.ConfigurationClientServiceRegistry.Add(
|
|
19
|
+
return ConfigurationClientServiceRegistry_1.ConfigurationClientServiceRegistry.Add(this.manifestId, configurationType, [this]);
|
|
20
20
|
};
|
|
21
21
|
this.withBuildOptions = (options) => {
|
|
22
22
|
BuildConfigurationRegistry_1.BuildConfigurationRegistry.AddBuildOptions(options);
|
|
@@ -31,8 +31,8 @@ class WebAppServiceComposer extends ServiceManifestComposer_1.ServiceManifestCom
|
|
|
31
31
|
if (!validScope) {
|
|
32
32
|
throw new Error("Can't add role based security provider with scope: " + options.scope + " it's not a valid scope value");
|
|
33
33
|
}
|
|
34
|
-
if (!models_2.
|
|
35
|
-
throw new Error("Can't add role based security provider with id: " + options.providerId + " must be a valid
|
|
34
|
+
if (!(0, models_2.isValidGuid)(options.providerId)) {
|
|
35
|
+
throw new Error("Can't add role based security provider with id: " + options.providerId + " must be a valid guid");
|
|
36
36
|
}
|
|
37
37
|
if (!options.roleName) {
|
|
38
38
|
throw new Error("Can't add role based security provider with out valid role name: " + JSON.stringify(options));
|
|
@@ -50,8 +50,8 @@ class WebAppServiceComposer extends ServiceManifestComposer_1.ServiceManifestCom
|
|
|
50
50
|
if (!options) {
|
|
51
51
|
throw new Error("Can't add combined security provider with missing options");
|
|
52
52
|
}
|
|
53
|
-
if (!models_2.
|
|
54
|
-
throw new Error("Can't add combined security provider with id: " + options.providerId + " must be a valid
|
|
53
|
+
if (!(0, models_2.isValidGuid)(options.providerId)) {
|
|
54
|
+
throw new Error("Can't add combined security provider with id: " + options.providerId + " must be a valid guid");
|
|
55
55
|
}
|
|
56
56
|
let combinedProvider = {
|
|
57
57
|
providerId: options.providerId,
|
|
@@ -64,8 +64,8 @@ class WebAppServiceComposer extends ServiceManifestComposer_1.ServiceManifestCom
|
|
|
64
64
|
SecurityProviderManifestRegistry_1.SecurityProviderManifestRegistry.AddSecurityProvider(combinedProvider);
|
|
65
65
|
return new CombinableSecurityProviderComposer_1.SecurityProviderCombinableRuleComposer(cbNewRule, this);
|
|
66
66
|
};
|
|
67
|
-
if (!models_2.
|
|
68
|
-
throw new Error("Can't register omnia service with id: " + this.manifestId + " must be a valid
|
|
67
|
+
if (!(0, models_2.isValidGuid)(this.manifestId)) {
|
|
68
|
+
throw new Error("Can't register omnia service with id: " + this.manifestId + " must be a valid guid");
|
|
69
69
|
}
|
|
70
70
|
let serviceInfo = {
|
|
71
71
|
description: serviceOptions.description,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ServiceOptions } from './models';
|
|
2
2
|
import { IServiceManifestComposer, ServiceManifestComposer } from './ServiceManifestComposer';
|
|
3
|
+
import { guid } from '@omnia/fx-models';
|
|
3
4
|
export interface IWorkerServiceComposer extends IServiceManifestComposer<IWorkerServiceComposer> {
|
|
4
5
|
/**
|
|
5
6
|
* This service is not deployed as standard, the exact behavior can be decided at deploy time for each optional service.
|
|
@@ -10,6 +11,6 @@ export interface IWorkerServiceComposer extends IServiceManifestComposer<IWorker
|
|
|
10
11
|
export declare class WorkerServiceComposer extends ServiceManifestComposer<IWorkerServiceComposer> implements IWorkerServiceComposer {
|
|
11
12
|
private manifestId;
|
|
12
13
|
private manifestTitle;
|
|
13
|
-
constructor(manifestId:
|
|
14
|
+
constructor(manifestId: guid, manifestTitle: string, serviceOptions: ServiceOptions);
|
|
14
15
|
isOptionalService(): this;
|
|
15
16
|
}
|
|
@@ -11,8 +11,8 @@ class WorkerServiceComposer extends ServiceManifestComposer_1.ServiceManifestCom
|
|
|
11
11
|
super(() => { return this; });
|
|
12
12
|
this.manifestId = manifestId;
|
|
13
13
|
this.manifestTitle = manifestTitle;
|
|
14
|
-
if (!fx_models_1.
|
|
15
|
-
throw new Error("Can't register omnia service with id: " + this.manifestId + " must be a valid
|
|
14
|
+
if (!(0, fx_models_1.isValidGuid)(this.manifestId)) {
|
|
15
|
+
throw new Error("Can't register omnia service with id: " + this.manifestId + " must be a valid guid");
|
|
16
16
|
}
|
|
17
17
|
let serviceInfo = {
|
|
18
18
|
description: serviceOptions.description,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { guid } from '@omnia/fx-models';
|
|
2
2
|
export interface BuildOptions {
|
|
3
3
|
/**
|
|
4
4
|
* enable tree shaking for dead-code elimination.
|
|
@@ -54,7 +54,7 @@ export interface BuildOptions {
|
|
|
54
54
|
/**
|
|
55
55
|
* Create dynamic documentaion with manifest id.
|
|
56
56
|
*/
|
|
57
|
-
docResourceManifestId?:
|
|
57
|
+
docResourceManifestId?: guid;
|
|
58
58
|
/**
|
|
59
59
|
* Create a namespace to element name.
|
|
60
60
|
*/
|
|
@@ -79,7 +79,7 @@ export interface BundleOptions {
|
|
|
79
79
|
/**
|
|
80
80
|
* The chunk name of the commons chunk. If set to manifest id, will append content to that manifest.
|
|
81
81
|
*/
|
|
82
|
-
name:
|
|
82
|
+
name: guid;
|
|
83
83
|
/**
|
|
84
84
|
* The minimum number of chunks which need to contain a module before it's moved into the commons chunk. Default value is 2.
|
|
85
85
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export interface ManifestGroupOptions
|
|
1
|
+
import { guid } from "@omnia/fx-models";
|
|
2
|
+
export interface ManifestGroupOptions {
|
|
3
3
|
/** The manifest id's of the webcomponent's to include in this group */
|
|
4
|
-
webComponentManifestIds?: Array<
|
|
4
|
+
webComponentManifestIds?: Array<guid>;
|
|
5
5
|
/** The manifest id's of the resources to include in this group */
|
|
6
|
-
resourceManifestIds?: Array<
|
|
6
|
+
resourceManifestIds?: Array<guid>;
|
|
7
7
|
}
|
|
@@ -3,7 +3,7 @@ import { SecurityProviderTypes, SecurityRoleScopes, RuleLogicalOperator, Service
|
|
|
3
3
|
import { IIcon } from '../../../fx-models/Icon';
|
|
4
4
|
import { ServiceParam } from '../../../fx-models/ServiceParam';
|
|
5
5
|
import { FeatureUIOption, IFeatureConfiguration } from '../../../fx-models/Feature';
|
|
6
|
-
import {
|
|
6
|
+
import { guid } from "@omnia/fx-models";
|
|
7
7
|
import { OmniaBackendRuntimes, OmniaRoleTypes, PersistentDiskTypes } from "../../../fx-models/Enums";
|
|
8
8
|
import { AzureAdAppPermissionInfo, AzureAdAppResourceAccessWithAlternate } from "../../../fx-models/AzureAdAppPermissions";
|
|
9
9
|
import { AzureAdAppPermissionOption } from "../AzureAdAppPermissionHelper";
|
|
@@ -58,7 +58,7 @@ export interface ServiceFeatureOption {
|
|
|
58
58
|
* PermissionRole
|
|
59
59
|
* Permission Role required for activating/upgrading/deactivating feature
|
|
60
60
|
* */
|
|
61
|
-
permissionRole:
|
|
61
|
+
permissionRole: guid;
|
|
62
62
|
/**
|
|
63
63
|
* UIOptions
|
|
64
64
|
* Optional - used to specify the client-side control which will display the wizard when activating/upgrading/deactivating feature
|
|
@@ -73,7 +73,7 @@ export interface ServiceFeatureOption {
|
|
|
73
73
|
* requiresLicense
|
|
74
74
|
* Optional - Specify license id(s) if the feature requires license to be activated
|
|
75
75
|
* */
|
|
76
|
-
requiresLicense?: Array<
|
|
76
|
+
requiresLicense?: Array<guid>;
|
|
77
77
|
/**
|
|
78
78
|
* requiresBackendEnvironment
|
|
79
79
|
* Optional - Specify Backend runtime evironment to be activated
|
|
@@ -89,16 +89,16 @@ export interface ServiceFeatureOption {
|
|
|
89
89
|
configuration?: IFeatureConfiguration;
|
|
90
90
|
}
|
|
91
91
|
export interface ServiceFeatureManifest extends Omit<ServiceFeatureOption, 'requiresAzureAdAppPermissions'>, ServerManifest {
|
|
92
|
-
uniqueId:
|
|
92
|
+
uniqueId: guid;
|
|
93
93
|
requiresAzureAdAppPermissions?: AzureAdAppPermissionInfo[];
|
|
94
94
|
}
|
|
95
95
|
export interface AppResourceType {
|
|
96
|
-
id:
|
|
96
|
+
id: guid;
|
|
97
97
|
title: string;
|
|
98
98
|
icon: IIcon;
|
|
99
99
|
parameters: Array<ServiceParam>;
|
|
100
100
|
providedParameters: Array<ServiceParam>;
|
|
101
|
-
requiredFeatures?: Array<
|
|
101
|
+
requiredFeatures?: Array<guid>;
|
|
102
102
|
requiredEnvironments?: Array<string>;
|
|
103
103
|
}
|
|
104
104
|
export interface ServiceAppDefinitionOption {
|
|
@@ -118,7 +118,7 @@ export interface ServiceAppDefinitionOption {
|
|
|
118
118
|
* requiresLicense
|
|
119
119
|
* Optional - Specify license id(s) if the app requires license
|
|
120
120
|
* */
|
|
121
|
-
requiresLicense?: Array<
|
|
121
|
+
requiresLicense?: Array<guid>;
|
|
122
122
|
/**
|
|
123
123
|
* Hidden
|
|
124
124
|
* Optional - used to specify whether the app is hidden in the UI and only available to be activated from api
|
|
@@ -130,7 +130,7 @@ export interface ServiceAppDefinitionOption {
|
|
|
130
130
|
resourceTypes: AppResourceType[];
|
|
131
131
|
}
|
|
132
132
|
export interface ServiceAppDefinitionManifest extends ServiceAppDefinitionOption, ServerManifest {
|
|
133
|
-
uniqueId:
|
|
133
|
+
uniqueId: guid;
|
|
134
134
|
}
|
|
135
135
|
export interface ServiceRoleDefinitionOption {
|
|
136
136
|
name: string;
|
|
@@ -138,25 +138,25 @@ export interface ServiceRoleDefinitionOption {
|
|
|
138
138
|
resourceEvaluatorType?: string;
|
|
139
139
|
roleType: OmniaRoleTypes;
|
|
140
140
|
parameters?: ServiceParam[];
|
|
141
|
-
parentRole?:
|
|
141
|
+
parentRole?: guid;
|
|
142
142
|
rules?: SecurityRule[];
|
|
143
|
-
editableRoles?:
|
|
144
|
-
systemDefinedRuleMappingRoles?:
|
|
143
|
+
editableRoles?: guid[];
|
|
144
|
+
systemDefinedRuleMappingRoles?: guid[];
|
|
145
145
|
isBindable?: boolean;
|
|
146
146
|
isExtensionOnly?: boolean;
|
|
147
147
|
}
|
|
148
148
|
export interface ServiceRoleDefinitionManifest extends ServiceRoleDefinitionOption, ServerManifest {
|
|
149
|
-
uniqueId:
|
|
149
|
+
uniqueId: guid;
|
|
150
150
|
}
|
|
151
151
|
export interface SecurityRule {
|
|
152
|
-
roleId:
|
|
152
|
+
roleId: guid;
|
|
153
153
|
logicalOperator: "OR" | "AND";
|
|
154
154
|
}
|
|
155
155
|
export interface RequestedResourceManifest extends ServerManifest {
|
|
156
156
|
resourceType: RequestedResourceTypes;
|
|
157
157
|
}
|
|
158
158
|
export interface ResourceOptionBase {
|
|
159
|
-
uniqueId:
|
|
159
|
+
uniqueId: guid;
|
|
160
160
|
}
|
|
161
161
|
export interface SqlResourceOption extends ResourceOptionBase {
|
|
162
162
|
}
|
|
@@ -164,7 +164,7 @@ export interface PersistentDiskResourceOption extends ResourceOptionBase {
|
|
|
164
164
|
type?: PersistentDiskTypes;
|
|
165
165
|
}
|
|
166
166
|
export interface SqlElasticPoolResourceOption extends ResourceOptionBase {
|
|
167
|
-
elasticPoolId:
|
|
167
|
+
elasticPoolId: guid;
|
|
168
168
|
}
|
|
169
169
|
export interface SqlResourceManifest extends SqlResourceOption, RequestedResourceManifest {
|
|
170
170
|
}
|
|
@@ -183,7 +183,7 @@ export interface SecurityProviderManifest extends ServerManifest {
|
|
|
183
183
|
}
|
|
184
184
|
export interface AzureAdAppPermissionManifest extends ServerManifest {
|
|
185
185
|
name?: string;
|
|
186
|
-
resourceAppId:
|
|
186
|
+
resourceAppId: guid;
|
|
187
187
|
resourceAccess: AzureAdAppResourceAccessWithAlternate[];
|
|
188
188
|
}
|
|
189
189
|
export interface AzureAdAppPermission {
|
|
@@ -214,7 +214,7 @@ export interface ServiceOptions {
|
|
|
214
214
|
description?: string;
|
|
215
215
|
}
|
|
216
216
|
export interface ServiceBase extends ServiceOptions {
|
|
217
|
-
id:
|
|
217
|
+
id: guid;
|
|
218
218
|
title?: string;
|
|
219
219
|
serviceType: ServiceTypes;
|
|
220
220
|
optionalService: boolean;
|
|
@@ -225,7 +225,7 @@ export interface CustomService extends ServiceBase {
|
|
|
225
225
|
export interface ServiceManifest extends ServiceBase, ServerManifest {
|
|
226
226
|
}
|
|
227
227
|
export interface SecurityProviderIdentity {
|
|
228
|
-
providerId:
|
|
228
|
+
providerId: guid;
|
|
229
229
|
}
|
|
230
230
|
export interface SecurityProvider extends SecurityProviderIdentity {
|
|
231
231
|
type: SecurityProviderTypes;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClientManifestTargetTypes,
|
|
1
|
+
import { ClientManifestTargetTypes, guid, LoadableBundleManifest, OmniaManifests } from '@omnia/fx-models';
|
|
2
2
|
declare const BuildStage: {
|
|
3
3
|
BeforeScanManifests: string;
|
|
4
4
|
AfterScanManifests: string;
|
|
@@ -25,9 +25,9 @@ declare function scanManifests(scanFolders?: any): void;
|
|
|
25
25
|
declare function getManifestsPaths(urlsToSearch: any, options: any): any[];
|
|
26
26
|
declare function processManifests(manifestPaths: string[]): void;
|
|
27
27
|
declare function buildLocalizationFiles(): void;
|
|
28
|
-
declare function getServiceId():
|
|
28
|
+
declare function getServiceId(): guid;
|
|
29
29
|
declare function getManifestJsonByTarget(target?: ClientManifestTargetTypes): OmniaManifests;
|
|
30
30
|
declare function getManifestsJson(): OmniaManifests;
|
|
31
31
|
declare function updateManifestData(manifest: OmniaManifests): void;
|
|
32
|
-
declare function getManifestById(id:
|
|
32
|
+
declare function getManifestById(id: guid): LoadableBundleManifest;
|
|
33
33
|
export { getServiceId, getManifestById, getManifestsJson, getManifestJsonByTarget, updateManifestData, scanManifests, getManifestsPaths, processManifests, buildManifestEntries, build, bundleManifestsByWebpackEntries, buildLocalizationFiles, OmniaOutput, BuildStage };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omnia/tooling-composers",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "8.0.
|
|
4
|
+
"version": "8.0.193-dev",
|
|
5
5
|
"description": "Provide tooling to work with manifest things.",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
],
|
|
20
20
|
"author": "Precio Fishbone",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@omnia/fx-models": "8.0.
|
|
23
|
-
"@omnia/tooling": "8.0.
|
|
22
|
+
"@omnia/fx-models": "8.0.193-dev",
|
|
23
|
+
"@omnia/tooling": "8.0.193-dev",
|
|
24
24
|
"deep-extend": "0.6.0",
|
|
25
25
|
"fs-extra": "11.1.0",
|
|
26
26
|
"del": "6.0.0",
|