quidproquo-core
Advanced tools
Comparing version 0.0.170 to 0.0.171
@@ -1,2 +0,2 @@ | ||
import { StorageDriveTier } from "../../config"; | ||
import { StorageDriveTier } from '../../config'; | ||
export declare enum FileActionType { | ||
@@ -9,3 +9,4 @@ ReadTextContents = "@quidproquo-core/File/ReadTextContents", | ||
ReadBinaryContents = "@quidproquo-core/File/ReadBinaryContents", | ||
WriteBinaryContents = "@quidproquo-core/File/WriteBinaryContents" | ||
WriteBinaryContents = "@quidproquo-core/File/WriteBinaryContents", | ||
GenerateTemporarySecureUrl = "@quidproquo-core/File/GenerateTemporarySecureUrl" | ||
} | ||
@@ -12,0 +13,0 @@ export declare const filePathDelimiter = "/"; |
@@ -13,3 +13,4 @@ "use strict"; | ||
FileActionType["WriteBinaryContents"] = "@quidproquo-core/File/WriteBinaryContents"; | ||
FileActionType["GenerateTemporarySecureUrl"] = "@quidproquo-core/File/GenerateTemporarySecureUrl"; | ||
})(FileActionType = exports.FileActionType || (exports.FileActionType = {})); | ||
exports.filePathDelimiter = `/`; |
@@ -16,1 +16,3 @@ export * from './FileActionType'; | ||
export * from './FileWriteBinaryContentsActionTypes'; | ||
export * from './FileGenerateTemporarySecureUrlActionRequester'; | ||
export * from './FileGenerateTemporarySecureUrlActionTypes'; |
@@ -32,1 +32,3 @@ "use strict"; | ||
__exportStar(require("./FileWriteBinaryContentsActionTypes"), exports); | ||
__exportStar(require("./FileGenerateTemporarySecureUrlActionRequester"), exports); | ||
__exportStar(require("./FileGenerateTemporarySecureUrlActionTypes"), exports); |
import { LogCreateActionRequester } from './LogCreateActionTypes'; | ||
import { LogLevelEnum } from '../../types/LogLevelEnum'; | ||
export declare function askLogCreate(logLevel: LogLevelEnum, msg: string, data?: object): LogCreateActionRequester; | ||
export declare function askLogCreate(logLevel: LogLevelEnum, msg: string, data?: any): LogCreateActionRequester; |
@@ -11,3 +11,3 @@ "use strict"; | ||
msg, | ||
dataJson: JSON.stringify(data), | ||
data, | ||
}, | ||
@@ -14,0 +14,0 @@ }; |
@@ -7,3 +7,3 @@ import { Action, ActionProcessor, ActionRequester } from '../../types/Action'; | ||
msg: string; | ||
dataJson?: string; | ||
data?: any; | ||
} | ||
@@ -10,0 +10,0 @@ export interface LogCreateAction extends Action<LogCreateActionPayload> { |
@@ -61,2 +61,3 @@ "use strict"; | ||
runtimeType: runtimeType, | ||
logs: [], | ||
}; | ||
@@ -131,5 +132,23 @@ // Exit if the depth has exceeded the limit (of 100) | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const storyResult = yield resolveStory(story, args); | ||
yield logger(storyResult); | ||
return storyResult; | ||
const logs = []; | ||
const oldConsoleLog = console.log; | ||
try { | ||
// TODO: This would need to change once we move to web | ||
// we can't just override console.log like this when running concurrently | ||
console.log = (...args) => { | ||
const logLog = { | ||
t: getTimeNow(), | ||
a: args, | ||
}; | ||
logs.push(logLog); | ||
return oldConsoleLog(...args); | ||
}; | ||
const storyResult = yield resolveStory(story, args); | ||
storyResult.logs = logs; | ||
yield logger(storyResult); | ||
return storyResult; | ||
} | ||
finally { | ||
console.log = oldConsoleLog; | ||
} | ||
}); | ||
@@ -136,0 +155,0 @@ } |
@@ -16,3 +16,3 @@ "use strict"; | ||
// Log the early exit response | ||
yield* (0, actions_1.askLogCreate)(types_1.LogLevelEnum.Info, `earlyExitResponse [${JSON.stringify(earlyExitResponse, null, 2)}]`); | ||
yield* (0, actions_1.askLogCreate)(types_1.LogLevelEnum.Info, 'earlyExitResponse', earlyExitResponse || `[no early exit response]`); | ||
if (earlyExitResponse) { | ||
@@ -19,0 +19,0 @@ // Transform the early exit response if needed |
import { QPQError } from './ErrorTypeEnum'; | ||
import { StoryResult, StorySession, StorySessionUpdater } from './StorySession'; | ||
import { ExtractGeneratorReturnType, StoryResult, StorySession, StorySessionUpdater } from './StorySession'; | ||
export interface Action<T> { | ||
@@ -9,2 +9,3 @@ type: string; | ||
export type ActionProcessorResult<T> = [T?, QPQError?]; | ||
export type AsyncActionProcessorResult<T> = Promise<ActionProcessorResult<T>>; | ||
export type EitherActionResult<T> = { | ||
@@ -19,6 +20,7 @@ success: true; | ||
}; | ||
export type ActionProcessor<TAction extends Action<any>, TReturn = any, TActionPayload = TAction['payload']> = (payload: TActionPayload, session: StorySession, actionProcessors: ActionProcessorList, logger: (result: StoryResult<any>) => Promise<void>, updateSession: StorySessionUpdater) => Promise<ActionProcessorResult<TReturn>>; | ||
export type ActionProcessor<TAction extends Action<any>, TReturn = any> = (payload: TAction['payload'], session: StorySession, actionProcessors: ActionProcessorList, logger: (result: StoryResult<any>) => Promise<void>, updateSession: StorySessionUpdater) => AsyncActionProcessorResult<TReturn>; | ||
export type ActionRequester<TAction extends Action<any>, TReturn = undefined, TQPQReturn = TReturn> = Generator<TAction, TReturn, TQPQReturn>; | ||
export type ActionProcessorReturnType<T extends Generator<any, any, any>> = ExtractGeneratorReturnType<T>; | ||
export type ActionProcessorList = { | ||
[key: string]: ActionProcessor<any, any, any>; | ||
[key: string]: ActionProcessor<any, any>; | ||
}; |
@@ -67,2 +67,6 @@ import { ErrorTypeEnum } from './ErrorTypeEnum'; | ||
} | ||
export interface qpqConsoleLog { | ||
t: string; | ||
a: any[]; | ||
} | ||
export interface StoryResult<TArgs extends Array<any>, TResult = any> { | ||
@@ -81,2 +85,3 @@ input: TArgs; | ||
runtimeType: QpqRuntimeType; | ||
logs?: qpqConsoleLog[]; | ||
} | ||
@@ -83,0 +88,0 @@ export interface StoryResultMetadata { |
{ | ||
"name": "quidproquo-core", | ||
"version": "0.0.170", | ||
"version": "0.0.171", | ||
"description": "", | ||
@@ -28,5 +28,5 @@ "main": "./lib/commonjs/index.js", | ||
"devDependencies": { | ||
"quidproquo-tsconfig": "0.0.170", | ||
"quidproquo-tsconfig": "0.0.171", | ||
"typescript": "^4.9.3" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
277957
448
5423