@omnia/tooling-composers 8.0.111-vnext → 8.0.112-vnext

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.
@@ -0,0 +1,11 @@
1
+ import { ServiceOptions } from './models';
2
+ import { IServiceManifestComposer, ServiceManifestComposer } from './ServiceManifestComposer';
3
+ export interface ICustomServiceComposer extends IServiceManifestComposer<ICustomServiceComposer> {
4
+ runHelm: (cmd: string) => ICustomServiceComposer;
5
+ }
6
+ export declare class CustomServiceComposer extends ServiceManifestComposer<CustomServiceComposer> implements ICustomServiceComposer {
7
+ private manifestId;
8
+ private manifestTitle;
9
+ constructor(manifestId: string, manifestTitle: string, serviceOptions: ServiceOptions);
10
+ runHelm(cmd: string): this;
11
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomServiceComposer = void 0;
4
+ const models_1 = require("./models");
5
+ const Utils_1 = require("./Utils");
6
+ const ServiceManifestRegistry_1 = require("./ServiceManifestRegistry");
7
+ const ServiceManifestComposer_1 = require("./ServiceManifestComposer");
8
+ class CustomServiceComposer extends ServiceManifestComposer_1.ServiceManifestComposer {
9
+ constructor(manifestId, manifestTitle, serviceOptions) {
10
+ // TODO wait hot reload update not execute composer two times
11
+ super(() => { return this; });
12
+ this.manifestId = manifestId;
13
+ this.manifestTitle = manifestTitle;
14
+ if (!Utils_1.Utils.isValidGuid(this.manifestId)) {
15
+ throw new Error("Can't register omnia service with id: " + this.manifestId + " must be a valid Guid");
16
+ }
17
+ let serviceInfo = {
18
+ description: serviceOptions.description,
19
+ id: manifestId,
20
+ serviceType: models_1.ServiceTypes.Custom,
21
+ title: manifestTitle,
22
+ optionalService: false
23
+ };
24
+ ServiceManifestRegistry_1.ServiceManifestRegistry.AddService(serviceInfo);
25
+ }
26
+ runHelm(cmd) {
27
+ ServiceManifestRegistry_1.ServiceManifestRegistry.getServiceInfo().hemlCommand = cmd;
28
+ return this;
29
+ }
30
+ }
31
+ exports.CustomServiceComposer = CustomServiceComposer;
@@ -1,6 +1,7 @@
1
1
  import { ServiceOptions } from './models';
2
2
  import { IWebAppServiceComposer } from './WebAppServiceComposer';
3
3
  import { IWorkerServiceComposer } from './WorkerServiceComposer';
4
+ import { ICustomServiceComposer } from './CustomServiceComposer';
4
5
  export interface IRegisterService {
5
6
  /** Specify service type for this omnia service project.
6
7
  E.g. A service could be a worker, doing simple async jobs, worker queues etc
@@ -17,6 +18,10 @@ export interface IServiceComposer {
17
18
  * Register service to be of type worker
18
19
  */
19
20
  AsWorker: () => IWorkerServiceComposer;
21
+ /**
22
+ * Register service to be of custom type (to install heml)
23
+ */
24
+ AsCustom: () => ICustomServiceComposer;
20
25
  }
21
26
  export declare class ServiceComposer implements IServiceComposer {
22
27
  private manifestId;
@@ -25,4 +30,5 @@ export declare class ServiceComposer implements IServiceComposer {
25
30
  constructor(manifestId: string, manifestName: string, serviceInfo: ServiceOptions);
26
31
  AsWebApp: () => IWebAppServiceComposer;
27
32
  AsWorker: () => IWorkerServiceComposer;
33
+ AsCustom: () => ICustomServiceComposer;
28
34
  }
@@ -2,8 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ServiceComposer = void 0;
4
4
  const Utils_1 = require("./Utils");
5
- const WorkerServiceComposer_1 = require("./WorkerServiceComposer");
6
5
  const WebAppServiceComposer_1 = require("./WebAppServiceComposer");
6
+ const WorkerServiceComposer_1 = require("./WorkerServiceComposer");
7
+ const CustomServiceComposer_1 = require("./CustomServiceComposer");
7
8
  class ServiceComposer {
8
9
  constructor(manifestId, manifestName, serviceInfo) {
9
10
  // TODO wait hot reload update not execute composer two times
@@ -16,6 +17,9 @@ class ServiceComposer {
16
17
  this.AsWorker = () => {
17
18
  return new WorkerServiceComposer_1.WorkerServiceComposer(this.manifestId, this.manifestName, this.serviceInfo);
18
19
  };
20
+ this.AsCustom = () => {
21
+ return new CustomServiceComposer_1.CustomServiceComposer(this.manifestId, this.manifestName, this.serviceInfo);
22
+ };
19
23
  if (!Utils_1.Utils.isValidGuid(this.manifestId)) {
20
24
  throw new Error("Can't register service with id: " + this.manifestId + " must be a valid Guid");
21
25
  }
@@ -8,7 +8,8 @@ class ServiceManifestRegistry {
8
8
  ServiceManifestRegistry.Service = null;
9
9
  ServiceManifestRegistry.AddService = (service) => {
10
10
  if (!(service.serviceType === index_1.ServiceTypes.WebApp ||
11
- service.serviceType === index_1.ServiceTypes.Worker)) {
11
+ service.serviceType === index_1.ServiceTypes.Worker ||
12
+ service.serviceType === index_1.ServiceTypes.Custom)) {
12
13
  throw new Error("Unknown service type: " + JSON.stringify(service));
13
14
  }
14
15
  if (ServiceManifestRegistry.Service) {
@@ -21,3 +21,4 @@ export * from './ServiceManifestRegistry';
21
21
  export * from './ImportManifestRegistry';
22
22
  export * from "./ConfigurationClientServiceRegistry";
23
23
  export { type BuildOptions, ServiceTypes, type ElementOptions as WebComponentOptions } from "./models/index";
24
+ export * from "./CustomServiceComposer";
@@ -26,5 +26,6 @@ tslib_1.__exportStar(require("./ImportManifestRegistry"), exports);
26
26
  tslib_1.__exportStar(require("./ConfigurationClientServiceRegistry"), exports);
27
27
  var index_1 = require("./models/index");
28
28
  Object.defineProperty(exports, "ServiceTypes", { enumerable: true, get: function () { return index_1.ServiceTypes; } });
29
+ tslib_1.__exportStar(require("./CustomServiceComposer"), exports);
29
30
  const models_1 = require("../../fx-models");
30
31
  var ignore = models_1.AuthenticationValidationStatuses;
@@ -5,7 +5,8 @@ export declare enum RequestedResourceTypes {
5
5
  }
6
6
  export declare enum ServiceTypes {
7
7
  WebApp = "WebAppService",
8
- Worker = "WorkerService"
8
+ Worker = "WorkerService",
9
+ Custom = "CustomService"
9
10
  }
10
11
  export declare enum SecurityProviderTypes {
11
12
  RoleBased = "RoleBasedProvider",
@@ -33,7 +34,8 @@ export declare enum ServerManifestTypes {
33
34
  ServiceFeature = "servicefeature",
34
35
  ServiceAppDefinition = "serviceappdefinition",
35
36
  AzureADAppPermission = "azureadapppermission",
36
- ServiceRoleDefinition = "serviceroledefinition"
37
+ ServiceRoleDefinition = "serviceroledefinition",
38
+ HemlProvider = "hemlprovider"
37
39
  }
38
40
  export declare enum BundleTargetTypes {
39
41
  Javascript = "js",
@@ -11,6 +11,7 @@ var ServiceTypes;
11
11
  (function (ServiceTypes) {
12
12
  ServiceTypes["WebApp"] = "WebAppService";
13
13
  ServiceTypes["Worker"] = "WorkerService";
14
+ ServiceTypes["Custom"] = "CustomService";
14
15
  })(ServiceTypes = exports.ServiceTypes || (exports.ServiceTypes = {}));
15
16
  var SecurityProviderTypes;
16
17
  (function (SecurityProviderTypes) {
@@ -44,6 +45,7 @@ var ServerManifestTypes;
44
45
  ServerManifestTypes["ServiceAppDefinition"] = "serviceappdefinition";
45
46
  ServerManifestTypes["AzureADAppPermission"] = "azureadapppermission";
46
47
  ServerManifestTypes["ServiceRoleDefinition"] = "serviceroledefinition";
48
+ ServerManifestTypes["HemlProvider"] = "hemlprovider";
47
49
  })(ServerManifestTypes = exports.ServerManifestTypes || (exports.ServerManifestTypes = {}));
48
50
  var BundleTargetTypes;
49
51
  (function (BundleTargetTypes) {
@@ -4,7 +4,7 @@ import { IIcon } from '../../../fx-models/Icon';
4
4
  import { ServiceParam } from '../../../fx-models/ServiceParam';
5
5
  import { FeatureUIOption, IFeatureConfiguration } from '../../../fx-models/Feature';
6
6
  import { GuidValue } from "@omnia/fx-models";
7
- import { OmniaBackendRuntimes, OmniaRoleTypes } from "../../../fx-models/Enums";
7
+ import { OmniaBackendRuntimes, OmniaRoleTypes, PersistentDiskTypes } from "../../../fx-models/Enums";
8
8
  import { AzureAdAppPermissionInfo, AzureAdAppResourceAccessWithAlternate } from "../../../fx-models/AzureAdAppPermissions";
9
9
  import { AzureAdAppPermissionOption } from "../AzureAdAppPermissionHelper";
10
10
  export interface ServiceFeatureOption {
@@ -98,6 +98,7 @@ export interface AppResourceType {
98
98
  icon: IIcon;
99
99
  parameters: Array<ServiceParam>;
100
100
  providedParameters: Array<ServiceParam>;
101
+ requiredFeatures?: Array<GuidValue>;
101
102
  }
102
103
  export interface ServiceAppDefinitionOption {
103
104
  title: string;
@@ -159,6 +160,7 @@ export interface ResourceOptionBase {
159
160
  export interface SqlResourceOption extends ResourceOptionBase {
160
161
  }
161
162
  export interface PersistentDiskResourceOption extends ResourceOptionBase {
163
+ type?: PersistentDiskTypes;
162
164
  }
163
165
  export interface SqlElasticPoolResourceOption extends ResourceOptionBase {
164
166
  elasticPoolId: GuidValue;
@@ -216,6 +218,9 @@ export interface ServiceBase extends ServiceOptions {
216
218
  serviceType: ServiceTypes;
217
219
  optionalService: boolean;
218
220
  }
221
+ export interface CustomService extends ServiceBase {
222
+ hemlCommand?: string;
223
+ }
219
224
  export interface ServiceManifest extends ServiceBase, ServerManifest {
220
225
  }
221
226
  export interface SecurityProviderIdentity {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/tooling-composers",
3
3
  "license": "MIT",
4
- "version": "8.0.111-vnext",
4
+ "version": "8.0.112-vnext",
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.111-vnext",
23
- "@omnia/tooling": "8.0.111-vnext",
22
+ "@omnia/fx-models": "8.0.112-vnext",
23
+ "@omnia/tooling": "8.0.112-vnext",
24
24
  "deep-extend": "0.6.0",
25
25
  "fs-extra": "11.1.0",
26
26
  "del": "6.0.0",