quidproquo-core 0.0.37 → 0.0.38
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/package.json +1 -4
- package/src/actions/config/ConfigActionType.ts +5 -0
- package/src/actions/config/ConfigGetParameterActionRequester.ts +6 -0
- package/{lib/actions/config/ConfigGetParameterActionTypes.d.ts → src/actions/config/ConfigGetParameterActionTypes.ts} +9 -3
- package/src/actions/config/ConfigGetParametersActionRequester.ts +8 -0
- package/{lib/actions/config/ConfigGetParametersActionTypes.d.ts → src/actions/config/ConfigGetParametersActionTypes.ts} +17 -5
- package/src/actions/config/ConfigGetSecretActionRequester.ts +6 -0
- package/{lib/actions/config/ConfigGetSecretActionTypes.d.ts → src/actions/config/ConfigGetSecretActionTypes.ts} +9 -3
- package/{lib/actions/config/index.d.ts → src/actions/config/index.ts} +3 -0
- package/src/actions/date/DateActionType.ts +3 -0
- package/src/actions/date/DateNowActionRequester.ts +6 -0
- package/{lib/actions/date/DateNowActionTypes.d.ts → src/actions/date/DateNowActionTypes.ts} +8 -3
- package/{lib/actions/date/index.d.ts → src/actions/date/index.ts} +1 -0
- package/src/actions/error/ErrorActionType.ts +3 -0
- package/src/actions/error/ErrorThrowErrorActionRequester.ts +14 -0
- package/{lib/actions/error/ErrorThrowErrorActionRequesterTypes.d.ts → src/actions/error/ErrorThrowErrorActionRequesterTypes.ts} +11 -5
- package/{lib/actions/error/index.d.ts → src/actions/error/index.ts} +1 -0
- package/src/actions/event/EventActionType.ts +6 -0
- package/src/actions/event/EventAutoRespondActionRequester.ts +11 -0
- package/{lib/actions/event/EventAutoRespondActionTypes.d.ts → src/actions/event/EventAutoRespondActionTypes.ts} +17 -11
- package/src/actions/event/EventMatchStoryActionRequester.ts +11 -0
- package/{lib/actions/event/EventMatchStoryActionTypes.d.ts → src/actions/event/EventMatchStoryActionTypes.ts} +30 -18
- package/src/actions/event/EventTransformEventParamsActionRequester.ts +12 -0
- package/src/actions/event/EventTransformEventParamsActionTypes.ts +24 -0
- package/src/actions/event/EventTransformResponseResultActionRequester.ts +12 -0
- package/src/actions/event/EventTransformResponseResultActionTypes.ts +25 -0
- package/{lib/actions/event/index.d.ts → src/actions/event/index.ts} +4 -0
- package/src/actions/file/FileActionType.ts +21 -0
- package/src/actions/file/FileDeleteActionRequester.ts +12 -0
- package/{lib/actions/file/FileDeleteActionTypes.d.ts → src/actions/file/FileDeleteActionTypes.ts} +10 -4
- package/src/actions/file/FileExistsActionRequester.ts +12 -0
- package/{lib/actions/file/FileExistsActionTypes.d.ts → src/actions/file/FileExistsActionTypes.ts} +10 -4
- package/src/actions/file/FileListDirectoryActionRequester.ts +42 -0
- package/src/actions/file/FileListDirectoryActionTypes.ts +26 -0
- package/src/actions/file/FileReadTextContentsActionRequester.ts +15 -0
- package/{lib/actions/file/FileReadTextContentsActionTypes.d.ts → src/actions/file/FileReadTextContentsActionTypes.ts} +18 -6
- package/src/actions/file/FileWriteTextContentsActionRequester.ts +17 -0
- package/{lib/actions/file/FileWriteTextContentsActionTypes.d.ts → src/actions/file/FileWriteTextContentsActionTypes.ts} +19 -7
- package/{lib/actions/file/index.d.ts → src/actions/file/index.ts} +5 -0
- package/src/actions/guid/GuidActionType.ts +3 -0
- package/src/actions/guid/GuidNewActionRequester.ts +6 -0
- package/{lib/actions/guid/GuidNewActionRequesterTypes.d.ts → src/actions/guid/GuidNewActionRequesterTypes.ts} +8 -3
- package/{lib/actions/guid/index.d.ts → src/actions/guid/index.ts} +1 -0
- package/{lib/actions/index.d.ts → src/actions/index.ts} +0 -0
- package/src/actions/log/LogActionType.ts +3 -0
- package/src/actions/log/LogCreateActionRequester.ts +18 -0
- package/{lib/actions/log/LogCreateActionTypes.d.ts → src/actions/log/LogCreateActionTypes.ts} +11 -5
- package/{lib/actions/log/index.d.ts → src/actions/log/index.ts} +1 -0
- package/src/actions/math/MathActionType.ts +3 -0
- package/src/actions/math/MathRandomNumberActionRequester.ts +6 -0
- package/{lib/actions/math/MathRandomNumberActionRequesterTypes.d.ts → src/actions/math/MathRandomNumberActionRequesterTypes.ts} +8 -3
- package/{lib/actions/math/index.d.ts → src/actions/math/index.ts} +1 -0
- package/src/actions/network/NetworkActionType.ts +27 -0
- package/src/actions/network/NetworkRequestActionRequester.ts +22 -0
- package/{lib/actions/network/NetworkRequestActionTypes.d.ts → src/actions/network/NetworkRequestActionTypes.ts} +23 -10
- package/{lib/actions/network/index.d.ts → src/actions/network/index.ts} +1 -0
- package/src/actions/platform/PlatformActionType.ts +3 -0
- package/src/actions/platform/PlatformDelayActionRequester.ts +6 -0
- package/{lib/actions/platform/PlatformDelayActionRequesterTypes.d.ts → src/actions/platform/PlatformDelayActionRequesterTypes.ts} +9 -3
- package/{lib/actions/platform/index.d.ts → src/actions/platform/index.ts} +1 -0
- package/src/actions/system/SystemActionType.ts +13 -0
- package/src/actions/system/SystemBatchActionRequester.ts +10 -0
- package/{lib/actions/system/SystemBatchActionTypes.d.ts → src/actions/system/SystemBatchActionTypes.ts} +23 -11
- package/src/actions/system/SystemExecuteStoryActionRequester.ts +19 -0
- package/src/actions/system/SystemExecuteStoryActionTypes.ts +27 -0
- package/src/actions/system/SystemRunParallelActionRequester.ts +40 -0
- package/src/actions/system/SystemRunParallelActionTypes.ts +9 -0
- package/{lib/actions/system/index.d.ts → src/actions/system/index.ts} +3 -0
- package/src/config/QPQConfig.ts +13 -0
- package/{lib/config/index.d.ts → src/config/index.ts} +0 -0
- package/src/config/settings/appName.ts +13 -0
- package/{lib/config/settings/index.d.ts → src/config/settings/index.ts} +0 -0
- package/src/config/settings/parameter.ts +15 -0
- package/src/config/settings/schedule.ts +27 -0
- package/src/config/settings/secret.ts +19 -0
- package/src/config/settings/storageDrive.ts +11 -0
- package/{lib/index.d.ts → src/index.ts} +6 -0
- package/src/logic/actionLogic.ts +34 -0
- package/src/qpqCoreUtils.ts +94 -0
- package/src/qpqRuntime.ts +145 -0
- package/src/stories/askProcessEvent.ts +30 -0
- package/{lib/stories/index.d.ts → src/stories/index.ts} +1 -1
- package/src/types/Action.ts +38 -0
- package/src/types/ErrorTypeEnum.ts +46 -0
- package/src/types/LogLevelEnum.ts +45 -0
- package/src/types/ScheduledEvent.ts +6 -0
- package/src/types/StorySession.ts +46 -0
- package/tsconfig.json +8 -0
- package/lib/actions/config/ConfigActionType.d.ts +0 -5
- package/lib/actions/config/ConfigActionType.js +0 -9
- package/lib/actions/config/ConfigGetParameterActionRequester.d.ts +0 -2
- package/lib/actions/config/ConfigGetParameterActionRequester.js +0 -8
- package/lib/actions/config/ConfigGetParameterActionTypes.js +0 -2
- package/lib/actions/config/ConfigGetParametersActionRequester.d.ts +0 -2
- package/lib/actions/config/ConfigGetParametersActionRequester.js +0 -8
- package/lib/actions/config/ConfigGetParametersActionTypes.js +0 -2
- package/lib/actions/config/ConfigGetSecretActionRequester.d.ts +0 -2
- package/lib/actions/config/ConfigGetSecretActionRequester.js +0 -8
- package/lib/actions/config/ConfigGetSecretActionTypes.js +0 -2
- package/lib/actions/config/index.js +0 -23
- package/lib/actions/date/DateActionType.d.ts +0 -3
- package/lib/actions/date/DateActionType.js +0 -7
- package/lib/actions/date/DateNowActionRequester.d.ts +0 -2
- package/lib/actions/date/DateNowActionRequester.js +0 -8
- package/lib/actions/date/DateNowActionTypes.js +0 -2
- package/lib/actions/date/index.js +0 -19
- package/lib/actions/error/ErrorActionType.d.ts +0 -3
- package/lib/actions/error/ErrorActionType.js +0 -7
- package/lib/actions/error/ErrorThrowErrorActionRequester.d.ts +0 -3
- package/lib/actions/error/ErrorThrowErrorActionRequester.js +0 -11
- package/lib/actions/error/ErrorThrowErrorActionRequesterTypes.js +0 -2
- package/lib/actions/error/index.js +0 -19
- package/lib/actions/event/EventActionType.d.ts +0 -6
- package/lib/actions/event/EventActionType.js +0 -10
- package/lib/actions/event/EventAutoRespondActionRequester.d.ts +0 -2
- package/lib/actions/event/EventAutoRespondActionRequester.js +0 -11
- package/lib/actions/event/EventAutoRespondActionTypes.js +0 -2
- package/lib/actions/event/EventMatchStoryActionRequester.d.ts +0 -2
- package/lib/actions/event/EventMatchStoryActionRequester.js +0 -11
- package/lib/actions/event/EventMatchStoryActionTypes.js +0 -2
- package/lib/actions/event/EventTransformEventParamsActionRequester.d.ts +0 -2
- package/lib/actions/event/EventTransformEventParamsActionRequester.js +0 -11
- package/lib/actions/event/EventTransformEventParamsActionTypes.d.ts +0 -11
- package/lib/actions/event/EventTransformEventParamsActionTypes.js +0 -2
- package/lib/actions/event/EventTransformResponseResultActionRequester.d.ts +0 -2
- package/lib/actions/event/EventTransformResponseResultActionRequester.js +0 -11
- package/lib/actions/event/EventTransformResponseResultActionTypes.d.ts +0 -12
- package/lib/actions/event/EventTransformResponseResultActionTypes.js +0 -2
- package/lib/actions/event/index.js +0 -25
- package/lib/actions/file/FileActionType.d.ts +0 -18
- package/lib/actions/file/FileActionType.js +0 -12
- package/lib/actions/file/FileDeleteActionRequester.d.ts +0 -2
- package/lib/actions/file/FileDeleteActionRequester.js +0 -14
- package/lib/actions/file/FileDeleteActionTypes.js +0 -2
- package/lib/actions/file/FileExistsActionRequester.d.ts +0 -2
- package/lib/actions/file/FileExistsActionRequester.js +0 -14
- package/lib/actions/file/FileExistsActionTypes.js +0 -2
- package/lib/actions/file/FileListDirectoryActionRequester.d.ts +0 -5
- package/lib/actions/file/FileListDirectoryActionRequester.js +0 -30
- package/lib/actions/file/FileListDirectoryActionTypes.d.ts +0 -14
- package/lib/actions/file/FileListDirectoryActionTypes.js +0 -2
- package/lib/actions/file/FileReadTextContentsActionRequester.d.ts +0 -2
- package/lib/actions/file/FileReadTextContentsActionRequester.js +0 -14
- package/lib/actions/file/FileReadTextContentsActionTypes.js +0 -2
- package/lib/actions/file/FileWriteTextContentsActionRequester.d.ts +0 -2
- package/lib/actions/file/FileWriteTextContentsActionRequester.js +0 -15
- package/lib/actions/file/FileWriteTextContentsActionTypes.js +0 -2
- package/lib/actions/file/index.js +0 -27
- package/lib/actions/guid/GuidActionType.d.ts +0 -3
- package/lib/actions/guid/GuidActionType.js +0 -7
- package/lib/actions/guid/GuidNewActionRequester.d.ts +0 -2
- package/lib/actions/guid/GuidNewActionRequester.js +0 -8
- package/lib/actions/guid/GuidNewActionRequesterTypes.js +0 -2
- package/lib/actions/guid/index.js +0 -19
- package/lib/actions/index.js +0 -27
- package/lib/actions/log/LogActionType.d.ts +0 -3
- package/lib/actions/log/LogActionType.js +0 -7
- package/lib/actions/log/LogCreateActionRequester.d.ts +0 -3
- package/lib/actions/log/LogCreateActionRequester.js +0 -15
- package/lib/actions/log/LogCreateActionTypes.js +0 -2
- package/lib/actions/log/index.js +0 -19
- package/lib/actions/math/MathActionType.d.ts +0 -3
- package/lib/actions/math/MathActionType.js +0 -7
- package/lib/actions/math/MathRandomNumberActionRequester.d.ts +0 -2
- package/lib/actions/math/MathRandomNumberActionRequester.js +0 -8
- package/lib/actions/math/MathRandomNumberActionRequesterTypes.js +0 -2
- package/lib/actions/math/index.js +0 -19
- package/lib/actions/network/NetworkActionType.d.ts +0 -16
- package/lib/actions/network/NetworkActionType.js +0 -7
- package/lib/actions/network/NetworkRequestActionRequester.d.ts +0 -3
- package/lib/actions/network/NetworkRequestActionRequester.js +0 -18
- package/lib/actions/network/NetworkRequestActionTypes.js +0 -2
- package/lib/actions/network/index.js +0 -19
- package/lib/actions/platform/PlatformActionType.d.ts +0 -3
- package/lib/actions/platform/PlatformActionType.js +0 -7
- package/lib/actions/platform/PlatformDelayActionRequester.d.ts +0 -2
- package/lib/actions/platform/PlatformDelayActionRequester.js +0 -8
- package/lib/actions/platform/PlatformDelayActionRequesterTypes.js +0 -2
- package/lib/actions/platform/index.js +0 -19
- package/lib/actions/system/SystemActionType.d.ts +0 -4
- package/lib/actions/system/SystemActionType.js +0 -15
- package/lib/actions/system/SystemBatchActionRequester.d.ts +0 -3
- package/lib/actions/system/SystemBatchActionRequester.js +0 -9
- package/lib/actions/system/SystemBatchActionTypes.js +0 -2
- package/lib/actions/system/SystemExecuteStoryActionRequester.d.ts +0 -2
- package/lib/actions/system/SystemExecuteStoryActionRequester.js +0 -16
- package/lib/actions/system/SystemExecuteStoryActionTypes.d.ts +0 -14
- package/lib/actions/system/SystemExecuteStoryActionTypes.js +0 -2
- package/lib/actions/system/SystemRunParallelActionRequester.d.ts +0 -2
- package/lib/actions/system/SystemRunParallelActionRequester.js +0 -37
- package/lib/actions/system/SystemRunParallelActionTypes.d.ts +0 -1
- package/lib/actions/system/SystemRunParallelActionTypes.js +0 -2
- package/lib/actions/system/index.js +0 -23
- package/lib/config/QPQConfig.d.ts +0 -11
- package/lib/config/QPQConfig.js +0 -11
- package/lib/config/index.js +0 -18
- package/lib/config/settings/appName.d.ts +0 -6
- package/lib/config/settings/appName.js +0 -10
- package/lib/config/settings/index.js +0 -21
- package/lib/config/settings/parameter.d.ts +0 -7
- package/lib/config/settings/parameter.js +0 -11
- package/lib/config/settings/schedule.d.ts +0 -11
- package/lib/config/settings/schedule.js +0 -16
- package/lib/config/settings/secret.d.ts +0 -7
- package/lib/config/settings/secret.js +0 -11
- package/lib/config/settings/storageDrive.d.ts +0 -5
- package/lib/config/settings/storageDrive.js +0 -9
- package/lib/index.js +0 -41
- package/lib/logic/actionLogic.d.ts +0 -8
- package/lib/logic/actionLogic.js +0 -30
- package/lib/qpqCoreUtils.d.ts +0 -12
- package/lib/qpqCoreUtils.js +0 -58
- package/lib/qpqRuntime.d.ts +0 -3
- package/lib/qpqRuntime.js +0 -88
- package/lib/stories/askProcessEvent.d.ts +0 -1
- package/lib/stories/askProcessEvent.js +0 -22
- package/lib/stories/index.js +0 -17
- package/lib/types/Action.d.ts +0 -12
- package/lib/types/Action.js +0 -2
- package/lib/types/ErrorTypeEnum.d.ts +0 -19
- package/lib/types/ErrorTypeEnum.js +0 -33
- package/lib/types/LogLevelEnum.d.ts +0 -8
- package/lib/types/LogLevelEnum.js +0 -44
- package/lib/types/ScheduledEvent.d.ts +0 -5
- package/lib/types/ScheduledEvent.js +0 -2
- package/lib/types/StorySession.d.ts +0 -28
- package/lib/types/StorySession.js +0 -2
package/package.json
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quidproquo-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.38",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.js",
|
|
7
|
-
"files": [
|
|
8
|
-
"lib/**/*"
|
|
9
|
-
],
|
|
10
7
|
"scripts": {
|
|
11
8
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
9
|
"clean": "npx rimraf lib",
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ConfigGetParameterActionRequester } from './ConfigGetParameterActionTypes';
|
|
2
|
+
import { ConfigActionType } from './ConfigActionType';
|
|
3
|
+
|
|
4
|
+
export function* askConfigGetParameter(parameterName: string): ConfigGetParameterActionRequester {
|
|
5
|
+
return yield { type: ConfigActionType.GetParameter, payload: { parameterName } };
|
|
6
|
+
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
2
|
import { ConfigActionType } from './ConfigActionType';
|
|
3
|
+
|
|
4
|
+
// Payload
|
|
3
5
|
export interface ConfigGetParameterActionPayload {
|
|
4
|
-
|
|
6
|
+
parameterName: string;
|
|
5
7
|
}
|
|
8
|
+
|
|
9
|
+
// Action
|
|
6
10
|
export interface ConfigGetParameterAction extends Action<ConfigGetParameterActionPayload> {
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
type: ConfigActionType.GetParameter;
|
|
12
|
+
payload: ConfigGetParameterActionPayload;
|
|
9
13
|
}
|
|
14
|
+
|
|
15
|
+
// Function Types
|
|
10
16
|
export type ConfigGetParameterActionProcessor = ActionProcessor<ConfigGetParameterAction, string>;
|
|
11
17
|
export type ConfigGetParameterActionRequester = ActionRequester<ConfigGetParameterAction, string>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ConfigGetParametersActionRequester } from './ConfigGetParametersActionTypes';
|
|
2
|
+
import { ConfigActionType } from './ConfigActionType';
|
|
3
|
+
|
|
4
|
+
export function* askConfigGetParameters(
|
|
5
|
+
parameterNames: string[],
|
|
6
|
+
): ConfigGetParametersActionRequester {
|
|
7
|
+
return yield { type: ConfigActionType.GetParameters, payload: { parameterNames } };
|
|
8
|
+
}
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
2
|
import { ConfigActionType } from './ConfigActionType';
|
|
3
|
+
|
|
4
|
+
// Payload
|
|
3
5
|
export interface ConfigGetParametersActionPayload {
|
|
4
|
-
|
|
6
|
+
parameterNames: string[];
|
|
5
7
|
}
|
|
8
|
+
|
|
9
|
+
// Action
|
|
6
10
|
export interface ConfigGetParametersAction extends Action<ConfigGetParametersActionPayload> {
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
type: ConfigActionType.GetParameters;
|
|
12
|
+
payload: ConfigGetParametersActionPayload;
|
|
9
13
|
}
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
|
|
15
|
+
// Function Types
|
|
16
|
+
export type ConfigGetParametersActionProcessor = ActionProcessor<
|
|
17
|
+
ConfigGetParametersAction,
|
|
18
|
+
string[]
|
|
19
|
+
>;
|
|
20
|
+
export type ConfigGetParametersActionRequester = ActionRequester<
|
|
21
|
+
ConfigGetParametersAction,
|
|
22
|
+
string[]
|
|
23
|
+
>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ConfigGetSecretActionRequester } from './ConfigGetSecretActionTypes';
|
|
2
|
+
import { ConfigActionType } from './ConfigActionType';
|
|
3
|
+
|
|
4
|
+
export function* askConfigGetSecret(secretName: string): ConfigGetSecretActionRequester {
|
|
5
|
+
return yield { type: ConfigActionType.GetSecret, payload: { secretName } };
|
|
6
|
+
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
2
|
import { ConfigActionType } from './ConfigActionType';
|
|
3
|
+
|
|
4
|
+
// Payload
|
|
3
5
|
export interface ConfigGetSecretActionPayload {
|
|
4
|
-
|
|
6
|
+
secretName: string;
|
|
5
7
|
}
|
|
8
|
+
|
|
9
|
+
// Action
|
|
6
10
|
export interface ConfigGetSecretAction extends Action<ConfigGetSecretActionPayload> {
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
type: ConfigActionType.GetSecret;
|
|
12
|
+
payload: ConfigGetSecretActionPayload;
|
|
9
13
|
}
|
|
14
|
+
|
|
15
|
+
// Function Types
|
|
10
16
|
export type ConfigGetSecretActionProcessor = ActionProcessor<ConfigGetSecretAction, string>;
|
|
11
17
|
export type ConfigGetSecretActionRequester = ActionRequester<ConfigGetSecretAction, string>;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export * from './ConfigActionType';
|
|
2
|
+
|
|
2
3
|
export * from './ConfigGetParameterActionRequester';
|
|
3
4
|
export * from './ConfigGetParameterActionTypes';
|
|
5
|
+
|
|
4
6
|
export * from './ConfigGetParametersActionRequester';
|
|
5
7
|
export * from './ConfigGetParametersActionTypes';
|
|
8
|
+
|
|
6
9
|
export * from './ConfigGetSecretActionRequester';
|
|
7
10
|
export * from './ConfigGetSecretActionTypes';
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
2
|
import { DateActionType } from './DateActionType';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
|
|
4
|
+
// Payload
|
|
5
|
+
export interface DateNowActionPayload {}
|
|
6
|
+
|
|
7
|
+
// Action
|
|
5
8
|
export interface DateNowAction extends Action<DateNowActionPayload> {
|
|
6
|
-
|
|
9
|
+
type: DateActionType.Now;
|
|
7
10
|
}
|
|
11
|
+
|
|
12
|
+
// Function Types
|
|
8
13
|
export type DateNowActionProcessor = ActionProcessor<DateNowAction, string>;
|
|
9
14
|
export type DateNowActionRequester = ActionRequester<DateNowAction, string>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ErrorThrowErrorActionRequester } from './ErrorThrowErrorActionRequesterTypes';
|
|
2
|
+
import { ErrorActionType } from './ErrorActionType';
|
|
3
|
+
import { ErrorTypeEnum } from '../../types/ErrorTypeEnum';
|
|
4
|
+
|
|
5
|
+
export function* askThrowError(
|
|
6
|
+
errorType: ErrorTypeEnum,
|
|
7
|
+
errorText: string,
|
|
8
|
+
errorStack?: string,
|
|
9
|
+
): ErrorThrowErrorActionRequester {
|
|
10
|
+
yield {
|
|
11
|
+
type: ErrorActionType.ThrowError,
|
|
12
|
+
payload: { errorType, errorText, errorStack },
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { ErrorActionType } from './ErrorActionType';
|
|
2
2
|
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
3
3
|
import { ErrorTypeEnum } from '../../types/ErrorTypeEnum';
|
|
4
|
+
|
|
5
|
+
// Payload
|
|
4
6
|
export interface ErrorThrowErrorActionPayload {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
errorType: ErrorTypeEnum;
|
|
8
|
+
errorText: string;
|
|
9
|
+
errorStack?: string;
|
|
8
10
|
}
|
|
11
|
+
|
|
12
|
+
// Action
|
|
9
13
|
export interface ErrorThrowErrorAction extends Action<ErrorThrowErrorActionPayload> {
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
type: ErrorActionType.ThrowError;
|
|
15
|
+
payload: ErrorThrowErrorActionPayload;
|
|
12
16
|
}
|
|
17
|
+
|
|
18
|
+
// Functions
|
|
13
19
|
export type ErrorThrowErrorActionProcessor = ActionProcessor<ErrorThrowErrorAction, void>;
|
|
14
20
|
export type ErrorThrowErrorActionRequester = ActionRequester<ErrorThrowErrorAction, void>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export enum EventActionType {
|
|
2
|
+
TransformEventParams = '@quidproquo-core/event/TransformEventParams',
|
|
3
|
+
TransformResponseResult = '@quidproquo-core/event/TransformResponseResult',
|
|
4
|
+
AutoRespond = '@quidproquo-core/event/AutoRespond',
|
|
5
|
+
MatchStory = '@quidproquo-core/event/MatchStory',
|
|
6
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EventAutoRespondActionRequester } from './EventAutoRespondActionTypes';
|
|
2
|
+
import { EventActionType } from './EventActionType';
|
|
3
|
+
|
|
4
|
+
export function* askEventAutoRespond<T>(
|
|
5
|
+
transformedEventParams: any,
|
|
6
|
+
): EventAutoRespondActionRequester<T> {
|
|
7
|
+
return yield {
|
|
8
|
+
type: EventActionType.AutoRespond,
|
|
9
|
+
payload: { transformedEventParams },
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
|
-
import { EventActionType } from './EventActionType';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
|
|
1
|
+
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
|
+
import { EventActionType } from './EventActionType';
|
|
3
|
+
|
|
4
|
+
// payload
|
|
5
|
+
export interface EventAutoRespondActionPayload<T> {
|
|
6
|
+
transformedEventParams: T;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// action
|
|
10
|
+
export interface EventAutoRespondAction<T> extends Action<EventAutoRespondActionPayload<T>> {
|
|
11
|
+
type: EventActionType.AutoRespond;
|
|
12
|
+
payload: EventAutoRespondActionPayload<T>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Functions
|
|
16
|
+
export type EventAutoRespondActionProcessor<T> = ActionProcessor<EventAutoRespondAction<T>, any>;
|
|
17
|
+
export type EventAutoRespondActionRequester<T> = ActionRequester<EventAutoRespondAction<T>, any>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EventActionType } from './EventActionType';
|
|
2
|
+
|
|
3
|
+
import { EventMatchStoryActionRequester } from './EventMatchStoryActionTypes';
|
|
4
|
+
export function* askEventMatchStory<T>(
|
|
5
|
+
transformedEventParams: any,
|
|
6
|
+
): EventMatchStoryActionRequester<T> {
|
|
7
|
+
return yield {
|
|
8
|
+
type: EventActionType.MatchStory,
|
|
9
|
+
payload: { transformedEventParams },
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -1,18 +1,30 @@
|
|
|
1
|
-
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
|
-
import { EventActionType } from './EventActionType';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export
|
|
18
|
-
|
|
1
|
+
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
|
+
import { EventActionType } from './EventActionType';
|
|
3
|
+
|
|
4
|
+
// Custom return result
|
|
5
|
+
export type MatchStoryResult = {
|
|
6
|
+
src?: string;
|
|
7
|
+
runtime?: string;
|
|
8
|
+
options?: { [key: string]: string };
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// Payload
|
|
12
|
+
export interface EventMatchStoryActionPayload<T> {
|
|
13
|
+
transformedEventParams: T;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Action
|
|
17
|
+
export interface EventMatchStoryAction<T> extends Action<EventMatchStoryActionPayload<T>> {
|
|
18
|
+
type: EventActionType.MatchStory;
|
|
19
|
+
payload: EventMatchStoryActionPayload<T>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Functions
|
|
23
|
+
export type EventMatchStoryActionProcessor<T> = ActionProcessor<
|
|
24
|
+
EventMatchStoryAction<T>,
|
|
25
|
+
MatchStoryResult
|
|
26
|
+
>;
|
|
27
|
+
export type EventMatchStoryActionRequester<T> = ActionRequester<
|
|
28
|
+
EventMatchStoryAction<T>,
|
|
29
|
+
MatchStoryResult
|
|
30
|
+
>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EventActionType } from './EventActionType';
|
|
2
|
+
|
|
3
|
+
import { EventTransformEventParamsActionRequester } from './EventTransformEventParamsActionTypes';
|
|
4
|
+
|
|
5
|
+
export function* askEventTransformEventParams<T extends Array<unknown>, TRes>(
|
|
6
|
+
...eventParams: T
|
|
7
|
+
): EventTransformEventParamsActionRequester<T, TRes> {
|
|
8
|
+
return yield {
|
|
9
|
+
type: EventActionType.TransformEventParams,
|
|
10
|
+
payload: { eventParams },
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
|
+
import { EventActionType } from './EventActionType';
|
|
3
|
+
|
|
4
|
+
// Payload
|
|
5
|
+
export interface EventTransformEventParamsActionPayload<T extends Array<unknown>> {
|
|
6
|
+
eventParams: T;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// Action
|
|
10
|
+
export interface EventTransformEventParamsAction<T extends Array<unknown>>
|
|
11
|
+
extends Action<EventTransformEventParamsActionPayload<T>> {
|
|
12
|
+
type: EventActionType.TransformEventParams;
|
|
13
|
+
payload: EventTransformEventParamsActionPayload<T>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Functions
|
|
17
|
+
export type EventTransformEventParamsActionProcessor<
|
|
18
|
+
T extends Array<unknown>,
|
|
19
|
+
TRes,
|
|
20
|
+
> = ActionProcessor<EventTransformEventParamsAction<T>, TRes>;
|
|
21
|
+
export type EventTransformEventParamsActionRequester<
|
|
22
|
+
T extends Array<unknown>,
|
|
23
|
+
TRes,
|
|
24
|
+
> = ActionRequester<EventTransformEventParamsAction<T>, TRes>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EventActionType } from './EventActionType';
|
|
2
|
+
import { EventTransformResponseResultActionRequester } from './EventTransformResponseResultActionTypes';
|
|
3
|
+
|
|
4
|
+
export function* askEventTransformResponseResult<TOutputRes, TInputRes, TTransformedEventParams>(
|
|
5
|
+
response: TInputRes,
|
|
6
|
+
transformedEventParams: TTransformedEventParams,
|
|
7
|
+
): EventTransformResponseResultActionRequester<TOutputRes> {
|
|
8
|
+
return yield {
|
|
9
|
+
type: EventActionType.TransformResponseResult,
|
|
10
|
+
payload: { response, transformedEventParams },
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
|
+
import { EventActionType } from './EventActionType';
|
|
3
|
+
|
|
4
|
+
// Payload
|
|
5
|
+
export interface EventTransformResponseResultActionPayload {
|
|
6
|
+
response: any;
|
|
7
|
+
transformedEventParams: any;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Action
|
|
11
|
+
export interface EventTransformResponseResultAction
|
|
12
|
+
extends Action<EventTransformResponseResultActionPayload> {
|
|
13
|
+
type: EventActionType.TransformResponseResult;
|
|
14
|
+
payload: EventTransformResponseResultActionPayload;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Functions
|
|
18
|
+
export type EventTransformResponseResultActionProcessor<TRes> = ActionProcessor<
|
|
19
|
+
EventTransformResponseResultAction,
|
|
20
|
+
TRes
|
|
21
|
+
>;
|
|
22
|
+
export type EventTransformResponseResultActionRequester<TRes> = ActionRequester<
|
|
23
|
+
EventTransformResponseResultAction,
|
|
24
|
+
TRes
|
|
25
|
+
>;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
export * from './EventActionType';
|
|
2
|
+
|
|
2
3
|
export * from './EventAutoRespondActionRequester';
|
|
3
4
|
export * from './EventAutoRespondActionTypes';
|
|
5
|
+
|
|
4
6
|
export * from './EventMatchStoryActionRequester';
|
|
5
7
|
export * from './EventMatchStoryActionTypes';
|
|
8
|
+
|
|
6
9
|
export * from './EventTransformEventParamsActionRequester';
|
|
7
10
|
export * from './EventTransformEventParamsActionTypes';
|
|
11
|
+
|
|
8
12
|
export * from './EventTransformResponseResultActionRequester';
|
|
9
13
|
export * from './EventTransformResponseResultActionTypes';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export enum FileActionType {
|
|
2
|
+
ReadTextContents = '@quidproquo-core/File/ReadTextContents',
|
|
3
|
+
WriteTextContents = '@quidproquo-core/File/WriteTextContents',
|
|
4
|
+
ListDirectory = '@quidproquo-core/File/ListDirectory',
|
|
5
|
+
Exists = '@quidproquo-core/File/Exists',
|
|
6
|
+
Delete = '@quidproquo-core/File/Delete',
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const filePathDelimiter = `/`;
|
|
10
|
+
|
|
11
|
+
export interface FileInfo {
|
|
12
|
+
filepath: string;
|
|
13
|
+
drive: string;
|
|
14
|
+
isDir: boolean;
|
|
15
|
+
hashMd5?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface DirectoryList {
|
|
19
|
+
fileInfos: FileInfo[];
|
|
20
|
+
pageToken?: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FileDeleteActionRequester } from './FileDeleteActionTypes';
|
|
2
|
+
import { FileActionType } from './FileActionType';
|
|
3
|
+
|
|
4
|
+
export function* askFileDelete(drive: string, filepaths: string[]): FileDeleteActionRequester {
|
|
5
|
+
return yield {
|
|
6
|
+
type: FileActionType.Delete,
|
|
7
|
+
payload: {
|
|
8
|
+
drive,
|
|
9
|
+
filepaths,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
}
|
package/{lib/actions/file/FileDeleteActionTypes.d.ts → src/actions/file/FileDeleteActionTypes.ts}
RENAMED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
2
|
import { FileActionType } from './FileActionType';
|
|
3
|
+
|
|
4
|
+
// Payload
|
|
3
5
|
export interface FileDeleteActionPayload {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
drive: string;
|
|
7
|
+
filepaths: string[];
|
|
6
8
|
}
|
|
9
|
+
|
|
10
|
+
// Action
|
|
7
11
|
export interface FileDeleteAction extends Action<FileDeleteActionPayload> {
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
type: FileActionType.Delete;
|
|
13
|
+
payload: FileDeleteActionPayload;
|
|
10
14
|
}
|
|
15
|
+
|
|
16
|
+
// Function Types
|
|
11
17
|
export type FileDeleteActionProcessor = ActionProcessor<FileDeleteAction, string[]>;
|
|
12
18
|
export type FileDeleteActionRequester = ActionRequester<FileDeleteAction, string[]>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FileExistsActionRequester } from './FileExistsActionTypes';
|
|
2
|
+
import { FileActionType } from './FileActionType';
|
|
3
|
+
|
|
4
|
+
export function* askFileExists(drive: string, filepath: string): FileExistsActionRequester {
|
|
5
|
+
return yield {
|
|
6
|
+
type: FileActionType.Exists,
|
|
7
|
+
payload: {
|
|
8
|
+
drive,
|
|
9
|
+
filepath,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
}
|
package/{lib/actions/file/FileExistsActionTypes.d.ts → src/actions/file/FileExistsActionTypes.ts}
RENAMED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
2
|
import { FileActionType } from './FileActionType';
|
|
3
|
+
|
|
4
|
+
// Payload
|
|
3
5
|
export interface FileExistsActionPayload {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
drive: string;
|
|
7
|
+
filepath: string;
|
|
6
8
|
}
|
|
9
|
+
|
|
10
|
+
// Action
|
|
7
11
|
export interface FileExistsAction extends Action<FileExistsActionPayload> {
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
type: FileActionType.Exists;
|
|
13
|
+
payload: FileExistsActionPayload;
|
|
10
14
|
}
|
|
15
|
+
|
|
16
|
+
// Function Types
|
|
11
17
|
export type FileExistsActionProcessor = ActionProcessor<FileExistsAction, boolean>;
|
|
12
18
|
export type FileExistsActionRequester = ActionRequester<FileExistsAction, boolean>;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { FileListDirectoryActionRequester } from './FileListDirectoryActionTypes';
|
|
2
|
+
import { FileActionType, FileInfo } from './FileActionType';
|
|
3
|
+
import { AskResponse } from '../../types/StorySession';
|
|
4
|
+
|
|
5
|
+
export function* askFileListDirectory(
|
|
6
|
+
drive: string,
|
|
7
|
+
folderPath: string,
|
|
8
|
+
maxFiles: number = 1000,
|
|
9
|
+
pageToken?: string,
|
|
10
|
+
): FileListDirectoryActionRequester {
|
|
11
|
+
return yield {
|
|
12
|
+
type: FileActionType.ListDirectory,
|
|
13
|
+
payload: {
|
|
14
|
+
drive,
|
|
15
|
+
folderPath,
|
|
16
|
+
pageToken,
|
|
17
|
+
maxFiles,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function* askFileListAllDirectory(
|
|
23
|
+
drive: string,
|
|
24
|
+
folderPath: string,
|
|
25
|
+
): AskResponse<FileInfo[]> {
|
|
26
|
+
var pageToken: string | undefined;
|
|
27
|
+
let fileInfos: FileInfo[] = [];
|
|
28
|
+
|
|
29
|
+
while (true) {
|
|
30
|
+
const directoryInfo = yield* askFileListDirectory(drive, folderPath, 1000, pageToken);
|
|
31
|
+
|
|
32
|
+
fileInfos = [...fileInfos, ...directoryInfo.fileInfos];
|
|
33
|
+
|
|
34
|
+
if (!directoryInfo.pageToken) {
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
pageToken = directoryInfo.pageToken;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return fileInfos;
|
|
42
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
|
+
import { FileActionType, DirectoryList } from './FileActionType';
|
|
3
|
+
|
|
4
|
+
// Payload
|
|
5
|
+
export interface FileListDirectoryActionPayload {
|
|
6
|
+
drive: string;
|
|
7
|
+
folderPath: string;
|
|
8
|
+
maxFiles: number;
|
|
9
|
+
pageToken?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Action
|
|
13
|
+
export interface FileListDirectoryAction extends Action<FileListDirectoryActionPayload> {
|
|
14
|
+
type: FileActionType.ListDirectory;
|
|
15
|
+
payload: FileListDirectoryActionPayload;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Function Types
|
|
19
|
+
export type FileListDirectoryActionProcessor = ActionProcessor<
|
|
20
|
+
FileListDirectoryAction,
|
|
21
|
+
DirectoryList
|
|
22
|
+
>;
|
|
23
|
+
export type FileListDirectoryActionRequester = ActionRequester<
|
|
24
|
+
FileListDirectoryAction,
|
|
25
|
+
DirectoryList
|
|
26
|
+
>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FileReadTextContentsActionRequester } from './FileReadTextContentsActionTypes';
|
|
2
|
+
import { FileActionType } from './FileActionType';
|
|
3
|
+
|
|
4
|
+
export function* askFileReadTextContents(
|
|
5
|
+
drive: string,
|
|
6
|
+
filepath: string,
|
|
7
|
+
): FileReadTextContentsActionRequester {
|
|
8
|
+
return yield {
|
|
9
|
+
type: FileActionType.ReadTextContents,
|
|
10
|
+
payload: {
|
|
11
|
+
drive,
|
|
12
|
+
filepath,
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
2
|
import { FileActionType } from './FileActionType';
|
|
3
|
+
|
|
4
|
+
// Payload
|
|
3
5
|
export interface FileReadTextContentsActionPayload {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
drive: string;
|
|
7
|
+
filepath: string;
|
|
6
8
|
}
|
|
9
|
+
|
|
10
|
+
// Action
|
|
7
11
|
export interface FileReadTextContentsAction extends Action<FileReadTextContentsActionPayload> {
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
type: FileActionType.ReadTextContents;
|
|
13
|
+
payload: FileReadTextContentsActionPayload;
|
|
10
14
|
}
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
|
|
16
|
+
// Function Types
|
|
17
|
+
export type FileReadTextContentsActionProcessor = ActionProcessor<
|
|
18
|
+
FileReadTextContentsAction,
|
|
19
|
+
string
|
|
20
|
+
>;
|
|
21
|
+
export type FileReadTextContentsActionRequester = ActionRequester<
|
|
22
|
+
FileReadTextContentsAction,
|
|
23
|
+
string
|
|
24
|
+
>;
|