quidproquo-core 0.0.12 → 0.0.14
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/actions/date/DateActionRequester.d.ts +6 -1
- package/lib/actions/date/DateActionRequester.js +8 -0
- package/lib/actions/event/EventActionRequester.d.ts +30 -4
- package/lib/actions/event/EventActionRequester.js +2 -2
- package/lib/actions/guid/GuidActionRequester.d.ts +6 -1
- package/lib/actions/math/MathActionRequester.d.ts +6 -1
- package/lib/actions/platform/PlatformActionRequester.d.ts +9 -1
- package/lib/actions/system/SystemActionRequester.d.ts +16 -2
- package/lib/actions/system/SystemActionRequester.js +13 -13
- package/lib/index.d.ts +2 -1
- package/lib/index.js +26 -5
- package/lib/qpqCoreUtils.d.ts +0 -6
- package/lib/qpqCoreUtils.js +0 -5
- package/lib/types/ActionPayload.d.ts +3 -0
- package/lib/types/ActionPayload.js +2 -0
- package/package.json +1 -1
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import DateActionTypeEnum from './DateActionTypeEnum';
|
|
2
|
+
import { ActionPayload } from '../../types/ActionPayload';
|
|
3
|
+
export interface DateNowActionPayload extends ActionPayload {
|
|
4
|
+
type: DateActionTypeEnum.Now;
|
|
5
|
+
}
|
|
6
|
+
export declare function askDateNow(): Generator<DateNowActionPayload, string, string>;
|
|
@@ -5,6 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.askDateNow = void 0;
|
|
7
7
|
const DateActionTypeEnum_1 = __importDefault(require("./DateActionTypeEnum"));
|
|
8
|
+
// Generator<
|
|
9
|
+
// Thing you are giving to QPQ,
|
|
10
|
+
// Thing the function returns to the regular logic,
|
|
11
|
+
// the thing QPQ gives us
|
|
12
|
+
// >
|
|
13
|
+
// We give DateNowActionPayload to QPQ
|
|
14
|
+
// QPQ gives us back a string ('2022-11-30T11:49:19.768Z')
|
|
15
|
+
// Then we return the same string back to the calling method
|
|
8
16
|
function* askDateNow() {
|
|
9
17
|
return yield { type: DateActionTypeEnum_1.default.Now };
|
|
10
18
|
}
|
|
@@ -1,4 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
1
|
+
import EventActionTypeEnum from './EventActionTypeEnum';
|
|
2
|
+
import { ActionPayload } from '../../types/ActionPayload';
|
|
3
|
+
export interface EventTransformEventParamsActionPayload extends ActionPayload {
|
|
4
|
+
type: EventActionTypeEnum.TransformEventParams;
|
|
5
|
+
payload: {
|
|
6
|
+
eventParams: any[];
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare function askEventTransformEventParams(...eventParams: any): Generator<EventTransformEventParamsActionPayload>;
|
|
10
|
+
export interface EventTransformResponseResultActionPayload extends ActionPayload {
|
|
11
|
+
type: EventActionTypeEnum.TransformResponseResult;
|
|
12
|
+
payload: {
|
|
13
|
+
response: any;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export declare function askEventTransformResponseResult(response: any): Generator<EventTransformResponseResultActionPayload>;
|
|
17
|
+
export interface EventMatchStoryActionPayload extends ActionPayload {
|
|
18
|
+
type: EventActionTypeEnum.MatchStory;
|
|
19
|
+
payload: {
|
|
20
|
+
transformedEventParams: any;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export declare function askEventMatchStory(transformedEventParams: any): Generator<EventMatchStoryActionPayload>;
|
|
24
|
+
export interface EventAutoRespondActionPayload extends ActionPayload {
|
|
25
|
+
type: EventActionTypeEnum.AutoRespond;
|
|
26
|
+
payload: {
|
|
27
|
+
transformedEventParams: any;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export declare function askEventAutoRespond(transformedEventParams: any): Generator<EventAutoRespondActionPayload>;
|
|
@@ -5,10 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.askEventAutoRespond = exports.askEventMatchStory = exports.askEventTransformResponseResult = exports.askEventTransformEventParams = void 0;
|
|
7
7
|
const EventActionTypeEnum_1 = __importDefault(require("./EventActionTypeEnum"));
|
|
8
|
-
function* askEventTransformEventParams(...
|
|
8
|
+
function* askEventTransformEventParams(...eventParams) {
|
|
9
9
|
return yield {
|
|
10
10
|
type: EventActionTypeEnum_1.default.TransformEventParams,
|
|
11
|
-
payload: {
|
|
11
|
+
payload: { eventParams },
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
14
|
exports.askEventTransformEventParams = askEventTransformEventParams;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import GuidActionTypeEnum from './GuidActionTypeEnum';
|
|
2
|
+
import { ActionPayload } from '../../types/ActionPayload';
|
|
3
|
+
export interface GuidNewActionPayload extends ActionPayload {
|
|
4
|
+
type: GuidActionTypeEnum.New;
|
|
5
|
+
}
|
|
6
|
+
export declare function askNewGuid(): Generator<GuidNewActionPayload, string, string>;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import MathActionTypeEnum from './MathActionTypeEnum';
|
|
2
|
+
import { ActionPayload } from '../../types/ActionPayload';
|
|
3
|
+
export interface MathRandomNumberActionPayload extends ActionPayload {
|
|
4
|
+
type: MathActionTypeEnum.RandomNumber;
|
|
5
|
+
}
|
|
6
|
+
export declare function askRandomNumber(): Generator<MathRandomNumberActionPayload, number, number>;
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import PlatformActionTypeEnum from './PlatformActionTypeEnum';
|
|
2
|
+
import { ActionPayload } from '../../types/ActionPayload';
|
|
3
|
+
export interface PlatformDelayActionPayload extends ActionPayload {
|
|
4
|
+
type: PlatformActionTypeEnum.Delay;
|
|
5
|
+
payload: {
|
|
6
|
+
timeMs: number;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare function askDelay(timeMs: number): Generator<PlatformDelayActionPayload, void, void>;
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import SystemActionTypeEnum from './SystemActionTypeEnum';
|
|
2
|
+
import { ActionPayload } from '../../types/ActionPayload';
|
|
3
|
+
export interface SystemBatchActionPayload extends ActionPayload {
|
|
4
|
+
type: SystemActionTypeEnum.Batch;
|
|
5
|
+
payload: {
|
|
6
|
+
actions: ActionPayload[];
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare function askBatch(actions: ActionPayload[]): Generator<SystemBatchActionPayload, any[], any[]>;
|
|
10
|
+
export interface SystemExecuteStoryActionPayload extends ActionPayload {
|
|
11
|
+
type: SystemActionTypeEnum.Batch;
|
|
12
|
+
payload: {
|
|
13
|
+
actions: ActionPayload[];
|
|
14
|
+
};
|
|
15
|
+
}
|
|
3
16
|
export declare function askExecuteStory(type: string, src: string, runtime: string, ...params: any): Generator<any, any, any>;
|
|
17
|
+
export declare function askParallel(stories: Array<any>): Generator<any, any, any>;
|
|
@@ -5,13 +5,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
6
|
};
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.
|
|
8
|
+
exports.askParallel = exports.askExecuteStory = exports.askBatch = void 0;
|
|
9
9
|
const SystemActionTypeEnum_1 = __importDefault(require("./SystemActionTypeEnum"));
|
|
10
10
|
// TODO: fix typing
|
|
11
11
|
function* askBatch(actions) {
|
|
12
12
|
return yield { type: SystemActionTypeEnum_1.default.Batch, payload: { actions } };
|
|
13
13
|
}
|
|
14
14
|
exports.askBatch = askBatch;
|
|
15
|
+
function* askExecuteStory(type, src, runtime, ...params) {
|
|
16
|
+
return yield {
|
|
17
|
+
type: SystemActionTypeEnum_1.default.ExecuteStory,
|
|
18
|
+
payload: {
|
|
19
|
+
type,
|
|
20
|
+
src,
|
|
21
|
+
runtime,
|
|
22
|
+
params,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
exports.askExecuteStory = askExecuteStory;
|
|
15
27
|
// TODO: Make this faster?
|
|
16
28
|
// TODO: Type support
|
|
17
29
|
// Runs n number of stories in parallel
|
|
@@ -43,15 +55,3 @@ function* askParallel(stories) {
|
|
|
43
55
|
}
|
|
44
56
|
}
|
|
45
57
|
exports.askParallel = askParallel;
|
|
46
|
-
function* askExecuteStory(type, src, runtime, ...params) {
|
|
47
|
-
return yield {
|
|
48
|
-
type: SystemActionTypeEnum_1.default.ExecuteStory,
|
|
49
|
-
payload: {
|
|
50
|
-
type,
|
|
51
|
-
src,
|
|
52
|
-
runtime,
|
|
53
|
-
params,
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
exports.askExecuteStory = askExecuteStory;
|
package/lib/index.d.ts
CHANGED
|
@@ -4,5 +4,6 @@ export { EventActionTypeEnum } from "./actions/event/EventActionTypeEnum";
|
|
|
4
4
|
export { MathActionTypeEnum } from "./actions/math/MathActionTypeEnum";
|
|
5
5
|
export { PlatformActionTypeEnum } from "./actions/platform/PlatformActionTypeEnum";
|
|
6
6
|
export { SystemActionTypeEnum } from "./actions/system/SystemActionTypeEnum";
|
|
7
|
+
export { defineAppName, AppNameQPQConfigSetting, } from "./config/settings/appName";
|
|
7
8
|
export { QPQCoreConfigSettingType, QPQConfigSetting, QPQConfig, } from "./config/QPQConfig";
|
|
8
|
-
export
|
|
9
|
+
export * as qpqCoreUtils from "./qpqCoreUtils";
|
package/lib/index.js
CHANGED
|
@@ -1,9 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
4
24
|
};
|
|
5
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.qpqCoreUtils = exports.QPQCoreConfigSettingType = exports.SystemActionTypeEnum = exports.PlatformActionTypeEnum = exports.MathActionTypeEnum = exports.EventActionTypeEnum = exports.GuidActionTypeEnum = exports.DateActionTypeEnum = void 0;
|
|
26
|
+
exports.qpqCoreUtils = exports.QPQCoreConfigSettingType = exports.defineAppName = exports.SystemActionTypeEnum = exports.PlatformActionTypeEnum = exports.MathActionTypeEnum = exports.EventActionTypeEnum = exports.GuidActionTypeEnum = exports.DateActionTypeEnum = void 0;
|
|
7
27
|
var DateActionTypeEnum_1 = require("./actions/date/DateActionTypeEnum");
|
|
8
28
|
Object.defineProperty(exports, "DateActionTypeEnum", { enumerable: true, get: function () { return DateActionTypeEnum_1.DateActionTypeEnum; } });
|
|
9
29
|
var GuidActionTypeEnum_1 = require("./actions/guid/GuidActionTypeEnum");
|
|
@@ -16,7 +36,8 @@ var PlatformActionTypeEnum_1 = require("./actions/platform/PlatformActionTypeEnu
|
|
|
16
36
|
Object.defineProperty(exports, "PlatformActionTypeEnum", { enumerable: true, get: function () { return PlatformActionTypeEnum_1.PlatformActionTypeEnum; } });
|
|
17
37
|
var SystemActionTypeEnum_1 = require("./actions/system/SystemActionTypeEnum");
|
|
18
38
|
Object.defineProperty(exports, "SystemActionTypeEnum", { enumerable: true, get: function () { return SystemActionTypeEnum_1.SystemActionTypeEnum; } });
|
|
39
|
+
var appName_1 = require("./config/settings/appName");
|
|
40
|
+
Object.defineProperty(exports, "defineAppName", { enumerable: true, get: function () { return appName_1.defineAppName; } });
|
|
19
41
|
var QPQConfig_1 = require("./config/QPQConfig");
|
|
20
42
|
Object.defineProperty(exports, "QPQCoreConfigSettingType", { enumerable: true, get: function () { return QPQConfig_1.QPQCoreConfigSettingType; } });
|
|
21
|
-
|
|
22
|
-
Object.defineProperty(exports, "qpqCoreUtils", { enumerable: true, get: function () { return __importDefault(qpqCoreUtils_1).default; } });
|
|
43
|
+
exports.qpqCoreUtils = __importStar(require("./qpqCoreUtils"));
|
package/lib/qpqCoreUtils.d.ts
CHANGED
|
@@ -2,9 +2,3 @@ import { QPQConfig, QPQConfigSetting } from "./config/QPQConfig";
|
|
|
2
2
|
export declare const getConfigSettings: <T extends QPQConfigSetting>(configs: QPQConfig, configSettingType: string) => T[];
|
|
3
3
|
export declare const getConfigSetting: <T extends QPQConfigSetting>(configs: QPQConfig, serviceInfrastructureConfigType: string) => T | undefined;
|
|
4
4
|
export declare const getAppName: (configs: QPQConfig) => string;
|
|
5
|
-
declare const _default: {
|
|
6
|
-
getConfigSettings: <T extends QPQConfigSetting>(configs: QPQConfig, configSettingType: string) => T[];
|
|
7
|
-
getConfigSetting: <T_1 extends QPQConfigSetting>(configs: QPQConfig, serviceInfrastructureConfigType: string) => T_1 | undefined;
|
|
8
|
-
getAppName: (configs: QPQConfig) => string;
|
|
9
|
-
};
|
|
10
|
-
export default _default;
|
package/lib/qpqCoreUtils.js
CHANGED