quidproquo-core 0.0.205 → 0.0.207

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.
@@ -46,6 +46,7 @@ export declare const getApplicationModuleDeployRegion: (qpqConfig: QPQConfig) =>
46
46
  export declare const getStorageDrives: (configs: QPQConfig) => StorageDriveQPQConfigSetting[];
47
47
  export declare const getStorageDriveByName: (storageDriveName: string, configs: QPQConfig) => StorageDriveQPQConfigSetting | undefined;
48
48
  export declare const getQueues: (configs: QPQConfig) => QueueQPQConfigSetting[];
49
+ export declare const getQueueByName: (configs: QPQConfig, name: string) => QueueQPQConfigSetting | undefined;
49
50
  export declare const getStorageDriveNames: (configs: QPQConfig) => string[];
50
51
  export declare const getAllEventBusConfigs: (qpqConfig: QPQConfig) => EventBusQPQConfigSetting[];
51
52
  export declare const getAllClaudeAiConfigs: (qpqConfig: QPQConfig) => ClaudeAIQPQConfigSetting[];
@@ -11,8 +11,8 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  return t;
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.convertCrossModuleOwnerToGenericResourceNameOverride = exports.getQueueQueueProcessors = exports.getUserDirectoryEntryFullPath = exports.getQueueEntryFullPath = exports.getStorageDriveUploadFullPath = exports.getDeployEventFullPath = exports.getStorageDriveEntryFullPath = exports.getScheduleEntryFullPath = exports.getUniqueKeyForSetting = exports.getOwnedParameterConfigs = exports.getParameterConfig = exports.getAllParameterConfigs = exports.getUserDirectoryByName = exports.getOwnedUserDirectories = exports.getUserDirectories = exports.getGlobalConfigValue = exports.getOwnedSecrets = exports.getAllSecretConfigs = exports.getSecretByName = exports.getAllSrcEntries = exports.getUserDirectorySrcEntries = exports.getQueueSrcEntries = exports.getScheduleEvents = exports.getUserDirectoryEmailTemplates = exports.getActionProcessorSources = exports.getKeyValueStoreByName = exports.resolveCrossServiceResourceName = exports.getOwnedStorageDrives = exports.getOwnedKeyValueStores = exports.getDeployEventConfigs = exports.getAllKeyValueStores = exports.getOwnedItems = exports.getEventBusConfigByName = exports.getOwnedEventBusConfigs = exports.getAllClaudeAiConfigs = exports.getAllEventBusConfigs = exports.getStorageDriveNames = exports.getQueues = exports.getStorageDriveByName = exports.getStorageDrives = exports.getApplicationModuleDeployRegion = exports.getApplicationModuleEnvironment = exports.getConfigRoot = exports.getApplicationModuleFeature = exports.getApplicationName = exports.getApplicationModuleName = exports.getApplicationConfigSetting = exports.getConfigSetting = exports.getConfigSettings = exports.flattenQpqConfig = void 0;
15
- exports.isSameResource = exports.getKeyValueStoreFullyQualifiedResourceName = exports.getFullyQualifiedResourceName = exports.convertCustomFullyQualifiedResourceToGeneric = void 0;
14
+ exports.getQueueQueueProcessors = exports.getUserDirectoryEntryFullPath = exports.getQueueEntryFullPath = exports.getStorageDriveUploadFullPath = exports.getDeployEventFullPath = exports.getStorageDriveEntryFullPath = exports.getScheduleEntryFullPath = exports.getUniqueKeyForSetting = exports.getOwnedParameterConfigs = exports.getParameterConfig = exports.getAllParameterConfigs = exports.getUserDirectoryByName = exports.getOwnedUserDirectories = exports.getUserDirectories = exports.getGlobalConfigValue = exports.getOwnedSecrets = exports.getAllSecretConfigs = exports.getSecretByName = exports.getAllSrcEntries = exports.getUserDirectorySrcEntries = exports.getQueueSrcEntries = exports.getScheduleEvents = exports.getUserDirectoryEmailTemplates = exports.getActionProcessorSources = exports.getKeyValueStoreByName = exports.resolveCrossServiceResourceName = exports.getOwnedStorageDrives = exports.getOwnedKeyValueStores = exports.getDeployEventConfigs = exports.getAllKeyValueStores = exports.getOwnedItems = exports.getEventBusConfigByName = exports.getOwnedEventBusConfigs = exports.getAllClaudeAiConfigs = exports.getAllEventBusConfigs = exports.getStorageDriveNames = exports.getQueueByName = exports.getQueues = exports.getStorageDriveByName = exports.getStorageDrives = exports.getApplicationModuleDeployRegion = exports.getApplicationModuleEnvironment = exports.getConfigRoot = exports.getApplicationModuleFeature = exports.getApplicationName = exports.getApplicationModuleName = exports.getApplicationConfigSetting = exports.getConfigSetting = exports.getConfigSettings = exports.flattenQpqConfig = void 0;
15
+ exports.isSameResource = exports.getKeyValueStoreFullyQualifiedResourceName = exports.getFullyQualifiedResourceName = exports.convertCustomFullyQualifiedResourceToGeneric = exports.convertCrossModuleOwnerToGenericResourceNameOverride = void 0;
16
16
  const utils_1 = require("./utils");
