quidproquo-core 0.0.50 → 0.0.52

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.
@@ -4,9 +4,14 @@ export declare enum QPQCoreConfigSettingType {
4
4
  schedule = "@quidproquo-core/config/schedule",
5
5
  secret = "@quidproquo-core/config/secret",
6
6
  parameter = "@quidproquo-core/config/parameter",
7
- actionProcessors = "@quidproquo-core/config/actionProcessors"
7
+ actionProcessors = "@quidproquo-core/config/actionProcessors",
8
+ buildPath = "@quidproquo-core/config/buildPath"
8
9
  }
9
10
  export interface QPQConfigSetting {
10
11
  configSettingType: string;
12
+ uniqueKey: string;
13
+ }
14
+ export interface QPQConfigAdvancedSettings {
15
+ deprecated?: boolean;
11
16
  }
12
17
  export type QPQConfig = QPQConfigSetting[];
@@ -9,4 +9,5 @@ var QPQCoreConfigSettingType;
9
9
  QPQCoreConfigSettingType["secret"] = "@quidproquo-core/config/secret";
10
10
  QPQCoreConfigSettingType["parameter"] = "@quidproquo-core/config/parameter";
11
11
  QPQCoreConfigSettingType["actionProcessors"] = "@quidproquo-core/config/actionProcessors";
12
+ QPQCoreConfigSettingType["buildPath"] = "@quidproquo-core/config/buildPath";
12
13
  })(QPQCoreConfigSettingType = exports.QPQCoreConfigSettingType || (exports.QPQCoreConfigSettingType = {}));
@@ -2,4 +2,4 @@ import { QPQConfigSetting } from '../QPQConfig';
2
2
  export interface ActionProcessorsQPQConfigSetting extends QPQConfigSetting {
3
3
  src: string;
4
4
  }
5
- export declare const defineActionProcessors: (src: string) => ActionProcessorsQPQConfigSetting;
5
+ export declare const defineActionProcessors: (name: string, src: string) => ActionProcessorsQPQConfigSetting;
@@ -2,8 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defineActionProcessors = void 0;
4
4
  const QPQConfig_1 = require("../QPQConfig");
