quidproquo-core 0.0.57 → 0.0.59

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.
@@ -1,5 +1,6 @@
1
1
  export declare enum ConfigActionType {
2
2
  GetSecret = "@quidproquo-core/Config/GetSecret",
3
3
  GetParameter = "@quidproquo-core/Config/GetParameter",
4
- GetParameters = "@quidproquo-core/Config/GetParameters"
4
+ GetParameters = "@quidproquo-core/Config/GetParameters",
5
+ GetApplicationInfo = "@quidproquo-core/Config/GetApplicationInfo"
5
6
  }
@@ -6,4 +6,5 @@ var ConfigActionType;
6
6
  ConfigActionType["GetSecret"] = "@quidproquo-core/Config/GetSecret";
7
7
  ConfigActionType["GetParameter"] = "@quidproquo-core/Config/GetParameter";
8
8
  ConfigActionType["GetParameters"] = "@quidproquo-core/Config/GetParameters";
9
+ ConfigActionType["GetApplicationInfo"] = "@quidproquo-core/Config/GetApplicationInfo";
9
10
  })(ConfigActionType = exports.ConfigActionType || (exports.ConfigActionType = {}));
@@ -0,0 +1,2 @@
1
+ import { ConfigGetApplicationInfoActionRequester } from './ConfigGetApplicationInfoActionTypes';
2
+ export declare function askConfigGetApplicationInfo(): ConfigGetApplicationInfoActionRequester;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.askConfigGetApplicationInfo = void 0;
4
+ const ConfigActionType_1 = require("./ConfigActionType");
5
+ function* askConfigGetApplicationInfo() {
6
+ return yield { type: ConfigActionType_1.ConfigActionType.GetApplicationInfo };
7
+ }
8
+ exports.askConfigGetApplicationInfo = askConfigGetApplicationInfo;
@@ -0,0 +1,15 @@
1
+ import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
2
+ import { ConfigActionType } from './ConfigActionType';
3
+ export interface ApplicationConfigInfo {
4
+ name: string;
5
+ environment: string;
6
+ module: string;
7
+ feature?: string;
8
+ }
9
+ export interface ConfigGetApplicationInfoActionPayload {
10
+ }
11
+ export interface ConfigGetApplicationInfoAction extends Action<ConfigGetApplicationInfoActionPayload> {
12
+ type: ConfigActionType.GetApplicationInfo;
13
+ }
14
+ export type ConfigGetApplicationInfoActionProcessor = ActionProcessor<ConfigGetApplicationInfoAction, ApplicationConfigInfo>;
15
+ export type ConfigGetApplicationInfoActionRequester = ActionRequester<ConfigGetApplicationInfoAction, ApplicationConfigInfo>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +1,6 @@
1
1
  export * from './ConfigActionType';
2
+ export * from './ConfigGetApplicationInfoActionRequester';
3
+ export * from './ConfigGetApplicationInfoActionTypes';
2
4
  export * from './ConfigGetParameterActionRequester';
3
5
  export * from './ConfigGetParameterActionTypes';
4
6
  export * from './ConfigGetParametersActionRequester';
@@ -15,6 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ConfigActionType"), exports);
18
+ __exportStar(require("./ConfigGetApplicationInfoActionRequester"), exports);
19
+ __exportStar(require("./ConfigGetApplicationInfoActionTypes"), exports);
18
20
  __exportStar(require("./ConfigGetParameterActionRequester"), exports);
19
21
  __exportStar(require("./ConfigGetParameterActionTypes"), exports);
20
22
  __exportStar(require("./ConfigGetParametersActionRequester"), exports);
package/lib/qpqRuntime.js CHANGED
@@ -18,9 +18,17 @@ function processAction(action, actionProcessors, session) {
18
18
  return __awaiter(this, void 0, void 0, function* () {
19
19
  // Special action ~ batch - needs access to the processAction / actionProcessor context
20
20
  if (action.type === SystemActionType_1.SystemActionType.Batch) {
21
- return (0, actionLogic_1.actionResult)(yield Promise.all(action.payload.actions.map((a) => {
21
+ const batchRes = yield Promise.all(action.payload.actions.map((a) => {
22
22
  return a ? processAction(a, actionProcessors, session) : null;
23
- })));
23
+ }));
24
+ // If there was an error, throw that error back
25
+ const erroredBatchItem = batchRes.find((br) => (0, actionLogic_1.isErroredActionResult)(br));
26
+ if (erroredBatchItem) {
27
+ const error = (0, actionLogic_1.resolveActionResultError)(erroredBatchItem);
28
+ return (0, actionLogic_1.actionResultError)(ErrorTypeEnum_1.ErrorTypeEnum.GenericError, error.errorText, error.errorStack);
29
+ }
30
+ // unwrap the values
31
+ return (0, actionLogic_1.actionResult)(batchRes.map((br) => (0, actionLogic_1.resolveActionResult)(br)));
24
32
  }
25
33
  const processor = actionProcessors === null || actionProcessors === void 0 ? void 0 : actionProcessors[action === null || action === void 0 ? void 0 : action.type];
26
34
  if (!processor) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidproquo-core",
3
- "version": "0.0.57",
3
+ "version": "0.0.59",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.js",