quidproquo-core 0.0.231 → 0.0.232
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/event/EventGetStorySessionActionRequester.d.ts +2 -1
- package/lib/commonjs/actions/event/EventGetStorySessionActionRequester.js +2 -2
- package/lib/commonjs/actions/event/EventGetStorySessionActionTypes.d.ts +7 -6
- package/lib/commonjs/actions/userDirectory/UserDirectoryActionType.d.ts +0 -4
- package/lib/commonjs/actions/userDirectory/UserDirectoryDecodeAccessTokenActionTypes.d.ts +2 -1
- package/lib/commonjs/actions/userDirectory/UserDirectoryReadAccessTokenActionTypes.d.ts +2 -1
- package/lib/commonjs/actions/userDirectory/UserDirectorySetAccessTokenActionRequester.d.ts +1 -1
- package/lib/commonjs/actions/userDirectory/UserDirectorySetAccessTokenActionRequester.js +2 -1
- package/lib/commonjs/actions/userDirectory/UserDirectorySetAccessTokenActionTypes.d.ts +4 -2
- package/lib/commonjs/config/QPQConfig.d.ts +1 -2
- package/lib/commonjs/config/QPQConfig.js +1 -2
- package/lib/commonjs/config/settings/apiBuildPath/defineApiBuildPath.d.ts +5 -0
- package/lib/commonjs/config/settings/apiBuildPath/defineApiBuildPath.js +10 -0
- package/lib/commonjs/config/settings/apiBuildPath/index.d.ts +1 -0
- package/lib/commonjs/config/settings/apiBuildPath/index.js +17 -0
- package/lib/commonjs/config/settings/applicationModule.d.ts +1 -1
- package/lib/commonjs/config/settings/applicationModule.js +3 -1
- package/lib/commonjs/config/settings/deployEvent.d.ts +1 -2
- package/lib/commonjs/config/settings/deployEvent.js +1 -2
- package/lib/commonjs/config/settings/index.d.ts +1 -2
- package/lib/commonjs/config/settings/index.js +1 -2
- package/lib/commonjs/config/settings/queue.d.ts +1 -2
- package/lib/commonjs/config/settings/queue.js +1 -2
- package/lib/commonjs/config/settings/schedule.d.ts +1 -2
- package/lib/commonjs/config/settings/schedule.js +1 -2
- package/lib/commonjs/config/settings/storageDrive.d.ts +0 -1
- package/lib/commonjs/config/settings/userDirectory.d.ts +1 -2
- package/lib/commonjs/config/settings/userDirectory.js +1 -2
- package/lib/commonjs/createImplementationRuntime.js +1 -1
- package/lib/commonjs/qpqCoreUtils.d.ts +2 -6
- package/lib/commonjs/qpqCoreUtils.js +13 -31
- package/lib/commonjs/qpqExecuteLog.js +1 -1
- package/lib/commonjs/qpqRuntime.js +1 -1
- package/lib/commonjs/stories/askProcessEvent.js +1 -1
- package/lib/commonjs/types/StorySession.d.ts +12 -3
- package/lib/esm/actions/event/EventGetStorySessionActionRequester.d.ts +2 -1
- package/lib/esm/actions/event/EventGetStorySessionActionRequester.js +2 -2
- package/lib/esm/actions/event/EventGetStorySessionActionTypes.d.ts +7 -6
- package/lib/esm/actions/userDirectory/UserDirectoryActionType.d.ts +0 -4
- package/lib/esm/actions/userDirectory/UserDirectoryDecodeAccessTokenActionTypes.d.ts +2 -1
- package/lib/esm/actions/userDirectory/UserDirectoryReadAccessTokenActionTypes.d.ts +2 -1
- package/lib/esm/actions/userDirectory/UserDirectorySetAccessTokenActionRequester.d.ts +1 -1
- package/lib/esm/actions/userDirectory/UserDirectorySetAccessTokenActionRequester.js +2 -1
- package/lib/esm/actions/userDirectory/UserDirectorySetAccessTokenActionTypes.d.ts +4 -2
- package/lib/esm/config/QPQConfig.d.ts +1 -2
- package/lib/esm/config/QPQConfig.js +1 -2
- package/lib/esm/config/settings/apiBuildPath/defineApiBuildPath.d.ts +5 -0
- package/lib/esm/config/settings/apiBuildPath/defineApiBuildPath.js +6 -0
- package/lib/esm/config/settings/apiBuildPath/index.d.ts +1 -0
- package/lib/esm/config/settings/apiBuildPath/index.js +1 -0
- package/lib/esm/config/settings/applicationModule.d.ts +1 -1
- package/lib/esm/config/settings/applicationModule.js +3 -1
- package/lib/esm/config/settings/deployEvent.d.ts +1 -2
- package/lib/esm/config/settings/deployEvent.js +1 -2
- package/lib/esm/config/settings/index.d.ts +1 -2
- package/lib/esm/config/settings/index.js +1 -2
- package/lib/esm/config/settings/queue.d.ts +1 -2
- package/lib/esm/config/settings/queue.js +1 -2
- package/lib/esm/config/settings/schedule.d.ts +1 -2
- package/lib/esm/config/settings/schedule.js +1 -2
- package/lib/esm/config/settings/storageDrive.d.ts +0 -1
- package/lib/esm/config/settings/userDirectory.d.ts +1 -2
- package/lib/esm/config/settings/userDirectory.js +1 -2
- package/lib/esm/createImplementationRuntime.js +1 -1
- package/lib/esm/qpqCoreUtils.d.ts +2 -6
- package/lib/esm/qpqCoreUtils.js +9 -22
- package/lib/esm/qpqExecuteLog.js +1 -1
- package/lib/esm/qpqRuntime.js +1 -1
- package/lib/esm/stories/askProcessEvent.js +1 -1
- package/lib/esm/types/StorySession.d.ts +12 -3
- package/package.json +2 -2
- package/lib/commonjs/config/settings/applicationBasePath.d.ts +0 -5
- package/lib/commonjs/config/settings/applicationBasePath.js +0 -11
- package/lib/commonjs/config/settings/buildPath.d.ts +0 -5
- package/lib/commonjs/config/settings/buildPath.js +0 -10
- package/lib/esm/config/settings/applicationBasePath.d.ts +0 -5
- package/lib/esm/config/settings/applicationBasePath.js +0 -7
- package/lib/esm/config/settings/buildPath.d.ts +0 -5
- package/lib/esm/config/settings/buildPath.js +0 -6
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { EventGetStorySessionActionRequester } from './EventGetStorySessionActionTypes';
|
|
2
|
-
|
|
2
|
+
import { AnyMatchStoryResult } from './EventActionType';
|
|
3
|
+
export declare function askEventGetStorySession<EventParams extends Array<unknown>, QpqEventRecord, MSR extends AnyMatchStoryResult>(eventParams: EventParams, qpqEventRecord: QpqEventRecord, matchStoryResult: MSR): EventGetStorySessionActionRequester<EventParams, QpqEventRecord, MSR>;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.askEventGetStorySession = void 0;
|
|
4
4
|
const EventActionType_1 = require("./EventActionType");
|
|
5
|
-
function* askEventGetStorySession(eventParams, qpqEventRecord) {
|
|
5
|
+
function* askEventGetStorySession(eventParams, qpqEventRecord, matchStoryResult) {
|
|
6
6
|
return yield {
|
|
7
7
|
type: EventActionType_1.EventActionType.GetStorySession,
|
|
8
|
-
payload: { eventParams, qpqEventRecord },
|
|
8
|
+
payload: { eventParams, qpqEventRecord, matchStoryResult },
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
exports.askEventGetStorySession = askEventGetStorySession;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { StorySession } from '../../types';
|
|
2
2
|
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
3
|
-
import { EventActionType } from './EventActionType';
|
|
4
|
-
export interface EventGetStorySessionActionPayload<EventParams extends Array<unknown>, QpqEventRecord> {
|
|
3
|
+
import { AnyMatchStoryResult, EventActionType } from './EventActionType';
|
|
4
|
+
export interface EventGetStorySessionActionPayload<EventParams extends Array<unknown>, QpqEventRecord, MSR extends AnyMatchStoryResult> {
|
|
5
5
|
qpqEventRecord: QpqEventRecord;
|
|
6
6
|
eventParams: EventParams;
|
|
7
|
+
matchStoryResult: MSR;
|
|
7
8
|
}
|
|
8
|
-
export interface EventGetStorySessionAction<EventParams extends Array<unknown>, QpqEventRecord> extends Action<EventGetStorySessionActionPayload<EventParams, QpqEventRecord>> {
|
|
9
|
+
export interface EventGetStorySessionAction<EventParams extends Array<unknown>, QpqEventRecord, MSR extends AnyMatchStoryResult> extends Action<EventGetStorySessionActionPayload<EventParams, QpqEventRecord, MSR>> {
|
|
9
10
|
type: EventActionType.GetStorySession;
|
|
10
|
-
payload: EventGetStorySessionActionPayload<EventParams, QpqEventRecord>;
|
|
11
|
+
payload: EventGetStorySessionActionPayload<EventParams, QpqEventRecord, MSR>;
|
|
11
12
|
}
|
|
12
|
-
export type EventGetStorySessionActionProcessor<EventParams extends Array<unknown>, QpqEventRecord> = ActionProcessor<EventGetStorySessionAction<EventParams, QpqEventRecord>, StorySession | undefined>;
|
|
13
|
-
export type EventGetStorySessionActionRequester<EventParams extends Array<unknown>, QpqEventRecord> = ActionRequester<EventGetStorySessionAction<EventParams, QpqEventRecord>, StorySession | undefined>;
|
|
13
|
+
export type EventGetStorySessionActionProcessor<EventParams extends Array<unknown>, QpqEventRecord, MSR extends AnyMatchStoryResult> = ActionProcessor<EventGetStorySessionAction<EventParams, QpqEventRecord, MSR>, StorySession | undefined>;
|
|
14
|
+
export type EventGetStorySessionActionRequester<EventParams extends Array<unknown>, QpqEventRecord, MSR extends AnyMatchStoryResult> = ActionRequester<EventGetStorySessionAction<EventParams, QpqEventRecord, MSR>, StorySession | undefined>;
|
|
@@ -38,10 +38,6 @@ export interface AuthenticateUserResponse {
|
|
|
38
38
|
session?: string;
|
|
39
39
|
authenticationInfo?: AuthenticationInfo;
|
|
40
40
|
}
|
|
41
|
-
export interface DecodedAccessToken {
|
|
42
|
-
userId: string;
|
|
43
|
-
username: string;
|
|
44
|
-
}
|
|
45
41
|
export interface UserAttributes {
|
|
46
42
|
/** The user's email address */
|
|
47
43
|
email?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { DecodedAccessToken } from '../../types';
|
|
1
2
|
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
|
-
import { UserDirectoryActionType
|
|
3
|
+
import { UserDirectoryActionType } from './UserDirectoryActionType';
|
|
3
4
|
export interface UserDirectoryDecodeAccessTokenActionPayload {
|
|
4
5
|
userDirectoryName: string;
|
|
5
6
|
ignoreExpiration: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { DecodedAccessToken } from '../../types';
|
|
1
2
|
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
|
-
import { UserDirectoryActionType
|
|
3
|
+
import { UserDirectoryActionType } from './UserDirectoryActionType';
|
|
3
4
|
export interface UserDirectoryReadAccessTokenActionPayload {
|
|
4
5
|
userDirectoryName: string;
|
|
5
6
|
ignoreExpiration: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { UserDirectorySetAccessTokenActionRequester } from './UserDirectorySetAccessTokenActionTypes';
|
|
2
|
-
export declare function askUserDirectorySetAccessToken(accessToken: string): UserDirectorySetAccessTokenActionRequester;
|
|
2
|
+
export declare function askUserDirectorySetAccessToken(userDirectoryName: string, accessToken: string): UserDirectorySetAccessTokenActionRequester;
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.askUserDirectorySetAccessToken = void 0;
|
|
4
4
|
const UserDirectoryActionType_1 = require("./UserDirectoryActionType");
|
|
5
|
-
function* askUserDirectorySetAccessToken(accessToken) {
|
|
5
|
+
function* askUserDirectorySetAccessToken(userDirectoryName, accessToken) {
|
|
6
6
|
return yield {
|
|
7
7
|
type: UserDirectoryActionType_1.UserDirectoryActionType.SetAccessToken,
|
|
8
8
|
payload: {
|
|
9
9
|
accessToken,
|
|
10
|
+
userDirectoryName,
|
|
10
11
|
},
|
|
11
12
|
};
|
|
12
13
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { DecodedAccessToken } from '../../types';
|
|
1
2
|
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
3
|
import { UserDirectoryActionType } from './UserDirectoryActionType';
|
|
3
4
|
export interface UserDirectorySetAccessTokenActionPayload {
|
|
4
5
|
accessToken: string;
|
|
6
|
+
userDirectoryName: string;
|
|
5
7
|
}
|
|
6
8
|
export interface UserDirectorySetAccessTokenAction extends Action<UserDirectorySetAccessTokenActionPayload> {
|
|
7
9
|
type: UserDirectoryActionType.SetAccessToken;
|
|
8
10
|
payload: UserDirectorySetAccessTokenActionPayload;
|
|
9
11
|
}
|
|
10
|
-
export type UserDirectorySetAccessTokenActionProcessor = ActionProcessor<UserDirectorySetAccessTokenAction,
|
|
11
|
-
export type UserDirectorySetAccessTokenActionRequester = ActionRequester<UserDirectorySetAccessTokenAction,
|
|
12
|
+
export type UserDirectorySetAccessTokenActionProcessor = ActionProcessor<UserDirectorySetAccessTokenAction, DecodedAccessToken>;
|
|
13
|
+
export type UserDirectorySetAccessTokenActionRequester = ActionRequester<UserDirectorySetAccessTokenAction, DecodedAccessToken>;
|
|
@@ -2,14 +2,13 @@ import { CrossModuleOwner } from '../types';
|
|
|
2
2
|
export declare enum QPQCoreConfigSettingType {
|
|
3
3
|
appName = "@quidproquo-core/config/AppName",
|
|
4
4
|
moduleName = "@quidproquo-core/config/moduleName",
|
|
5
|
-
appBasePath = "@quidproquo-core/config/appBasePath",
|
|
6
5
|
storageDrive = "@quidproquo-core/config/storageDrive",
|
|
7
6
|
schedule = "@quidproquo-core/config/schedule",
|
|
8
7
|
secret = "@quidproquo-core/config/secret",
|
|
9
8
|
global = "@quidproquo-core/config/global",
|
|
10
9
|
parameter = "@quidproquo-core/config/parameter",
|
|
11
10
|
actionProcessors = "@quidproquo-core/config/actionProcessors",
|
|
12
|
-
|
|
11
|
+
apiBuildPath = "@quidproquo-core/config/apiBuildPath",
|
|
13
12
|
queue = "@quidproquo-core/config/Queue",
|
|
14
13
|
eventBus = "@quidproquo-core/config/EventBus",
|
|
15
14
|
userDirectory = "@quidproquo-core/config/UserDirectory",
|
|
@@ -5,14 +5,13 @@ var QPQCoreConfigSettingType;
|
|
|
5
5
|
(function (QPQCoreConfigSettingType) {
|
|
6
6
|
QPQCoreConfigSettingType["appName"] = "@quidproquo-core/config/AppName";
|
|
7
7
|
QPQCoreConfigSettingType["moduleName"] = "@quidproquo-core/config/moduleName";
|
|
8
|
-
QPQCoreConfigSettingType["appBasePath"] = "@quidproquo-core/config/appBasePath";
|
|
9
8
|
QPQCoreConfigSettingType["storageDrive"] = "@quidproquo-core/config/storageDrive";
|
|
10
9
|
QPQCoreConfigSettingType["schedule"] = "@quidproquo-core/config/schedule";
|
|
11
10
|
QPQCoreConfigSettingType["secret"] = "@quidproquo-core/config/secret";
|
|
12
11
|
QPQCoreConfigSettingType["global"] = "@quidproquo-core/config/global";
|
|
13
12
|
QPQCoreConfigSettingType["parameter"] = "@quidproquo-core/config/parameter";
|
|
14
13
|
QPQCoreConfigSettingType["actionProcessors"] = "@quidproquo-core/config/actionProcessors";
|
|
15
|
-
QPQCoreConfigSettingType["
|
|
14
|
+
QPQCoreConfigSettingType["apiBuildPath"] = "@quidproquo-core/config/apiBuildPath";
|
|
16
15
|
QPQCoreConfigSettingType["queue"] = "@quidproquo-core/config/Queue";
|
|
17
16
|
QPQCoreConfigSettingType["eventBus"] = "@quidproquo-core/config/EventBus";
|
|
18
17
|
QPQCoreConfigSettingType["userDirectory"] = "@quidproquo-core/config/UserDirectory";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineApiBuildPath = void 0;
|
|
4
|
+
const QPQConfig_1 = require("../../QPQConfig");
|
|
5
|
+
const defineApiBuildPath = (apiBuildPath) => ({
|
|
6
|
+
configSettingType: QPQConfig_1.QPQCoreConfigSettingType.apiBuildPath,
|
|
7
|
+
uniqueKey: apiBuildPath,
|
|
8
|
+
apiBuildPath,
|
|
9
|
+
});
|
|
10
|
+
exports.defineApiBuildPath = defineApiBuildPath;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './defineApiBuildPath';
|
|
@@ -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("./defineApiBuildPath"), exports);
|
|
@@ -7,4 +7,4 @@ export interface ApplicationModuleQPQConfigSetting extends QPQConfigSetting {
|
|
|
7
7
|
deployRegion?: string;
|
|
8
8
|
feature?: string;
|
|
9
9
|
}
|
|
10
|
-
export declare const defineApplicationModule: (applicationName: string, moduleName: string, environment: string, configRoot: string, deployRegion?: string, feature?: string) => QPQConfig;
|
|
10
|
+
export declare const defineApplicationModule: (applicationName: string, moduleName: string, environment: string, configRoot: string, apiBuildPath: string, deployRegion?: string, feature?: string) => QPQConfig;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defineApplicationModule = void 0;
|
|
4
|
+
const apiBuildPath_1 = require("./apiBuildPath");
|
|
4
5
|
const applicationName_1 = require("./applicationName");
|
|
5
6
|
const moduleName_1 = require("./moduleName");
|
|
6
|
-
const defineApplicationModule = (applicationName, moduleName, environment, configRoot, deployRegion, feature) => [
|
|
7
|
+
const defineApplicationModule = (applicationName, moduleName, environment, configRoot, apiBuildPath, deployRegion, feature) => [
|
|
7
8
|
(0, applicationName_1.defineApplication)(applicationName, environment, configRoot, deployRegion, feature),
|
|
8
9
|
(0, moduleName_1.defineModule)(moduleName),
|
|
10
|
+
(0, apiBuildPath_1.defineApiBuildPath)(apiBuildPath),
|
|
9
11
|
];
|
|
10
12
|
exports.defineApplicationModule = defineApplicationModule;
|
|
@@ -2,7 +2,6 @@ import { QpqFunctionRuntime } from '../../types';
|
|
|
2
2
|
import { QPQConfigSetting } from '../QPQConfig';
|
|
3
3
|
export interface DeployEventsQPQConfigSetting extends QPQConfigSetting {
|
|
4
4
|
name: string;
|
|
5
|
-
buildPath: string;
|
|
6
5
|
runtime: QpqFunctionRuntime;
|
|
7
6
|
}
|
|
8
|
-
export declare const defineDeployEvent: (
|
|
7
|
+
export declare const defineDeployEvent: (name: string, runtime: QpqFunctionRuntime) => DeployEventsQPQConfigSetting;
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defineDeployEvent = void 0;
|
|
4
4
|
const QPQConfig_1 = require("../QPQConfig");
|
|
5
|
-
const defineDeployEvent = (
|
|
5
|
+
const defineDeployEvent = (name, runtime) => ({
|
|
6
6
|
configSettingType: QPQConfig_1.QPQCoreConfigSettingType.deployEvent,
|
|
7
7
|
uniqueKey: name,
|
|
8
|
-
buildPath,
|
|
9
8
|
runtime,
|
|
10
9
|
name,
|
|
11
10
|
});
|
|
@@ -2,10 +2,9 @@ export * from './emailTemplates';
|
|
|
2
2
|
export * from './actionProcessors';
|
|
3
3
|
export * from './applicationModule';
|
|
4
4
|
export * from './applicationName';
|
|
5
|
-
export * from './applicationBasePath';
|
|
6
5
|
export * from './applicationVersion';
|
|
7
6
|
export * from './moduleName';
|
|
8
|
-
export * from './
|
|
7
|
+
export * from './apiBuildPath';
|
|
9
8
|
export * from './configValue';
|
|
10
9
|
export * from './environmentSettings';
|
|
11
10
|
export * from './eventBus';
|
|
@@ -18,10 +18,9 @@ __exportStar(require("./emailTemplates"), exports);
|
|
|
18
18
|
__exportStar(require("./actionProcessors"), exports);
|
|
19
19
|
__exportStar(require("./applicationModule"), exports);
|
|
20
20
|
__exportStar(require("./applicationName"), exports);
|
|
21
|
-
__exportStar(require("./applicationBasePath"), exports);
|
|
22
21
|
__exportStar(require("./applicationVersion"), exports);
|
|
23
22
|
__exportStar(require("./moduleName"), exports);
|
|
24
|
-
__exportStar(require("./
|
|
23
|
+
__exportStar(require("./apiBuildPath"), exports);
|
|
25
24
|
__exportStar(require("./configValue"), exports);
|
|
26
25
|
__exportStar(require("./environmentSettings"), exports);
|
|
27
26
|
__exportStar(require("./eventBus"), exports);
|
|
@@ -15,7 +15,6 @@ export interface QPQConfigAdvancedQueueSettings extends QPQConfigAdvancedSetting
|
|
|
15
15
|
}
|
|
16
16
|
export interface QueueQPQConfigSetting extends QPQConfigSetting {
|
|
17
17
|
name: string;
|
|
18
|
-
buildPath: string;
|
|
19
18
|
batchSize: number;
|
|
20
19
|
batchWindowInSeconds: number;
|
|
21
20
|
concurrency: number;
|
|
@@ -26,4 +25,4 @@ export interface QueueQPQConfigSetting extends QPQConfigSetting {
|
|
|
26
25
|
eventBusSubscriptions: string[];
|
|
27
26
|
maxConcurrentExecutions?: number;
|
|
28
27
|
}
|
|
29
|
-
export declare const defineQueue: (name: string,
|
|
28
|
+
export declare const defineQueue: (name: string, processors: QpqQueueProcessors, options?: QPQConfigAdvancedQueueSettings) => QueueQPQConfigSetting;
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.defineQueue = void 0;
|
|
4
4
|
const QPQConfig_1 = require("../QPQConfig");
|
|
5
|
-
const defineQueue = (name,
|
|
5
|
+
const defineQueue = (name, processors, options) => ({
|
|
6
6
|
configSettingType: QPQConfig_1.QPQCoreConfigSettingType.queue,
|
|
7
7
|
uniqueKey: name,
|
|
8
8
|
name,
|
|
9
|
-
buildPath,
|
|
10
9
|
batchSize: (options === null || options === void 0 ? void 0 : options.batchSize) || 0,
|
|
11
10
|
batchWindowInSeconds: (options === null || options === void 0 ? void 0 : options.batchWindowInSeconds) || 5,
|
|
12
11
|
concurrency: (options === null || options === void 0 ? void 0 : options.concurrency) || 1,
|
|
@@ -10,7 +10,6 @@ export interface ScheduleQPQConfigSetting extends QPQConfigSetting {
|
|
|
10
10
|
scheduleType: ScheduleTypeEnum;
|
|
11
11
|
runtime: QpqFunctionRuntime;
|
|
12
12
|
cronExpression: string;
|
|
13
|
-
buildPath: string;
|
|
14
13
|
metadata: Record<string, any>;
|
|
15
14
|
}
|
|
16
15
|
/**
|
|
@@ -73,4 +72,4 @@ export interface ScheduleQPQConfigSetting extends QPQConfigSetting {
|
|
|
73
72
|
* @param {string} buildPath - The build path to the function's code.
|
|
74
73
|
* @returns {ScheduleQPQConfigSetting} The configuration setting for the scheduled task.
|
|
75
74
|
*/
|
|
76
|
-
export declare const defineRecurringSchedule: (cronExpression: string, runtime: QpqFunctionRuntime,
|
|
75
|
+
export declare const defineRecurringSchedule: (cronExpression: string, runtime: QpqFunctionRuntime, options?: QPQConfigAdvancedScheduleSettings) => ScheduleQPQConfigSetting;
|
|
@@ -67,7 +67,7 @@ var ScheduleTypeEnum;
|
|
|
67
67
|
* @param {string} buildPath - The build path to the function's code.
|
|
68
68
|
* @returns {ScheduleQPQConfigSetting} The configuration setting for the scheduled task.
|
|
69
69
|
*/
|
|
70
|
-
const defineRecurringSchedule = (cronExpression, runtime,
|
|
70
|
+
const defineRecurringSchedule = (cronExpression, runtime, options) => {
|
|
71
71
|
const uniqueKey = (0, qpqCoreUtils_1.getStoryNameFromQpqFunctionRuntime)(runtime);
|
|
72
72
|
return {
|
|
73
73
|
configSettingType: QPQConfig_1.QPQCoreConfigSettingType.schedule,
|
|
@@ -75,7 +75,6 @@ const defineRecurringSchedule = (cronExpression, runtime, buildPath, options) =>
|
|
|
75
75
|
scheduleType: ScheduleTypeEnum.Recurring,
|
|
76
76
|
runtime,
|
|
77
77
|
cronExpression,
|
|
78
|
-
buildPath,
|
|
79
78
|
metadata: (options === null || options === void 0 ? void 0 : options.metadata) || {},
|
|
80
79
|
};
|
|
81
80
|
};
|
|
@@ -35,7 +35,6 @@ export interface QPQConfigAdvancedUserDirectorySettings extends QPQConfigAdvance
|
|
|
35
35
|
}
|
|
36
36
|
export interface UserDirectoryQPQConfigSetting extends QPQConfigSetting {
|
|
37
37
|
name: string;
|
|
38
|
-
buildPath: string;
|
|
39
38
|
phoneRequired: boolean;
|
|
40
39
|
selfSignUpEnabled: boolean;
|
|
41
40
|
emailTemplates: EmailTemplates;
|
|
@@ -44,4 +43,4 @@ export interface UserDirectoryQPQConfigSetting extends QPQConfigSetting {
|
|
|
44
43
|
oAuth?: AuthDirectoryOAuth;
|
|
45
44
|
customAuthRuntime?: CustomAuthRuntime;
|
|
46
45
|
}
|
|
47
|
-
export declare const defineUserDirectory: (name: string,
|
|
46
|
+
export declare const defineUserDirectory: (name: string, options?: QPQConfigAdvancedUserDirectorySettings) => UserDirectoryQPQConfigSetting;
|
|
@@ -8,13 +8,12 @@ var AuthDirectoryFederatedProviderType;
|
|
|
8
8
|
AuthDirectoryFederatedProviderType["Facebook"] = "facebook";
|
|
9
9
|
AuthDirectoryFederatedProviderType["Google"] = "google";
|
|
10
10
|
})(AuthDirectoryFederatedProviderType = exports.AuthDirectoryFederatedProviderType || (exports.AuthDirectoryFederatedProviderType = {}));
|
|
11
|
-
const defineUserDirectory = (name,
|
|
11
|
+
const defineUserDirectory = (name, options) => {
|
|
12
12
|
var _a, _b, _c;
|
|
13
13
|
return ({
|
|
14
14
|
configSettingType: QPQConfig_1.QPQCoreConfigSettingType.userDirectory,
|
|
15
15
|
uniqueKey: name,
|
|
16
16
|
name,
|
|
17
|
-
buildPath,
|
|
18
17
|
phoneRequired: (options === null || options === void 0 ? void 0 : options.phoneRequired) || false,
|
|
19
18
|
selfSignUpEnabled: (options === null || options === void 0 ? void 0 : options.selfSignUpEnabled) || true,
|
|
20
19
|
emailTemplates: {
|
|
@@ -31,7 +31,7 @@ const createImplementationRuntime = (qpqConfig, tags, getDateNow, randomGuid, se
|
|
|
31
31
|
const resolveStory = (0, qpqRuntime_1.createRuntime)(qpqConfig, {
|
|
32
32
|
context: session.context,
|
|
33
33
|
depth: (session.depth || 0) + 1,
|
|
34
|
-
|
|
34
|
+
decodedAccessToken: session.decodedAccessToken,
|
|
35
35
|
correlation: session.correlation,
|
|
36
36
|
}, () => __awaiter(void 0, void 0, void 0, function* () { return actionProcessors; }), getDateNow, logger,
|
|
37
37
|
// TODO: Share this logic.
|
|
@@ -67,7 +67,7 @@ export declare const getScheduleEvents: (configs: QPQConfig) => ScheduleQPQConfi
|
|
|
67
67
|
export declare const getQueueSrcEntries: (configs: QPQConfig) => QpqFunctionRuntime[];
|
|
68
68
|
export declare const getUserDirectorySrcEntries: (qpqConfig: QPQConfig) => QpqFunctionRuntime[];
|
|
69
69
|
export declare const getAllSrcEntries: (qpqConfig: QPQConfig) => QpqFunctionRuntime[];
|
|
70
|
-
export declare const
|
|
70
|
+
export declare const getApiBuildPath: (qpqConfig: QPQConfig) => string;
|
|
71
71
|
export declare const getSrcPathFromQpqFunctionRuntime: (qpqFunctionRuntime: QpqFunctionRuntime) => string;
|
|
72
72
|
export declare function getSrcPathFromQpqFunctionRuntimeWithoutLeadingSlash(runtime: QpqFunctionRuntime): string;
|
|
73
73
|
export declare const getFullSrcPathFromQpqFunctionRuntime: (qpqFunctionRuntime: QpqFunctionRuntime, qpqConfig: QPQConfig, configRootOverride?: string) => string;
|
|
@@ -84,12 +84,8 @@ export declare const getAllParameterConfigs: (qpqConfig: QPQConfig) => Parameter
|
|
|
84
84
|
export declare const getParameterConfig: (name: string, qpqConfig: QPQConfig) => ParameterQPQConfigSetting;
|
|
85
85
|
export declare const getOwnedParameterConfigs: (qpqConfig: QPQConfig) => ParameterQPQConfigSetting[];
|
|
86
86
|
export declare const getUniqueKeyForSetting: (setting: QPQConfigSetting) => string;
|
|
87
|
-
export declare const getScheduleEntryFullPath: (qpqConfig: QPQConfig, scheduleConfig: ScheduleQPQConfigSetting) => string;
|
|
88
|
-
export declare const getStorageDriveEntryFullPath: (qpqConfig: QPQConfig, storageDriveConfig: StorageDriveQPQConfigSetting) => string;
|
|
89
|
-
export declare const getDeployEventFullPath: (qpqConfig: QPQConfig, deployEventConfig: DeployEventsQPQConfigSetting) => string;
|
|
90
87
|
export declare const getStorageDriveUploadFullPath: (qpqConfig: QPQConfig, storageDriveConfig: StorageDriveQPQConfigSetting) => string;
|
|
91
|
-
export declare const
|
|
92
|
-
export declare const getUserDirectoryEntryFullPath: (qpqConfig: QPQConfig, userDirectoryConfig: UserDirectoryQPQConfigSetting) => string;
|
|
88
|
+
export declare const getApiBuildPathFullPath: (qpqConfig: QPQConfig) => string;
|
|
93
89
|
export declare const getQueueQueueProcessors: (name: string, qpqConfig: QPQConfig) => QpqQueueProcessors;
|
|
94
90
|
export declare const convertCrossModuleOwnerToGenericResourceNameOverride: <T extends string>(owner?: CrossModuleOwner<T> | undefined) => CrossModuleOwner<'resourceNameOverride'> | undefined;
|
|
95
91
|
export declare const convertCustomFullyQualifiedResourceToGeneric: <T extends string>(resource: CustomFullyQualifiedResource<T>) => FullyQualifiedResource;
|
|
@@ -11,8 +11,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.getAllParameterConfigs = exports.getUserDirectoryByName = exports.getOwnedUserDirectories = exports.getUserDirectories = exports.getGlobalConfigValue = exports.getOwnedSecrets = exports.getAllSecretConfigs = exports.getSecretByName = exports.getSrcFilenameFromQpqFunctionRuntime = exports.getStoryNameFromQpqFunctionRuntime = exports.getFullSrcPathFromQpqFunctionRuntime = exports.getSrcPathFromQpqFunctionRuntimeWithoutLeadingSlash = exports.getSrcPathFromQpqFunctionRuntime = exports.
|
|
15
|
-
exports.getFullUrlFromConfigUrl = exports.isSameResource = exports.getKeyValueStoreFullyQualifiedResourceName = exports.getFullyQualifiedResourceName = exports.convertCustomFullyQualifiedResourceToGeneric = exports.convertCrossModuleOwnerToGenericResourceNameOverride = exports.getQueueQueueProcessors = exports.
|
|
14
|
+
exports.getAllParameterConfigs = exports.getUserDirectoryByName = exports.getOwnedUserDirectories = exports.getUserDirectories = exports.getGlobalConfigValue = exports.getOwnedSecrets = exports.getAllSecretConfigs = exports.getSecretByName = exports.getSrcFilenameFromQpqFunctionRuntime = exports.getStoryNameFromQpqFunctionRuntime = exports.getFullSrcPathFromQpqFunctionRuntime = exports.getSrcPathFromQpqFunctionRuntimeWithoutLeadingSlash = exports.getSrcPathFromQpqFunctionRuntime = exports.getApiBuildPath = exports.getAllSrcEntries = exports.getUserDirectorySrcEntries = exports.getQueueSrcEntries = exports.getScheduleEvents = exports.getUserDirectoryEmailTemplates = exports.getActionProcessorSources = exports.getKeyValueStoreByName = exports.resolveCrossServiceResourceName = exports.getOwnedStorageDrives = exports.getOwnedGraphDatabases = exports.getOwnedKeyValueStores = exports.getVirualNetworkConfigs = exports.getDeployEventConfigs = exports.getAllGraphDatabaseConfigs = exports.getAllKeyValueStores = exports.getOwnedItems = exports.getEventBusConfigByName = exports.getOwnedEventBusConfigs = exports.getAllClaudeAiConfigs = exports.getAllEventBusConfigs = exports.getStorageDriveNames = exports.getQueueByName = exports.getQueues = exports.getStorageDriveByName = exports.getStorageDrives = exports.getApplicationModuleDeployRegion = exports.getApplicationModuleEnvironment = exports.getConfigRoot = exports.getApplicationModuleFeature = exports.getApplicationName = exports.getApplicationConfigRoot = exports.getApplicationModuleName = exports.getApplicationConfigSetting = exports.getConfigSetting = exports.getConfigSettings = exports.flattenQpqConfig = void 0;
|
|
15
|
+
exports.getFullUrlFromConfigUrl = exports.isSameResource = exports.getKeyValueStoreFullyQualifiedResourceName = exports.getFullyQualifiedResourceName = exports.convertCustomFullyQualifiedResourceToGeneric = exports.convertCrossModuleOwnerToGenericResourceNameOverride = exports.getQueueQueueProcessors = exports.getApiBuildPathFullPath = exports.getStorageDriveUploadFullPath = exports.getUniqueKeyForSetting = exports.getOwnedParameterConfigs = exports.getParameterConfig = void 0;
|
|
16
16
|
const utils_1 = require("./utils");
|
|
17
17
|
const config_1 = require("./config");
|
|
18
18
|
/**
|
|
@@ -272,14 +272,14 @@ const getAllSrcEntries = (qpqConfig) => {
|
|
|
272
272
|
return result;
|
|
273
273
|
};
|
|
274
274
|
exports.getAllSrcEntries = getAllSrcEntries;
|
|
275
|
-
const
|
|
276
|
-
const [
|
|
277
|
-
if (!
|
|
278
|
-
throw new Error(`Can not find app base path use
|
|
275
|
+
const getApiBuildPath = (qpqConfig) => {
|
|
276
|
+
const [apiBuildPathConfig] = (0, exports.getConfigSettings)(qpqConfig, config_1.QPQCoreConfigSettingType.apiBuildPath);
|
|
277
|
+
if (!apiBuildPathConfig) {
|
|
278
|
+
throw new Error(`Can not find app base path use defineApiBuildPath or defineApplicationModule`);
|
|
279
279
|
}
|
|
280
|
-
return
|
|
280
|
+
return apiBuildPathConfig.apiBuildPath;
|
|
281
281
|
};
|
|
282
|
-
exports.
|
|
282
|
+
exports.getApiBuildPath = getApiBuildPath;
|
|
283
283
|
const getSrcPathFromQpqFunctionRuntime = (qpqFunctionRuntime) => {
|
|
284
284
|
const [srcPath, _method] = qpqFunctionRuntime.split('::');
|
|
285
285
|
if (srcPath.startsWith('full@')) {
|
|
@@ -385,34 +385,16 @@ const getUniqueKeyForSetting = (setting) => {
|
|
|
385
385
|
return `${type}${key}`;
|
|
386
386
|
};
|
|
387
387
|
exports.getUniqueKeyForSetting = getUniqueKeyForSetting;
|
|
388
|
-
const getScheduleEntryFullPath = (qpqConfig, scheduleConfig) => {
|
|
389
|
-
return (0, utils_1.joinPaths)((0, exports.getConfigRoot)(qpqConfig), scheduleConfig.buildPath);
|
|
390
|
-
};
|
|
391
|
-
exports.getScheduleEntryFullPath = getScheduleEntryFullPath;
|
|
392
|
-
const getStorageDriveEntryFullPath = (qpqConfig, storageDriveConfig) => {
|
|
393
|
-
var _a;
|
|
394
|
-
if (!((_a = storageDriveConfig.onEvent) === null || _a === void 0 ? void 0 : _a.buildPath)) {
|
|
395
|
-
throw new Error('Please specify a build path in your storage drive config (onEvent)');
|
|
396
|
-
}
|
|
397
|
-
return (0, utils_1.joinPaths)((0, exports.getConfigRoot)(qpqConfig), storageDriveConfig.onEvent.buildPath);
|
|
398
|
-
};
|
|
399
|
-
exports.getStorageDriveEntryFullPath = getStorageDriveEntryFullPath;
|
|
400
|
-
const getDeployEventFullPath = (qpqConfig, deployEventConfig) => {
|
|
401
|
-
return (0, utils_1.joinPaths)((0, exports.getConfigRoot)(qpqConfig), deployEventConfig.buildPath);
|
|
402
|
-
};
|
|
403
|
-
exports.getDeployEventFullPath = getDeployEventFullPath;
|
|
404
388
|
const getStorageDriveUploadFullPath = (qpqConfig, storageDriveConfig) => {
|
|
405
389
|
return (0, utils_1.joinPaths)((0, exports.getConfigRoot)(qpqConfig), storageDriveConfig.copyPath || '');
|
|
406
390
|
};
|
|
407
391
|
exports.getStorageDriveUploadFullPath = getStorageDriveUploadFullPath;
|
|
408
|
-
const
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
const getUserDirectoryEntryFullPath = (qpqConfig, userDirectoryConfig) => {
|
|
413
|
-
return (0, utils_1.joinPaths)((0, exports.getConfigRoot)(qpqConfig), userDirectoryConfig.buildPath);
|
|
392
|
+
const getApiBuildPathFullPath = (qpqConfig) => {
|
|
393
|
+
const configRoot = (0, exports.getConfigRoot)(qpqConfig);
|
|
394
|
+
const apiBuildPath = (0, exports.getApiBuildPath)(qpqConfig);
|
|
395
|
+
return (0, utils_1.joinPaths)(configRoot, apiBuildPath);
|
|
414
396
|
};
|
|
415
|
-
exports.
|
|
397
|
+
exports.getApiBuildPathFullPath = getApiBuildPathFullPath;
|
|
416
398
|
const getQueueQueueProcessors = (name, qpqConfig) => {
|
|
417
399
|
const seoConfigs = (0, exports.getConfigSettings)(qpqConfig, config_1.QPQCoreConfigSettingType.queue);
|
|
418
400
|
const queueConfig = seoConfigs.find((c) => c.name === name);
|
|
@@ -30,7 +30,7 @@ const qpqExecuteLog = (storyResult, runtime, overrides = {}) => __awaiter(void 0
|
|
|
30
30
|
},
|
|
31
31
|
});
|
|
32
32
|
// Generate an empty story resolver
|
|
33
|
-
const resolveStory = (0, qpqRuntime_1.createRuntime)([(0, config_1.defineApplicationModule)('Debugger', storyResult.moduleName, 'development', __dirname)], {
|
|
33
|
+
const resolveStory = (0, qpqRuntime_1.createRuntime)([(0, config_1.defineApplicationModule)('Debugger', storyResult.moduleName, 'development', __dirname, './dist')], {
|
|
34
34
|
correlation: storyResult.fromCorrelation,
|
|
35
35
|
depth: storyResult.session.depth,
|
|
36
36
|
context: storyResult.session.context,
|
|
@@ -44,7 +44,7 @@ const createRuntime = (qpqConfig, callerSession, getActionProcessors, getTimeNow
|
|
|
44
44
|
let storySession = {
|
|
45
45
|
correlation: runtimeCorrelation,
|
|
46
46
|
depth: callerSession.depth + 1,
|
|
47
|
-
|
|
47
|
+
decodedAccessToken: callerSession.decodedAccessToken,
|
|
48
48
|
context: callerSession.context,
|
|
49
49
|
};
|
|
50
50
|
const updateSession = (newSession) => {
|
|
@@ -24,7 +24,7 @@ function* askProcessEventRecord(qpqEventRecord, eventArguments) {
|
|
|
24
24
|
// return the result
|
|
25
25
|
return (0, actionLogic_1.getSuccessfulEitherActionResult)(earlyExitQpqEventRecordResponse);
|
|
26
26
|
}
|
|
27
|
-
const messageSession = yield* (0, actions_2.askEventGetStorySession)(eventArguments, qpqEventRecord);
|
|
27
|
+
const messageSession = yield* (0, actions_2.askEventGetStorySession)(eventArguments, qpqEventRecord, matchResultResult.result);
|
|
28
28
|
// Execute the story
|
|
29
29
|
const executeStoryResponse = yield* (0, askCatch_1.askCatch)((0, system_1.askExecuteStory)(matchResultResult.result.runtime, [qpqEventRecord, matchResultResult.result.runtimeOptions], messageSession));
|
|
30
30
|
yield* (0, actions_1.askLogCreate)(types_1.LogLevelEnum.Info, 'executeStoryResponse', executeStoryResponse);
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { QPQError } from './ErrorTypeEnum';
|
|
2
2
|
import { Action } from './Action';
|
|
3
3
|
import { QpqContext } from './QpqContextIdentifier';
|
|
4
|
+
export interface DecodedAccessToken {
|
|
5
|
+
userId: string;
|
|
6
|
+
username: string;
|
|
7
|
+
exp: number;
|
|
8
|
+
roles?: string[];
|
|
9
|
+
userDirectory: string;
|
|
10
|
+
wasValid: boolean;
|
|
11
|
+
}
|
|
4
12
|
export interface StorySession {
|
|
5
13
|
correlation?: string;
|
|
6
14
|
depth: number;
|
|
7
15
|
accessToken?: string;
|
|
16
|
+
decodedAccessToken?: DecodedAccessToken;
|
|
8
17
|
context: QpqContext<any>;
|
|
9
18
|
}
|
|
10
19
|
export type StorySessionUpdater = (newSession: Partial<StorySession>) => void;
|
|
@@ -41,9 +50,9 @@ export type AskResponse<T> = Generator<Action<any>, T, any>;
|
|
|
41
50
|
export type ExtractGeneratorReturnType<T extends Generator> = T extends Generator<any, infer R, any> ? R : never;
|
|
42
51
|
export type AskResponseReturnType<T extends AskResponse<any>> = ExtractGeneratorReturnType<T>;
|
|
43
52
|
export type qpqStory = <T = any>(...args: any[]) => AskResponse<T>;
|
|
44
|
-
export interface ActionHistory<
|
|
45
|
-
act: Action<
|
|
46
|
-
res:
|
|
53
|
+
export interface ActionHistory<P = any, R = any> {
|
|
54
|
+
act: Action<P>;
|
|
55
|
+
res: R;
|
|
47
56
|
startedAt: string;
|
|
48
57
|
finishedAt: string;
|
|
49
58
|
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { EventGetStorySessionActionRequester } from './EventGetStorySessionActionTypes';
|
|
2
|
-
|
|
2
|
+
import { AnyMatchStoryResult } from './EventActionType';
|
|
3
|
+
export declare function askEventGetStorySession<EventParams extends Array<unknown>, QpqEventRecord, MSR extends AnyMatchStoryResult>(eventParams: EventParams, qpqEventRecord: QpqEventRecord, matchStoryResult: MSR): EventGetStorySessionActionRequester<EventParams, QpqEventRecord, MSR>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventActionType } from './EventActionType';
|
|
2
|
-
export function* askEventGetStorySession(eventParams, qpqEventRecord) {
|
|
2
|
+
export function* askEventGetStorySession(eventParams, qpqEventRecord, matchStoryResult) {
|
|
3
3
|
return yield {
|
|
4
4
|
type: EventActionType.GetStorySession,
|
|
5
|
-
payload: { eventParams, qpqEventRecord },
|
|
5
|
+
payload: { eventParams, qpqEventRecord, matchStoryResult },
|
|
6
6
|
};
|
|
7
7
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { StorySession } from '../../types';
|
|
2
2
|
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
3
|
-
import { EventActionType } from './EventActionType';
|
|
4
|
-
export interface EventGetStorySessionActionPayload<EventParams extends Array<unknown>, QpqEventRecord> {
|
|
3
|
+
import { AnyMatchStoryResult, EventActionType } from './EventActionType';
|
|
4
|
+
export interface EventGetStorySessionActionPayload<EventParams extends Array<unknown>, QpqEventRecord, MSR extends AnyMatchStoryResult> {
|
|
5
5
|
qpqEventRecord: QpqEventRecord;
|
|
6
6
|
eventParams: EventParams;
|
|
7
|
+
matchStoryResult: MSR;
|
|
7
8
|
}
|
|
8
|
-
export interface EventGetStorySessionAction<EventParams extends Array<unknown>, QpqEventRecord> extends Action<EventGetStorySessionActionPayload<EventParams, QpqEventRecord>> {
|
|
9
|
+
export interface EventGetStorySessionAction<EventParams extends Array<unknown>, QpqEventRecord, MSR extends AnyMatchStoryResult> extends Action<EventGetStorySessionActionPayload<EventParams, QpqEventRecord, MSR>> {
|
|
9
10
|
type: EventActionType.GetStorySession;
|
|
10
|
-
payload: EventGetStorySessionActionPayload<EventParams, QpqEventRecord>;
|
|
11
|
+
payload: EventGetStorySessionActionPayload<EventParams, QpqEventRecord, MSR>;
|
|
11
12
|
}
|
|
12
|
-
export type EventGetStorySessionActionProcessor<EventParams extends Array<unknown>, QpqEventRecord> = ActionProcessor<EventGetStorySessionAction<EventParams, QpqEventRecord>, StorySession | undefined>;
|
|
13
|
-
export type EventGetStorySessionActionRequester<EventParams extends Array<unknown>, QpqEventRecord> = ActionRequester<EventGetStorySessionAction<EventParams, QpqEventRecord>, StorySession | undefined>;
|
|
13
|
+
export type EventGetStorySessionActionProcessor<EventParams extends Array<unknown>, QpqEventRecord, MSR extends AnyMatchStoryResult> = ActionProcessor<EventGetStorySessionAction<EventParams, QpqEventRecord, MSR>, StorySession | undefined>;
|
|
14
|
+
export type EventGetStorySessionActionRequester<EventParams extends Array<unknown>, QpqEventRecord, MSR extends AnyMatchStoryResult> = ActionRequester<EventGetStorySessionAction<EventParams, QpqEventRecord, MSR>, StorySession | undefined>;
|
|
@@ -38,10 +38,6 @@ export interface AuthenticateUserResponse {
|
|
|
38
38
|
session?: string;
|
|
39
39
|
authenticationInfo?: AuthenticationInfo;
|
|
40
40
|
}
|
|
41
|
-
export interface DecodedAccessToken {
|
|
42
|
-
userId: string;
|
|
43
|
-
username: string;
|
|
44
|
-
}
|
|
45
41
|
export interface UserAttributes {
|
|
46
42
|
/** The user's email address */
|
|
47
43
|
email?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { DecodedAccessToken } from '../../types';
|
|
1
2
|
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
|
-
import { UserDirectoryActionType
|
|
3
|
+
import { UserDirectoryActionType } from './UserDirectoryActionType';
|
|
3
4
|
export interface UserDirectoryDecodeAccessTokenActionPayload {
|
|
4
5
|
userDirectoryName: string;
|
|
5
6
|
ignoreExpiration: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { DecodedAccessToken } from '../../types';
|
|
1
2
|
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
|
-
import { UserDirectoryActionType
|
|
3
|
+
import { UserDirectoryActionType } from './UserDirectoryActionType';
|
|
3
4
|
export interface UserDirectoryReadAccessTokenActionPayload {
|
|
4
5
|
userDirectoryName: string;
|
|
5
6
|
ignoreExpiration: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { UserDirectorySetAccessTokenActionRequester } from './UserDirectorySetAccessTokenActionTypes';
|
|
2
|
-
export declare function askUserDirectorySetAccessToken(accessToken: string): UserDirectorySetAccessTokenActionRequester;
|
|
2
|
+
export declare function askUserDirectorySetAccessToken(userDirectoryName: string, accessToken: string): UserDirectorySetAccessTokenActionRequester;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { UserDirectoryActionType } from './UserDirectoryActionType';
|
|
2
|
-
export function* askUserDirectorySetAccessToken(accessToken) {
|
|
2
|
+
export function* askUserDirectorySetAccessToken(userDirectoryName, accessToken) {
|
|
3
3
|
return yield {
|
|
4
4
|
type: UserDirectoryActionType.SetAccessToken,
|
|
5
5
|
payload: {
|
|
6
6
|
accessToken,
|
|
7
|
+
userDirectoryName,
|
|
7
8
|
},
|
|
8
9
|
};
|
|
9
10
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { DecodedAccessToken } from '../../types';
|
|
1
2
|
import { Action, ActionProcessor, ActionRequester } from '../../types/Action';
|
|
2
3
|
import { UserDirectoryActionType } from './UserDirectoryActionType';
|
|
3
4
|
export interface UserDirectorySetAccessTokenActionPayload {
|
|
4
5
|
accessToken: string;
|
|
6
|
+
userDirectoryName: string;
|
|
5
7
|
}
|
|
6
8
|
export interface UserDirectorySetAccessTokenAction extends Action<UserDirectorySetAccessTokenActionPayload> {
|
|
7
9
|
type: UserDirectoryActionType.SetAccessToken;
|
|
8
10
|
payload: UserDirectorySetAccessTokenActionPayload;
|
|
9
11
|
}
|
|
10
|
-
export type UserDirectorySetAccessTokenActionProcessor = ActionProcessor<UserDirectorySetAccessTokenAction,
|
|
11
|
-
export type UserDirectorySetAccessTokenActionRequester = ActionRequester<UserDirectorySetAccessTokenAction,
|
|
12
|
+
export type UserDirectorySetAccessTokenActionProcessor = ActionProcessor<UserDirectorySetAccessTokenAction, DecodedAccessToken>;
|
|
13
|
+
export type UserDirectorySetAccessTokenActionRequester = ActionRequester<UserDirectorySetAccessTokenAction, DecodedAccessToken>;
|
|
@@ -2,14 +2,13 @@ import { CrossModuleOwner } from '../types';
|
|
|
2
2
|
export declare enum QPQCoreConfigSettingType {
|
|
3
3
|
appName = "@quidproquo-core/config/AppName",
|
|
4
4
|
moduleName = "@quidproquo-core/config/moduleName",
|
|
5
|
-
appBasePath = "@quidproquo-core/config/appBasePath",
|
|
6
5
|
storageDrive = "@quidproquo-core/config/storageDrive",
|
|
7
6
|
schedule = "@quidproquo-core/config/schedule",
|
|
8
7
|
secret = "@quidproquo-core/config/secret",
|
|
9
8
|
global = "@quidproquo-core/config/global",
|
|
10
9
|
parameter = "@quidproquo-core/config/parameter",
|
|
11
10
|
actionProcessors = "@quidproquo-core/config/actionProcessors",
|
|
12
|
-
|
|
11
|
+
apiBuildPath = "@quidproquo-core/config/apiBuildPath",
|
|
13
12
|
queue = "@quidproquo-core/config/Queue",
|
|
14
13
|
eventBus = "@quidproquo-core/config/EventBus",
|
|
15
14
|
userDirectory = "@quidproquo-core/config/UserDirectory",
|
|
@@ -2,14 +2,13 @@ export var QPQCoreConfigSettingType;
|
|
|
2
2
|
(function (QPQCoreConfigSettingType) {
|
|
3
3
|
QPQCoreConfigSettingType["appName"] = "@quidproquo-core/config/AppName";
|
|
4
4
|
QPQCoreConfigSettingType["moduleName"] = "@quidproquo-core/config/moduleName";
|
|
5
|
-
QPQCoreConfigSettingType["appBasePath"] = "@quidproquo-core/config/appBasePath";
|
|
6
5
|
QPQCoreConfigSettingType["storageDrive"] = "@quidproquo-core/config/storageDrive";
|
|
7
6
|
QPQCoreConfigSettingType["schedule"] = "@quidproquo-core/config/schedule";
|
|
8
7
|
QPQCoreConfigSettingType["secret"] = "@quidproquo-core/config/secret";
|
|
9
8
|
QPQCoreConfigSettingType["global"] = "@quidproquo-core/config/global";
|
|
10
9
|
QPQCoreConfigSettingType["parameter"] = "@quidproquo-core/config/parameter";
|
|
11
10
|
QPQCoreConfigSettingType["actionProcessors"] = "@quidproquo-core/config/actionProcessors";
|
|
12
|
-
QPQCoreConfigSettingType["
|
|
11
|
+
QPQCoreConfigSettingType["apiBuildPath"] = "@quidproquo-core/config/apiBuildPath";
|
|
13
12
|
QPQCoreConfigSettingType["queue"] = "@quidproquo-core/config/Queue";
|
|
14
13
|
QPQCoreConfigSettingType["eventBus"] = "@quidproquo-core/config/EventBus";
|
|
15
14
|
QPQCoreConfigSettingType["userDirectory"] = "@quidproquo-core/config/UserDirectory";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './defineApiBuildPath';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './defineApiBuildPath';
|
|
@@ -7,4 +7,4 @@ export interface ApplicationModuleQPQConfigSetting extends QPQConfigSetting {
|
|
|
7
7
|
deployRegion?: string;
|
|
8
8
|
feature?: string;
|
|
9
9
|
}
|
|
10
|
-
export declare const defineApplicationModule: (applicationName: string, moduleName: string, environment: string, configRoot: string, deployRegion?: string, feature?: string) => QPQConfig;
|
|
10
|
+
export declare const defineApplicationModule: (applicationName: string, moduleName: string, environment: string, configRoot: string, apiBuildPath: string, deployRegion?: string, feature?: string) => QPQConfig;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { defineApiBuildPath } from './apiBuildPath';
|
|
1
2
|
import { defineApplication } from './applicationName';
|
|
2
3
|
import { defineModule } from './moduleName';
|
|
3
|
-
export const defineApplicationModule = (applicationName, moduleName, environment, configRoot, deployRegion, feature) => [
|
|
4
|
+
export const defineApplicationModule = (applicationName, moduleName, environment, configRoot, apiBuildPath, deployRegion, feature) => [
|
|
4
5
|
defineApplication(applicationName, environment, configRoot, deployRegion, feature),
|
|
5
6
|
defineModule(moduleName),
|
|
7
|
+
defineApiBuildPath(apiBuildPath),
|
|
6
8
|
];
|
|
@@ -2,7 +2,6 @@ import { QpqFunctionRuntime } from '../../types';
|
|
|
2
2
|
import { QPQConfigSetting } from '../QPQConfig';
|
|
3
3
|
export interface DeployEventsQPQConfigSetting extends QPQConfigSetting {
|
|
4
4
|
name: string;
|
|
5
|
-
buildPath: string;
|
|
6
5
|
runtime: QpqFunctionRuntime;
|
|
7
6
|
}
|
|
8
|
-
export declare const defineDeployEvent: (
|
|
7
|
+
export declare const defineDeployEvent: (name: string, runtime: QpqFunctionRuntime) => DeployEventsQPQConfigSetting;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { QPQCoreConfigSettingType } from '../QPQConfig';
|
|
2
|
-
export const defineDeployEvent = (
|
|
2
|
+
export const defineDeployEvent = (name, runtime) => ({
|
|
3
3
|
configSettingType: QPQCoreConfigSettingType.deployEvent,
|
|
4
4
|
uniqueKey: name,
|
|
5
|
-
buildPath,
|
|
6
5
|
runtime,
|
|
7
6
|
name,
|
|
8
7
|
});
|
|
@@ -2,10 +2,9 @@ export * from './emailTemplates';
|
|
|
2
2
|
export * from './actionProcessors';
|
|
3
3
|
export * from './applicationModule';
|
|
4
4
|
export * from './applicationName';
|
|
5
|
-
export * from './applicationBasePath';
|
|
6
5
|
export * from './applicationVersion';
|
|
7
6
|
export * from './moduleName';
|
|
8
|
-
export * from './
|
|
7
|
+
export * from './apiBuildPath';
|
|
9
8
|
export * from './configValue';
|
|
10
9
|
export * from './environmentSettings';
|
|
11
10
|
export * from './eventBus';
|
|
@@ -2,10 +2,9 @@ export * from './emailTemplates';
|
|
|
2
2
|
export * from './actionProcessors';
|
|
3
3
|
export * from './applicationModule';
|
|
4
4
|
export * from './applicationName';
|
|
5
|
-
export * from './applicationBasePath';
|
|
6
5
|
export * from './applicationVersion';
|
|
7
6
|
export * from './moduleName';
|
|
8
|
-
export * from './
|
|
7
|
+
export * from './apiBuildPath';
|
|
9
8
|
export * from './configValue';
|
|
10
9
|
export * from './environmentSettings';
|
|
11
10
|
export * from './eventBus';
|
|
@@ -15,7 +15,6 @@ export interface QPQConfigAdvancedQueueSettings extends QPQConfigAdvancedSetting
|
|
|
15
15
|
}
|
|
16
16
|
export interface QueueQPQConfigSetting extends QPQConfigSetting {
|
|
17
17
|
name: string;
|
|
18
|
-
buildPath: string;
|
|
19
18
|
batchSize: number;
|
|
20
19
|
batchWindowInSeconds: number;
|
|
21
20
|
concurrency: number;
|
|
@@ -26,4 +25,4 @@ export interface QueueQPQConfigSetting extends QPQConfigSetting {
|
|
|
26
25
|
eventBusSubscriptions: string[];
|
|
27
26
|
maxConcurrentExecutions?: number;
|
|
28
27
|
}
|
|
29
|
-
export declare const defineQueue: (name: string,
|
|
28
|
+
export declare const defineQueue: (name: string, processors: QpqQueueProcessors, options?: QPQConfigAdvancedQueueSettings) => QueueQPQConfigSetting;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { QPQCoreConfigSettingType } from '../QPQConfig';
|
|
2
|
-
export const defineQueue = (name,
|
|
2
|
+
export const defineQueue = (name, processors, options) => ({
|
|
3
3
|
configSettingType: QPQCoreConfigSettingType.queue,
|
|
4
4
|
uniqueKey: name,
|
|
5
5
|
name,
|
|
6
|
-
buildPath,
|
|
7
6
|
batchSize: options?.batchSize || 0,
|
|
8
7
|
batchWindowInSeconds: options?.batchWindowInSeconds || 5,
|
|
9
8
|
concurrency: options?.concurrency || 1,
|
|
@@ -10,7 +10,6 @@ export interface ScheduleQPQConfigSetting extends QPQConfigSetting {
|
|
|
10
10
|
scheduleType: ScheduleTypeEnum;
|
|
11
11
|
runtime: QpqFunctionRuntime;
|
|
12
12
|
cronExpression: string;
|
|
13
|
-
buildPath: string;
|
|
14
13
|
metadata: Record<string, any>;
|
|
15
14
|
}
|
|
16
15
|
/**
|
|
@@ -73,4 +72,4 @@ export interface ScheduleQPQConfigSetting extends QPQConfigSetting {
|
|
|
73
72
|
* @param {string} buildPath - The build path to the function's code.
|
|
74
73
|
* @returns {ScheduleQPQConfigSetting} The configuration setting for the scheduled task.
|
|
75
74
|
*/
|
|
76
|
-
export declare const defineRecurringSchedule: (cronExpression: string, runtime: QpqFunctionRuntime,
|
|
75
|
+
export declare const defineRecurringSchedule: (cronExpression: string, runtime: QpqFunctionRuntime, options?: QPQConfigAdvancedScheduleSettings) => ScheduleQPQConfigSetting;
|
|
@@ -64,7 +64,7 @@ export var ScheduleTypeEnum;
|
|
|
64
64
|
* @param {string} buildPath - The build path to the function's code.
|
|
65
65
|
* @returns {ScheduleQPQConfigSetting} The configuration setting for the scheduled task.
|
|
66
66
|
*/
|
|
67
|
-
export const defineRecurringSchedule = (cronExpression, runtime,
|
|
67
|
+
export const defineRecurringSchedule = (cronExpression, runtime, options) => {
|
|
68
68
|
const uniqueKey = getStoryNameFromQpqFunctionRuntime(runtime);
|
|
69
69
|
return {
|
|
70
70
|
configSettingType: QPQCoreConfigSettingType.schedule,
|
|
@@ -72,7 +72,6 @@ export const defineRecurringSchedule = (cronExpression, runtime, buildPath, opti
|
|
|
72
72
|
scheduleType: ScheduleTypeEnum.Recurring,
|
|
73
73
|
runtime,
|
|
74
74
|
cronExpression,
|
|
75
|
-
buildPath,
|
|
76
75
|
metadata: options?.metadata || {},
|
|
77
76
|
};
|
|
78
77
|
};
|
|
@@ -35,7 +35,6 @@ export interface QPQConfigAdvancedUserDirectorySettings extends QPQConfigAdvance
|
|
|
35
35
|
}
|
|
36
36
|
export interface UserDirectoryQPQConfigSetting extends QPQConfigSetting {
|
|
37
37
|
name: string;
|
|
38
|
-
buildPath: string;
|
|
39
38
|
phoneRequired: boolean;
|
|
40
39
|
selfSignUpEnabled: boolean;
|
|
41
40
|
emailTemplates: EmailTemplates;
|
|
@@ -44,4 +43,4 @@ export interface UserDirectoryQPQConfigSetting extends QPQConfigSetting {
|
|
|
44
43
|
oAuth?: AuthDirectoryOAuth;
|
|
45
44
|
customAuthRuntime?: CustomAuthRuntime;
|
|
46
45
|
}
|
|
47
|
-
export declare const defineUserDirectory: (name: string,
|
|
46
|
+
export declare const defineUserDirectory: (name: string, options?: QPQConfigAdvancedUserDirectorySettings) => UserDirectoryQPQConfigSetting;
|
|
@@ -5,11 +5,10 @@ export var AuthDirectoryFederatedProviderType;
|
|
|
5
5
|
AuthDirectoryFederatedProviderType["Facebook"] = "facebook";
|
|
6
6
|
AuthDirectoryFederatedProviderType["Google"] = "google";
|
|
7
7
|
})(AuthDirectoryFederatedProviderType || (AuthDirectoryFederatedProviderType = {}));
|
|
8
|
-
export const defineUserDirectory = (name,
|
|
8
|
+
export const defineUserDirectory = (name, options) => ({
|
|
9
9
|
configSettingType: QPQCoreConfigSettingType.userDirectory,
|
|
10
10
|
uniqueKey: name,
|
|
11
11
|
name,
|
|
12
|
-
buildPath,
|
|
13
12
|
phoneRequired: options?.phoneRequired || false,
|
|
14
13
|
selfSignUpEnabled: options?.selfSignUpEnabled || true,
|
|
15
14
|
emailTemplates: {
|
|
@@ -19,7 +19,7 @@ export const createImplementationRuntime = (qpqConfig, tags, getDateNow, randomG
|
|
|
19
19
|
const resolveStory = createRuntime(qpqConfig, {
|
|
20
20
|
context: session.context,
|
|
21
21
|
depth: (session.depth || 0) + 1,
|
|
22
|
-
|
|
22
|
+
decodedAccessToken: session.decodedAccessToken,
|
|
23
23
|
correlation: session.correlation,
|
|
24
24
|
}, async () => actionProcessors, getDateNow, logger,
|
|
25
25
|
// TODO: Share this logic.
|
|
@@ -67,7 +67,7 @@ export declare const getScheduleEvents: (configs: QPQConfig) => ScheduleQPQConfi
|
|
|
67
67
|
export declare const getQueueSrcEntries: (configs: QPQConfig) => QpqFunctionRuntime[];
|
|
68
68
|
export declare const getUserDirectorySrcEntries: (qpqConfig: QPQConfig) => QpqFunctionRuntime[];
|
|
69
69
|
export declare const getAllSrcEntries: (qpqConfig: QPQConfig) => QpqFunctionRuntime[];
|
|
70
|
-
export declare const
|
|
70
|
+
export declare const getApiBuildPath: (qpqConfig: QPQConfig) => string;
|
|
71
71
|
export declare const getSrcPathFromQpqFunctionRuntime: (qpqFunctionRuntime: QpqFunctionRuntime) => string;
|
|
72
72
|
export declare function getSrcPathFromQpqFunctionRuntimeWithoutLeadingSlash(runtime: QpqFunctionRuntime): string;
|
|
73
73
|
export declare const getFullSrcPathFromQpqFunctionRuntime: (qpqFunctionRuntime: QpqFunctionRuntime, qpqConfig: QPQConfig, configRootOverride?: string) => string;
|
|
@@ -84,12 +84,8 @@ export declare const getAllParameterConfigs: (qpqConfig: QPQConfig) => Parameter
|
|
|
84
84
|
export declare const getParameterConfig: (name: string, qpqConfig: QPQConfig) => ParameterQPQConfigSetting;
|
|
85
85
|
export declare const getOwnedParameterConfigs: (qpqConfig: QPQConfig) => ParameterQPQConfigSetting[];
|
|
86
86
|
export declare const getUniqueKeyForSetting: (setting: QPQConfigSetting) => string;
|
|
87
|
-
export declare const getScheduleEntryFullPath: (qpqConfig: QPQConfig, scheduleConfig: ScheduleQPQConfigSetting) => string;
|
|
88
|
-
export declare const getStorageDriveEntryFullPath: (qpqConfig: QPQConfig, storageDriveConfig: StorageDriveQPQConfigSetting) => string;
|
|
89
|
-
export declare const getDeployEventFullPath: (qpqConfig: QPQConfig, deployEventConfig: DeployEventsQPQConfigSetting) => string;
|
|
90
87
|
export declare const getStorageDriveUploadFullPath: (qpqConfig: QPQConfig, storageDriveConfig: StorageDriveQPQConfigSetting) => string;
|
|
91
|
-
export declare const
|
|
92
|
-
export declare const getUserDirectoryEntryFullPath: (qpqConfig: QPQConfig, userDirectoryConfig: UserDirectoryQPQConfigSetting) => string;
|
|
88
|
+
export declare const getApiBuildPathFullPath: (qpqConfig: QPQConfig) => string;
|
|
93
89
|
export declare const getQueueQueueProcessors: (name: string, qpqConfig: QPQConfig) => QpqQueueProcessors;
|
|
94
90
|
export declare const convertCrossModuleOwnerToGenericResourceNameOverride: <T extends string>(owner?: CrossModuleOwner<T> | undefined) => CrossModuleOwner<'resourceNameOverride'> | undefined;
|
|
95
91
|
export declare const convertCustomFullyQualifiedResourceToGeneric: <T extends string>(resource: CustomFullyQualifiedResource<T>) => FullyQualifiedResource;
|
package/lib/esm/qpqCoreUtils.js
CHANGED
|
@@ -224,12 +224,12 @@ export const getAllSrcEntries = (qpqConfig) => {
|
|
|
224
224
|
];
|
|
225
225
|
return result;
|
|
226
226
|
};
|
|
227
|
-
export const
|
|
228
|
-
const [
|
|
229
|
-
if (!
|
|
230
|
-
throw new Error(`Can not find app base path use
|
|
227
|
+
export const getApiBuildPath = (qpqConfig) => {
|
|
228
|
+
const [apiBuildPathConfig] = getConfigSettings(qpqConfig, QPQCoreConfigSettingType.apiBuildPath);
|
|
229
|
+
if (!apiBuildPathConfig) {
|
|
230
|
+
throw new Error(`Can not find app base path use defineApiBuildPath or defineApplicationModule`);
|
|
231
231
|
}
|
|
232
|
-
return
|
|
232
|
+
return apiBuildPathConfig.apiBuildPath;
|
|
233
233
|
};
|
|
234
234
|
export const getSrcPathFromQpqFunctionRuntime = (qpqFunctionRuntime) => {
|
|
235
235
|
const [srcPath, _method] = qpqFunctionRuntime.split('::');
|
|
@@ -320,26 +320,13 @@ export const getUniqueKeyForSetting = (setting) => {
|
|
|
320
320
|
const key = setting.uniqueKey;
|
|
321
321
|
return `${type}${key}`;
|
|
322
322
|
};
|
|
323
|
-
export const getScheduleEntryFullPath = (qpqConfig, scheduleConfig) => {
|
|
324
|
-
return joinPaths(getConfigRoot(qpqConfig), scheduleConfig.buildPath);
|
|
325
|
-
};
|
|
326
|
-
export const getStorageDriveEntryFullPath = (qpqConfig, storageDriveConfig) => {
|
|
327
|
-
if (!storageDriveConfig.onEvent?.buildPath) {
|
|
328
|
-
throw new Error('Please specify a build path in your storage drive config (onEvent)');
|
|
329
|
-
}
|
|
330
|
-
return joinPaths(getConfigRoot(qpqConfig), storageDriveConfig.onEvent.buildPath);
|
|
331
|
-
};
|
|
332
|
-
export const getDeployEventFullPath = (qpqConfig, deployEventConfig) => {
|
|
333
|
-
return joinPaths(getConfigRoot(qpqConfig), deployEventConfig.buildPath);
|
|
334
|
-
};
|
|
335
323
|
export const getStorageDriveUploadFullPath = (qpqConfig, storageDriveConfig) => {
|
|
336
324
|
return joinPaths(getConfigRoot(qpqConfig), storageDriveConfig.copyPath || '');
|
|
337
325
|
};
|
|
338
|
-
export const
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
return joinPaths(getConfigRoot(qpqConfig), userDirectoryConfig.buildPath);
|
|
326
|
+
export const getApiBuildPathFullPath = (qpqConfig) => {
|
|
327
|
+
const configRoot = getConfigRoot(qpqConfig);
|
|
328
|
+
const apiBuildPath = getApiBuildPath(qpqConfig);
|
|
329
|
+
return joinPaths(configRoot, apiBuildPath);
|
|
343
330
|
};
|
|
344
331
|
export const getQueueQueueProcessors = (name, qpqConfig) => {
|
|
345
332
|
const seoConfigs = getConfigSettings(qpqConfig, QPQCoreConfigSettingType.queue);
|
package/lib/esm/qpqExecuteLog.js
CHANGED
|
@@ -18,7 +18,7 @@ export const qpqExecuteLog = async (storyResult, runtime, overrides = {}) => {
|
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
20
|
// Generate an empty story resolver
|
|
21
|
-
const resolveStory = createRuntime([defineApplicationModule('Debugger', storyResult.moduleName, 'development', __dirname)], {
|
|
21
|
+
const resolveStory = createRuntime([defineApplicationModule('Debugger', storyResult.moduleName, 'development', __dirname, './dist')], {
|
|
22
22
|
correlation: storyResult.fromCorrelation,
|
|
23
23
|
depth: storyResult.session.depth,
|
|
24
24
|
context: storyResult.session.context,
|
package/lib/esm/qpqRuntime.js
CHANGED
|
@@ -27,7 +27,7 @@ export const createRuntime = (qpqConfig, callerSession, getActionProcessors, get
|
|
|
27
27
|
let storySession = {
|
|
28
28
|
correlation: runtimeCorrelation,
|
|
29
29
|
depth: callerSession.depth + 1,
|
|
30
|
-
|
|
30
|
+
decodedAccessToken: callerSession.decodedAccessToken,
|
|
31
31
|
context: callerSession.context,
|
|
32
32
|
};
|
|
33
33
|
const updateSession = (newSession) => {
|
|
@@ -21,7 +21,7 @@ function* askProcessEventRecord(qpqEventRecord, eventArguments) {
|
|
|
21
21
|
// return the result
|
|
22
22
|
return getSuccessfulEitherActionResult(earlyExitQpqEventRecordResponse);
|
|
23
23
|
}
|
|
24
|
-
const messageSession = yield* askEventGetStorySession(eventArguments, qpqEventRecord);
|
|
24
|
+
const messageSession = yield* askEventGetStorySession(eventArguments, qpqEventRecord, matchResultResult.result);
|
|
25
25
|
// Execute the story
|
|
26
26
|
const executeStoryResponse = yield* askCatch(askExecuteStory(matchResultResult.result.runtime, [qpqEventRecord, matchResultResult.result.runtimeOptions], messageSession));
|
|
27
27
|
yield* askLogCreate(LogLevelEnum.Info, 'executeStoryResponse', executeStoryResponse);
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { QPQError } from './ErrorTypeEnum';
|
|
2
2
|
import { Action } from './Action';
|
|
3
3
|
import { QpqContext } from './QpqContextIdentifier';
|
|
4
|
+
export interface DecodedAccessToken {
|
|
5
|
+
userId: string;
|
|
6
|
+
username: string;
|
|
7
|
+
exp: number;
|
|
8
|
+
roles?: string[];
|
|
9
|
+
userDirectory: string;
|
|
10
|
+
wasValid: boolean;
|
|
11
|
+
}
|
|
4
12
|
export interface StorySession {
|
|
5
13
|
correlation?: string;
|
|
6
14
|
depth: number;
|
|
7
15
|
accessToken?: string;
|
|
16
|
+
decodedAccessToken?: DecodedAccessToken;
|
|
8
17
|
context: QpqContext<any>;
|
|
9
18
|
}
|
|
10
19
|
export type StorySessionUpdater = (newSession: Partial<StorySession>) => void;
|
|
@@ -41,9 +50,9 @@ export type AskResponse<T> = Generator<Action<any>, T, any>;
|
|
|
41
50
|
export type ExtractGeneratorReturnType<T extends Generator> = T extends Generator<any, infer R, any> ? R : never;
|
|
42
51
|
export type AskResponseReturnType<T extends AskResponse<any>> = ExtractGeneratorReturnType<T>;
|
|
43
52
|
export type qpqStory = <T = any>(...args: any[]) => AskResponse<T>;
|
|
44
|
-
export interface ActionHistory<
|
|
45
|
-
act: Action<
|
|
46
|
-
res:
|
|
53
|
+
export interface ActionHistory<P = any, R = any> {
|
|
54
|
+
act: Action<P>;
|
|
55
|
+
res: R;
|
|
47
56
|
startedAt: string;
|
|
48
57
|
finishedAt: string;
|
|
49
58
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quidproquo-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.232",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/joe-coady/quidproquo#readme",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"quidproquo-tsconfig": "0.0.
|
|
32
|
+
"quidproquo-tsconfig": "0.0.232",
|
|
33
33
|
"typescript": "^4.9.3"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defineApplicationBasePath = void 0;
|
|
4
|
-
const QPQConfig_1 = require("../QPQConfig");
|
|
5
|
-
const defineApplicationBasePath = (basePath) => ({
|
|
6
|
-
configSettingType: QPQConfig_1.QPQCoreConfigSettingType.appBasePath,
|
|
7
|
-
// There can be only one base path
|
|
8
|
-
uniqueKey: 'Base_Path',
|
|
9
|
-
basePath,
|
|
10
|
-
});
|
|
11
|
-
exports.defineApplicationBasePath = defineApplicationBasePath;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defineBuildPath = void 0;
|
|
4
|
-
const QPQConfig_1 = require("../QPQConfig");
|
|
5
|
-
const defineBuildPath = (buildPath) => ({
|
|
6
|
-
configSettingType: QPQConfig_1.QPQCoreConfigSettingType.buildPath,
|
|
7
|
-
uniqueKey: buildPath,
|
|
8
|
-
buildPath,
|
|
9
|
-
});
|
|
10
|
-
exports.defineBuildPath = defineBuildPath;
|