quidproquo-core 0.0.52 → 0.0.54

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,10 @@
1
+ import { QPQConfigSetting } from '../QPQConfig';
2
+ export interface ApplicationModuleQPQConfigSetting extends QPQConfigSetting {
3
+ applicationName: string;
4
+ moduleName: string;
5
+ configRoot: string;
6
+ environment?: string;
7
+ deployRegion?: string;
8
+ feature?: string;
9
+ }
10
+ export declare const defineApplicationModule: (applicationName: string, moduleName: string, environment: string, configRoot: string, deployRegion?: string, feature?: string) => ApplicationModuleQPQConfigSetting;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defineApplicationModule = void 0;
4
+ const QPQConfig_1 = require("../QPQConfig");
5
+ const defineApplicationModule = (applicationName, moduleName, environment, configRoot, deployRegion, feature) => ({
6
+ configSettingType: QPQConfig_1.QPQCoreConfigSettingType.appName,
7
+ uniqueKey: `${applicationName}-${moduleName}`,
8
+ applicationName,
9
+ moduleName,
10
+ configRoot,
11
+ environment,
12
+ deployRegion,
13
+ feature,
14
+ });
15
+ exports.defineApplicationModule = defineApplicationModule;
@@ -1,5 +1,5 @@
1
1
  export * from './actionProcessors';
2
- export * from './application';
2
+ export * from './applicationModule';
3
3
  export * from './buildPath';
4
4
  export * from './parameter';
5
5
  export * from './schedule';
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./actionProcessors"), exports);
18
- __exportStar(require("./application"), exports);
18
+ __exportStar(require("./applicationModule"), exports);
19
19
  __exportStar(require("./buildPath"), exports);
20
20
  __exportStar(require("./parameter"), exports);
21
21
  __exportStar(require("./schedule"), exports);
@@ -1,11 +1,14 @@
1
1
  import { QPQConfig, QPQConfigSetting } from './config/QPQConfig';
2
- import { ScheduleQPQConfigSetting, SecretQPQConfigSetting, ParameterQPQConfigSetting } from './config/settings';
2
+ import { ApplicationModuleQPQConfigSetting, ScheduleQPQConfigSetting, SecretQPQConfigSetting, ParameterQPQConfigSetting } from './config/settings';
3
3
  export declare const getConfigSettings: <T extends QPQConfigSetting>(configs: QPQConfig, configSettingType: string) => T[];
4
4
  export declare const getConfigSetting: <T extends QPQConfigSetting>(configs: QPQConfig, serviceInfrastructureConfigType: string) => T | undefined;
5
- export declare const getAppName: (configs: QPQConfig) => string;
6
- export declare const getAppFeature: (configs: QPQConfig) => string;
7
- export declare const getDeployRegion: (configs: QPQConfig) => string;
8
- export declare const getConfigRoot: (configs: QPQConfig) => string;
5
+ export declare const getApplicationModuleSetting: (qpqConfig: QPQConfig) => ApplicationModuleQPQConfigSetting;
6
+ export declare const getApplicationName: (qpqConfig: QPQConfig) => string;
7
+ export declare const getApplicationModuleName: (qpqConfig: QPQConfig) => string;
8
+ export declare const getApplicationModuleFeature: (qpqConfig: QPQConfig) => string | undefined;
9
+ export declare const getConfigRoot: (qpqConfig: QPQConfig) => string;
10
+ export declare const getApplicationModuleEnvironment: (qpqConfig: QPQConfig) => string;
11
+ export declare const getApplicationModuleDeployRegion: (qpqConfig: QPQConfig) => string;
9
12
  export declare const getStorageDriveNames: (configs: QPQConfig) => string[];
10
13
  export declare const getActionProcessorSources: (configs: QPQConfig) => string[];
11
14
  export declare const getScheduleEvents: (configs: QPQConfig) => ScheduleQPQConfigSetting[];
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.getScheduleEntryFullPath = exports.getUniqueKeyForSetting = exports.getBuildPath = exports.getSharedSecrets = exports.getOwnedParameters = exports.getOwnedSecrets = exports.getAllSrcEntries = exports.getScheduleEvents = exports.getActionProcessorSources = exports.getStorageDriveNames = exports.getConfigRoot = exports.getDeployRegion = exports.getAppFeature = exports.getAppName = exports.getConfigSetting = exports.getConfigSettings = void 0;
26
+ exports.getScheduleEntryFullPath = exports.getUniqueKeyForSetting = exports.getBuildPath = exports.getSharedSecrets = exports.getOwnedParameters = exports.getOwnedSecrets = exports.getAllSrcEntries = exports.getScheduleEvents = exports.getActionProcessorSources = exports.getStorageDriveNames = exports.getApplicationModuleDeployRegion = exports.getApplicationModuleEnvironment = exports.getConfigRoot = exports.getApplicationModuleFeature = exports.getApplicationModuleName = exports.getApplicationName = exports.getApplicationModuleSetting = exports.getConfigSetting = exports.getConfigSettings = void 0;
27
27
  const path = __importStar(require("path"));
28
28
  const QPQConfig_1 = require("./config/QPQConfig");