5
- const defineActionProcessors = (src) => ({
5
+ const defineActionProcessors = (name, src) => ({
6
6
  configSettingType: QPQConfig_1.QPQCoreConfigSettingType.actionProcessors,
7
+ uniqueKey: name,
7
8
  src,
8
9
  });
9
10
  exports.defineActionProcessors = defineActionProcessors;
@@ -0,0 +1,8 @@
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;
@@ -0,0 +1,13 @@
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;
@@ -0,0 +1,5 @@
1
+ import { QPQConfigSetting } from '../QPQConfig';
2
+ export interface BuildPathQPQConfigSetting extends QPQConfigSetting {
3
+ buildPath: string;
4
+ }
5
+ export declare const defineBuildPath: (buildPath: string) => BuildPathQPQConfigSetting;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defineBuildPath = void 0;
4
+ const QPQConfig_1 = require("../QPQConfig");
5
+ const defineBuildPath = (buildPath) => ({
6
+ configSettingType: QPQConfig_1.QPQCoreConfigSettingType.buildPath,
7
+ uniqueKey: buildPath,
8
+ buildPath,
9
+ });
10
+ exports.defineBuildPath = defineBuildPath;
@@ -1,5 +1,6 @@
1
1
  export * from './actionProcessors';
2
- export * from './appName';
2
+ export * from './application';
3
+ export * from './buildPath';
3
4
  export * from './parameter';
4
5
  export * from './schedule';
5
6
  export * from './secret';
@@ -15,7 +15,8 @@ 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("./appName"), exports);
18
+ __exportStar(require("./application"), exports);
19
+ __exportStar(require("./buildPath"), exports);
19
20
  __exportStar(require("./parameter"), exports);
20
21
  __exportStar(require("./schedule"), exports);
21
22
  __exportStar(require("./secret"), exports);
@@ -4,6 +4,7 @@ exports.defineParameter = void 0;
4
4
  const QPQConfig_1 = require("../QPQConfig");
5
5
  const defineParameter = (key, value = '') => ({
6
6
  configSettingType: QPQConfig_1.QPQCoreConfigSettingType.parameter,
7
+ uniqueKey: key,
7
8
  key,
8
9
  value,
9
10
  owned: !!value,
@@ -7,5 +7,6 @@ export interface ScheduleQPQConfigSetting extends QPQConfigSetting {
7
7
  src: string;
8
8
  runtime: string;
9
9
  cronExpression: string;
10
+ buildPath: string;
10
11
  }
11
- export declare const defineRecurringSchedule: (cronExpression: string, src: string, runtime: string) => ScheduleQPQConfigSetting;
12
+ export declare const defineRecurringSchedule: (cronExpression: string, src: string, runtime: string, buildPath: string) => ScheduleQPQConfigSetting;
@@ -6,11 +6,13 @@ var ScheduleTypeEnum;
6
6
  (function (ScheduleTypeEnum) {
7
7
  ScheduleTypeEnum["Recurring"] = "Recurring";
8
8
  })(ScheduleTypeEnum = exports.ScheduleTypeEnum || (exports.ScheduleTypeEnum = {}));
9
- const defineRecurringSchedule = (cronExpression, src, runtime) => ({
9
+ const defineRecurringSchedule = (cronExpression, src, runtime, buildPath) => ({
10
10
  configSettingType: QPQConfig_1.QPQCoreConfigSettingType.schedule,
11
+ uniqueKey: runtime,
11
12
  scheduleType: ScheduleTypeEnum.Recurring,
12
13
  src,
13
14
  runtime,
14
15
  cronExpression,
16
+ buildPath,
15
17
  });
16
18
  exports.defineRecurringSchedule = defineRecurringSchedule;
@@ -4,6 +4,7 @@ exports.defineSecret = void 0;
4
4
  const QPQConfig_1 = require("../QPQConfig");
5
5
  const defineSecret = (key, owned = true, value = '') => ({
6
6
  configSettingType: QPQConfig_1.QPQCoreConfigSettingType.secret,
7
+ uniqueKey: key,
7
8
  key,
8
9
  value,
9
10
  owned,
@@ -4,6 +4,7 @@ exports.defineStorageDrive = void 0;
4
4
  const QPQConfig_1 = require("../QPQConfig");
5
5
  const defineStorageDrive = (storageDrive) => ({
6
6
  configSettingType: QPQConfig_1.QPQCoreConfigSettingType.storageDrive,
7
+ uniqueKey: storageDrive,
7
8
  storageDrive,
8
9
  });
9
10
  exports.defineStorageDrive = defineStorageDrive;
@@ -4,6 +4,8 @@ export declare const getConfigSettings: <T extends QPQConfigSetting>(configs: QP
4
4
  export declare const getConfigSetting: <T extends QPQConfigSetting>(configs: QPQConfig, serviceInfrastructureConfigType: string) => T | undefined;
5
5
  export declare const getAppName: (configs: QPQConfig) => string;
6
6
  export declare const getAppFeature: (configs: QPQConfig) => string;
7
+ export declare const getDeployRegion: (configs: QPQConfig) => string;
8
+ export declare const getConfigRoot: (configs: QPQConfig) => string;
7
9
  export declare const getStorageDriveNames: (configs: QPQConfig) => string[];
8
10
  export declare const getActionProcessorSources: (configs: QPQConfig) => string[];
9
11
  export declare const getScheduleEvents: (configs: QPQConfig) => ScheduleQPQConfigSetting[];
@@ -11,3 +13,6 @@ export declare const getAllSrcEntries: (configs: QPQConfig) => string[];
11
13
  export declare const getOwnedSecrets: (configs: QPQConfig) => SecretQPQConfigSetting[];
12
14
  export declare const getOwnedParameters: (configs: QPQConfig) => ParameterQPQConfigSetting[];
13
15
  export declare const getSharedSecrets: (configs: QPQConfig) => SecretQPQConfigSetting[];
16
+ export declare const getBuildPath: (configs: QPQConfig) => string;
17
+ export declare const getUniqueKeyForSetting: (setting: QPQConfigSetting) => string;
18
+ export declare const getScheduleEntryFullPath: (qpqConfig: QPQConfig, scheduleConfig: ScheduleQPQConfigSetting) => string;
@@ -1,6 +1,30 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSharedSecrets = exports.getOwnedParameters = exports.getOwnedSecrets = exports.getAllSrcEntries = exports.getScheduleEvents = exports.getActionProcessorSources = exports.getStorageDriveNames = 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.getConfigRoot = exports.getDeployRegion = exports.getAppFeature = exports.getAppName = exports.getConfigSetting = exports.getConfigSettings = void 0;
27
+ const path = __importStar(require("path"));
4
28
  const QPQConfig_1 = require("./config/QPQConfig");
5
29
  const getConfigSettings = (configs, configSettingType) => {
6
30
  return configs.filter((c) => c.configSettingType === configSettingType);
@@ -15,7 +39,7 @@ const getAppName = (configs) => {
15
39
  var _a;
16
40
  const appName = (_a = (0, exports.getConfigSetting)(configs, QPQConfig_1.QPQCoreConfigSettingType.appName)) === null || _a === void 0 ? void 0 : _a.appName;
17
41
  if (!appName) {
18
- throw new Error('please use defineAppName in your QPQ config');
42
+ throw new Error('please use defineApplication in your QPQ config');
19
43
  }
20
44
  return appName;
21
45
  };
@@ -26,6 +50,21 @@ const getAppFeature = (configs) => {
26
50
  return featureName;
27
51
  };
28
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;
57
+ };
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;
66
+ };
67
+ exports.getConfigRoot = getConfigRoot;
29
68
  const getStorageDriveNames = (configs) => {
30
69
  const storageDriveNames = (0, exports.getConfigSettings)(configs, QPQConfig_1.QPQCoreConfigSettingType.storageDrive).map((sd) => sd.storageDrive);
31
70
  return storageDriveNames;
@@ -61,3 +100,22 @@ const getSharedSecrets = (configs) => {
61
100
  return secrets.filter((s) => !s.owned);
62
101
  };
63
102
  exports.getSharedSecrets = getSharedSecrets;
103
+ const getBuildPath = (configs) => {
104
+ var _a;
105
+ const buildPath = (_a = (0, exports.getConfigSetting)(configs, QPQConfig_1.QPQCoreConfigSettingType.buildPath)) === null || _a === void 0 ? void 0 : _a.buildPath;
106
+ if (!buildPath) {
107
+ throw new Error('please use defineBuildPath in your QPQ config');
108
+ }
109
+ return buildPath;
110
+ };
111
+ exports.getBuildPath = getBuildPath;
112
+ const getUniqueKeyForSetting = (setting) => {
113
+ const type = setting.configSettingType.split('/').pop();
114
+ const key = setting.uniqueKey;
115
+ return `${type}${key}`;
116
+ };
117
+ exports.getUniqueKeyForSetting = getUniqueKeyForSetting;
118
+ const getScheduleEntryFullPath = (qpqConfig, scheduleConfig) => {
119
+ return path.join((0, exports.getConfigRoot)(qpqConfig), scheduleConfig.buildPath);
120
+ };
121
+ exports.getScheduleEntryFullPath = getScheduleEntryFullPath;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidproquo-core",
3
- "version": "0.0.50",
3
+ "version": "0.0.52",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.js",
@@ -1,6 +0,0 @@
1
- import { QPQConfigSetting } from '../QPQConfig';
2
- export interface AppNameQPQConfigSetting extends QPQConfigSetting {
3
- appName: string;
4
- featureName?: string;
5
- }
6
- export declare const defineAppName: (appName: string, featureName?: string) => AppNameQPQConfigSetting;
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defineAppName = void 0;
4
- const QPQConfig_1 = require("../QPQConfig");
5
- const defineAppName = (appName, featureName) => ({
6
- configSettingType: QPQConfig_1.QPQCoreConfigSettingType.appName,
7
- appName,
8
- featureName,
9
- });
10
- exports.defineAppName = defineAppName;