quidproquo-core 0.0.53 → 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,12 +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 getApplicationEnvironment: (configs: QPQConfig) => string;
7
- export declare const getApplicationFeature: (configs: QPQConfig) => string | undefined;
8
- export declare const getDeployRegion: (configs: QPQConfig) => string;
9
- 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;
10
12
  export declare const getStorageDriveNames: (configs: QPQConfig) => string[];
11
13
  export declare const getActionProcessorSources: (configs: QPQConfig) => string[];
12
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.getApplicationFeature = exports.getApplicationEnvironment = 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,42 +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 getApplicationEnvironment = (configs) => {
48
- var _a;
49
- const environment = ((_a = (0, exports.getConfigSetting)(configs, QPQConfig_1.QPQCoreConfigSettingType.appName)) === null || _a === void 0 ? void 0 : _a.environment) || 'production';
50
- return environment;
45
+ exports.getApplicationModuleSetting = getApplicationModuleSetting;
46
+ const getApplicationName = (qpqConfig) => {
47
+ return (0, exports.getApplicationModuleSetting)(qpqConfig).applicationName;
51
48
  };
52
- exports.getApplicationEnvironment = getApplicationEnvironment;
53
- const getApplicationFeature = (configs) => {
54
- var _a;
55
- const feature = (_a = (0, exports.getConfigSetting)(configs, QPQConfig_1.QPQCoreConfigSettingType.appName)) === null || _a === void 0 ? void 0 : _a.feature;
56
- return feature;
49
+ exports.getApplicationName = getApplicationName;
50
+ const getApplicationModuleName = (qpqConfig) => {
51
+ return (0, exports.getApplicationModuleSetting)(qpqConfig).moduleName;
57
52
  };
58
- exports.getApplicationFeature = getApplicationFeature;
59
- const getDeployRegion = (configs) => {
60
- var _a;
61
- const deployRegion = ((_a = (0, exports.getConfigSetting)(configs, QPQConfig_1.QPQCoreConfigSettingType.appName)) === null || _a === void 0 ? void 0 : _a.deployRegion) || 'us-east-1';
62
- return deployRegion;
53
+ exports.getApplicationModuleName = getApplicationModuleName;
54
+ const getApplicationModuleFeature = (qpqConfig) => {
55
+ return (0, exports.getApplicationModuleSetting)(qpqConfig).feature;
63
56
  };
64
- exports.getDeployRegion = getDeployRegion;
65
- const getConfigRoot = (configs) => {
66
- var _a;
67
- const configRoot = (_a = (0, exports.getConfigSetting)(configs, QPQConfig_1.QPQCoreConfigSettingType.appName)) === null || _a === void 0 ? void 0 : _a.configRoot;
68
- if (!configRoot) {
69
- throw new Error('please use defineApplication in your QPQ config');
70
- }
71
- return configRoot;
57
+ exports.getApplicationModuleFeature = getApplicationModuleFeature;
58
+ const getConfigRoot = (qpqConfig) => {
59
+ return (0, exports.getApplicationModuleSetting)(qpqConfig).configRoot;
72
60
  };
73
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;
74
70
  const getStorageDriveNames = (configs) => {
75
71
  const storageDriveNames = (0, exports.getConfigSettings)(configs, QPQConfig_1.QPQCoreConfigSettingType.storageDrive).map((sd) => sd.storageDrive);
76
72
  return storageDriveNames;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidproquo-core",
3
- "version": "0.0.53",
3
+ "version": "0.0.54",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.js",
@@ -1,9 +0,0 @@
1
- import { QPQConfigSetting } from '../QPQConfig';
2
- export interface AppNameQPQConfigSetting extends QPQConfigSetting {
3
- appName: string;
4
- configRoot: string;
5
- environment?: string;
6
- deployRegion?: string;
7
- feature?: string;
8
- }
9
- export declare const defineApplication: (appName: string, environment: string, configRoot: string, deployRegion?: string, feature?: string) => AppNameQPQConfigSetting;
@@ -1,14 +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, environment, configRoot, deployRegion, feature) => ({
6
- configSettingType: QPQConfig_1.QPQCoreConfigSettingType.appName,
7
- uniqueKey: appName,
8
- appName,
9
- configRoot,
10
- environment,
11
- deployRegion,
12
- feature,
13
- });
14
- exports.defineApplication = defineApplication;