29
29
  const getConfigSettings = (configs, configSettingType) => {
@@ -35,36 +35,38 @@ const getConfigSetting = (configs, serviceInfrastructureConfigType) => {
35
35
  return setting;
36
36
  };
37
37
  exports.getConfigSetting = getConfigSetting;
38
- const getAppName = (configs) => {
39
- var _a;
40
- const appName = (_a = (0, exports.getConfigSetting)(configs, QPQConfig_1.QPQCoreConfigSettingType.appName)) === null || _a === void 0 ? void 0 : _a.appName;
41
- if (!appName) {
42
- throw new Error('please use defineApplication in your QPQ config');
38
+ const getApplicationModuleSetting = (qpqConfig) => {
39
+ const applicationModuleSetting = (0, exports.getConfigSetting)(qpqConfig, QPQConfig_1.QPQCoreConfigSettingType.appName);
40
+ if (!applicationModuleSetting) {
41
+ throw new Error('please use defineApplicationModule in your QPQ config');
43
42
  }
44
- return appName;
43
+ return applicationModuleSetting;
45
44
  };
46
- exports.getAppName = getAppName;
47
- const getAppFeature = (configs) => {
48
- var _a;
49
- const featureName = ((_a = (0, exports.getConfigSetting)(configs, QPQConfig_1.QPQCoreConfigSettingType.appName)) === null || _a === void 0 ? void 0 : _a.featureName) || 'production';
50
- return featureName;
45
+ exports.getApplicationModuleSetting = getApplicationModuleSetting;
46
+ const getApplicationName = (qpqConfig) => {
47
+ return (0, exports.getApplicationModuleSetting)(qpqConfig).applicationName;
51
48
  };
52
- exports.getAppFeature = getAppFeature;
53
- const getDeployRegion = (configs) => {
54
- var _a;
55
- const deployRegion = ((_a = (0, exports.getConfigSetting)(configs, QPQConfig_1.QPQCoreConfigSettingType.appName)) === null || _a === void 0 ? void 0 : _a.deployRegion) || 'us-east-1';
56
- return deployRegion;
49
+ exports.getApplicationName = getApplicationName;
50
+ const getApplicationModuleName = (qpqConfig) => {
51
+ return (0, exports.getApplicationModuleSetting)(qpqConfig).moduleName;
57
52
  };
58
- exports.getDeployRegion = getDeployRegion;
59
- const getConfigRoot = (configs) => {
60
- var _a;
61
- const configRoot = (_a = (0, exports.getConfigSetting)(configs, QPQConfig_1.QPQCoreConfigSettingType.appName)) === null || _a === void 0 ? void 0 : _a.configRoot;
62
- if (!configRoot) {
63
- throw new Error('please use defineApplication in your QPQ config');
64
- }
65
- return configRoot;
53
+ exports.getApplicationModuleName = getApplicationModuleName;
54
+ const getApplicationModuleFeature = (qpqConfig) => {
55
+ return (0, exports.getApplicationModuleSetting)(qpqConfig).feature;
56
+ };
57
+ exports.getApplicationModuleFeature = getApplicationModuleFeature;
58
+ const getConfigRoot = (qpqConfig) => {
59
+ return (0, exports.getApplicationModuleSetting)(qpqConfig).configRoot;
66
60
  };
67
61
  exports.getConfigRoot = getConfigRoot;
62
+ const getApplicationModuleEnvironment = (qpqConfig) => {
63
+ return (0, exports.getApplicationModuleSetting)(qpqConfig).environment || 'production';
64
+ };
65
+ exports.getApplicationModuleEnvironment = getApplicationModuleEnvironment;
66
+ const getApplicationModuleDeployRegion = (qpqConfig) => {
67
+ return (0, exports.getApplicationModuleSetting)(qpqConfig).deployRegion || 'us-east-1';
68
+ };
69
+ exports.getApplicationModuleDeployRegion = getApplicationModuleDeployRegion;
68
70
  const getStorageDriveNames = (configs) => {
69
71
  const storageDriveNames = (0, exports.getConfigSettings)(configs, QPQConfig_1.QPQCoreConfigSettingType.storageDrive).map((sd) => sd.storageDrive);
70
72
  return storageDriveNames;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidproquo-core",
3
- "version": "0.0.52",
3
+ "version": "0.0.54",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.js",
@@ -1,8 +0,0 @@
1
- import { QPQConfigSetting } from '../QPQConfig';
2
- export interface AppNameQPQConfigSetting extends QPQConfigSetting {
3
- appName: string;
4
- configRoot: string;
5
- featureName?: string;
6
- deployRegion?: string;
7
- }
8
- export declare const defineApplication: (appName: string, configRoot: string, featureName?: string, deployRegion?: string) => AppNameQPQConfigSetting;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defineApplication = void 0;
4
- const QPQConfig_1 = require("../QPQConfig");
5
- const defineApplication = (appName, configRoot, featureName, deployRegion) => ({
6
- configSettingType: QPQConfig_1.QPQCoreConfigSettingType.appName,
7
- uniqueKey: appName,
8
- appName,
9
- configRoot,
10
- featureName,
11
- deployRegion,
12
- });
13
- exports.defineApplication = defineApplication;