quidproquo-actionprocessor-web 0.0.251 → 0.0.252
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/actionProcessor/core/{log/getLogTemplateLiteralActionProcessor.d.ts → config/getConfigGetParameterActionProcessor.d.ts} +1 -1
- package/lib/commonjs/actionProcessor/core/config/getConfigGetParameterActionProcessor.js +30 -0
- package/lib/commonjs/actionProcessor/core/{claudeAi/getClaudeAiMessagesApiActionProcessor.d.ts → config/getConfigGetParametersActionProcessor.d.ts} +1 -1
- package/lib/commonjs/actionProcessor/core/config/getConfigGetParametersActionProcessor.js +37 -0
- package/lib/{esm/actionProcessor/core/log/getLogTemplateLiteralActionProcessor.d.ts → commonjs/actionProcessor/core/config/getConfigSetParameterActionProcessor.d.ts} +1 -1
- package/lib/commonjs/actionProcessor/core/{log/getLogTemplateLiteralActionProcessor.js → config/getConfigSetParameterActionProcessor.js} +13 -9
- package/lib/commonjs/actionProcessor/core/config/index.js +4 -2
- package/lib/commonjs/actionProcessor/core/index.d.ts +0 -12
- package/lib/commonjs/actionProcessor/core/index.js +1 -38
- package/lib/commonjs/{insdex.d.ts → index.d.ts} +1 -0
- package/lib/commonjs/{insdex.js → index.js} +1 -0
- package/lib/esm/actionProcessor/core/config/getConfigGetParameterActionProcessor.d.ts +2 -0
- package/lib/esm/actionProcessor/core/config/getConfigGetParameterActionProcessor.js +15 -0
- package/lib/esm/actionProcessor/core/{claudeAi/getClaudeAiMessagesApiActionProcessor.d.ts → config/getConfigGetParametersActionProcessor.d.ts} +1 -1
- package/lib/esm/actionProcessor/core/config/getConfigGetParametersActionProcessor.js +22 -0
- package/lib/esm/actionProcessor/core/config/getConfigSetParameterActionProcessor.d.ts +2 -0
- package/lib/esm/actionProcessor/core/config/getConfigSetParameterActionProcessor.js +15 -0
- package/lib/esm/actionProcessor/core/config/index.js +6 -2
- package/lib/esm/actionProcessor/core/index.d.ts +0 -12
- package/lib/esm/actionProcessor/core/index.js +0 -33
- package/lib/esm/{insdex.d.ts → index.d.ts} +1 -0
- package/lib/esm/{insdex.js → index.js} +1 -0
- package/package.json +6 -6
- package/lib/commonjs/actionProcessor/core/claudeAi/getClaudeAiMessagesApiActionProcessor.js +0 -64
- package/lib/commonjs/actionProcessor/core/claudeAi/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/claudeAi/index.js +0 -17
- package/lib/commonjs/actionProcessor/core/config/getConfigGetApplicationInfoActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/config/getConfigGetApplicationInfoActionProcessor.js +0 -30
- package/lib/commonjs/actionProcessor/core/context/getContextListActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/context/getContextListActionProcessor.js +0 -24
- package/lib/commonjs/actionProcessor/core/context/getContextReadActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/context/getContextReadActionProcessor.js +0 -27
- package/lib/commonjs/actionProcessor/core/context/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/context/index.js +0 -18
- package/lib/commonjs/actionProcessor/core/customActions/getCustomActionActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/customActions/getCustomActionActionProcessor.js +0 -58
- package/lib/commonjs/actionProcessor/core/customActions/index.d.ts +0 -1
- package/lib/commonjs/actionProcessor/core/customActions/index.js +0 -18
- package/lib/commonjs/actionProcessor/core/date/getDateNowActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/date/getDateNowActionProcessor.js +0 -24
- package/lib/commonjs/actionProcessor/core/date/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/date/index.js +0 -17
- package/lib/commonjs/actionProcessor/core/error/getErrorThrowErrorActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/error/getErrorThrowErrorActionProcessor.js +0 -24
- package/lib/commonjs/actionProcessor/core/error/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/error/index.js +0 -17
- package/lib/commonjs/actionProcessor/core/guid/getGuidNewActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/guid/getGuidNewActionProcessor.js +0 -25
- package/lib/commonjs/actionProcessor/core/guid/getGuidNewSortableActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/guid/getGuidNewSortableActionProcessor.js +0 -25
- package/lib/commonjs/actionProcessor/core/guid/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/guid/index.js +0 -18
- package/lib/commonjs/actionProcessor/core/log/getLogCreateActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/log/getLogCreateActionProcessor.js +0 -30
- package/lib/commonjs/actionProcessor/core/log/getLogDisableEventHistoryActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/log/getLogDisableEventHistoryActionProcessor.js +0 -25
- package/lib/commonjs/actionProcessor/core/log/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/log/index.js +0 -19
- package/lib/commonjs/actionProcessor/core/math/getMathRandomNumberActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/math/getMathRandomNumberActionProcessor.js +0 -24
- package/lib/commonjs/actionProcessor/core/math/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/math/index.js +0 -17
- package/lib/commonjs/actionProcessor/core/network/getNetworkRequestActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/network/getNetworkRequestActionProcessor.js +0 -150
- package/lib/commonjs/actionProcessor/core/network/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/network/index.js +0 -17
- package/lib/commonjs/actionProcessor/core/platform/getPlatformDelayActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/platform/getPlatformDelayActionProcessor.js +0 -24
- package/lib/commonjs/actionProcessor/core/platform/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/platform/index.js +0 -17
- package/lib/commonjs/actionProcessor/core/system/getSystemBatchActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/system/getSystemBatchActionProcessor.js +0 -51
- package/lib/commonjs/actionProcessor/core/system/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/system/index.js +0 -17
- package/lib/esm/actionProcessor/core/claudeAi/getClaudeAiMessagesApiActionProcessor.js +0 -26
- package/lib/esm/actionProcessor/core/claudeAi/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/claudeAi/index.js +0 -4
- package/lib/esm/actionProcessor/core/config/getConfigGetApplicationInfoActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/config/getConfigGetApplicationInfoActionProcessor.js +0 -15
- package/lib/esm/actionProcessor/core/context/getContextListActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/context/getContextListActionProcessor.js +0 -9
- package/lib/esm/actionProcessor/core/context/getContextReadActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/context/getContextReadActionProcessor.js +0 -12
- package/lib/esm/actionProcessor/core/context/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/context/index.js +0 -6
- package/lib/esm/actionProcessor/core/customActions/getCustomActionActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/customActions/getCustomActionActionProcessor.js +0 -43
- package/lib/esm/actionProcessor/core/customActions/index.d.ts +0 -1
- package/lib/esm/actionProcessor/core/customActions/index.js +0 -2
- package/lib/esm/actionProcessor/core/date/getDateNowActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/date/getDateNowActionProcessor.js +0 -9
- package/lib/esm/actionProcessor/core/date/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/date/index.js +0 -4
- package/lib/esm/actionProcessor/core/error/getErrorThrowErrorActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/error/getErrorThrowErrorActionProcessor.js +0 -9
- package/lib/esm/actionProcessor/core/error/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/error/index.js +0 -4
- package/lib/esm/actionProcessor/core/guid/getGuidNewActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/guid/getGuidNewActionProcessor.js +0 -10
- package/lib/esm/actionProcessor/core/guid/getGuidNewSortableActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/guid/getGuidNewSortableActionProcessor.js +0 -10
- package/lib/esm/actionProcessor/core/guid/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/guid/index.js +0 -6
- package/lib/esm/actionProcessor/core/log/getLogCreateActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/log/getLogCreateActionProcessor.js +0 -15
- package/lib/esm/actionProcessor/core/log/getLogDisableEventHistoryActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/log/getLogDisableEventHistoryActionProcessor.js +0 -10
- package/lib/esm/actionProcessor/core/log/getLogTemplateLiteralActionProcessor.js +0 -11
- package/lib/esm/actionProcessor/core/log/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/log/index.js +0 -8
- package/lib/esm/actionProcessor/core/math/getMathRandomNumberActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/math/getMathRandomNumberActionProcessor.js +0 -9
- package/lib/esm/actionProcessor/core/math/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/math/index.js +0 -4
- package/lib/esm/actionProcessor/core/network/getNetworkRequestActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/network/getNetworkRequestActionProcessor.js +0 -134
- package/lib/esm/actionProcessor/core/network/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/network/index.js +0 -4
- package/lib/esm/actionProcessor/core/platform/getPlatformDelayActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/platform/getPlatformDelayActionProcessor.js +0 -9
- package/lib/esm/actionProcessor/core/platform/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/platform/index.js +0 -4
- package/lib/esm/actionProcessor/core/system/getSystemBatchActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/core/system/getSystemBatchActionProcessor.js +0 -36
- package/lib/esm/actionProcessor/core/system/index.d.ts +0 -2
- package/lib/esm/actionProcessor/core/system/index.js +0 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ActionProcessorListResolver } from 'quidproquo-core';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const getConfigGetParameterActionProcessor: ActionProcessorListResolver;
|
|
@@ -0,0 +1,30 @@
|
|
|
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.getConfigGetParameterActionProcessor = void 0;
|
|
13
|
+
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
|
+
const getProcessConfigGetParameter = (qpqConfig) => {
|
|
15
|
+
return ({ parameterName }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
// Read the value from Local Storage
|
|
17
|
+
const parameterValue = localStorage.getItem(parameterName);
|
|
18
|
+
// If the parameter doesn't exist, return an error
|
|
19
|
+
if (parameterValue === null) {
|
|
20
|
+
return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.NotFound, `Parameter '${parameterName}' not found in Local Storage`);
|
|
21
|
+
}
|
|
22
|
+
return (0, quidproquo_core_1.actionResult)(parameterValue);
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
const getConfigGetParameterActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
|
+
return ({
|
|
27
|
+
[quidproquo_core_1.ConfigActionType.GetParameter]: getProcessConfigGetParameter(qpqConfig),
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
exports.getConfigGetParameterActionProcessor = getConfigGetParameterActionProcessor;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ActionProcessorListResolver } from 'quidproquo-core';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const getConfigGetParametersActionProcessor: ActionProcessorListResolver;
|
|
@@ -0,0 +1,37 @@
|
|
|
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.getConfigGetParametersActionProcessor = void 0;
|
|
13
|
+
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
|
+
const getProcessConfigGetParameters = (qpqConfig) => {
|
|
15
|
+
return ({ parameterNames }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
// Retrieve values from Local Storage for each parameter name
|
|
17
|
+
const parameterValues = parameterNames.map((name) => ({
|
|
18
|
+
name,
|
|
19
|
+
value: localStorage.getItem(name),
|
|
20
|
+
found: localStorage.getItem(name) !== null, // Check if it exists
|
|
21
|
+
}));
|
|
22
|
+
// Find missing parameters
|
|
23
|
+
const missingParameters = parameterValues.filter((param) => !param.found);
|
|
24
|
+
// If any parameters are missing, return an error
|
|
25
|
+
if (missingParameters.length > 0) {
|
|
26
|
+
return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.NotFound, `Parameters not found in Local Storage: ${missingParameters.map((param) => param.name).join(', ')}`);
|
|
27
|
+
}
|
|
28
|
+
// Return an array of values
|
|
29
|
+
return (0, quidproquo_core_1.actionResult)(parameterValues.map((param) => param.value));
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
const getConfigGetParametersActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
+
return ({
|
|
34
|
+
[quidproquo_core_1.ConfigActionType.GetParameters]: getProcessConfigGetParameters(qpqConfig),
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
exports.getConfigGetParametersActionProcessor = getConfigGetParametersActionProcessor;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ActionProcessorListResolver } from 'quidproquo-core';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const getConfigSetParameterActionProcessor: ActionProcessorListResolver;
|
|
@@ -9,18 +9,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.getConfigSetParameterActionProcessor = void 0;
|
|
13
13
|
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
|
-
const
|
|
15
|
-
return ({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
const getProcessConfigSetParameter = (qpqConfig) => {
|
|
15
|
+
return ({ parameterName, parameterValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
try {
|
|
17
|
+
localStorage.setItem(parameterName, parameterValue);
|
|
18
|
+
return (0, quidproquo_core_1.actionResult)(void 0);
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.GenericError, `Failed to save parameter '${parameterName}' to Local Storage.`);
|
|
22
|
+
}
|
|
19
23
|
});
|
|
20
24
|
};
|
|
21
|
-
const
|
|
25
|
+
const getConfigSetParameterActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
26
|
return ({
|
|
23
|
-
[quidproquo_core_1.
|
|
27
|
+
[quidproquo_core_1.ConfigActionType.SetParameter]: getProcessConfigSetParameter(qpqConfig),
|
|
24
28
|
});
|
|
25
29
|
});
|
|
26
|
-
exports.
|
|
30
|
+
exports.getConfigSetParameterActionProcessor = getConfigSetParameterActionProcessor;
|
|
@@ -10,8 +10,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getConfigActionProcessor = void 0;
|
|
13
|
-
const
|
|
13
|
+
const getConfigGetParameterActionProcessor_1 = require("./getConfigGetParameterActionProcessor");
|
|
14
|
+
const getConfigGetParametersActionProcessor_1 = require("./getConfigGetParametersActionProcessor");
|
|
15
|
+
const getConfigSetParameterActionProcessor_1 = require("./getConfigSetParameterActionProcessor");
|
|
14
16
|
const getConfigActionProcessor = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
-
return (Object.assign({}, (yield (0,
|
|
17
|
+
return (Object.assign(Object.assign(Object.assign({}, (yield (0, getConfigGetParameterActionProcessor_1.getConfigGetParameterActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getConfigGetParametersActionProcessor_1.getConfigGetParametersActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getConfigSetParameterActionProcessor_1.getConfigSetParameterActionProcessor)(qpqConfig, dynamicModuleLoader))));
|
|
16
18
|
});
|
|
17
19
|
exports.getConfigActionProcessor = getConfigActionProcessor;
|
|
@@ -1,14 +1,2 @@
|
|
|
1
1
|
import { ActionProcessorListResolver } from 'quidproquo-core';
|
|
2
|
-
export * from './claudeAi';
|
|
3
|
-
export * from './config';
|
|
4
|
-
export * from './context';
|
|
5
|
-
export * from './date';
|
|
6
|
-
export * from './error';
|
|
7
|
-
export * from './guid';
|
|
8
|
-
export * from './log';
|
|
9
|
-
export * from './math';
|
|
10
|
-
export * from './network';
|
|
11
|
-
export * from './platform';
|
|
12
|
-
export * from './system';
|
|
13
|
-
export * from './customActions';
|
|
14
2
|
export declare const getCoreActionProcessor: ActionProcessorListResolver;
|
|
@@ -1,18 +1,4 @@
|
|
|
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 __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
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -24,31 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
10
|
};
|
|
25
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
12
|
exports.getCoreActionProcessor = void 0;
|
|
27
|
-
const claudeAi_1 = require("./claudeAi");
|
|
28
13
|
const config_1 = require("./config");
|
|
29
|
-
const context_1 = require("./context");
|
|
30
|
-
const date_1 = require("./date");
|
|
31
|
-
const error_1 = require("./error");
|
|
32
|
-
const guid_1 = require("./guid");
|
|
33
|
-
const log_1 = require("./log");
|
|
34
|
-
const math_1 = require("./math");
|
|
35
|
-
const network_1 = require("./network");
|
|
36
|
-
const platform_1 = require("./platform");
|
|
37
|
-
const system_1 = require("./system");
|
|
38
|
-
__exportStar(require("./claudeAi"), exports);
|
|
39
|
-
__exportStar(require("./config"), exports);
|
|
40
|
-
__exportStar(require("./context"), exports);
|
|
41
|
-
__exportStar(require("./date"), exports);
|
|
42
|
-
__exportStar(require("./error"), exports);
|
|
43
|
-
__exportStar(require("./guid"), exports);
|
|
44
|
-
__exportStar(require("./log"), exports);
|
|
45
|
-
__exportStar(require("./math"), exports);
|
|
46
|
-
__exportStar(require("./network"), exports);
|
|
47
|
-
__exportStar(require("./platform"), exports);
|
|
48
|
-
__exportStar(require("./system"), exports);
|
|
49
|
-
// Custom actions is not done here, as it has to be done last after all
|
|
50
|
-
__exportStar(require("./customActions"), exports);
|
|
51
14
|
const getCoreActionProcessor = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
|
|
52
|
-
return (Object.assign(
|
|
15
|
+
return (Object.assign({}, (yield (0, config_1.getConfigActionProcessor)(qpqConfig, dynamicModuleLoader))));
|
|
53
16
|
});
|
|
54
17
|
exports.getCoreActionProcessor = getCoreActionProcessor;
|
|
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./actionProcessor"), exports);
|
|
17
18
|
__exportStar(require("./getWebActionProcessors"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { actionResult, actionResultError, ConfigActionType, ErrorTypeEnum, } from 'quidproquo-core';
|
|
2
|
+
const getProcessConfigGetParameter = (qpqConfig) => {
|
|
3
|
+
return async ({ parameterName }) => {
|
|
4
|
+
// Read the value from Local Storage
|
|
5
|
+
const parameterValue = localStorage.getItem(parameterName);
|
|
6
|
+
// If the parameter doesn't exist, return an error
|
|
7
|
+
if (parameterValue === null) {
|
|
8
|
+
return actionResultError(ErrorTypeEnum.NotFound, `Parameter '${parameterName}' not found in Local Storage`);
|
|
9
|
+
}
|
|
10
|
+
return actionResult(parameterValue);
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export const getConfigGetParameterActionProcessor = async (qpqConfig) => ({
|
|
14
|
+
[ConfigActionType.GetParameter]: getProcessConfigGetParameter(qpqConfig),
|
|
15
|
+
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ActionProcessorListResolver } from 'quidproquo-core';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const getConfigGetParametersActionProcessor: ActionProcessorListResolver;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { actionResult, actionResultError, ConfigActionType, ErrorTypeEnum, } from 'quidproquo-core';
|
|
2
|
+
const getProcessConfigGetParameters = (qpqConfig) => {
|
|
3
|
+
return async ({ parameterNames }) => {
|
|
4
|
+
// Retrieve values from Local Storage for each parameter name
|
|
5
|
+
const parameterValues = parameterNames.map((name) => ({
|
|
6
|
+
name,
|
|
7
|
+
value: localStorage.getItem(name),
|
|
8
|
+
found: localStorage.getItem(name) !== null, // Check if it exists
|
|
9
|
+
}));
|
|
10
|
+
// Find missing parameters
|
|
11
|
+
const missingParameters = parameterValues.filter((param) => !param.found);
|
|
12
|
+
// If any parameters are missing, return an error
|
|
13
|
+
if (missingParameters.length > 0) {
|
|
14
|
+
return actionResultError(ErrorTypeEnum.NotFound, `Parameters not found in Local Storage: ${missingParameters.map((param) => param.name).join(', ')}`);
|
|
15
|
+
}
|
|
16
|
+
// Return an array of values
|
|
17
|
+
return actionResult(parameterValues.map((param) => param.value));
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export const getConfigGetParametersActionProcessor = async (qpqConfig) => ({
|
|
21
|
+
[ConfigActionType.GetParameters]: getProcessConfigGetParameters(qpqConfig),
|
|
22
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { actionResult, actionResultError, ConfigActionType, ErrorTypeEnum, } from 'quidproquo-core';
|
|
2
|
+
const getProcessConfigSetParameter = (qpqConfig) => {
|
|
3
|
+
return async ({ parameterName, parameterValue }) => {
|
|
4
|
+
try {
|
|
5
|
+
localStorage.setItem(parameterName, parameterValue);
|
|
6
|
+
return actionResult(void 0);
|
|
7
|
+
}
|
|
8
|
+
catch (error) {
|
|
9
|
+
return actionResultError(ErrorTypeEnum.GenericError, `Failed to save parameter '${parameterName}' to Local Storage.`);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export const getConfigSetParameterActionProcessor = async (qpqConfig) => ({
|
|
14
|
+
[ConfigActionType.SetParameter]: getProcessConfigSetParameter(qpqConfig),
|
|
15
|
+
});
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getConfigGetParameterActionProcessor } from './getConfigGetParameterActionProcessor';
|
|
2
|
+
import { getConfigGetParametersActionProcessor } from './getConfigGetParametersActionProcessor';
|
|
3
|
+
import { getConfigSetParameterActionProcessor } from './getConfigSetParameterActionProcessor';
|
|
2
4
|
export const getConfigActionProcessor = async (qpqConfig, dynamicModuleLoader) => ({
|
|
3
|
-
...(await
|
|
5
|
+
...(await getConfigGetParameterActionProcessor(qpqConfig, dynamicModuleLoader)),
|
|
6
|
+
...(await getConfigGetParametersActionProcessor(qpqConfig, dynamicModuleLoader)),
|
|
7
|
+
...(await getConfigSetParameterActionProcessor(qpqConfig, dynamicModuleLoader)),
|
|
4
8
|
});
|
|
@@ -1,14 +1,2 @@
|
|
|
1
1
|
import { ActionProcessorListResolver } from 'quidproquo-core';
|
|
2
|
-
export * from './claudeAi';
|
|
3
|
-
export * from './config';
|
|
4
|
-
export * from './context';
|
|
5
|
-
export * from './date';
|
|
6
|
-
export * from './error';
|
|
7
|
-
export * from './guid';
|
|
8
|
-
export * from './log';
|
|
9
|
-
export * from './math';
|
|
10
|
-
export * from './network';
|
|
11
|
-
export * from './platform';
|
|
12
|
-
export * from './system';
|
|
13
|
-
export * from './customActions';
|
|
14
2
|
export declare const getCoreActionProcessor: ActionProcessorListResolver;
|
|
@@ -1,37 +1,4 @@
|
|
|
1
|
-
import { getClaudeAiActionProcessor } from './claudeAi';
|
|
2
1
|
import { getConfigActionProcessor } from './config';
|
|
3
|
-
import { getContextActionProcessor } from './context';
|
|
4
|
-
import { getDateActionProcessor } from './date';
|
|
5
|
-
import { getErrorActionProcessor } from './error';
|
|
6
|
-
import { getGuidProcessor } from './guid';
|
|
7
|
-
import { getLogActionProcessor } from './log';
|
|
8
|
-
import { getMathActionProcessor } from './math';
|
|
9
|
-
import { getNetworkActionProcessor } from './network';
|
|
10
|
-
import { getPlatformActionProcessor } from './platform';
|
|
11
|
-
import { getSystemActionProcessor } from './system';
|
|
12
|
-
export * from './claudeAi';
|
|
13
|
-
export * from './config';
|
|
14
|
-
export * from './context';
|
|
15
|
-
export * from './date';
|
|
16
|
-
export * from './error';
|
|
17
|
-
export * from './guid';
|
|
18
|
-
export * from './log';
|
|
19
|
-
export * from './math';
|
|
20
|
-
export * from './network';
|
|
21
|
-
export * from './platform';
|
|
22
|
-
export * from './system';
|
|
23
|
-
// Custom actions is not done here, as it has to be done last after all
|
|
24
|
-
export * from './customActions';
|
|
25
2
|
export const getCoreActionProcessor = async (qpqConfig, dynamicModuleLoader) => ({
|
|
26
3
|
...(await getConfigActionProcessor(qpqConfig, dynamicModuleLoader)),
|
|
27
|
-
...(await getContextActionProcessor(qpqConfig, dynamicModuleLoader)),
|
|
28
|
-
...(await getClaudeAiActionProcessor(qpqConfig, dynamicModuleLoader)),
|
|
29
|
-
...(await getDateActionProcessor(qpqConfig, dynamicModuleLoader)),
|
|
30
|
-
...(await getErrorActionProcessor(qpqConfig, dynamicModuleLoader)),
|
|
31
|
-
...(await getGuidProcessor(qpqConfig, dynamicModuleLoader)),
|
|
32
|
-
...(await getLogActionProcessor(qpqConfig, dynamicModuleLoader)),
|
|
33
|
-
...(await getMathActionProcessor(qpqConfig, dynamicModuleLoader)),
|
|
34
|
-
...(await getNetworkActionProcessor(qpqConfig, dynamicModuleLoader)),
|
|
35
|
-
...(await getPlatformActionProcessor(qpqConfig, dynamicModuleLoader)),
|
|
36
|
-
...(await getSystemActionProcessor(qpqConfig, dynamicModuleLoader)),
|
|
37
4
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quidproquo-actionprocessor-web",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.252",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
"@anthropic-ai/sdk": "^0.19.1",
|
|
36
36
|
"axios": "^1.2.1",
|
|
37
37
|
"mime-types": "^2.1.35",
|
|
38
|
-
"quidproquo-
|
|
39
|
-
"quidproquo-
|
|
40
|
-
"quidproquo-
|
|
38
|
+
"quidproquo-actionprocessor-js": "0.0.252",
|
|
39
|
+
"quidproquo-core": "0.0.252",
|
|
40
|
+
"quidproquo-webserver": "0.0.252",
|
|
41
41
|
"uuid": "^9.0.0",
|
|
42
42
|
"uuidv7": "^1.0.1"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@types/mime-types": "^2.1.1",
|
|
46
46
|
"@types/uuid": "^9.0.0",
|
|
47
|
-
"quidproquo-tsconfig": "0.0.
|
|
47
|
+
"quidproquo-tsconfig": "0.0.252",
|
|
48
48
|
"typescript": "^4.9.3"
|
|
49
49
|
}
|
|
50
|
-
}
|
|
50
|
+
}
|
|
@@ -1,64 +0,0 @@
|
|
|
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
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.getClaudeAiMessagesApiActionProcessor = void 0;
|
|
36
|
-
const quidproquo_core_1 = require("quidproquo-core");
|
|
37
|
-
const sdk_1 = __importStar(require("@anthropic-ai/sdk"));
|
|
38
|
-
const getProcessMessagesApi = (qpqConfig) => {
|
|
39
|
-
return ({ body, apiKey }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
-
const anthropic = new sdk_1.default({ apiKey });
|
|
41
|
-
try {
|
|
42
|
-
const msg = yield anthropic.messages.create(body);
|
|
43
|
-
return (0, quidproquo_core_1.actionResult)(msg);
|
|
44
|
-
}
|
|
45
|
-
catch (error) {
|
|
46
|
-
console.log(error);
|
|
47
|
-
if (error instanceof sdk_1.AuthenticationError) {
|
|
48
|
-
return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.Unauthorized, 'Invalid API key.');
|
|
49
|
-
}
|
|
50
|
-
else if (error instanceof Error) {
|
|
51
|
-
return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.GenericError, error.message);
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.GenericError, 'An error occurred while processing your request.');
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
const getClaudeAiMessagesApiActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
60
|
-
return ({
|
|
61
|
-
[quidproquo_core_1.ClaudeAiActionType.MessagesApi]: getProcessMessagesApi(qpqConfig),
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
exports.getClaudeAiMessagesApiActionProcessor = getClaudeAiMessagesApiActionProcessor;
|
|
@@ -1,17 +0,0 @@
|
|
|
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.getClaudeAiActionProcessor = void 0;
|
|
13
|
-
const getClaudeAiMessagesApiActionProcessor_1 = require("./getClaudeAiMessagesApiActionProcessor");
|
|
14
|
-
const getClaudeAiActionProcessor = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
-
return (Object.assign({}, (yield (0, getClaudeAiMessagesApiActionProcessor_1.getClaudeAiMessagesApiActionProcessor)(qpqConfig, dynamicModuleLoader))));
|
|
16
|
-
});
|
|
17
|
-
exports.getClaudeAiActionProcessor = getClaudeAiActionProcessor;
|
package/lib/commonjs/actionProcessor/core/config/getConfigGetApplicationInfoActionProcessor.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
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.getConfigGetApplicationInfoActionProcessor = void 0;
|
|
13
|
-
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
|
-
const getProcessConfigGetApplicationConfig = (qpqConfig) => {
|
|
15
|
-
return () => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
const appInfo = {
|
|
17
|
-
environment: quidproquo_core_1.qpqCoreUtils.getApplicationModuleEnvironment(qpqConfig),
|
|
18
|
-
feature: quidproquo_core_1.qpqCoreUtils.getApplicationModuleFeature(qpqConfig),
|
|
19
|
-
module: quidproquo_core_1.qpqCoreUtils.getApplicationModuleName(qpqConfig),
|
|
20
|
-
name: quidproquo_core_1.qpqCoreUtils.getApplicationName(qpqConfig),
|
|
21
|
-
};
|
|
22
|
-
return (0, quidproquo_core_1.actionResult)(appInfo);
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
const getConfigGetApplicationInfoActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
|
-
return ({
|
|
27
|
-
[quidproquo_core_1.ConfigActionType.GetApplicationInfo]: getProcessConfigGetApplicationConfig(qpqConfig),
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
exports.getConfigGetApplicationInfoActionProcessor = getConfigGetApplicationInfoActionProcessor;
|
|
@@ -1,24 +0,0 @@
|
|
|
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.getContextListActionProcessor = void 0;
|
|
13
|
-
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
|
-
const getProcessContextList = (qpqConfig) => {
|
|
15
|
-
return (payload, session) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
return (0, quidproquo_core_1.actionResult)(session.context);
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
const getContextListActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
return ({
|
|
21
|
-
[quidproquo_core_1.ContextActionType.List]: getProcessContextList(qpqConfig),
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
exports.getContextListActionProcessor = getContextListActionProcessor;
|
|
@@ -1,27 +0,0 @@
|
|
|
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.getContextReadActionProcessor = void 0;
|
|
13
|
-
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
|
-
const getContextValue = (context, contextIdentifier) => {
|
|
15
|
-
return contextIdentifier.uniqueName in context ? context[contextIdentifier.uniqueName] : contextIdentifier.defaultValue;
|
|
16
|
-
};
|
|
17
|
-
const getProcessContextRead = (qpqConfig) => {
|
|
18
|
-
return ({ contextIdentifier }, session) => __awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
return (0, quidproquo_core_1.actionResult)(getContextValue(session.context, contextIdentifier));
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
const getContextReadActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
|
-
return ({
|
|
24
|
-
[quidproquo_core_1.ContextActionType.Read]: getProcessContextRead(qpqConfig),
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
exports.getContextReadActionProcessor = getContextReadActionProcessor;
|
|
@@ -1,18 +0,0 @@
|
|
|
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.getContextActionProcessor = void 0;
|
|
13
|
-
const getContextListActionProcessor_1 = require("./getContextListActionProcessor");
|
|
14
|
-
const getContextReadActionProcessor_1 = require("./getContextReadActionProcessor");
|
|
15
|
-
const getContextActionProcessor = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
return (Object.assign(Object.assign({}, (yield (0, getContextListActionProcessor_1.getContextListActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getContextReadActionProcessor_1.getContextReadActionProcessor)(qpqConfig, dynamicModuleLoader))));
|
|
17
|
-
});
|
|
18
|
-
exports.getContextActionProcessor = getContextActionProcessor;
|