quidproquo-actionprocessor-node 0.0.262 → 0.1.0
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/index.d.ts +2 -12
- package/lib/commonjs/actionProcessor/core/index.js +10 -25
- package/lib/commonjs/actionProcessor/core/inlineFunction/getInlineFunctionExecuteActionProcessor.d.ts +2 -0
- package/lib/commonjs/actionProcessor/core/inlineFunction/getInlineFunctionExecuteActionProcessor.js +47 -0
- package/lib/commonjs/actionProcessor/core/{network/getNetworkRequestActionProcessor.d.ts → inlineFunction/index.d.ts} +1 -1
- package/lib/commonjs/actionProcessor/core/{error → inlineFunction}/index.js +5 -5
- package/lib/commonjs/actionProcessor/core/{context/getContextReadActionProcessor.d.ts → stream/getStreamCloseActionProcessor.d.ts} +1 -1
- package/lib/commonjs/actionProcessor/core/{context/getContextReadActionProcessor.js → stream/getStreamCloseActionProcessor.js} +8 -10
- package/lib/commonjs/actionProcessor/core/stream/getStreamReadActionProcessor.d.ts +2 -0
- package/lib/commonjs/actionProcessor/core/{math/getMathRandomNumberActionProcessor.js → stream/getStreamReadActionProcessor.js} +8 -7
- package/lib/commonjs/actionProcessor/core/{system → stream}/index.d.ts +1 -1
- package/lib/commonjs/actionProcessor/core/{system → stream}/index.js +6 -5
- package/lib/commonjs/actionProcessor/webserver/index.js +4 -2
- package/lib/commonjs/dynamicActionProcessor/file/getFileDeleteActionProcessor.js +7 -4
- package/lib/commonjs/dynamicActionProcessor/file/getFileExistsActionProcessor.js +10 -4
- package/lib/commonjs/dynamicActionProcessor/file/getFileGenerateTemporarySecureUrlActionProcessor.js +1 -2
- package/lib/commonjs/dynamicActionProcessor/file/getFileGenerateTemporaryUploadSecureUrlActionProcessor.js +1 -2
- package/lib/commonjs/dynamicActionProcessor/file/getFileListDirectoryActionProcessor.js +6 -9
- package/lib/commonjs/dynamicActionProcessor/file/getFileReadBinaryContentsActionProcessor.js +4 -6
- package/lib/commonjs/dynamicActionProcessor/file/getFileReadObjectJsonActionProcessor.js +5 -9
- package/lib/commonjs/dynamicActionProcessor/file/getFileReadTextContentsActionProcessor.js +4 -6
- package/lib/commonjs/dynamicActionProcessor/file/getFileStreamOpenActionProcessor.d.ts +3 -0
- package/lib/commonjs/dynamicActionProcessor/file/getFileStreamOpenActionProcessor.js +135 -0
- package/lib/commonjs/dynamicActionProcessor/file/getFileWriteBinaryContentsActionProcessor.js +10 -3
- package/lib/commonjs/dynamicActionProcessor/file/getFileWriteObjectJsonActionProcessor.js +4 -3
- package/lib/commonjs/dynamicActionProcessor/file/getFileWriteTextContentsActionProcessor.js +4 -3
- package/lib/commonjs/dynamicActionProcessor/file/index.js +2 -1
- package/lib/commonjs/dynamicActionProcessor/file/utils.d.ts +2 -1
- package/lib/commonjs/dynamicActionProcessor/file/utils.js +11 -1
- package/lib/esm/actionProcessor/core/index.d.ts +2 -12
- package/lib/esm/actionProcessor/core/index.js +12 -35
- package/lib/esm/actionProcessor/core/inlineFunction/getInlineFunctionExecuteActionProcessor.d.ts +2 -0
- package/lib/esm/actionProcessor/core/inlineFunction/getInlineFunctionExecuteActionProcessor.js +32 -0
- package/lib/esm/actionProcessor/core/{network/getNetworkRequestActionProcessor.d.ts → inlineFunction/index.d.ts} +1 -1
- package/lib/esm/actionProcessor/core/inlineFunction/index.js +4 -0
- package/lib/{commonjs/actionProcessor/core/context/getContextListActionProcessor.d.ts → esm/actionProcessor/core/stream/getStreamCloseActionProcessor.d.ts} +1 -1
- package/lib/esm/actionProcessor/core/stream/getStreamCloseActionProcessor.js +10 -0
- package/lib/esm/actionProcessor/core/stream/getStreamReadActionProcessor.d.ts +2 -0
- package/lib/esm/actionProcessor/core/stream/getStreamReadActionProcessor.js +10 -0
- package/lib/esm/actionProcessor/core/{config → stream}/index.d.ts +1 -1
- package/lib/esm/actionProcessor/core/stream/index.js +6 -0
- package/lib/esm/actionProcessor/webserver/index.js +4 -2
- package/lib/esm/dynamicActionProcessor/file/getFileDeleteActionProcessor.js +8 -5
- package/lib/esm/dynamicActionProcessor/file/getFileExistsActionProcessor.js +11 -5
- package/lib/esm/dynamicActionProcessor/file/getFileGenerateTemporarySecureUrlActionProcessor.js +2 -3
- package/lib/esm/dynamicActionProcessor/file/getFileGenerateTemporaryUploadSecureUrlActionProcessor.js +2 -3
- package/lib/esm/dynamicActionProcessor/file/getFileListDirectoryActionProcessor.js +7 -10
- package/lib/esm/dynamicActionProcessor/file/getFileReadBinaryContentsActionProcessor.js +5 -7
- package/lib/esm/dynamicActionProcessor/file/getFileReadObjectJsonActionProcessor.js +6 -10
- package/lib/esm/dynamicActionProcessor/file/getFileReadTextContentsActionProcessor.js +5 -7
- package/lib/esm/dynamicActionProcessor/file/getFileStreamOpenActionProcessor.d.ts +3 -0
- package/lib/esm/dynamicActionProcessor/file/getFileStreamOpenActionProcessor.js +37 -0
- package/lib/esm/dynamicActionProcessor/file/getFileWriteBinaryContentsActionProcessor.js +11 -4
- package/lib/esm/dynamicActionProcessor/file/getFileWriteObjectJsonActionProcessor.js +5 -4
- package/lib/esm/dynamicActionProcessor/file/getFileWriteTextContentsActionProcessor.js +5 -4
- package/lib/esm/dynamicActionProcessor/file/index.js +2 -0
- package/lib/esm/dynamicActionProcessor/file/utils.d.ts +2 -1
- package/lib/esm/dynamicActionProcessor/file/utils.js +9 -1
- package/package.json +5 -9
- package/lib/commonjs/actionProcessor/core/claudeAi/getClaudeAiMessagesApiActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/claudeAi/getClaudeAiMessagesApiActionProcessor.js +0 -74
- 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/config/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/config/index.js +0 -17
- package/lib/commonjs/actionProcessor/core/context/getContextListActionProcessor.js +0 -24
- 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/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/getLogTemplateLiteralActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/log/getLogTemplateLiteralActionProcessor.js +0 -26
- 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/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/core/math/index.js +0 -17
- 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/webserver/dns/getDnsListActionProcessor.d.ts +0 -2
- package/lib/commonjs/actionProcessor/webserver/dns/getDnsListActionProcessor.js +0 -26
- package/lib/commonjs/actionProcessor/webserver/dns/index.d.ts +0 -2
- package/lib/commonjs/actionProcessor/webserver/dns/index.js +0 -17
- package/lib/esm/actionProcessor/core/claudeAi/getClaudeAiMessagesApiActionProcessor.d.ts +0 -2
- 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/config/index.js +0 -4
- 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.d.ts +0 -2
- 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.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
- package/lib/esm/actionProcessor/webserver/dns/getDnsListActionProcessor.d.ts +0 -2
- package/lib/esm/actionProcessor/webserver/dns/getDnsListActionProcessor.js +0 -11
- package/lib/esm/actionProcessor/webserver/dns/index.d.ts +0 -2
- package/lib/esm/actionProcessor/webserver/dns/index.js +0 -4
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { actionResult, actionResultError,
|
|
1
|
+
import { actionResult, actionResultError, actionResultErrorFromCaughtError, FileActionType, FileWriteTextContentsErrorTypeEnum, } from 'quidproquo-core';
|
|
2
2
|
import * as fs from 'fs/promises';
|
|
3
3
|
import { ensureParentDirectoryExists, resolveFilePath } from './utils';
|
|
4
4
|
const getProcessFileWriteTextContents = (qpqConfig, config) => {
|
|
5
|
-
const serviceName = qpqCoreUtils.getApplicationModuleName(qpqConfig);
|
|
6
5
|
return async ({ drive, filepath, data }) => {
|
|
7
6
|
try {
|
|
8
|
-
const fullPath = resolveFilePath(config,
|
|
7
|
+
const fullPath = resolveFilePath(config, qpqConfig, drive, filepath);
|
|
9
8
|
await ensureParentDirectoryExists(fullPath);
|
|
10
9
|
await fs.writeFile(fullPath, data, 'utf8');
|
|
11
10
|
return actionResult(void 0);
|
|
12
11
|
}
|
|
13
12
|
catch (error) {
|
|
14
|
-
return
|
|
13
|
+
return actionResultErrorFromCaughtError(error, {
|
|
14
|
+
EACCES: () => actionResultError(FileWriteTextContentsErrorTypeEnum.AccessDenied, `Access denied writing file: ${filepath}`), // node fs code
|
|
15
|
+
});
|
|
15
16
|
}
|
|
16
17
|
};
|
|
17
18
|
};
|
|
@@ -7,6 +7,7 @@ import { getFileListDirectoryActionProcessor } from './getFileListDirectoryActio
|
|
|
7
7
|
import { getFileReadBinaryContentsActionProcessor } from './getFileReadBinaryContentsActionProcessor';
|
|
8
8
|
import { getFileReadObjectJsonActionProcessor } from './getFileReadObjectJsonActionProcessor';
|
|
9
9
|
import { getFileReadTextContentsActionProcessor } from './getFileReadTextContentsActionProcessor';
|
|
10
|
+
import { getFileStreamOpenActionProcessor } from './getFileStreamOpenActionProcessor';
|
|
10
11
|
import { getFileWriteBinaryContentsActionProcessor } from './getFileWriteBinaryContentsActionProcessor';
|
|
11
12
|
import { getFileWriteObjectJsonActionProcessor } from './getFileWriteObjectJsonActionProcessor';
|
|
12
13
|
import { getFileWriteTextContentsActionProcessor } from './getFileWriteTextContentsActionProcessor';
|
|
@@ -26,6 +27,7 @@ export const getFileActionProcessor = (fileStorageConfig) => {
|
|
|
26
27
|
...(await getFileGenerateTemporarySecureUrlActionProcessor(fileStorageConfig)(qpqConfig, dynamicModuleLoader)),
|
|
27
28
|
...(await getFileGenerateTemporaryUploadSecureUrlActionProcessor(fileStorageConfig)(qpqConfig, dynamicModuleLoader)),
|
|
28
29
|
...(await getFileIsColdStorageActionProcessor(fileStorageConfig)(qpqConfig, dynamicModuleLoader)),
|
|
30
|
+
...(await getFileStreamOpenActionProcessor(fileStorageConfig)(qpqConfig, dynamicModuleLoader)),
|
|
29
31
|
});
|
|
30
32
|
};
|
|
31
33
|
export * from "./secureUrlUtils";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { QPQConfig } from 'quidproquo-core';
|
|
2
2
|
import { FileStorageConfig } from './types';
|
|
3
3
|
export declare const isStorageDriveNameValid: (drive: string, qpqConfig: QPQConfig) => boolean;
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function resolveDriveServiceName(drive: string, qpqConfig: QPQConfig): string;
|
|
5
|
+
export declare function resolveFilePath(fileStorageConfig: FileStorageConfig, qpqConfig: QPQConfig, drive: string, filepath: string): string;
|
|
5
6
|
export declare const ensureDirectoryExists: (dirPath: string) => Promise<void>;
|
|
6
7
|
export declare const ensureParentDirectoryExists: (filePath: string) => Promise<void>;
|
|
@@ -9,7 +9,15 @@ export const isStorageDriveNameValid = (drive, qpqConfig) => {
|
|
|
9
9
|
}
|
|
10
10
|
return true;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
// Resolve the service that owns a drive's on-disk location. Drives declared with
|
|
13
|
+
// `owner.module` are shared across services, so every caller reads and writes
|
|
14
|
+
// under the owner's folder — mirroring how AWS resolves the bucket by owner.
|
|
15
|
+
export function resolveDriveServiceName(drive, qpqConfig) {
|
|
16
|
+
const storageDrive = qpqCoreUtils.getStorageDriveByName(drive, qpqConfig);
|
|
17
|
+
return storageDrive?.owner?.module ?? qpqCoreUtils.getApplicationModuleName(qpqConfig);
|
|
18
|
+
}
|
|
19
|
+
export function resolveFilePath(fileStorageConfig, qpqConfig, drive, filepath) {
|
|
20
|
+
const service = resolveDriveServiceName(drive, qpqConfig);
|
|
13
21
|
const root = path.resolve(fileStorageConfig.storagePath, service, drive);
|
|
14
22
|
// Block absolute paths and null bytes outright
|
|
15
23
|
if (path.isAbsolute(filepath)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quidproquo-actionprocessor-node",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -33,17 +33,13 @@
|
|
|
33
33
|
"homepage": "https://github.com/joe-coady/quidproquo#readme",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@anthropic-ai/sdk": "^0.19.1",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"quidproquo-
|
|
39
|
-
"quidproquo-webserver": "0.0.262",
|
|
40
|
-
"uuid": "^9.0.0",
|
|
36
|
+
"quidproquo-actionprocessor-js": "0.1.0",
|
|
37
|
+
"quidproquo-core": "0.1.0",
|
|
38
|
+
"quidproquo-webserver": "0.1.0",
|
|
41
39
|
"uuidv7": "^1.0.1"
|
|
42
40
|
},
|
|
43
41
|
"devDependencies": {
|
|
44
|
-
"
|
|
45
|
-
"@types/uuid": "^9.0.0",
|
|
46
|
-
"quidproquo-tsconfig": "0.0.262",
|
|
42
|
+
"quidproquo-tsconfig": "0.1.0",
|
|
47
43
|
"typescript": "^5.8.2"
|
|
48
44
|
}
|
|
49
45
|
}
|
|
@@ -1,74 +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 () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
-
exports.getClaudeAiMessagesApiActionProcessor = void 0;
|
|
46
|
-
const quidproquo_core_1 = require("quidproquo-core");
|
|
47
|
-
const sdk_1 = __importStar(require("@anthropic-ai/sdk"));
|
|
48
|
-
const getProcessMessagesApi = (qpqConfig) => {
|
|
49
|
-
return (_a) => __awaiter(void 0, [_a], void 0, function* ({ body, apiKey }) {
|
|
50
|
-
const anthropic = new sdk_1.default({ apiKey });
|
|
51
|
-
try {
|
|
52
|
-
const msg = yield anthropic.messages.create(body);
|
|
53
|
-
return (0, quidproquo_core_1.actionResult)(msg);
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
console.log(error);
|
|
57
|
-
if (error instanceof sdk_1.AuthenticationError) {
|
|
58
|
-
return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.Unauthorized, 'Invalid API key.');
|
|
59
|
-
}
|
|
60
|
-
else if (error instanceof Error) {
|
|
61
|
-
return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.GenericError, error.message);
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
return (0, quidproquo_core_1.actionResultError)(quidproquo_core_1.ErrorTypeEnum.GenericError, 'An error occurred while processing your request.');
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
const getClaudeAiMessagesApiActionProcessor = (qpqConfig) => __awaiter(void 0, void 0, void 0, function* () {
|
|
70
|
-
return ({
|
|
71
|
-
[quidproquo_core_1.ClaudeAiActionType.MessagesApi]: getProcessMessagesApi(qpqConfig),
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
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,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.getConfigActionProcessor = void 0;
|
|
13
|
-
const getConfigGetApplicationInfoActionProcessor_1 = require("./getConfigGetApplicationInfoActionProcessor");
|
|
14
|
-
const getConfigActionProcessor = (qpqConfig, dynamicModuleLoader) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
-
return (Object.assign({}, (yield (0, getConfigGetApplicationInfoActionProcessor_1.getConfigGetApplicationInfoActionProcessor)(qpqConfig, dynamicModuleLoader))));
|
|
16
|
-
});
|
|
17
|
-
exports.getConfigActionProcessor = getConfigActionProcessor;
|
|
@@ -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,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;
|
|
@@ -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 (_a) => __awaiter(void 0, [_a], void 0, function* ({ errorStack, errorText, errorType }) {
|
|
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,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 (_a) => __awaiter(void 0, [_a], void 0, function* ({ msg, logLevel, data }) {
|
|
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;
|