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,58 +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.getCustomActionActionProcessor = void 0;
|
|
13
|
-
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
|
-
function getActionProcessorListLoader(dynamicModuleLoader, qpqConfig) {
|
|
15
|
-
return function loadModule(qpqFunctionRuntime) {
|
|
16
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
try {
|
|
18
|
-
const possibleModule = yield dynamicModuleLoader(qpqFunctionRuntime);
|
|
19
|
-
if (typeof possibleModule !== 'function') {
|
|
20
|
-
throw new Error(`Expected module to be a function, but got ${typeof possibleModule}`);
|
|
21
|
-
}
|
|
22
|
-
const apl = yield possibleModule(qpqConfig, dynamicModuleLoader);
|
|
23
|
-
if (typeof apl !== 'object') {
|
|
24
|
-
throw new Error(`Expected action processor list to be an object, but got ${typeof apl}`);
|
|
25
|
-
}
|
|
26
|
-
if (Object.values(apl).find((aplv) => typeof aplv !== 'function')) {
|
|
27
|
-
throw new Error('Expected all action processors to be functions');
|
|
28
|
-
}
|
|
29
|
-
return apl;
|
|
30
|
-
}
|
|
31
|
-
catch (e) {
|
|
32
|
-
console.log(`Unable to dynamically load action processors: [${e}] ${JSON.stringify(qpqFunctionRuntime)}`);
|
|
33
|
-
throw e;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
const getProcessCustomAction = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
-
try {
|
|
40
|
-
const actionProcessorListLoader = getActionProcessorListLoader(dynamicModuleLoader, qpqConfig);
|
|
41
|
-
const getCustomActionProcessors = quidproquo_core_1.qpqCoreUtils.getActionProcessorSources(qpqConfig);
|
|
42
|
-
const possibleModuleResults = yield Promise.allSettled(getCustomActionProcessors.map(actionProcessorListLoader));
|
|
43
|
-
// Filter out successfully loaded modules that are functions
|
|
44
|
-
const actionProcessorLists = possibleModuleResults
|
|
45
|
-
.filter((result) => result.status === 'fulfilled')
|
|
46
|
-
.map((result) => result.value);
|
|
47
|
-
return actionProcessorLists.reduce((acc, cur) => (Object.assign(Object.assign({}, acc), cur)), {});
|
|
48
|
-
}
|
|
49
|
-
catch (e) {
|
|
50
|
-
// This should never get hit, but just in case
|
|
51
|
-
console.log(`Unable to dynamically load action processors: [${e}]`);
|
|
52
|
-
return {};
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
const getCustomActionActionProcessor = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
|
-
return (Object.assign({}, (yield getProcessCustomAction(qpqConfig, dynamicModuleLoader))));
|
|
57
|
-
});
|
|
58
|
-
exports.getCustomActionActionProcessor = getCustomActionActionProcessor;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './getCustomActionActionProcessor';
|
|
@@ -1,18 +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 __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
|
-
// This is a special one because it just has all the custom ones
|
|
18
|
-
__exportStar(require("./getCustomActionActionProcessor"), exports);
|
|
@@ -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.getDateNowActionProcessor = void 0;
|
|
13
|
-
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
|
-
const getProcessDateNow = (qpqConfig) => {
|
|
15
|
-
return () => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
return (0, quidproquo_core_1.actionResult)(new Date().toISOString());
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
const getDateNowActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
return ({
|
|
21
|
-
[quidproquo_core_1.DateActionType.Now]: getProcessDateNow(qpqConfig),
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
exports.getDateNowActionProcessor = getDateNowActionProcessor;
|
|
@@ -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.getDateActionProcessor = void 0;
|
|
13
|
-
const getDateNowActionProcessor_1 = require("./getDateNowActionProcessor");
|
|
14
|
-
const getDateActionProcessor = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
-
return (Object.assign({}, (yield (0, getDateNowActionProcessor_1.getDateNowActionProcessor)(qpqConfig, dynamicModuleLoader))));
|
|
16
|
-
});
|
|
17
|
-
exports.getDateActionProcessor = getDateActionProcessor;
|
|
@@ -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.getErrorThrowErrorActionProcessor = void 0;
|
|
13
|
-
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
|
-
const getProcessErrorThrowError = (qpqConfig) => {
|
|
15
|
-
return ({ errorStack, errorText, errorType }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
return (0, quidproquo_core_1.actionResultError)(errorType, errorText, errorStack);
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
const getErrorThrowErrorActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
return ({
|
|
21
|
-
[quidproquo_core_1.ErrorActionType.ThrowError]: getProcessErrorThrowError(qpqConfig),
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
exports.getErrorThrowErrorActionProcessor = getErrorThrowErrorActionProcessor;
|
|
@@ -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.getErrorActionProcessor = void 0;
|
|
13
|
-
const getErrorThrowErrorActionProcessor_1 = require("./getErrorThrowErrorActionProcessor");
|
|
14
|
-
const getErrorActionProcessor = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
-
return (Object.assign({}, (yield (0, getErrorThrowErrorActionProcessor_1.getErrorThrowErrorActionProcessor)(qpqConfig, dynamicModuleLoader))));
|
|
16
|
-
});
|
|
17
|
-
exports.getErrorActionProcessor = getErrorActionProcessor;
|
|
@@ -1,25 +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.getGuidNewActionProcessor = void 0;
|
|
13
|
-
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
|
-
const uuid_1 = require("uuid");
|
|
15
|
-
const getProcessGuidNew = (qpqConfig) => {
|
|
16
|
-
return () => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
-
return (0, quidproquo_core_1.actionResult)((0, uuid_1.v4)());
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
const getGuidNewActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
-
return ({
|
|
22
|
-
[quidproquo_core_1.GuidActionType.New]: getProcessGuidNew(qpqConfig),
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
exports.getGuidNewActionProcessor = getGuidNewActionProcessor;
|
|
@@ -1,25 +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.getGuidNewSortableActionProcessor = void 0;
|
|
13
|
-
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
|
-
const uuidv7_1 = require("uuidv7");
|
|
15
|
-
const getProcessGuidNewSortable = (qpqConfig) => {
|
|
16
|
-
return () => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
-
return (0, quidproquo_core_1.actionResult)((0, uuidv7_1.uuidv7)());
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
const getGuidNewSortableActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
-
return ({
|
|
22
|
-
[quidproquo_core_1.GuidActionType.NewSortable]: getProcessGuidNewSortable(qpqConfig),
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
exports.getGuidNewSortableActionProcessor = getGuidNewSortableActionProcessor;
|
|
@@ -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.getGuidProcessor = void 0;
|
|
13
|
-
const getGuidNewActionProcessor_1 = require("./getGuidNewActionProcessor");
|
|
14
|
-
const getGuidNewSortableActionProcessor_1 = require("./getGuidNewSortableActionProcessor");
|
|
15
|
-
const getGuidProcessor = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
return (Object.assign(Object.assign({}, (yield (0, getGuidNewActionProcessor_1.getGuidNewActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getGuidNewSortableActionProcessor_1.getGuidNewSortableActionProcessor)(qpqConfig, dynamicModuleLoader))));
|
|
17
|
-
});
|
|
18
|
-
exports.getGuidProcessor = getGuidProcessor;
|
|
@@ -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.getLogCreateActionProcessor = void 0;
|
|
13
|
-
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
|
-
const getProcessLogCreate = (qpqConfig) => {
|
|
15
|
-
return ({ msg, logLevel, data }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
if (data) {
|
|
17
|
-
console.log(`${logLevel}: ${msg}`, data);
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
console.log(`${logLevel}: ${msg}`);
|
|
21
|
-
}
|
|
22
|
-
return (0, quidproquo_core_1.actionResult)(void 0);
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
const getLogCreateActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
|
-
return ({
|
|
27
|
-
[quidproquo_core_1.LogActionType.Create]: getProcessLogCreate(qpqConfig),
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
exports.getLogCreateActionProcessor = getLogCreateActionProcessor;
|
|
@@ -1,25 +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.getLogDisableEventHistoryActionProcessor = void 0;
|
|
13
|
-
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
|
-
const getProcessLogDisableEventHistory = (qpqConfig) => {
|
|
15
|
-
return ({ enable, reason }, session, _actionProcessors, logger) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
yield logger.enableLogs(enable, reason, session.correlation || '');
|
|
17
|
-
return (0, quidproquo_core_1.actionResult)(void 0);
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
const getLogDisableEventHistoryActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
-
return ({
|
|
22
|
-
[quidproquo_core_1.LogActionType.DisableEventHistory]: getProcessLogDisableEventHistory(qpqConfig),
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
exports.getLogDisableEventHistoryActionProcessor = getLogDisableEventHistoryActionProcessor;
|
|
@@ -1,19 +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.getLogActionProcessor = void 0;
|
|
13
|
-
const getLogCreateActionProcessor_1 = require("./getLogCreateActionProcessor");
|
|
14
|
-
const getLogDisableEventHistoryActionProcessor_1 = require("./getLogDisableEventHistoryActionProcessor");
|
|
15
|
-
const getLogTemplateLiteralActionProcessor_1 = require("./getLogTemplateLiteralActionProcessor");
|
|
16
|
-
const getLogActionProcessor = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
-
return (Object.assign(Object.assign(Object.assign({}, (yield (0, getLogCreateActionProcessor_1.getLogCreateActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getLogDisableEventHistoryActionProcessor_1.getLogDisableEventHistoryActionProcessor)(qpqConfig, dynamicModuleLoader))), (yield (0, getLogTemplateLiteralActionProcessor_1.getLogTemplateLiteralActionProcessor)(qpqConfig, dynamicModuleLoader))));
|
|
18
|
-
});
|
|
19
|
-
exports.getLogActionProcessor = getLogActionProcessor;
|
|
@@ -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.getMathRandomNumberActionProcessor = void 0;
|
|
13
|
-
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
|
-
const getProcessMathRandomNumber = (qpqConfig) => {
|
|
15
|
-
return () => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
return (0, quidproquo_core_1.actionResult)(Math.random());
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
const getMathRandomNumberActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
return ({
|
|
21
|
-
[quidproquo_core_1.MathActionType.RandomNumber]: getProcessMathRandomNumber(qpqConfig),
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
exports.getMathRandomNumberActionProcessor = getMathRandomNumberActionProcessor;
|
|
@@ -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.getMathActionProcessor = void 0;
|
|
13
|
-
const getMathRandomNumberActionProcessor_1 = require("./getMathRandomNumberActionProcessor");
|
|
14
|
-
const getMathActionProcessor = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
-
return (Object.assign({}, (yield (0, getMathRandomNumberActionProcessor_1.getMathRandomNumberActionProcessor)(qpqConfig, dynamicModuleLoader))));
|
|
16
|
-
});
|
|
17
|
-
exports.getMathActionProcessor = getMathActionProcessor;
|
|
@@ -1,150 +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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getNetworkRequestActionProcessor = void 0;
|
|
16
|
-
const quidproquo_core_1 = require("quidproquo-core");
|
|
17
|
-
const axios_1 = __importDefault(require("axios"));
|
|
18
|
-
const mime_types_1 = require("mime-types");
|
|
19
|
-
const getAxiosResponseType = (responseType) => {
|
|
20
|
-
if (responseType === 'binary') {
|
|
21
|
-
return 'arraybuffer';
|
|
22
|
-
}
|
|
23
|
-
return 'json';
|
|
24
|
-
};
|
|
25
|
-
const transformResponse = (payload, response) => {
|
|
26
|
-
var _a, _b;
|
|
27
|
-
if (payload.responseType === 'binary') {
|
|
28
|
-
const headers = response.headers || {};
|
|
29
|
-
const mimeType = headers['content-type'] || 'application/octet-stream';
|
|
30
|
-
const filename = ((_b = (_a = headers['content-disposition']) === null || _a === void 0 ? void 0 : _a.match(/filename="([^"]+)"/)) === null || _b === void 0 ? void 0 : _b[1]) || `file.${(0, mime_types_1.extension)(mimeType)}`;
|
|
31
|
-
return Object.assign(Object.assign({}, response), { data: {
|
|
32
|
-
base64Data: Buffer.from(response.data).toString('base64'),
|
|
33
|
-
mimetype: mimeType,
|
|
34
|
-
filename,
|
|
35
|
-
} });
|
|
36
|
-
}
|
|
37
|
-
return response;
|
|
38
|
-
};
|
|
39
|
-
const axiosInstance = axios_1.default.create({
|
|
40
|
-
timeout: 25000,
|
|
41
|
-
headers: {
|
|
42
|
-
// Fixes: https://github.com/axios/axios/issues/5346
|
|
43
|
-
'Accept-Encoding': 'gzip,deflate,compress',
|
|
44
|
-
},
|
|
45
|
-
validateStatus: () => true,
|
|
46
|
-
});
|
|
47
|
-
const processNetworkRequestGet = (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
-
const response = yield axiosInstance.get(payload.url, {
|
|
49
|
-
baseURL: payload.basePath,
|
|
50
|
-
headers: payload.headers,
|
|
51
|
-
params: payload.params,
|
|
52
|
-
responseType: getAxiosResponseType(payload.responseType),
|
|
53
|
-
});
|
|
54
|
-
return transformResponse(payload, response);
|
|
55
|
-
});
|
|
56
|
-
const processNetworkRequestPost = (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
57
|
-
const response = yield axiosInstance.post(payload.url, payload.body, {
|
|
58
|
-
baseURL: payload.basePath,
|
|
59
|
-
headers: payload.headers,
|
|
60
|
-
params: payload.params,
|
|
61
|
-
responseType: getAxiosResponseType(payload.responseType),
|
|
62
|
-
});
|
|
63
|
-
return transformResponse(payload, response);
|
|
64
|
-
});
|
|
65
|
-
const processNetworkRequestDelete = (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
66
|
-
const response = yield axiosInstance.delete(payload.url, {
|
|
67
|
-
baseURL: payload.basePath,
|
|
68
|
-
headers: payload.headers,
|
|
69
|
-
params: payload.params,
|
|
70
|
-
responseType: getAxiosResponseType(payload.responseType),
|
|
71
|
-
});
|
|
72
|
-
return transformResponse(payload, response);
|
|
73
|
-
});
|
|
74
|
-
const processNetworkRequestHead = (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
75
|
-
const response = yield axiosInstance.head(payload.url, {
|
|
76
|
-
baseURL: payload.basePath,
|
|
77
|
-
headers: payload.headers,
|
|
78
|
-
params: payload.params,
|
|
79
|
-
responseType: getAxiosResponseType(payload.responseType),
|
|
80
|
-
});
|
|
81
|
-
return transformResponse(payload, response);
|
|
82
|
-
});
|
|
83
|
-
const processNetworkRequestOptions = (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
84
|
-
const response = yield axiosInstance.options(payload.url, {
|
|
85
|
-
baseURL: payload.basePath,
|
|
86
|
-
headers: payload.headers,
|
|
87
|
-
params: payload.params,
|
|
88
|
-
responseType: getAxiosResponseType(payload.responseType),
|
|
89
|
-
});
|
|
90
|
-
return transformResponse(payload, response);
|
|
91
|
-
});
|
|
92
|
-
const processNetworkRequestPut = (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
93
|
-
const response = yield axiosInstance.put(payload.url, payload.body, {
|
|
94
|
-
baseURL: payload.basePath,
|
|
95
|
-
headers: payload.headers,
|
|
96
|
-
params: payload.params,
|
|
97
|
-
responseType: getAxiosResponseType(payload.responseType),
|
|
98
|
-
});
|
|
99
|
-
return transformResponse(payload, response);
|
|
100
|
-
});
|
|
101
|
-
const processNetworkRequestPatch = (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
102
|
-
const response = yield axiosInstance.patch(payload.url, payload.body, {
|
|
103
|
-
baseURL: payload.basePath,
|
|
104
|
-
headers: payload.headers,
|
|
105
|
-
params: payload.params,
|
|
106
|
-
responseType: getAxiosResponseType(payload.responseType),
|
|
107
|
-
});
|
|
108
|
-
return transformResponse(payload, response);
|
|
109
|
-
});
|
|
110
|
-
const processNetworkRequestConnect = (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
111
|
-
throw new Error('Function not implemented.');
|
|
112
|
-
});
|
|
113
|
-
const requestMethodMap = {
|
|
114
|
-
GET: processNetworkRequestGet,
|
|
115
|
-
POST: processNetworkRequestPost,
|
|
116
|
-
DELETE: processNetworkRequestDelete,
|
|
117
|
-
HEAD: processNetworkRequestHead,
|
|
118
|
-
OPTIONS: processNetworkRequestOptions,
|
|
119
|
-
PUT: processNetworkRequestPut,
|
|
120
|
-
PATCH: processNetworkRequestPatch,
|
|
121
|
-
CONNECT: processNetworkRequestConnect,
|
|
122
|
-
};
|
|
123
|
-
const getProcessNetworkRequest = (qpqConfig) => {
|
|
124
|
-
return (payload) => __awaiter(void 0, void 0, void 0, function* () {
|
|
125
|
-
const requestMethod = requestMethodMap[payload.method];
|
|
126
|
-
if (!requestMethod) {
|
|
127
|
-
return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.NotImplemented, `${payload.method}: Not implemented`);
|
|
128
|
-
}
|
|
129
|
-
console.log(payload.url);
|
|
130
|
-
try {
|
|
131
|
-
const response = yield requestMethod(payload);
|
|
132
|
-
return (0, quidproquo_core_1.actionResult)({
|
|
133
|
-
headers: response.headers,
|
|
134
|
-
status: response.status,
|
|
135
|
-
statusText: response.statusText,
|
|
136
|
-
data: response.data,
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
catch (err) {
|
|
140
|
-
console.log(err);
|
|
141
|
-
return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.GenericError, err.stack);
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
};
|
|
145
|
-
const getNetworkRequestActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
146
|
-
return ({
|
|
147
|
-
[quidproquo_core_1.NetworkActionType.Request]: getProcessNetworkRequest(qpqConfig),
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
exports.getNetworkRequestActionProcessor = getNetworkRequestActionProcessor;
|
|
@@ -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.getNetworkActionProcessor = void 0;
|
|
13
|
-
const getNetworkRequestActionProcessor_1 = require("./getNetworkRequestActionProcessor");
|
|
14
|
-
const getNetworkActionProcessor = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
-
return (Object.assign({}, (yield (0, getNetworkRequestActionProcessor_1.getNetworkRequestActionProcessor)(qpqConfig, dynamicModuleLoader))));
|
|
16
|
-
});
|
|
17
|
-
exports.getNetworkActionProcessor = getNetworkActionProcessor;
|
|
@@ -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.getPlatformDelayActionProcessor = void 0;
|
|
13
|
-
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
|
-
const getProcessPlatformDelay = (qpqConfig) => {
|
|
15
|
-
return ({ timeMs }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
-
return new Promise((resolve) => setTimeout(() => resolve((0, quidproquo_core_1.actionResult)(undefined)), timeMs));
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
const getPlatformDelayActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
return ({
|
|
21
|
-
[quidproquo_core_1.PlatformActionType.Delay]: getProcessPlatformDelay(qpqConfig),
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
exports.getPlatformDelayActionProcessor = getPlatformDelayActionProcessor;
|