17
17
  const QPQConfig_1 = require("./config/QPQConfig");
18
18
  /**
@@ -137,6 +137,10 @@ const getQueues = (configs) => {
137
137
  return (0, exports.getConfigSettings)(configs, QPQConfig_1.QPQCoreConfigSettingType.queue);
138
138
  };
139
139
  exports.getQueues = getQueues;
140
+ const getQueueByName = (configs, name) => {
141
+ return (0, exports.getQueues)(configs).find((q) => q.name === name);
142
+ };
143
+ exports.getQueueByName = getQueueByName;
140
144
  const getStorageDriveNames = (configs) => {
141
145
  const storageDriveNames = (0, exports.getConfigSettings)(configs, QPQConfig_1.QPQCoreConfigSettingType.storageDrive).map((sd) => sd.storageDrive);
142
146
  return storageDriveNames;
@@ -170,9 +174,7 @@ const getOwnedItems = (settings, qpqConfig) => {
170
174
  return settings.filter((s) => !s.owner ||
171
175
  ((!s.owner.module || s.owner.module === appModuleName) &&
172
176
  (!s.owner.application || s.owner.application === appName) &&
173
- (s.owner.feature === undefined ||
174
- (!s.owner.feature && !appFeature) ||
175
- s.owner.feature === appFeature) &&
177
+ (s.owner.feature === undefined || (!s.owner.feature && !appFeature) || s.owner.feature === appFeature) &&
176
178
  (!s.owner.environment || s.owner.environment === appEnvironment)));
177
179
  };
178
180
  exports.getOwnedItems = getOwnedItems;
@@ -232,10 +234,7 @@ const getUserDirectorySrcEntries = (qpqConfig) => {
232
234
  // We just want the ones this service owns.
233
235
  const userConfigs = (0, exports.getOwnedUserDirectories)(qpqConfig);
234
236
  return userConfigs
235
- .reduce((acc, ud) => [
236
- ...acc,
237
- ...Object.values(ud.emailTemplates).map((et) => et === null || et === void 0 ? void 0 : et.src),
238
- ], [])
237
+ .reduce((acc, ud) => [...acc, ...Object.values(ud.emailTemplates).map((et) => et === null || et === void 0 ? void 0 : et.src)], [])
239
238
  .filter((src) => !!src);
240
239
  };
241
240
  exports.getUserDirectorySrcEntries = getUserDirectorySrcEntries;
@@ -1,2 +1,2 @@
1
- import { StoryResult } from './types';
2
- export declare const qpqExecuteLog: (storyResult: StoryResult<any>, runtime: any) => Promise<StoryResult<any>>;
1
+ import { ActionProcessorList, StoryResult } from './types';
2
+ export declare const qpqExecuteLog: (storyResult: StoryResult<any>, runtime: any, overrides?: ActionProcessorList) => Promise<StoryResult<any>>;
@@ -12,11 +12,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.qpqExecuteLog = void 0;
13
13
  const qpqRuntime_1 = require("./qpqRuntime");
14
14
  const config_1 = require("./config");
15
- const qpqExecuteLog = (storyResult, runtime) => __awaiter(void 0, void 0, void 0, function* () {
15
+ const qpqExecuteLog = (storyResult, runtime, overrides = {}) => __awaiter(void 0, void 0, void 0, function* () {
16
16
  // Create a proxy that just resolves all actions to reading from the history
17
17
  var logIndex = 0;
18
18
  const storyActionProcessor = new Proxy({}, {
19
19
  get: (target, property) => {
20
+ if (overrides[property]) {
21
+ return overrides[property];
22
+ }
23
+ // TODO: We wan't a debug version of batch...
24
+ // but i think we need to move the node imps to core
20
25
  return () => __awaiter(void 0, void 0, void 0, function* () {
21
26
  const res = storyResult.history[logIndex].res;
22
27
  logIndex = logIndex + 1;
@@ -46,6 +46,7 @@ export declare const getApplicationModuleDeployRegion: (qpqConfig: QPQConfig) =>
46
46
  export declare const getStorageDrives: (configs: QPQConfig) => StorageDriveQPQConfigSetting[];
47
47
  export declare const getStorageDriveByName: (storageDriveName: string, configs: QPQConfig) => StorageDriveQPQConfigSetting | undefined;
48
48
  export declare const getQueues: (configs: QPQConfig) => QueueQPQConfigSetting[];
49
+ export declare const getQueueByName: (configs: QPQConfig, name: string) => QueueQPQConfigSetting | undefined;
49
50
  export declare const getStorageDriveNames: (configs: QPQConfig) => string[];
50
51
  export declare const getAllEventBusConfigs: (qpqConfig: QPQConfig) => EventBusQPQConfigSetting[];
51
52
  export declare const getAllClaudeAiConfigs: (qpqConfig: QPQConfig) => ClaudeAIQPQConfigSetting[];
@@ -1,5 +1,5 @@
1
1
  import { joinPaths } from './utils';
2
- import { QPQCoreConfigSettingType, } from './config/QPQConfig';
2
+ import { QPQCoreConfigSettingType } from './config/QPQConfig';
3
3
  /**
4
4
  * Flattens a QPQConfig array into a single array of QPQConfigSetting objects.
5
5
  * If a QPQConfigItem has a configSettingType of QPQCoreConfigSettingType.environmentSettings,
@@ -109,6 +109,9 @@ export const getStorageDriveByName = (storageDriveName, configs) => {
109
109
  export const getQueues = (configs) => {
110
110
  return getConfigSettings(configs, QPQCoreConfigSettingType.queue);
111
111
  };
112
+ export const getQueueByName = (configs, name) => {
113
+ return getQueues(configs).find((q) => q.name === name);
114
+ };
112
115
  export const getStorageDriveNames = (configs) => {
113
116
  const storageDriveNames = getConfigSettings(configs, QPQCoreConfigSettingType.storageDrive).map((sd) => sd.storageDrive);
114
117
  return storageDriveNames;
@@ -137,9 +140,7 @@ export const getOwnedItems = (settings, qpqConfig) => {
137
140
  return settings.filter((s) => !s.owner ||
138
141
  ((!s.owner.module || s.owner.module === appModuleName) &&
139
142
  (!s.owner.application || s.owner.application === appName) &&
140
- (s.owner.feature === undefined ||
141
- (!s.owner.feature && !appFeature) ||
142
- s.owner.feature === appFeature) &&
143
+ (s.owner.feature === undefined || (!s.owner.feature && !appFeature) || s.owner.feature === appFeature) &&
143
144
  (!s.owner.environment || s.owner.environment === appEnvironment)));
144
145
  };
145
146
  export const getAllKeyValueStores = (qpqConfig) => {
@@ -191,10 +192,7 @@ export const getUserDirectorySrcEntries = (qpqConfig) => {
191
192
  // We just want the ones this service owns.
192
193
  const userConfigs = getOwnedUserDirectories(qpqConfig);
193
194
  return userConfigs
194
- .reduce((acc, ud) => [
195
- ...acc,
196
- ...Object.values(ud.emailTemplates).map((et) => et?.src),
197
- ], [])
195
+ .reduce((acc, ud) => [...acc, ...Object.values(ud.emailTemplates).map((et) => et?.src)], [])
198
196
  .filter((src) => !!src);
199
197
  };
200
198
  // Used in bundlers to know where and what to build and index
@@ -1,2 +1,2 @@
1
- import { StoryResult } from './types';
2
- export declare const qpqExecuteLog: (storyResult: StoryResult<any>, runtime: any) => Promise<StoryResult<any>>;
1
+ import { ActionProcessorList, StoryResult } from './types';
2
+ export declare const qpqExecuteLog: (storyResult: StoryResult<any>, runtime: any, overrides?: ActionProcessorList) => Promise<StoryResult<any>>;
@@ -1,10 +1,15 @@
1
1
  import { createRuntime } from './qpqRuntime';
2
2
  import { defineApplicationModule } from './config';
3
- export const qpqExecuteLog = async (storyResult, runtime) => {
3
+ export const qpqExecuteLog = async (storyResult, runtime, overrides = {}) => {
4
4
  // Create a proxy that just resolves all actions to reading from the history
5
5
  var logIndex = 0;
6
6
  const storyActionProcessor = new Proxy({}, {
7
7
  get: (target, property) => {
8
+ if (overrides[property]) {
9
+ return overrides[property];
10
+ }
11
+ // TODO: We wan't a debug version of batch...
12
+ // but i think we need to move the node imps to core
8
13
  return async () => {
9
14
  const res = storyResult.history[logIndex].res;
10
15
  logIndex = logIndex + 1;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "quidproquo-core",
3
- "version": "0.0.205",
3
+ "version": "0.0.207",
4
4
  "description": "",
5
5
  "main": "./lib/commonjs/index.js",
6
6
  "module": "./lib/esm/index.js",
7
- "types": "./lib/esm/index.d.ts",
7
+ "types": "./lib/commonjs/index.d.ts",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "lib/**/*"
@@ -13,7 +13,7 @@
13
13
  "test": "echo \"Error: no test specified\" && exit 1",
14
14
  "clean": "npx rimraf lib && npx rimraf node_modules",
15
15
  "build": "npm run clean && npm run build:esm && npm run build:cjs",
16
- "watch": "tsc -p tsconfig.esm.json -w",
16
+ "watch": "tsc -p tsconfig.commonjs.json -w",
17
17
  "build:cjs": "tsc -p tsconfig.commonjs.json",
18
18
  "build:esm": "tsc -p tsconfig.esm.json"
19
19
  },
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "homepage": "https://github.com/joe-coady/quidproquo#readme",
31
31
  "devDependencies": {
32
- "quidproquo-tsconfig": "0.0.205",
32
+ "quidproquo-tsconfig": "0.0.207",
33
33
  "typescript": "^4.9.3"
34
34
  },
35
35
  "dependencies": {