quidproquo-core 0.0.255 → 0.0.256
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.
- package/lib/commonjs/actions/config/ConfigActionType.d.ts +1 -0
- package/lib/commonjs/actions/config/ConfigActionType.js +1 -0
- package/lib/commonjs/actions/config/ConfigListParametersActionRequester.d.ts +5 -0
- package/lib/commonjs/actions/config/ConfigListParametersActionRequester.js +12 -0
- package/lib/commonjs/actions/config/ConfigListParametersActionTypes.d.ts +7 -0
- package/lib/commonjs/actions/config/ConfigListParametersActionTypes.js +2 -0
- package/lib/commonjs/actions/config/index.d.ts +2 -0
- package/lib/commonjs/actions/config/index.js +2 -0
- package/lib/commonjs/config/settings/definePromiseMode.d.ts +2 -0
- package/lib/commonjs/config/settings/definePromiseMode.js +12 -0
- package/lib/commonjs/config/settings/index.d.ts +1 -0
- package/lib/commonjs/config/settings/index.js +1 -0
- package/lib/commonjs/index.d.ts +1 -0
- package/lib/commonjs/index.js +1 -0
- package/lib/commonjs/proiseify/getSystemExecuteStoryActionProcessor.d.ts +8 -0
- package/lib/commonjs/proiseify/getSystemExecuteStoryActionProcessor.js +79 -0
- package/lib/commonjs/proiseify/index.d.ts +1 -0
- package/lib/commonjs/proiseify/index.js +17 -0
- package/lib/commonjs/qpqCoreUtils.d.ts +1 -0
- package/lib/commonjs/qpqCoreUtils.js +6 -2
- package/lib/esm/actions/config/ConfigActionType.d.ts +1 -0
- package/lib/esm/actions/config/ConfigActionType.js +1 -0
- package/lib/esm/actions/config/ConfigListParametersActionRequester.d.ts +5 -0
- package/lib/esm/actions/config/ConfigListParametersActionRequester.js +8 -0
- package/lib/esm/actions/config/ConfigListParametersActionTypes.d.ts +7 -0
- package/lib/esm/actions/config/ConfigListParametersActionTypes.js +1 -0
- package/lib/esm/actions/config/index.d.ts +2 -0
- package/lib/esm/actions/config/index.js +2 -0
- package/lib/esm/config/settings/definePromiseMode.d.ts +2 -0
- package/lib/esm/config/settings/definePromiseMode.js +8 -0
- package/lib/esm/config/settings/index.d.ts +1 -0
- package/lib/esm/config/settings/index.js +1 -0
- package/lib/esm/index.d.ts +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/proiseify/getSystemExecuteStoryActionProcessor.d.ts +8 -0
- package/lib/esm/proiseify/getSystemExecuteStoryActionProcessor.js +61 -0
- package/lib/esm/proiseify/index.d.ts +1 -0
- package/lib/esm/proiseify/index.js +1 -0
- package/lib/esm/qpqCoreUtils.d.ts +1 -0
- package/lib/esm/qpqCoreUtils.js +3 -0
- package/package.json +2 -2
|
@@ -3,6 +3,7 @@ export declare enum ConfigActionType {
|
|
|
3
3
|
GetParameter = "@quidproquo-core/Config/GetParameter",
|
|
4
4
|
SetParameter = "@quidproquo-core/Config/SetParameter",
|
|
5
5
|
GetParameters = "@quidproquo-core/Config/GetParameters",
|
|
6
|
+
ListParameters = "@quidproquo-core/Config/ListParameters",
|
|
6
7
|
GetApplicationInfo = "@quidproquo-core/Config/GetApplicationInfo",
|
|
7
8
|
GetGlobal = "@quidproquo-core/Config/GetGlobal"
|
|
8
9
|
}
|
|
@@ -7,6 +7,7 @@ var ConfigActionType;
|
|
|
7
7
|
ConfigActionType["GetParameter"] = "@quidproquo-core/Config/GetParameter";
|
|
8
8
|
ConfigActionType["SetParameter"] = "@quidproquo-core/Config/SetParameter";
|
|
9
9
|
ConfigActionType["GetParameters"] = "@quidproquo-core/Config/GetParameters";
|
|
10
|
+
ConfigActionType["ListParameters"] = "@quidproquo-core/Config/ListParameters";
|
|
10
11
|
ConfigActionType["GetApplicationInfo"] = "@quidproquo-core/Config/GetApplicationInfo";
|
|
11
12
|
ConfigActionType["GetGlobal"] = "@quidproquo-core/Config/GetGlobal";
|
|
12
13
|
})(ConfigActionType || (exports.ConfigActionType = ConfigActionType = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConfigListParametersErrorTypeEnum = void 0;
|
|
4
|
+
exports.askConfigListParameters = askConfigListParameters;
|
|
5
|
+
const types_1 = require("../../types");
|
|
6
|
+
const ConfigActionType_1 = require("./ConfigActionType");
|
|
7
|
+
exports.ConfigListParametersErrorTypeEnum = (0, types_1.createErrorEnumForAction)(ConfigActionType_1.ConfigActionType.ListParameters, ['Throttling']);
|
|
8
|
+
function* askConfigListParameters() {
|
|
9
|
+
return yield {
|
|
10
|
+
type: ConfigActionType_1.ConfigActionType.ListParameters,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
|
+
import { ConfigActionType } from './ConfigActionType';
|
|
3
|
+
export interface ConfigListParametersAction extends Action<void> {
|
|
4
|
+
type: ConfigActionType.ListParameters;
|
|
5
|
+
}
|
|
6
|
+
export type ConfigListParametersActionProcessor = ActionProcessor<ConfigListParametersAction, string[]>;
|
|
7
|
+
export type ConfigListParametersActionRequester = ActionRequester<ConfigListParametersAction, string[]>;
|
|
@@ -9,5 +9,7 @@ export * from './ConfigGetParametersActionRequester';
|
|
|
9
9
|
export * from './ConfigGetParametersActionTypes';
|
|
10
10
|
export * from './ConfigGetSecretActionRequester';
|
|
11
11
|
export * from './ConfigGetSecretActionTypes';
|
|
12
|
+
export * from './ConfigListParametersActionRequester';
|
|
13
|
+
export * from './ConfigListParametersActionTypes';
|
|
12
14
|
export * from './ConfigSetParameterActionRequester';
|
|
13
15
|
export * from './ConfigSetParameterActionTypes';
|
|
@@ -25,5 +25,7 @@ __exportStar(require("./ConfigGetParametersActionRequester"), exports);
|
|
|
25
25
|
__exportStar(require("./ConfigGetParametersActionTypes"), exports);
|
|
26
26
|
__exportStar(require("./ConfigGetSecretActionRequester"), exports);
|
|
27
27
|
__exportStar(require("./ConfigGetSecretActionTypes"), exports);
|
|
28
|
+
__exportStar(require("./ConfigListParametersActionRequester"), exports);
|
|
29
|
+
__exportStar(require("./ConfigListParametersActionTypes"), exports);
|
|
28
30
|
__exportStar(require("./ConfigSetParameterActionRequester"), exports);
|
|
29
31
|
__exportStar(require("./ConfigSetParameterActionTypes"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.definePromiseMode = void 0;
|
|
4
|
+
const actionProcessors_1 = require("./actionProcessors");
|
|
5
|
+
const definePromiseMode = () => [
|
|
6
|
+
(0, actionProcessors_1.defineActionProcessors)({
|
|
7
|
+
basePath: __dirname,
|
|
8
|
+
relativePath: '../../proiseify/getSystemExecuteStoryActionProcessor',
|
|
9
|
+
functionName: 'getSystemExecuteStoryActionProcessor',
|
|
10
|
+
}),
|
|
11
|
+
];
|
|
12
|
+
exports.definePromiseMode = definePromiseMode;
|
|
@@ -5,6 +5,7 @@ export * from './applicationName';
|
|
|
5
5
|
export * from './applicationVersion';
|
|
6
6
|
export * from './claudeAi';
|
|
7
7
|
export * from './configValue';
|
|
8
|
+
export * from './definePromiseMode';
|
|
8
9
|
export * from './deployEvent';
|
|
9
10
|
export * from './emailTemplates';
|
|
10
11
|
export * from './environmentSettings';
|
|
@@ -21,6 +21,7 @@ __exportStar(require("./applicationName"), exports);
|
|
|
21
21
|
__exportStar(require("./applicationVersion"), exports);
|
|
22
22
|
__exportStar(require("./claudeAi"), exports);
|
|
23
23
|
__exportStar(require("./configValue"), exports);
|
|
24
|
+
__exportStar(require("./definePromiseMode"), exports);
|
|
24
25
|
__exportStar(require("./deployEvent"), exports);
|
|
25
26
|
__exportStar(require("./emailTemplates"), exports);
|
|
26
27
|
__exportStar(require("./environmentSettings"), exports);
|
package/lib/commonjs/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './config';
|
|
|
3
3
|
export * from './createImplementationRuntime';
|
|
4
4
|
export * from './logic';
|
|
5
5
|
export * from './logic/actionLogic';
|
|
6
|
+
export * from './proiseify';
|
|
6
7
|
export * as qpqCoreUtils from './qpqCoreUtils';
|
|
7
8
|
export * from './qpqExecuteLog';
|
|
8
9
|
export * from './runtime';
|
package/lib/commonjs/index.js
CHANGED
|
@@ -42,6 +42,7 @@ __exportStar(require("./config"), exports);
|
|
|
42
42
|
__exportStar(require("./createImplementationRuntime"), exports);
|
|
43
43
|
__exportStar(require("./logic"), exports);
|
|
44
44
|
__exportStar(require("./logic/actionLogic"), exports);
|
|
45
|
+
__exportStar(require("./proiseify"), exports);
|
|
45
46
|
exports.qpqCoreUtils = __importStar(require("./qpqCoreUtils"));
|
|
46
47
|
__exportStar(require("./qpqExecuteLog"), exports);
|
|
47
48
|
__exportStar(require("./runtime"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionProcessor, ActionProcessorListResolver, AskResponse, AskResponseReturnType, Story } from '../types';
|
|
2
|
+
export declare const getDateNow: () => string;
|
|
3
|
+
type QpqPromisifyRuntime = Parameters<ActionProcessor<any, any>>;
|
|
4
|
+
export type QpqResolveAsPromise = <T extends AskResponse<any>>(storyRuntime: T) => Promise<AskResponseReturnType<T>>;
|
|
5
|
+
export declare function qpqPromisify<S extends Story<any, any>>(story: S, runtimeInfo: QpqPromisifyRuntime): (...params: Parameters<S>) => Promise<AskResponseReturnType<ReturnType<S>>>;
|
|
6
|
+
export declare const getRun: (qpqPromisifyRuntime: QpqPromisifyRuntime) => QpqResolveAsPromise;
|
|
7
|
+
export declare const getSystemExecuteStoryActionProcessor: ActionProcessorListResolver;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getSystemExecuteStoryActionProcessor = exports.getRun = exports.getDateNow = void 0;
|
|
13
|
+
exports.qpqPromisify = qpqPromisify;
|
|
14
|
+
const actions_1 = require("../actions");
|
|
15
|
+
const actionLogic_1 = require("../logic/actionLogic");
|
|
16
|
+
const runtime_1 = require("../runtime");
|
|
17
|
+
const stories_1 = require("../stories");
|
|
18
|
+
const types_1 = require("../types");
|
|
19
|
+
const getDateNow = () => new Date().toISOString();
|
|
20
|
+
exports.getDateNow = getDateNow;
|
|
21
|
+
function qpqPromisify(story, runtimeInfo) {
|
|
22
|
+
return (...params) => __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
try {
|
|
24
|
+
const reader = story(...params);
|
|
25
|
+
let storyProgress = reader.next();
|
|
26
|
+
while (!storyProgress.done) {
|
|
27
|
+
const action = storyProgress.value;
|
|
28
|
+
const [payload, session, actionProcessors, logger, updateSession, dynamicModuleLoader] = runtimeInfo;
|
|
29
|
+
const actionResult = yield (0, runtime_1.processAction)(action, actionProcessors, session, logger, updateSession, dynamicModuleLoader);
|
|
30
|
+
const isSuccess = !(0, actionLogic_1.isErroredActionResult)(actionResult);
|
|
31
|
+
if (action.returnErrors) {
|
|
32
|
+
const result = isSuccess
|
|
33
|
+
? { success: true, result: (0, actionLogic_1.resolveActionResult)(actionResult) }
|
|
34
|
+
: { success: false, error: (0, actionLogic_1.resolveActionResultError)(actionResult) };
|
|
35
|
+
storyProgress = reader.next(result);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
if (!isSuccess) {
|
|
39
|
+
throw new Error((0, actionLogic_1.resolveActionResultError)(actionResult).errorText);
|
|
40
|
+
}
|
|
41
|
+
const result = (0, actionLogic_1.resolveActionResult)(actionResult);
|
|
42
|
+
storyProgress = reader.next(result);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return storyProgress.value;
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
throw new Error(`Error in qpqPromisify: ${error}`);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
const getRun = (qpqPromisifyRuntime) => (storyRuntime) => __awaiter(void 0, void 0, void 0, function* () {
|
|
53
|
+
const runAny = qpqPromisify(stories_1.askRunParallel, qpqPromisifyRuntime);
|
|
54
|
+
const [result] = yield runAny([storyRuntime]);
|
|
55
|
+
return result;
|
|
56
|
+
});
|
|
57
|
+
exports.getRun = getRun;
|
|
58
|
+
const getProcessExecuteStory = (qpqConfig) => {
|
|
59
|
+
return (payload, session, actionProcessors, logger, updateSession, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
|
|
60
|
+
let story = yield dynamicModuleLoader(payload.runtime);
|
|
61
|
+
if (!story) {
|
|
62
|
+
return (0, actionLogic_1.actionResultError)(types_1.ErrorTypeEnum.NotFound, `Unable to dynamically load: [${payload.runtime}]`);
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
const qpqPromisifyRuntime = [payload, session, actionProcessors, logger, updateSession, dynamicModuleLoader];
|
|
66
|
+
const result = yield story(...payload.params, (0, exports.getRun)(qpqPromisifyRuntime));
|
|
67
|
+
return (0, actionLogic_1.actionResult)(result);
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
return (0, actionLogic_1.actionResultError)(types_1.ErrorTypeEnum.GenericError, `${error}`);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
const getSystemExecuteStoryActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
75
|
+
return ({
|
|
76
|
+
[actions_1.SystemActionType.ExecuteStory]: getProcessExecuteStory(qpqConfig),
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
exports.getSystemExecuteStoryActionProcessor = getSystemExecuteStoryActionProcessor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getSystemExecuteStoryActionProcessor';
|
|
@@ -0,0 +1,17 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./getSystemExecuteStoryActionProcessor"), exports);
|
|
@@ -44,6 +44,7 @@ export declare const getApplicationModuleEnvironment: (qpqConfig: QPQConfig) =>
|
|
|
44
44
|
export declare const getStorageDrives: (configs: QPQConfig) => StorageDriveQPQConfigSetting[];
|
|
45
45
|
export declare const getStorageDriveByName: (storageDriveName: string, configs: QPQConfig) => StorageDriveQPQConfigSetting | undefined;
|
|
46
46
|
export declare const getQueues: (configs: QPQConfig) => QueueQPQConfigSetting[];
|
|
47
|
+
export declare const getOwnedQueues: (configs: QPQConfig) => QueueQPQConfigSetting[];
|
|
47
48
|
export declare const getNotifyErrorConfigs: (configs: QPQConfig) => NotifyErrorQPQConfigSetting[];
|
|
48
49
|
export declare const getQueueByName: (configs: QPQConfig, name: string) => QueueQPQConfigSetting | undefined;
|
|
49
50
|
export declare const getStorageDriveNames: (configs: QPQConfig) => string[];
|
|
@@ -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.
|
|
15
|
-
exports.getFullUrlFromConfigUrl = exports.isSameResource = exports.getKeyValueStoreFullyQualifiedResourceName = exports.getFullyQualifiedResourceName = exports.convertCustomFullyQualifiedResourceToGeneric = exports.convertCrossModuleOwnerToGenericResourceNameOverride = exports.getQueueQueueProcessors = exports.getUniqueKeyForSetting = void 0;
|
|
14
|
+
exports.getParameterConfig = exports.getAllParameterConfigs = exports.getUserDirectoryByName = exports.getOwnedUserDirectories = exports.getUserDirectories = exports.getGlobalConfigValue = exports.getOwnedSecrets = exports.getAllSecretConfigs = exports.getSecretByName = exports.getSrcFilenameFromQpqFunctionRuntime = exports.getStoryNameFromQpqFunctionRuntime = exports.getApiBuildPath = exports.getAllSrcEntries = exports.getUserDirectorySrcEntries = exports.getQueueSrcEntries = exports.getOwnedScheduleEvents = exports.getScheduleEvents = exports.getUserDirectoryEmailTemplates = exports.getActionProcessorSources = exports.getKeyValueStoreByName = exports.resolveCrossServiceResourceName = exports.getOwnedStorageDrives = exports.getOwnedGraphDatabases = exports.getOwnedKeyValueStores = exports.getVirualNetworkConfigs = exports.getDeployEventConfigs = exports.getAllGraphDatabaseConfigs = exports.getAllKeyValueStores = exports.getOwnedItems = exports.getEventBusConfigByName = exports.getOwnedEventBusConfigs = exports.getAllClaudeAiConfigs = exports.getAllEventBusConfigs = exports.getStorageDriveNames = exports.getQueueByName = exports.getNotifyErrorConfigs = exports.getOwnedQueues = exports.getQueues = exports.getStorageDriveByName = exports.getStorageDrives = exports.getApplicationModuleEnvironment = exports.getConfigRoot = exports.getApplicationModuleFeature = exports.getApplicationName = exports.getApplicationConfigRoot = exports.getApplicationModuleName = exports.getApplicationConfigSetting = exports.getConfigSetting = exports.getConfigSettings = exports.flattenQpqConfig = void 0;
|
|
15
|
+
exports.getFullUrlFromConfigUrl = exports.isSameResource = exports.getKeyValueStoreFullyQualifiedResourceName = exports.getFullyQualifiedResourceName = exports.convertCustomFullyQualifiedResourceToGeneric = exports.convertCrossModuleOwnerToGenericResourceNameOverride = exports.getQueueQueueProcessors = exports.getUniqueKeyForSetting = exports.getOwnedParameterConfigs = void 0;
|
|
16
16
|
const config_1 = require("./config");
|
|
17
17
|
const utils_1 = require("./utils");
|
|
18
18
|
/**
|
|
@@ -141,6 +141,10 @@ const getQueues = (configs) => {
|
|
|
141
141
|
return (0, exports.getConfigSettings)(configs, config_1.QPQCoreConfigSettingType.queue);
|
|
142
142
|
};
|
|
143
143
|
exports.getQueues = getQueues;
|
|
144
|
+
const getOwnedQueues = (configs) => {
|
|
145
|
+
return (0, exports.getOwnedItems)((0, exports.getQueues)(configs), configs);
|
|
146
|
+
};
|
|
147
|
+
exports.getOwnedQueues = getOwnedQueues;
|
|
144
148
|
const getNotifyErrorConfigs = (configs) => {
|
|
145
149
|
return (0, exports.getConfigSettings)(configs, config_1.QPQCoreConfigSettingType.notifyError);
|
|
146
150
|
};
|
|
@@ -3,6 +3,7 @@ export declare enum ConfigActionType {
|
|
|
3
3
|
GetParameter = "@quidproquo-core/Config/GetParameter",
|
|
4
4
|
SetParameter = "@quidproquo-core/Config/SetParameter",
|
|
5
5
|
GetParameters = "@quidproquo-core/Config/GetParameters",
|
|
6
|
+
ListParameters = "@quidproquo-core/Config/ListParameters",
|
|
6
7
|
GetApplicationInfo = "@quidproquo-core/Config/GetApplicationInfo",
|
|
7
8
|
GetGlobal = "@quidproquo-core/Config/GetGlobal"
|
|
8
9
|
}
|
|
@@ -4,6 +4,7 @@ export var ConfigActionType;
|
|
|
4
4
|
ConfigActionType["GetParameter"] = "@quidproquo-core/Config/GetParameter";
|
|
5
5
|
ConfigActionType["SetParameter"] = "@quidproquo-core/Config/SetParameter";
|
|
6
6
|
ConfigActionType["GetParameters"] = "@quidproquo-core/Config/GetParameters";
|
|
7
|
+
ConfigActionType["ListParameters"] = "@quidproquo-core/Config/ListParameters";
|
|
7
8
|
ConfigActionType["GetApplicationInfo"] = "@quidproquo-core/Config/GetApplicationInfo";
|
|
8
9
|
ConfigActionType["GetGlobal"] = "@quidproquo-core/Config/GetGlobal";
|
|
9
10
|
})(ConfigActionType || (ConfigActionType = {}));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createErrorEnumForAction } from '../../types';
|
|
2
|
+
import { ConfigActionType } from './ConfigActionType';
|
|
3
|
+
export const ConfigListParametersErrorTypeEnum = createErrorEnumForAction(ConfigActionType.ListParameters, ['Throttling']);
|
|
4
|
+
export function* askConfigListParameters() {
|
|
5
|
+
return yield {
|
|
6
|
+
type: ConfigActionType.ListParameters,
|
|
7
|
+
};
|
|
8
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
|
+
import { ConfigActionType } from './ConfigActionType';
|
|
3
|
+
export interface ConfigListParametersAction extends Action<void> {
|
|
4
|
+
type: ConfigActionType.ListParameters;
|
|
5
|
+
}
|
|
6
|
+
export type ConfigListParametersActionProcessor = ActionProcessor<ConfigListParametersAction, string[]>;
|
|
7
|
+
export type ConfigListParametersActionRequester = ActionRequester<ConfigListParametersAction, string[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -9,5 +9,7 @@ export * from './ConfigGetParametersActionRequester';
|
|
|
9
9
|
export * from './ConfigGetParametersActionTypes';
|
|
10
10
|
export * from './ConfigGetSecretActionRequester';
|
|
11
11
|
export * from './ConfigGetSecretActionTypes';
|
|
12
|
+
export * from './ConfigListParametersActionRequester';
|
|
13
|
+
export * from './ConfigListParametersActionTypes';
|
|
12
14
|
export * from './ConfigSetParameterActionRequester';
|
|
13
15
|
export * from './ConfigSetParameterActionTypes';
|
|
@@ -9,5 +9,7 @@ export * from './ConfigGetParametersActionRequester';
|
|
|
9
9
|
export * from './ConfigGetParametersActionTypes';
|
|
10
10
|
export * from './ConfigGetSecretActionRequester';
|
|
11
11
|
export * from './ConfigGetSecretActionTypes';
|
|
12
|
+
export * from './ConfigListParametersActionRequester';
|
|
13
|
+
export * from './ConfigListParametersActionTypes';
|
|
12
14
|
export * from './ConfigSetParameterActionRequester';
|
|
13
15
|
export * from './ConfigSetParameterActionTypes';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { defineActionProcessors } from './actionProcessors';
|
|
2
|
+
export const definePromiseMode = () => [
|
|
3
|
+
defineActionProcessors({
|
|
4
|
+
basePath: __dirname,
|
|
5
|
+
relativePath: '../../proiseify/getSystemExecuteStoryActionProcessor',
|
|
6
|
+
functionName: 'getSystemExecuteStoryActionProcessor',
|
|
7
|
+
}),
|
|
8
|
+
];
|
|
@@ -5,6 +5,7 @@ export * from './applicationName';
|
|
|
5
5
|
export * from './applicationVersion';
|
|
6
6
|
export * from './claudeAi';
|
|
7
7
|
export * from './configValue';
|
|
8
|
+
export * from './definePromiseMode';
|
|
8
9
|
export * from './deployEvent';
|
|
9
10
|
export * from './emailTemplates';
|
|
10
11
|
export * from './environmentSettings';
|
|
@@ -5,6 +5,7 @@ export * from './applicationName';
|
|
|
5
5
|
export * from './applicationVersion';
|
|
6
6
|
export * from './claudeAi';
|
|
7
7
|
export * from './configValue';
|
|
8
|
+
export * from './definePromiseMode';
|
|
8
9
|
export * from './deployEvent';
|
|
9
10
|
export * from './emailTemplates';
|
|
10
11
|
export * from './environmentSettings';
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './config';
|
|
|
3
3
|
export * from './createImplementationRuntime';
|
|
4
4
|
export * from './logic';
|
|
5
5
|
export * from './logic/actionLogic';
|
|
6
|
+
export * from './proiseify';
|
|
6
7
|
export * as qpqCoreUtils from './qpqCoreUtils';
|
|
7
8
|
export * from './qpqExecuteLog';
|
|
8
9
|
export * from './runtime';
|
package/lib/esm/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export * from './config';
|
|
|
3
3
|
export * from './createImplementationRuntime';
|
|
4
4
|
export * from './logic';
|
|
5
5
|
export * from './logic/actionLogic';
|
|
6
|
+
export * from './proiseify';
|
|
6
7
|
export * as qpqCoreUtils from './qpqCoreUtils';
|
|
7
8
|
export * from './qpqExecuteLog';
|
|
8
9
|
export * from './runtime';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ActionProcessor, ActionProcessorListResolver, AskResponse, AskResponseReturnType, Story } from '../types';
|
|
2
|
+
export declare const getDateNow: () => string;
|
|
3
|
+
type QpqPromisifyRuntime = Parameters<ActionProcessor<any, any>>;
|
|
4
|
+
export type QpqResolveAsPromise = <T extends AskResponse<any>>(storyRuntime: T) => Promise<AskResponseReturnType<T>>;
|
|
5
|
+
export declare function qpqPromisify<S extends Story<any, any>>(story: S, runtimeInfo: QpqPromisifyRuntime): (...params: Parameters<S>) => Promise<AskResponseReturnType<ReturnType<S>>>;
|
|
6
|
+
export declare const getRun: (qpqPromisifyRuntime: QpqPromisifyRuntime) => QpqResolveAsPromise;
|
|
7
|
+
export declare const getSystemExecuteStoryActionProcessor: ActionProcessorListResolver;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { SystemActionType } from '../actions';
|
|
2
|
+
import { actionResult, actionResultError, isErroredActionResult, resolveActionResult, resolveActionResultError } from '../logic/actionLogic';
|
|
3
|
+
import { processAction } from '../runtime';
|
|
4
|
+
import { askRunParallel } from '../stories';
|
|
5
|
+
import { ErrorTypeEnum, } from '../types';
|
|
6
|
+
export const getDateNow = () => new Date().toISOString();
|
|
7
|
+
export function qpqPromisify(story, runtimeInfo) {
|
|
8
|
+
return async (...params) => {
|
|
9
|
+
try {
|
|
10
|
+
const reader = story(...params);
|
|
11
|
+
let storyProgress = reader.next();
|
|
12
|
+
while (!storyProgress.done) {
|
|
13
|
+
const action = storyProgress.value;
|
|
14
|
+
const [payload, session, actionProcessors, logger, updateSession, dynamicModuleLoader] = runtimeInfo;
|
|
15
|
+
const actionResult = await processAction(action, actionProcessors, session, logger, updateSession, dynamicModuleLoader);
|
|
16
|
+
const isSuccess = !isErroredActionResult(actionResult);
|
|
17
|
+
if (action.returnErrors) {
|
|
18
|
+
const result = isSuccess
|
|
19
|
+
? { success: true, result: resolveActionResult(actionResult) }
|
|
20
|
+
: { success: false, error: resolveActionResultError(actionResult) };
|
|
21
|
+
storyProgress = reader.next(result);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
if (!isSuccess) {
|
|
25
|
+
throw new Error(resolveActionResultError(actionResult).errorText);
|
|
26
|
+
}
|
|
27
|
+
const result = resolveActionResult(actionResult);
|
|
28
|
+
storyProgress = reader.next(result);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return storyProgress.value;
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
throw new Error(`Error in qpqPromisify: ${error}`);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export const getRun = (qpqPromisifyRuntime) => async (storyRuntime) => {
|
|
39
|
+
const runAny = qpqPromisify(askRunParallel, qpqPromisifyRuntime);
|
|
40
|
+
const [result] = await runAny([storyRuntime]);
|
|
41
|
+
return result;
|
|
42
|
+
};
|
|
43
|
+
const getProcessExecuteStory = (qpqConfig) => {
|
|
44
|
+
return async (payload, session, actionProcessors, logger, updateSession, dynamicModuleLoader) => {
|
|
45
|
+
let story = await dynamicModuleLoader(payload.runtime);
|
|
46
|
+
if (!story) {
|
|
47
|
+
return actionResultError(ErrorTypeEnum.NotFound, `Unable to dynamically load: [${payload.runtime}]`);
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
const qpqPromisifyRuntime = [payload, session, actionProcessors, logger, updateSession, dynamicModuleLoader];
|
|
51
|
+
const result = await story(...payload.params, getRun(qpqPromisifyRuntime));
|
|
52
|
+
return actionResult(result);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
return actionResultError(ErrorTypeEnum.GenericError, `${error}`);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export const getSystemExecuteStoryActionProcessor = async (qpqConfig) => ({
|
|
60
|
+
[SystemActionType.ExecuteStory]: getProcessExecuteStory(qpqConfig),
|
|
61
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getSystemExecuteStoryActionProcessor';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getSystemExecuteStoryActionProcessor';
|
|
@@ -44,6 +44,7 @@ export declare const getApplicationModuleEnvironment: (qpqConfig: QPQConfig) =>
|
|
|
44
44
|
export declare const getStorageDrives: (configs: QPQConfig) => StorageDriveQPQConfigSetting[];
|
|
45
45
|
export declare const getStorageDriveByName: (storageDriveName: string, configs: QPQConfig) => StorageDriveQPQConfigSetting | undefined;
|
|
46
46
|
export declare const getQueues: (configs: QPQConfig) => QueueQPQConfigSetting[];
|
|
47
|
+
export declare const getOwnedQueues: (configs: QPQConfig) => QueueQPQConfigSetting[];
|
|
47
48
|
export declare const getNotifyErrorConfigs: (configs: QPQConfig) => NotifyErrorQPQConfigSetting[];
|
|
48
49
|
export declare const getQueueByName: (configs: QPQConfig, name: string) => QueueQPQConfigSetting | undefined;
|
|
49
50
|
export declare const getStorageDriveNames: (configs: QPQConfig) => string[];
|
package/lib/esm/qpqCoreUtils.js
CHANGED
|
@@ -113,6 +113,9 @@ export const getStorageDriveByName = (storageDriveName, configs) => {
|
|
|
113
113
|
export const getQueues = (configs) => {
|
|
114
114
|
return getConfigSettings(configs, QPQCoreConfigSettingType.queue);
|
|
115
115
|
};
|
|
116
|
+
export const getOwnedQueues = (configs) => {
|
|
117
|
+
return getOwnedItems(getQueues(configs), configs);
|
|
118
|
+
};
|
|
116
119
|
export const getNotifyErrorConfigs = (configs) => {
|
|
117
120
|
return getConfigSettings(configs, QPQCoreConfigSettingType.notifyError);
|
|
118
121
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quidproquo-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.256",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://github.com/joe-coady/quidproquo#readme",
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"quidproquo-tsconfig": "0.0.
|
|
35
|
+
"quidproquo-tsconfig": "0.0.256",
|
|
36
36
|
"typescript": "^5.8.2"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|