@trayio/cdk-dsl
Advanced tools
Comparing version 1.0.0 to 1.1.0
import { OperationHandlerAuth, OperationHandlerContext, OperationHandlerResult } from './OperationHandler'; | ||
import { OperationHandlerInvocation } from './OperationHandlerInvocation'; | ||
export type CompositeOperationHandlerFunction<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> = (ctx: OperationHandlerContext<AUTH>, input: IN, invoke: OperationHandlerInvocation<AUTH>) => Promise<OperationHandlerResult<OUT>>; | ||
export declare class CompositeOperationHandler<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
export type CompositeOperationHandlerFunction<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> = (ctx: OperationHandlerContext<AUTH>, input: IN, invoke: OperationHandlerInvocation<AUTH>) => Promise<OperationHandlerResult<OUT>>; | ||
export declare class CompositeOperationHandler<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> { | ||
readonly _tag: 'CompositeOperationHandler'; | ||
@@ -6,0 +6,0 @@ readonly handlerFunction: CompositeOperationHandlerFunction<AUTH, IN, OUT>; |
@@ -15,3 +15,3 @@ import { HttpMethod, HttpRequest, HttpHeaderValue, HttpResponse } from '@trayio/commons/http/Http'; | ||
} | ||
export type HttpOperationRequestHandler<AUTH extends OperationHandlerAuth<any, any>, IN> = (ctx: OperationHandlerContext<AUTH>, input: IN, request: HttpOperationRequest) => HttpOperationRequest; | ||
export type HttpOperationRequestHandler<AUTH extends OperationHandlerAuth<unknown, unknown>, IN> = (ctx: OperationHandlerContext<AUTH>, input: IN, request: HttpOperationRequest) => HttpOperationRequest; | ||
export declare class HttpOperationResponse { | ||
@@ -27,3 +27,3 @@ private jsonSerialization; | ||
export type HttpOperationResponseHandler<OUT> = (response: HttpOperationResponse) => OperationHandlerResult<OUT>; | ||
export declare class HttpOperationHandler<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
export declare class HttpOperationHandler<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> { | ||
readonly _tag: 'HttpOperationHandler'; | ||
@@ -35,3 +35,3 @@ readonly request: HttpOperationRequest; | ||
} | ||
export declare class HttpOperationHandlerResponseConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
export declare class HttpOperationHandlerResponseConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> { | ||
private request; | ||
@@ -42,3 +42,3 @@ private requestHandler; | ||
} | ||
export declare class HttpOperationHandlerRequestConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
export declare class HttpOperationHandlerRequestConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> { | ||
private request; | ||
@@ -48,3 +48,3 @@ constructor(request: HttpOperationRequest); | ||
} | ||
export declare class HttpOperationHandlerConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
export declare class HttpOperationHandlerConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> { | ||
get(path: string): HttpOperationHandlerRequestConfiguration<AUTH, IN, OUT>; | ||
@@ -57,3 +57,3 @@ post(path: string): HttpOperationHandlerRequestConfiguration<AUTH, IN, OUT>; | ||
} | ||
export type HttpOperationHandlerSetup<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> = (http: HttpOperationHandlerConfiguration<AUTH, IN, OUT>) => HttpOperationHandler<AUTH, IN, OUT>; | ||
export type HttpOperationHandlerSetup<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> = (http: HttpOperationHandlerConfiguration<AUTH, IN, OUT>) => HttpOperationHandler<AUTH, IN, OUT>; | ||
//# sourceMappingURL=HttpOperationHandler.d.ts.map |
@@ -28,3 +28,3 @@ import { Result, ResultInterface } from '@trayio/commons/result/Result'; | ||
}; | ||
export type OperationHandlerContext<AUTH extends OperationHandlerAuth<any, any>> = { | ||
export type OperationHandlerContext<AUTH extends OperationHandlerAuth<unknown, unknown>> = { | ||
auth?: AUTH; | ||
@@ -37,3 +37,2 @@ workflowId?: string; | ||
organizationId?: string; | ||
executionStartTime?: string; | ||
sourceWorkflowId?: string; | ||
@@ -46,3 +45,3 @@ solutionId?: string; | ||
}; | ||
export type OperationHandlerReference<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> = { | ||
export type OperationHandlerReference<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> = { | ||
name: string; | ||
@@ -49,0 +48,0 @@ }; |
import { OperationHandlerAuth, OperationHandlerReference, OperationHandlerResult } from './OperationHandler'; | ||
export type OperationHandlerInvocation<AUTH extends OperationHandlerAuth<any, any>> = <IN, OUT>(handlerReference: OperationHandlerReference<AUTH, IN, OUT>) => (input: IN) => Promise<OperationHandlerResult<OUT>>; | ||
export type OperationHandlerInvocation<AUTH extends OperationHandlerAuth<unknown, unknown>> = <IN, OUT>(handlerReference: OperationHandlerReference<AUTH, IN, OUT>) => (input: IN) => Promise<OperationHandlerResult<OUT>>; | ||
//# sourceMappingURL=OperationHandlerInvocation.d.ts.map |
@@ -7,4 +7,4 @@ import * as O from 'fp-ts/Option'; | ||
import { OperationHandlerAuth, OperationHandlerReference, TriggerOperationHttpResponse, TriggerRequestOperationInput, TriggerRequestOperationOutput, TriggerResponseOperationInput } from './OperationHandler'; | ||
export type OperationHandlerImplementation<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> = HttpOperationHandler<AUTH, IN, OUT> | CompositeOperationHandler<AUTH, IN, OUT>; | ||
export declare class OperationHandler<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
export type OperationHandlerImplementation<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> = HttpOperationHandler<AUTH, IN, OUT> | CompositeOperationHandler<AUTH, IN, OUT>; | ||
export declare class OperationHandler<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> { | ||
readonly name: string; | ||
@@ -16,4 +16,4 @@ readonly isPrivate: boolean; | ||
} | ||
export declare class OperationHandlerConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
static withName<AUTH extends OperationHandlerAuth<any, any>, IN, OUT>(name: string): OperationHandlerConfiguration<AUTH, IN, OUT>; | ||
export declare class OperationHandlerConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> { | ||
static withName<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT>(name: string): OperationHandlerConfiguration<AUTH, IN, OUT>; | ||
private name; | ||
@@ -31,4 +31,4 @@ private isPrivate; | ||
private static instance; | ||
static register<AUTH extends OperationHandlerAuth<any, any>, IN, OUT>(handler: OperationHandler<AUTH, IN, OUT>): void; | ||
static resolve<AUTH extends OperationHandlerAuth<any, any>, IN, OUT>(reference: OperationHandlerReference<AUTH, IN, OUT>): O.Option<OperationHandler<AUTH, IN, OUT>>; | ||
static register<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT>(handler: OperationHandler<AUTH, IN, OUT>): void; | ||
static resolve<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT>(reference: OperationHandlerReference<AUTH, IN, OUT>): O.Option<OperationHandler<AUTH, IN, OUT>>; | ||
private registry; | ||
@@ -39,11 +39,16 @@ private constructor(); | ||
} | ||
export type OperationHandlerSetup<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> = (handler: OperationHandlerConfiguration<AUTH, IN, OUT>) => OperationHandler<AUTH, IN, OUT>; | ||
export type OperationHandlerSetup<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> = (handler: OperationHandlerConfiguration<AUTH, IN, OUT>) => OperationHandler<AUTH, IN, OUT>; | ||
export interface OperationHandlerSetupInterface { | ||
configureHandler: <AUTH extends OperationHandlerAuth<any, any>, IN, OUT>(name: string, handlerSetup: OperationHandlerSetup<AUTH, IN, OUT>) => OperationHandlerReference<AUTH, IN, OUT>; | ||
configureTriggerCreateHandler: <AUTH extends OperationHandlerAuth<any, any>, IN>(name: string, handlerSetup: OperationHandlerSetup<AUTH, IN, DynamicObject>) => OperationHandlerReference<AUTH, IN, DynamicObject>; | ||
configureTriggerDestroyHandler: <AUTH extends OperationHandlerAuth<any, any>, IN>(name: string, handlerSetup: OperationHandlerSetup<AUTH, IN, DynamicObject>) => OperationHandlerReference<AUTH, IN, DynamicObject>; | ||
configureTriggerRequestHandler: <AUTH extends OperationHandlerAuth<any, any>, IN, OUT>(name: string, handlerSetup: OperationHandlerSetup<AUTH, TriggerRequestOperationInput<IN>, TriggerRequestOperationOutput<OUT>>) => OperationHandlerReference<AUTH, TriggerRequestOperationInput<IN>, TriggerRequestOperationOutput<OUT>>; | ||
configureTriggerResponseHandler: <AUTH extends OperationHandlerAuth<any, any>, IN, RES>(name: string, handlerSetup: OperationHandlerSetup<AUTH, TriggerResponseOperationInput<IN, RES>, TriggerOperationHttpResponse>) => OperationHandlerReference<AUTH, TriggerResponseOperationInput<IN, RES>, TriggerOperationHttpResponse>; | ||
configureHandler: <AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT>(handlerSetup: OperationHandlerSetup<AUTH, IN, OUT>) => OperationHandlerReference<AUTH, IN, OUT>; | ||
configureTriggerCreateHandler: <AUTH extends OperationHandlerAuth<unknown, unknown>, IN>(handlerSetup: OperationHandlerSetup<AUTH, IN, DynamicObject>) => OperationHandlerReference<AUTH, IN, DynamicObject>; | ||
configureTriggerDestroyHandler: <AUTH extends OperationHandlerAuth<unknown, unknown>, IN>(handlerSetup: OperationHandlerSetup<AUTH, IN, DynamicObject>) => OperationHandlerReference<AUTH, IN, DynamicObject>; | ||
configureTriggerRequestHandler: <AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT>(handlerSetup: OperationHandlerSetup<AUTH, TriggerRequestOperationInput<IN>, TriggerRequestOperationOutput<OUT>>) => OperationHandlerReference<AUTH, TriggerRequestOperationInput<IN>, TriggerRequestOperationOutput<OUT>>; | ||
configureTriggerResponseHandler: <AUTH extends OperationHandlerAuth<unknown, unknown>, IN, RES>(handlerSetup: OperationHandlerSetup<AUTH, TriggerResponseOperationInput<IN, RES>, TriggerOperationHttpResponse>) => OperationHandlerReference<AUTH, TriggerResponseOperationInput<IN, RES>, TriggerOperationHttpResponse>; | ||
} | ||
export type OperationDescriptor = { | ||
name: string; | ||
title: string; | ||
description?: string; | ||
}; | ||
export declare const OperationHandlerSetup: OperationHandlerSetupInterface; | ||
//# sourceMappingURL=OperationHandlerSetup.d.ts.map |
@@ -28,2 +28,5 @@ "use strict"; | ||
const O = __importStar(require("fp-ts/Option")); | ||
const function_1 = require("fp-ts/function"); | ||
const fs = __importStar(require("fs")); | ||
const pathLib = __importStar(require("path")); | ||
const CompositeOperationHandler_1 = require("./CompositeOperationHandler"); | ||
@@ -96,4 +99,15 @@ const HttpOperationHandler_1 = require("./HttpOperationHandler"); | ||
OperationHandlerRegistry.instance = new OperationHandlerRegistry(); | ||
// TODO: move to TTM | ||
const readJsonFile = (jsonFilePath) => JSON.parse(fs.readFileSync(jsonFilePath, 'utf8')); | ||
const readOperationDescriptorFile = () => { | ||
const operationDescriptorOpt = (0, function_1.pipe)(O.fromNullable(module.require.main), O.map((module) => module.path), O.map((modulePath) => pathLib.join(modulePath, 'operation.json')), O.map((operationDescriptorPath) => readJsonFile(operationDescriptorPath))); | ||
const operationDescriptor = O.getOrElse(() => { | ||
throw new Error('Cannot get parent module path'); | ||
})(operationDescriptorOpt); | ||
return operationDescriptor; | ||
}; | ||
exports.OperationHandlerSetup = { | ||
configureHandler: (name, handlerSetup) => { | ||
configureHandler: (handlerSetup) => { | ||
const descriptor = readOperationDescriptorFile(); | ||
const { name } = descriptor; | ||
const handler = handlerSetup(OperationHandlerConfiguration.withName(name)); | ||
@@ -103,3 +117,5 @@ OperationHandlerRegistry.register(handler); | ||
}, | ||
configureTriggerCreateHandler: (name, handlerSetup) => { | ||
configureTriggerCreateHandler: (handlerSetup) => { | ||
const descriptor = readOperationDescriptorFile(); | ||
const { name } = descriptor; | ||
const handler = handlerSetup(OperationHandlerConfiguration.withName(name)); | ||
@@ -111,3 +127,5 @@ OperationHandlerRegistry.register(handler); | ||
}, | ||
configureTriggerDestroyHandler: (name, handlerSetup) => { | ||
configureTriggerDestroyHandler: (handlerSetup) => { | ||
const descriptor = readOperationDescriptorFile(); | ||
const { name } = descriptor; | ||
const handler = handlerSetup(OperationHandlerConfiguration.withName(`${name}_destroy`)); | ||
@@ -119,3 +137,5 @@ OperationHandlerRegistry.register(handler); | ||
}, | ||
configureTriggerRequestHandler: (name, handlerSetup) => { | ||
configureTriggerRequestHandler: (handlerSetup) => { | ||
const descriptor = readOperationDescriptorFile(); | ||
const { name } = descriptor; | ||
const handler = handlerSetup(OperationHandlerConfiguration.withName(`${name}_request`)); | ||
@@ -125,3 +145,5 @@ OperationHandlerRegistry.register(handler); | ||
}, | ||
configureTriggerResponseHandler: (name, handlerSetup) => { | ||
configureTriggerResponseHandler: (handlerSetup) => { | ||
const descriptor = readOperationDescriptorFile(); | ||
const { name } = descriptor; | ||
const handler = handlerSetup(OperationHandlerConfiguration.withName(`${name}_response`)); | ||
@@ -128,0 +150,0 @@ OperationHandlerRegistry.register(handler); |
import * as O from 'fp-ts/Option'; | ||
import { OperationHandlerAuth, OperationHandlerContext, OperationHandlerReference, OperationHandlerResult } from './OperationHandler'; | ||
import { OperationHandlerInvocation } from './OperationHandlerInvocation'; | ||
export type OperationHandlerTestCaseResult<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX, TCCTX> = { | ||
export type OperationHandlerTestCaseResult<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT, TCTX, TCCTX> = { | ||
ctx: OperationHandlerContext<AUTH>; | ||
@@ -11,7 +11,7 @@ testContext: TCTX; | ||
}; | ||
export type OperationHandlerTestCaseFinallyFunction<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX, TCCTX> = (testCaseResult: OperationHandlerTestCaseResult<AUTH, IN, OUT, TCTX, TCCTX>, invoke: OperationHandlerInvocation<AUTH>) => Promise<OperationHandlerResult<undefined>>; | ||
export type OperationHandlerTestCaseThenFunction<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX, TCCTX> = (testCaseResult: OperationHandlerTestCaseResult<AUTH, IN, OUT, TCTX, TCCTX>) => void; | ||
export type OperationHandlerTestCaseWhenFunction<AUTH extends OperationHandlerAuth<any, any>, IN, TCTX, TCCTX> = (ctx: OperationHandlerContext<AUTH>, testContext: TCTX, testCaseContext: TCCTX) => IN; | ||
export type OperationHandlerTestCaseGivenFunction<AUTH extends OperationHandlerAuth<any, any>, TCTX, TCCTX> = (ctx: OperationHandlerContext<AUTH>, testContext: TCTX, invoke: OperationHandlerInvocation<AUTH>) => Promise<OperationHandlerResult<TCCTX>>; | ||
export declare class OperationHandlerTestCase<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX, TCCTX> { | ||
export type OperationHandlerTestCaseFinallyFunction<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT, TCTX, TCCTX> = (testCaseResult: OperationHandlerTestCaseResult<AUTH, IN, OUT, TCTX, TCCTX>, invoke: OperationHandlerInvocation<AUTH>) => Promise<OperationHandlerResult<undefined>>; | ||
export type OperationHandlerTestCaseThenFunction<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT, TCTX, TCCTX> = (testCaseResult: OperationHandlerTestCaseResult<AUTH, IN, OUT, TCTX, TCCTX>) => void; | ||
export type OperationHandlerTestCaseWhenFunction<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, TCTX, TCCTX> = (ctx: OperationHandlerContext<AUTH>, testContext: TCTX, testCaseContext: TCCTX) => IN; | ||
export type OperationHandlerTestCaseGivenFunction<AUTH extends OperationHandlerAuth<unknown, unknown>, TCTX, TCCTX> = (ctx: OperationHandlerContext<AUTH>, testContext: TCTX, invoke: OperationHandlerInvocation<AUTH>) => Promise<OperationHandlerResult<TCCTX>>; | ||
export declare class OperationHandlerTestCase<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT, TCTX, TCCTX> { | ||
description: string; | ||
@@ -26,3 +26,3 @@ ctx: OperationHandlerContext<AUTH>; | ||
} | ||
export declare class OperationHandlerTestCaseFinallyConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX, TCCTX> { | ||
export declare class OperationHandlerTestCaseFinallyConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT, TCTX, TCCTX> { | ||
private description; | ||
@@ -38,3 +38,3 @@ private ctx; | ||
} | ||
export declare class OperationHandlerTestCaseThenConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX, TCCTX> { | ||
export declare class OperationHandlerTestCaseThenConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT, TCTX, TCCTX> { | ||
private description; | ||
@@ -48,3 +48,3 @@ private ctx; | ||
} | ||
export declare class OperationHandlerTestCaseWhenConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX, TCCTX> { | ||
export declare class OperationHandlerTestCaseWhenConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT, TCTX, TCCTX> { | ||
private description; | ||
@@ -57,3 +57,3 @@ private ctx; | ||
} | ||
export declare class OperationHandlerTestCaseGivenConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX> { | ||
export declare class OperationHandlerTestCaseGivenConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT, TCTX> { | ||
private description; | ||
@@ -66,3 +66,3 @@ private ctx; | ||
} | ||
export declare class OperationHandlerTestCaseAuthConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX> { | ||
export declare class OperationHandlerTestCaseAuthConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT, TCTX> { | ||
private description; | ||
@@ -76,6 +76,6 @@ private defaultCtx; | ||
} | ||
export type OperationHandlerTestCaseSetup<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX, TCCTX> = (testCase: OperationHandlerTestCaseAuthConfiguration<AUTH, IN, OUT, TCTX>) => OperationHandlerTestCase<AUTH, IN, OUT, TCTX, TCCTX>; | ||
export type OperationHandlerTestAfterAllFunction<AUTH extends OperationHandlerAuth<any, any>, TCTX> = (ctx: OperationHandlerContext<AUTH>, testContext: TCTX, invoke: OperationHandlerInvocation<AUTH>) => Promise<OperationHandlerResult<undefined>>; | ||
export type OperationHandlerTestBeforeAllFunction<AUTH extends OperationHandlerAuth<any, any>, TCTX> = (ctx: OperationHandlerContext<AUTH>, invoke: OperationHandlerInvocation<AUTH>) => Promise<OperationHandlerResult<TCTX>>; | ||
export declare class OperationHandlerTestCaseFactory<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX, TCCTX> { | ||
export type OperationHandlerTestCaseSetup<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT, TCTX, TCCTX> = (testCase: OperationHandlerTestCaseAuthConfiguration<AUTH, IN, OUT, TCTX>) => OperationHandlerTestCase<AUTH, IN, OUT, TCTX, TCCTX>; | ||
export type OperationHandlerTestAfterAllFunction<AUTH extends OperationHandlerAuth<unknown, unknown>, TCTX> = (ctx: OperationHandlerContext<AUTH>, testContext: TCTX, invoke: OperationHandlerInvocation<AUTH>) => Promise<OperationHandlerResult<undefined>>; | ||
export type OperationHandlerTestBeforeAllFunction<AUTH extends OperationHandlerAuth<unknown, unknown>, TCTX> = (ctx: OperationHandlerContext<AUTH>, invoke: OperationHandlerInvocation<AUTH>) => Promise<OperationHandlerResult<TCTX>>; | ||
export declare class OperationHandlerTestCaseFactory<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT, TCTX, TCCTX> { | ||
description: string; | ||
@@ -87,3 +87,3 @@ private ctx; | ||
} | ||
export declare class OperationHandlerTest<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX> { | ||
export declare class OperationHandlerTest<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT, TCTX> { | ||
handlerReference: OperationHandlerReference<AUTH, IN, OUT>; | ||
@@ -96,3 +96,3 @@ ctx: OperationHandlerContext<AUTH>; | ||
} | ||
export declare class OperationHandlerTestAfterAllConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX> { | ||
export declare class OperationHandlerTestAfterAllConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT, TCTX> { | ||
private handlerReference; | ||
@@ -107,3 +107,3 @@ private ctx; | ||
} | ||
export declare class OperationHandlerTestMandatoryTestCaseConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX> { | ||
export declare class OperationHandlerTestMandatoryTestCaseConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT, TCTX> { | ||
private handlerReference; | ||
@@ -115,3 +115,3 @@ private ctx; | ||
} | ||
export declare class OperationHandlerTestBeforeAllConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
export declare class OperationHandlerTestBeforeAllConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> { | ||
private handlerReference; | ||
@@ -123,3 +123,3 @@ private ctx; | ||
} | ||
export declare class OperationHandlerTestAuthConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
export declare class OperationHandlerTestAuthConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> { | ||
private handlerReference; | ||
@@ -129,8 +129,8 @@ constructor(handlerReference: OperationHandlerReference<AUTH, IN, OUT>); | ||
} | ||
export type OperationHandlerTestRegistryOnRegistrationFunction<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> = (reference: OperationHandlerReference<AUTH, IN, OUT>) => void; | ||
export type OperationHandlerTestRegistryOnRegistrationFunction<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> = (reference: OperationHandlerReference<AUTH, IN, OUT>) => void; | ||
export declare class OperationHandlerTestRegistry { | ||
private static instance; | ||
static register<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX>(handlerTest: OperationHandlerTest<AUTH, IN, OUT, TCTX>): void; | ||
static resolve<AUTH extends OperationHandlerAuth<any, any>, IN, OUT>(reference: OperationHandlerReference<AUTH, IN, OUT>): O.Option<OperationHandlerTest<AUTH, IN, OUT, unknown>>; | ||
static onRegistration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT>(onRegistrationFunction: OperationHandlerTestRegistryOnRegistrationFunction<AUTH, IN, OUT>): void; | ||
static register<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT, TCTX>(handlerTest: OperationHandlerTest<AUTH, IN, OUT, TCTX>): void; | ||
static resolve<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT>(reference: OperationHandlerReference<AUTH, IN, OUT>): O.Option<OperationHandlerTest<AUTH, IN, OUT, unknown>>; | ||
static onRegistration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT>(onRegistrationFunction: OperationHandlerTestRegistryOnRegistrationFunction<AUTH, IN, OUT>): void; | ||
private registry; | ||
@@ -143,7 +143,7 @@ private observers; | ||
} | ||
export type OperationHandlerTestSetup<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX> = (handlerTest: OperationHandlerTestAuthConfiguration<AUTH, IN, OUT>) => OperationHandlerTest<AUTH, IN, OUT, TCTX>; | ||
export type OperationHandlerTestSetup<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT, TCTX> = (handlerTest: OperationHandlerTestAuthConfiguration<AUTH, IN, OUT>) => OperationHandlerTest<AUTH, IN, OUT, TCTX>; | ||
export interface OperationHandlerTestSetupInterface { | ||
configureHandlerTest: <AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX>(handlerReference: OperationHandlerReference<AUTH, IN, OUT>, handlerTestSetup: OperationHandlerTestSetup<AUTH, IN, OUT, TCTX>) => void; | ||
configureHandlerTest: <AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT, TCTX>(handlerReference: OperationHandlerReference<AUTH, IN, OUT>, handlerTestSetup: OperationHandlerTestSetup<AUTH, IN, OUT, TCTX>) => void; | ||
} | ||
export declare const OperationHandlerTestSetup: OperationHandlerTestSetupInterface; | ||
//# sourceMappingURL=OperationHandlerTest.d.ts.map |
import { OperationHandlerAuth, OperationHandlerContext } from './OperationHandler'; | ||
export type OperationHandlerInputValidationCondition<AUTH extends OperationHandlerAuth<any, any>, IN> = (ctx: OperationHandlerContext<AUTH>, input: IN) => boolean; | ||
export type OperationHandlerInputValidationErrorMessage<AUTH extends OperationHandlerAuth<any, any>, IN> = (ctx: OperationHandlerContext<AUTH>, input: IN) => string; | ||
export type OperationHandlerOutputValidationCondition<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> = (ctx: OperationHandlerContext<AUTH>, input: IN, output: OUT) => boolean; | ||
export type OperationHandlerOutputValidationErrorMessage<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> = (ctx: OperationHandlerContext<AUTH>, input: IN, output: OUT) => string; | ||
export declare class OperationHandlerValidation<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
static emptyValidation<AUTH extends OperationHandlerAuth<any, any>, IN, OUT>(): OperationHandlerValidation<AUTH, IN, OUT>; | ||
export type OperationHandlerInputValidationCondition<AUTH extends OperationHandlerAuth<unknown, unknown>, IN> = (ctx: OperationHandlerContext<AUTH>, input: IN) => boolean; | ||
export type OperationHandlerInputValidationErrorMessage<AUTH extends OperationHandlerAuth<unknown, unknown>, IN> = (ctx: OperationHandlerContext<AUTH>, input: IN) => string; | ||
export type OperationHandlerOutputValidationCondition<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> = (ctx: OperationHandlerContext<AUTH>, input: IN, output: OUT) => boolean; | ||
export type OperationHandlerOutputValidationErrorMessage<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> = (ctx: OperationHandlerContext<AUTH>, input: IN, output: OUT) => string; | ||
export declare class OperationHandlerValidation<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> { | ||
static emptyValidation<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT>(): OperationHandlerValidation<AUTH, IN, OUT>; | ||
readonly inputValidation: Array<OperationHandlerInputValidation<AUTH, IN>>; | ||
@@ -14,3 +14,3 @@ readonly outputValidation: Array<OperationHandlerOutputValidation<AUTH, IN, OUT>>; | ||
} | ||
export declare class OperationHandlerInputValidation<AUTH extends OperationHandlerAuth<any, any>, IN> { | ||
export declare class OperationHandlerInputValidation<AUTH extends OperationHandlerAuth<unknown, unknown>, IN> { | ||
readonly condition: OperationHandlerInputValidationCondition<AUTH, IN>; | ||
@@ -20,3 +20,3 @@ readonly errorMessage: OperationHandlerInputValidationErrorMessage<AUTH, IN>; | ||
} | ||
export declare class OperationHandlerInputValidationErrorMessageConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN> { | ||
export declare class OperationHandlerInputValidationErrorMessageConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN> { | ||
private condition; | ||
@@ -26,7 +26,7 @@ constructor(condition: OperationHandlerInputValidationCondition<AUTH, IN>); | ||
} | ||
export declare class OperationHandlerInputValidationConditionConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN> { | ||
export declare class OperationHandlerInputValidationConditionConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN> { | ||
condition(condition: OperationHandlerInputValidationCondition<AUTH, IN>): OperationHandlerInputValidationErrorMessageConfiguration<AUTH, IN>; | ||
} | ||
export type OperationHandlerInputValidationSetup<AUTH extends OperationHandlerAuth<any, any>, IN> = (inputValidation: OperationHandlerInputValidationConditionConfiguration<AUTH, IN>) => OperationHandlerInputValidation<AUTH, IN>; | ||
export declare class OperationHandlerOutputValidation<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
export type OperationHandlerInputValidationSetup<AUTH extends OperationHandlerAuth<unknown, unknown>, IN> = (inputValidation: OperationHandlerInputValidationConditionConfiguration<AUTH, IN>) => OperationHandlerInputValidation<AUTH, IN>; | ||
export declare class OperationHandlerOutputValidation<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> { | ||
readonly condition: OperationHandlerOutputValidationCondition<AUTH, IN, OUT>; | ||
@@ -36,3 +36,3 @@ readonly errorMessage: OperationHandlerOutputValidationErrorMessage<AUTH, IN, OUT>; | ||
} | ||
export declare class OperationHandlerOutputValidationErrorMessageConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
export declare class OperationHandlerOutputValidationErrorMessageConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> { | ||
private condition; | ||
@@ -42,6 +42,6 @@ constructor(condition: OperationHandlerOutputValidationCondition<AUTH, IN, OUT>); | ||
} | ||
export declare class OperationHandlerOutputValidationConditionConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
export declare class OperationHandlerOutputValidationConditionConfiguration<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> { | ||
condition(condition: OperationHandlerOutputValidationCondition<AUTH, IN, OUT>): OperationHandlerOutputValidationErrorMessageConfiguration<AUTH, IN, OUT>; | ||
} | ||
export type OperationHandlerOutputValidationSetup<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> = (outputValidation: OperationHandlerOutputValidationConditionConfiguration<AUTH, IN, OUT>) => OperationHandlerOutputValidation<AUTH, IN, OUT>; | ||
export type OperationHandlerOutputValidationSetup<AUTH extends OperationHandlerAuth<unknown, unknown>, IN, OUT> = (outputValidation: OperationHandlerOutputValidationConditionConfiguration<AUTH, IN, OUT>) => OperationHandlerOutputValidation<AUTH, IN, OUT>; | ||
//# sourceMappingURL=OperationHandlerValidation.d.ts.map |
{ | ||
"name": "@trayio/cdk-dsl", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "A DSL for connector development", | ||
@@ -17,3 +17,3 @@ "exports": { | ||
"dependencies": { | ||
"@trayio/commons": "1.0.0" | ||
"@trayio/commons": "1.1.0" | ||
}, | ||
@@ -20,0 +20,0 @@ "typesVersions": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
110968
1089
4
+ Added@trayio/commons@1.1.0(transitive)
- Removed@trayio/commons@1.0.0(transitive)
Updated@trayio/commons@1.1.0