quidproquo-core 0.0.161 → 0.0.162
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/actions/keyValueStore/KeyValueStoreQueryActionRequester.d.ts +2 -2
- package/lib/commonjs/actions/keyValueStore/KeyValueStoreQueryActionRequester.js +2 -3
- package/lib/commonjs/actions/keyValueStore/KeyValueStoreQueryActionTypes.d.ts +5 -2
- package/lib/commonjs/actions/system/SystemBatchActionRequester.js +6 -0
- package/lib/commonjs/actions/system/SystemBatchActionTypes.d.ts +2 -2
- package/lib/commonjs/index.d.ts +1 -0
- package/lib/commonjs/index.js +1 -0
- package/lib/commonjs/stories/system/askRunParallel.js +0 -4
- package/lib/commonjs/types/BoundLogicStory.d.ts +2 -0
- package/lib/commonjs/types/BoundLogicStory.js +2 -0
- package/lib/commonjs/types/UnboundLogicStory.d.ts +2 -0
- package/lib/commonjs/types/UnboundLogicStory.js +2 -0
- package/lib/commonjs/types/index.d.ts +2 -0
- package/lib/commonjs/types/index.js +2 -0
- package/lib/commonjs/utils/functions/bindApi.d.ts +4 -0
- package/lib/commonjs/utils/functions/bindApi.js +13 -0
- package/lib/commonjs/utils/functions/bindApiFunction.d.ts +2 -0
- package/lib/commonjs/utils/functions/bindApiFunction.js +9 -0
- package/lib/commonjs/utils/functions/index.d.ts +2 -0
- package/lib/commonjs/utils/functions/index.js +18 -0
- package/lib/commonjs/utils/index.d.ts +1 -0
- package/lib/commonjs/utils/index.js +17 -0
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { KeyValueStoreQueryActionRequester } from './KeyValueStoreQueryActionTypes';
|
|
1
|
+
import { KeyValueStoreQueryActionRequester, KeyValueStoreQueryOptions } from './KeyValueStoreQueryActionTypes';
|
|
2
2
|
import { KvsQueryOperation } from './types';
|
|
3
|
-
export declare function askKeyValueStoreQuery<KvsItem>(keyValueStoreName: string, keyCondition: KvsQueryOperation,
|
|
3
|
+
export declare function askKeyValueStoreQuery<KvsItem>(keyValueStoreName: string, keyCondition: KvsQueryOperation, options?: KeyValueStoreQueryOptions): KeyValueStoreQueryActionRequester<KvsItem>;
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.askKeyValueStoreQuery = void 0;
|
|
4
4
|
const KeyValueStoreActionType_1 = require("./KeyValueStoreActionType");
|
|
5
|
-
function* askKeyValueStoreQuery(keyValueStoreName, keyCondition,
|
|
5
|
+
function* askKeyValueStoreQuery(keyValueStoreName, keyCondition, options) {
|
|
6
6
|
return yield {
|
|
7
7
|
type: KeyValueStoreActionType_1.KeyValueStoreActionType.Query,
|
|
8
8
|
payload: {
|
|
9
9
|
keyValueStoreName,
|
|
10
10
|
keyCondition,
|
|
11
|
-
|
|
12
|
-
nextPageKey,
|
|
11
|
+
options,
|
|
13
12
|
},
|
|
14
13
|
};
|
|
15
14
|
}
|
|
@@ -4,12 +4,15 @@ import { KvsQueryOperation } from './types';
|
|
|
4
4
|
import { QpqPagedData } from '../../types';
|
|
5
5
|
export interface KeyValueStoreQueryOptions {
|
|
6
6
|
ttlInSeconds?: number;
|
|
7
|
+
sortAscending?: boolean;
|
|
8
|
+
limit?: number;
|
|
9
|
+
nextPageKey?: string;
|
|
10
|
+
filter?: KvsQueryOperation;
|
|
7
11
|
}
|
|
8
12
|
export interface KeyValueStoreQueryActionPayload {
|
|
9
13
|
keyValueStoreName: string;
|
|
10
14
|
keyCondition: KvsQueryOperation;
|
|
11
|
-
|
|
12
|
-
nextPageKey?: string;
|
|
15
|
+
options?: KeyValueStoreQueryOptions;
|
|
13
16
|
}
|
|
14
17
|
export interface KeyValueStoreQueryAction extends Action<KeyValueStoreQueryActionPayload> {
|
|
15
18
|
type: KeyValueStoreActionType.Query;
|
|
@@ -4,6 +4,12 @@ exports.askBatch = void 0;
|
|
|
4
4
|
const SystemActionType_1 = require("./SystemActionType");
|
|
5
5
|
// TODO: Make typings better
|
|
6
6
|
function* askBatch(actions) {
|
|
7
|
+
// If we only have one action, just execute it directly
|
|
8
|
+
// No need to batch it
|
|
9
|
+
if (actions.length === 1) {
|
|
10
|
+
return [yield actions[0]];
|
|
11
|
+
}
|
|
12
|
+
// Otherwise, batch the actions
|
|
7
13
|
return yield { type: SystemActionType_1.SystemActionType.Batch, payload: { actions } };
|
|
8
14
|
}
|
|
9
15
|
exports.askBatch = askBatch;
|
|
@@ -7,5 +7,5 @@ export interface SystemBatchAction extends Action<SystemBatchActionPayload> {
|
|
|
7
7
|
type: SystemActionType.Batch;
|
|
8
8
|
payload: SystemBatchActionPayload;
|
|
9
9
|
}
|
|
10
|
-
export type SystemBatchActionProcessor<TReturn extends Array<any>> = ActionProcessor<SystemBatchAction
|
|
11
|
-
export type SystemBatchActionRequester<TReturn extends Array<any>> = ActionRequester<SystemBatchAction
|
|
10
|
+
export type SystemBatchActionProcessor<TReturn extends Array<any>> = ActionProcessor<SystemBatchAction | Action<any>, TReturn>;
|
|
11
|
+
export type SystemBatchActionRequester<TReturn extends Array<any>> = ActionRequester<SystemBatchAction | Action<any>, TReturn>;
|
package/lib/commonjs/index.d.ts
CHANGED
package/lib/commonjs/index.js
CHANGED
|
@@ -3,10 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.askRunParallel = void 0;
|
|
4
4
|
const actions_1 = require("../../actions");
|
|
5
5
|
function* askRunParallel(storyRuntimes) {
|
|
6
|
-
// No need to batch if we only have one story
|
|
7
|
-
if (storyRuntimes.length === 1) {
|
|
8
|
-
return [yield* storyRuntimes[0]];
|
|
9
|
-
}
|
|
10
6
|
// Begin executing the stories
|
|
11
7
|
const storyProgress = storyRuntimes.map((input) => ({
|
|
12
8
|
iterator: input,
|
|
@@ -27,3 +27,5 @@ __exportStar(require("./QpqPagedData"), exports);
|
|
|
27
27
|
__exportStar(require("./QpqContextIdentifier"), exports);
|
|
28
28
|
__exportStar(require("./DeployEvent"), exports);
|
|
29
29
|
__exportStar(require("./FullyQualifiedResource"), exports);
|
|
30
|
+
__exportStar(require("./BoundLogicStory"), exports);
|
|
31
|
+
__exportStar(require("./UnboundLogicStory"), exports);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { AskResponse, BoundLogicStory } from '../../types';
|
|
2
|
+
export declare function bindApi<ApiDeps, ApiFunctions extends Record<string, (...args: any) => AskResponse<any>>>(dependencies: ApiDeps, apiFunctions: ApiFunctions): {
|
|
3
|
+
[K in keyof ApiFunctions]: BoundLogicStory<ApiFunctions[K]>;
|
|
4
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bindApi = void 0;
|
|
4
|
+
const bindApiFunction_1 = require("./bindApiFunction");
|
|
5
|
+
function bindApi(dependencies, apiFunctions) {
|
|
6
|
+
const boundFunctions = Object.keys(apiFunctions).reduce((acc, key) => {
|
|
7
|
+
const func = apiFunctions[key];
|
|
8
|
+
acc[key] = (0, bindApiFunction_1.bindApiFunction)(dependencies, func);
|
|
9
|
+
return acc;
|
|
10
|
+
}, {});
|
|
11
|
+
return boundFunctions;
|
|
12
|
+
}
|
|
13
|
+
exports.bindApi = bindApi;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bindApiFunction = void 0;
|
|
4
|
+
function bindApiFunction(dependencies, askFunction) {
|
|
5
|
+
return function (...args) {
|
|
6
|
+
return askFunction(dependencies, ...args);
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
exports.bindApiFunction = bindApiFunction;
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
__exportStar(require("./bindApi"), exports);
|
|
18
|
+
__exportStar(require("./bindApiFunction"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './functions';
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
__exportStar(require("./functions"), exports);
|