@trayio/cdk-dsl
Advanced tools
Comparing version 0.13.0 to 0.14.0
@@ -1,5 +0,5 @@ | ||
import { OperationHandlerResult } from './OperationHandler'; | ||
import { OperationHandlerAuth, OperationHandlerContext, OperationHandlerResult } from './OperationHandler'; | ||
import { OperationHandlerInvocation } from './OperationHandlerInvocation'; | ||
export type CompositeOperationHandlerFunction<AUTH, IN, OUT> = (auth: AUTH, input: IN, invoke: OperationHandlerInvocation<AUTH>) => Promise<OperationHandlerResult<OUT>>; | ||
export declare class CompositeOperationHandler<AUTH, IN, OUT> { | ||
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> { | ||
readonly _tag: 'CompositeOperationHandler'; | ||
@@ -6,0 +6,0 @@ readonly handlerFunction: CompositeOperationHandlerFunction<AUTH, IN, OUT>; |
import { HttpMethod, HttpRequest, HttpHeaderValue, HttpResponse } from '@trayio/commons/http/Http'; | ||
import { OperationHandlerResult } from './OperationHandler'; | ||
import { OperationHandlerAuth, OperationHandlerContext, OperationHandlerResult } from './OperationHandler'; | ||
export declare class HttpOperationRequest { | ||
@@ -15,3 +15,3 @@ private jsonSerialization; | ||
} | ||
export type HttpOperationRequestHandler<AUTH, IN> = (auth: AUTH, input: IN, request: HttpOperationRequest) => HttpOperationRequest; | ||
export type HttpOperationRequestHandler<AUTH extends OperationHandlerAuth<any, any>, 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, IN, OUT> { | ||
export declare class HttpOperationHandler<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
readonly _tag: 'HttpOperationHandler'; | ||
@@ -35,3 +35,3 @@ readonly request: HttpOperationRequest; | ||
} | ||
export declare class HttpOperationHandlerResponseConfiguration<AUTH, IN, OUT> { | ||
export declare class HttpOperationHandlerResponseConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
private request; | ||
@@ -42,3 +42,3 @@ private requestHandler; | ||
} | ||
export declare class HttpOperationHandlerRequestConfiguration<AUTH, IN, OUT> { | ||
export declare class HttpOperationHandlerRequestConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
private request; | ||
@@ -48,3 +48,3 @@ constructor(request: HttpOperationRequest); | ||
} | ||
export declare class HttpOperationHandlerConfiguration<AUTH, IN, OUT> { | ||
export declare class HttpOperationHandlerConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
get(path: string): HttpOperationHandlerRequestConfiguration<AUTH, IN, OUT>; | ||
@@ -57,3 +57,3 @@ post(path: string): HttpOperationHandlerRequestConfiguration<AUTH, IN, OUT>; | ||
} | ||
export type HttpOperationHandlerSetup<AUTH, IN, OUT> = (http: HttpOperationHandlerConfiguration<AUTH, IN, OUT>) => HttpOperationHandler<AUTH, IN, OUT>; | ||
export type HttpOperationHandlerSetup<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> = (http: HttpOperationHandlerConfiguration<AUTH, IN, OUT>) => HttpOperationHandler<AUTH, IN, OUT>; | ||
//# sourceMappingURL=HttpOperationHandler.d.ts.map |
import { Result, ResultInterface } from '@trayio/commons/result/Result'; | ||
import { DynamicObject } from '@trayio/commons/dynamictype/DynamicType'; | ||
export type OperationHandlerReference<AUTH, IN, OUT> = { | ||
export type OperationHandlerAuth<USER, APP> = { | ||
authType: string; | ||
authId: string; | ||
user: USER; | ||
app: APP; | ||
refreshMessage?: string; | ||
}; | ||
export type TokenOperationHandlerAuth<USER, APP> = OperationHandlerAuth<USER, APP> & { | ||
authType: 'TOKEN'; | ||
}; | ||
export type Oauth1OperationHandlerAuth<USER, APP> = OperationHandlerAuth<USER, APP> & { | ||
authType: 'OAUTH1'; | ||
}; | ||
export type Oauth2OperationHandlerAuth<USER, APP> = OperationHandlerAuth<USER, APP> & { | ||
authType: 'OAUTH2'; | ||
}; | ||
export type Oauth2PasswordOperationHandlerAuth<USER, APP> = OperationHandlerAuth<USER, APP> & { | ||
authType: 'OAUTH2_PASSWORD'; | ||
}; | ||
export type Oauth2ClientCredentialsOperationHandlerAuth<USER, APP> = OperationHandlerAuth<USER, APP> & { | ||
authType: 'OAUTH2_CLIENT_CREDENTIALS'; | ||
}; | ||
export type BuiltinOperationHandlerAuth<USER, APP> = OperationHandlerAuth<USER, APP> & { | ||
authType: 'BUILTIN'; | ||
}; | ||
export type OperationHandlerContext<AUTH extends OperationHandlerAuth<any, any>> = { | ||
auth?: AUTH; | ||
workflowId?: string; | ||
workflowTitle?: string; | ||
userId?: string; | ||
externalUserId?: string; | ||
executionId?: string; | ||
organizationId?: string; | ||
executionStartTime?: string; | ||
sourceWorkflowId?: string; | ||
solutionId?: string; | ||
solutionInstanceId?: string; | ||
usernameHash?: string; | ||
workspaceIdHash?: string; | ||
datapotIdHash?: string; | ||
}; | ||
export type OperationHandlerReference<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> = { | ||
name: string; | ||
@@ -5,0 +46,0 @@ }; |
@@ -1,3 +0,3 @@ | ||
import { OperationHandlerReference, OperationHandlerResult } from './OperationHandler'; | ||
export type OperationHandlerInvocation<AUTH> = <IN, OUT>(handlerReference: OperationHandlerReference<AUTH, IN, OUT>) => (input: IN) => Promise<OperationHandlerResult<OUT>>; | ||
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>>; | ||
//# sourceMappingURL=OperationHandlerInvocation.d.ts.map |
@@ -6,5 +6,5 @@ import * as O from 'fp-ts/Option'; | ||
import { OperationHandlerValidation, OperationHandlerInputValidationSetup, OperationHandlerOutputValidationSetup } from './OperationHandlerValidation'; | ||
import { OperationHandlerReference, TriggerOperationHttpResponse, TriggerRequestOperationInput, TriggerRequestOperationOutput, TriggerResponseOperationInput } from './OperationHandler'; | ||
export type OperationHandlerImplementation<AUTH, IN, OUT> = HttpOperationHandler<AUTH, IN, OUT> | CompositeOperationHandler<AUTH, IN, OUT>; | ||
export declare class OperationHandler<AUTH, IN, OUT> { | ||
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> { | ||
readonly name: string; | ||
@@ -16,4 +16,4 @@ readonly isPrivate: boolean; | ||
} | ||
export declare class OperationHandlerConfiguration<AUTH, IN, OUT> { | ||
static withName<AUTH, IN, OUT>(name: string): OperationHandlerConfiguration<AUTH, IN, OUT>; | ||
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>; | ||
private name; | ||
@@ -31,4 +31,4 @@ private isPrivate; | ||
private static instance; | ||
static register<AUTH, IN, OUT>(handler: OperationHandler<AUTH, IN, OUT>): void; | ||
static resolve<AUTH, IN, OUT>(reference: OperationHandlerReference<AUTH, IN, OUT>): O.Option<OperationHandler<AUTH, IN, OUT>>; | ||
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>>; | ||
private registry; | ||
@@ -39,11 +39,11 @@ private constructor(); | ||
} | ||
export type OperationHandlerSetup<AUTH, IN, OUT> = (handler: OperationHandlerConfiguration<AUTH, IN, OUT>) => OperationHandler<AUTH, IN, OUT>; | ||
export type OperationHandlerSetup<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> = (handler: OperationHandlerConfiguration<AUTH, IN, OUT>) => OperationHandler<AUTH, IN, OUT>; | ||
export interface OperationHandlerSetupInterface { | ||
configureHandler: <AUTH, IN, OUT>(name: string, handlerSetup: OperationHandlerSetup<AUTH, IN, OUT>) => OperationHandlerReference<AUTH, IN, OUT>; | ||
configureTriggerCreateHandler: <AUTH, IN>(name: string, handlerSetup: OperationHandlerSetup<AUTH, IN, DynamicObject>) => OperationHandlerReference<AUTH, IN, DynamicObject>; | ||
configureTriggerDestroyHandler: <AUTH, IN>(name: string, handlerSetup: OperationHandlerSetup<AUTH, IN, DynamicObject>) => OperationHandlerReference<AUTH, IN, DynamicObject>; | ||
configureTriggerRequestHandler: <AUTH, IN, OUT>(name: string, handlerSetup: OperationHandlerSetup<AUTH, TriggerRequestOperationInput<IN>, TriggerRequestOperationOutput<OUT>>) => OperationHandlerReference<AUTH, TriggerRequestOperationInput<IN>, TriggerRequestOperationOutput<OUT>>; | ||
configureTriggerResponseHandler: <AUTH, IN, RES>(name: string, handlerSetup: OperationHandlerSetup<AUTH, TriggerResponseOperationInput<IN, RES>, TriggerOperationHttpResponse>) => OperationHandlerReference<AUTH, TriggerResponseOperationInput<IN, RES>, TriggerOperationHttpResponse>; | ||
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>; | ||
} | ||
export declare const OperationHandlerSetup: OperationHandlerSetupInterface; | ||
//# sourceMappingURL=OperationHandlerSetup.d.ts.map |
import * as O from 'fp-ts/Option'; | ||
import { OperationHandlerReference, OperationHandlerResult } from './OperationHandler'; | ||
import { OperationHandlerAuth, OperationHandlerContext, OperationHandlerReference, OperationHandlerResult } from './OperationHandler'; | ||
import { OperationHandlerInvocation } from './OperationHandlerInvocation'; | ||
export type OperationHandlerTestCaseResult<AUTH, IN, OUT, TCTX, TCCTX> = { | ||
auth: AUTH; | ||
export type OperationHandlerTestCaseResult<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX, TCCTX> = { | ||
ctx: OperationHandlerContext<AUTH>; | ||
testContext: TCTX; | ||
@@ -11,9 +11,9 @@ testCaseContext: TCCTX; | ||
}; | ||
export type OperationHandlerTestCaseFinallyFunction<AUTH, IN, OUT, TCTX, TCCTX> = (testCaseResult: OperationHandlerTestCaseResult<AUTH, IN, OUT, TCTX, TCCTX>, invoke: OperationHandlerInvocation<AUTH>) => Promise<OperationHandlerResult<undefined>>; | ||
export type OperationHandlerTestCaseThenFunction<AUTH, IN, OUT, TCTX, TCCTX> = (testCaseResult: OperationHandlerTestCaseResult<AUTH, IN, OUT, TCTX, TCCTX>) => void; | ||
export type OperationHandlerTestCaseWhenFunction<AUTH, IN, TCTX, TCCTX> = (auth: AUTH, testContext: TCTX, testCaseContext: TCCTX) => IN; | ||
export type OperationHandlerTestCaseGivenFunction<AUTH, TCTX, TCCTX> = (auth: AUTH, testContext: TCTX, invoke: OperationHandlerInvocation<AUTH>) => Promise<OperationHandlerResult<TCCTX>>; | ||
export declare class OperationHandlerTestCase<AUTH, IN, OUT, TCTX, TCCTX> { | ||
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> { | ||
description: string; | ||
auth: AUTH; | ||
ctx: OperationHandlerContext<AUTH>; | ||
testContext: TCTX; | ||
@@ -24,7 +24,7 @@ givenFunction: OperationHandlerTestCaseGivenFunction<AUTH, TCTX, TCCTX>; | ||
finallyFunction: OperationHandlerTestCaseFinallyFunction<AUTH, IN, OUT, TCTX, TCCTX>; | ||
constructor(description: string, auth: AUTH, testContext: TCTX, givenFunction: OperationHandlerTestCaseGivenFunction<AUTH, TCTX, TCCTX>, whenFunction: OperationHandlerTestCaseWhenFunction<AUTH, IN, TCTX, TCCTX>, thenFunction: OperationHandlerTestCaseThenFunction<AUTH, IN, OUT, TCTX, TCCTX>, finallyFunction: OperationHandlerTestCaseFinallyFunction<AUTH, IN, OUT, TCTX, TCCTX>); | ||
constructor(description: string, ctx: OperationHandlerContext<AUTH>, testContext: TCTX, givenFunction: OperationHandlerTestCaseGivenFunction<AUTH, TCTX, TCCTX>, whenFunction: OperationHandlerTestCaseWhenFunction<AUTH, IN, TCTX, TCCTX>, thenFunction: OperationHandlerTestCaseThenFunction<AUTH, IN, OUT, TCTX, TCCTX>, finallyFunction: OperationHandlerTestCaseFinallyFunction<AUTH, IN, OUT, TCTX, TCCTX>); | ||
} | ||
export declare class OperationHandlerTestCaseFinallyConfiguration<AUTH, IN, OUT, TCTX, TCCTX> { | ||
export declare class OperationHandlerTestCaseFinallyConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX, TCCTX> { | ||
private description; | ||
private auth; | ||
private ctx; | ||
private testContext; | ||
@@ -34,64 +34,64 @@ private givenFunction; | ||
private thenFunction; | ||
constructor(description: string, auth: AUTH, testContext: TCTX, givenFunction: OperationHandlerTestCaseGivenFunction<AUTH, TCTX, TCCTX>, whenFunction: OperationHandlerTestCaseWhenFunction<AUTH, IN, TCTX, TCCTX>, thenFunction: OperationHandlerTestCaseThenFunction<AUTH, IN, OUT, TCTX, TCCTX>); | ||
constructor(description: string, ctx: OperationHandlerContext<AUTH>, testContext: TCTX, givenFunction: OperationHandlerTestCaseGivenFunction<AUTH, TCTX, TCCTX>, whenFunction: OperationHandlerTestCaseWhenFunction<AUTH, IN, TCTX, TCCTX>, thenFunction: OperationHandlerTestCaseThenFunction<AUTH, IN, OUT, TCTX, TCCTX>); | ||
finally(finallyFunction: OperationHandlerTestCaseFinallyFunction<AUTH, IN, OUT, TCTX, TCCTX>): OperationHandlerTestCase<AUTH, IN, OUT, TCTX, TCCTX>; | ||
finallyDoNothing(): OperationHandlerTestCase<AUTH, IN, OUT, TCTX, TCCTX>; | ||
} | ||
export declare class OperationHandlerTestCaseThenConfiguration<AUTH, IN, OUT, TCTX, TCCTX> { | ||
export declare class OperationHandlerTestCaseThenConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX, TCCTX> { | ||
private description; | ||
private auth; | ||
private ctx; | ||
private testContext; | ||
private givenFunction; | ||
private whenFunction; | ||
constructor(description: string, auth: AUTH, testContext: TCTX, givenFunction: OperationHandlerTestCaseGivenFunction<AUTH, TCTX, TCCTX>, whenFunction: OperationHandlerTestCaseWhenFunction<AUTH, IN, TCTX, TCCTX>); | ||
constructor(description: string, ctx: OperationHandlerContext<AUTH>, testContext: TCTX, givenFunction: OperationHandlerTestCaseGivenFunction<AUTH, TCTX, TCCTX>, whenFunction: OperationHandlerTestCaseWhenFunction<AUTH, IN, TCTX, TCCTX>); | ||
then(thenFunction: OperationHandlerTestCaseThenFunction<AUTH, IN, OUT, TCTX, TCCTX>): OperationHandlerTestCaseFinallyConfiguration<AUTH, IN, OUT, TCTX, TCCTX>; | ||
} | ||
export declare class OperationHandlerTestCaseWhenConfiguration<AUTH, IN, OUT, TCTX, TCCTX> { | ||
export declare class OperationHandlerTestCaseWhenConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX, TCCTX> { | ||
private description; | ||
private auth; | ||
private ctx; | ||
private testContext; | ||
private givenFunction; | ||
constructor(description: string, auth: AUTH, testContext: TCTX, givenFunction: OperationHandlerTestCaseGivenFunction<AUTH, TCTX, TCCTX>); | ||
constructor(description: string, ctx: OperationHandlerContext<AUTH>, testContext: TCTX, givenFunction: OperationHandlerTestCaseGivenFunction<AUTH, TCTX, TCCTX>); | ||
when(whenFunction: OperationHandlerTestCaseWhenFunction<AUTH, IN, TCTX, TCCTX>): OperationHandlerTestCaseThenConfiguration<AUTH, IN, OUT, TCTX, TCCTX>; | ||
} | ||
export declare class OperationHandlerTestCaseGivenConfiguration<AUTH, IN, OUT, TCTX> { | ||
export declare class OperationHandlerTestCaseGivenConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX> { | ||
private description; | ||
private auth; | ||
private ctx; | ||
private testContext; | ||
constructor(description: string, auth: AUTH, testContext: TCTX); | ||
constructor(description: string, ctx: OperationHandlerContext<AUTH>, testContext: TCTX); | ||
given<TCCTX>(givenFunction: OperationHandlerTestCaseGivenFunction<AUTH, TCTX, TCCTX>): OperationHandlerTestCaseWhenConfiguration<AUTH, IN, OUT, TCTX, TCCTX>; | ||
givenNoContext(): OperationHandlerTestCaseWhenConfiguration<AUTH, IN, OUT, TCTX, {}>; | ||
givenNothing(): OperationHandlerTestCaseWhenConfiguration<AUTH, IN, OUT, TCTX, {}>; | ||
} | ||
export declare class OperationHandlerTestCaseAuthConfiguration<AUTH, IN, OUT, TCTX> { | ||
export declare class OperationHandlerTestCaseAuthConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX> { | ||
private description; | ||
private defaultAuth; | ||
private defaultCtx; | ||
private testContext; | ||
constructor(description: string, defaultAuth: AUTH, testContext: TCTX); | ||
usingAuth(authId: string): OperationHandlerTestCaseGivenConfiguration<AUTH, IN, OUT, TCTX>; | ||
constructor(description: string, defaultCtx: OperationHandlerContext<AUTH>, testContext: TCTX); | ||
usingHandlerContext(ctxName: string): OperationHandlerTestCaseGivenConfiguration<AUTH, IN, OUT, TCTX>; | ||
given<TCCTX>(givenFunction: OperationHandlerTestCaseGivenFunction<AUTH, TCTX, TCCTX>): OperationHandlerTestCaseWhenConfiguration<AUTH, IN, OUT, TCTX, TCCTX>; | ||
givenNoContext(): OperationHandlerTestCaseWhenConfiguration<AUTH, IN, OUT, TCTX, {}>; | ||
givenNothing(): OperationHandlerTestCaseWhenConfiguration<AUTH, IN, OUT, TCTX, {}>; | ||
} | ||
export type OperationHandlerTestCaseSetup<AUTH, IN, OUT, TCTX, TCCTX> = (testCase: OperationHandlerTestCaseAuthConfiguration<AUTH, IN, OUT, TCTX>) => OperationHandlerTestCase<AUTH, IN, OUT, TCTX, TCCTX>; | ||
export type OperationHandlerTestAfterAllFunction<AUTH, TCTX> = (auth: AUTH, testContext: TCTX, invoke: OperationHandlerInvocation<AUTH>) => Promise<OperationHandlerResult<undefined>>; | ||
export type OperationHandlerTestBeforeAllFunction<AUTH, TCTX> = (auth: AUTH, invoke: OperationHandlerInvocation<AUTH>) => Promise<OperationHandlerResult<TCTX>>; | ||
export declare class OperationHandlerTestCaseFactory<AUTH, IN, OUT, TCTX, TCCTX> { | ||
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> { | ||
description: string; | ||
private auth; | ||
private ctx; | ||
private testCaseSetup; | ||
constructor(description: string, auth: AUTH, testCaseSetup: OperationHandlerTestCaseSetup<AUTH, IN, OUT, TCTX, TCCTX>); | ||
constructor(description: string, ctx: OperationHandlerContext<AUTH>, testCaseSetup: OperationHandlerTestCaseSetup<AUTH, IN, OUT, TCTX, TCCTX>); | ||
testCase(testContext: TCTX): OperationHandlerTestCase<AUTH, IN, OUT, TCTX, TCCTX>; | ||
} | ||
export declare class OperationHandlerTest<AUTH, IN, OUT, TCTX> { | ||
export declare class OperationHandlerTest<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX> { | ||
handlerReference: OperationHandlerReference<AUTH, IN, OUT>; | ||
auth: AUTH; | ||
ctx: OperationHandlerContext<AUTH>; | ||
beforeAllFunction: OperationHandlerTestBeforeAllFunction<AUTH, TCTX>; | ||
testCaseFactories: Array<OperationHandlerTestCaseFactory<AUTH, IN, OUT, TCTX, unknown>>; | ||
afterAllFunction: OperationHandlerTestAfterAllFunction<AUTH, TCTX>; | ||
constructor(handlerReference: OperationHandlerReference<AUTH, IN, OUT>, auth: AUTH, beforeAllFunction: OperationHandlerTestBeforeAllFunction<AUTH, TCTX>, testCaseFactories: Array<OperationHandlerTestCaseFactory<AUTH, IN, OUT, TCTX, unknown>>, afterAllFunction: OperationHandlerTestAfterAllFunction<AUTH, TCTX>); | ||
constructor(handlerReference: OperationHandlerReference<AUTH, IN, OUT>, ctx: OperationHandlerContext<AUTH>, beforeAllFunction: OperationHandlerTestBeforeAllFunction<AUTH, TCTX>, testCaseFactories: Array<OperationHandlerTestCaseFactory<AUTH, IN, OUT, TCTX, unknown>>, afterAllFunction: OperationHandlerTestAfterAllFunction<AUTH, TCTX>); | ||
} | ||
export declare class OperationHandlerTestAfterAllConfiguration<AUTH, IN, OUT, TCTX> { | ||
export declare class OperationHandlerTestAfterAllConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX> { | ||
private handlerReference; | ||
private auth; | ||
private ctx; | ||
private beforeAllFunction; | ||
private testCaseFactories; | ||
constructor(handlerReference: OperationHandlerReference<AUTH, IN, OUT>, auth: AUTH, beforeAllFunction: OperationHandlerTestBeforeAllFunction<AUTH, TCTX>, testCaseFactories: Array<OperationHandlerTestCaseFactory<AUTH, IN, OUT, TCTX, unknown>>); | ||
constructor(handlerReference: OperationHandlerReference<AUTH, IN, OUT>, ctx: OperationHandlerContext<AUTH>, beforeAllFunction: OperationHandlerTestBeforeAllFunction<AUTH, TCTX>, testCaseFactories: Array<OperationHandlerTestCaseFactory<AUTH, IN, OUT, TCTX, unknown>>); | ||
testCase<TCCTX>(description: string, testCaseSetup: OperationHandlerTestCaseSetup<AUTH, IN, OUT, TCTX, TCCTX>): OperationHandlerTestAfterAllConfiguration<AUTH, IN, OUT, TCTX>; | ||
@@ -101,27 +101,27 @@ afterAll(afterAllFunction: OperationHandlerTestAfterAllFunction<AUTH, TCTX>): OperationHandlerTest<AUTH, IN, OUT, TCTX>; | ||
} | ||
export declare class OperationHandlerTestMandatoryTestCaseConfiguration<AUTH, IN, OUT, TCTX> { | ||
export declare class OperationHandlerTestMandatoryTestCaseConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX> { | ||
private handlerReference; | ||
private auth; | ||
private ctx; | ||
private beforeAllFunction; | ||
constructor(handlerReference: OperationHandlerReference<AUTH, IN, OUT>, auth: AUTH, beforeAllFunction: OperationHandlerTestBeforeAllFunction<AUTH, TCTX>); | ||
constructor(handlerReference: OperationHandlerReference<AUTH, IN, OUT>, ctx: OperationHandlerContext<AUTH>, beforeAllFunction: OperationHandlerTestBeforeAllFunction<AUTH, TCTX>); | ||
testCase<TCCTX>(description: string, testCaseSetup: OperationHandlerTestCaseSetup<AUTH, IN, OUT, TCTX, TCCTX>): OperationHandlerTestAfterAllConfiguration<AUTH, IN, OUT, TCTX>; | ||
} | ||
export declare class OperationHandlerTestBeforeAllConfiguration<AUTH, IN, OUT> { | ||
export declare class OperationHandlerTestBeforeAllConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
private handlerReference; | ||
private auth; | ||
constructor(handlerReference: OperationHandlerReference<AUTH, IN, OUT>, auth: AUTH); | ||
private ctx; | ||
constructor(handlerReference: OperationHandlerReference<AUTH, IN, OUT>, ctx: OperationHandlerContext<AUTH>); | ||
beforeAll<TCTX>(beforeAllFunction: OperationHandlerTestBeforeAllFunction<AUTH, TCTX>): OperationHandlerTestMandatoryTestCaseConfiguration<AUTH, IN, OUT, TCTX>; | ||
nothingBeforeAll(): OperationHandlerTestMandatoryTestCaseConfiguration<AUTH, IN, OUT, {}>; | ||
} | ||
export declare class OperationHandlerTestAuthConfiguration<AUTH, IN, OUT> { | ||
export declare class OperationHandlerTestAuthConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
private handlerReference; | ||
constructor(handlerReference: OperationHandlerReference<AUTH, IN, OUT>); | ||
usingAuth(authId: string): OperationHandlerTestBeforeAllConfiguration<AUTH, IN, OUT>; | ||
usingHandlerContext(ctxName: string): OperationHandlerTestBeforeAllConfiguration<AUTH, IN, OUT>; | ||
} | ||
export type OperationHandlerTestRegistryOnRegistrationFunction<AUTH, IN, OUT> = (reference: OperationHandlerReference<AUTH, IN, OUT>) => void; | ||
export type OperationHandlerTestRegistryOnRegistrationFunction<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> = (reference: OperationHandlerReference<AUTH, IN, OUT>) => void; | ||
export declare class OperationHandlerTestRegistry { | ||
private static instance; | ||
static register<AUTH, IN, OUT, TCTX>(handlerTest: OperationHandlerTest<AUTH, IN, OUT, TCTX>): void; | ||
static resolve<AUTH, IN, OUT>(reference: OperationHandlerReference<AUTH, IN, OUT>): O.Option<OperationHandlerTest<AUTH, IN, OUT, unknown>>; | ||
static onRegistration<AUTH, IN, OUT>(onRegistrationFunction: OperationHandlerTestRegistryOnRegistrationFunction<AUTH, IN, OUT>): void; | ||
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; | ||
private registry; | ||
@@ -134,7 +134,7 @@ private observers; | ||
} | ||
export type OperationHandlerTestSetup<AUTH, IN, OUT, TCTX> = (handlerTest: OperationHandlerTestAuthConfiguration<AUTH, IN, OUT>) => OperationHandlerTest<AUTH, IN, OUT, TCTX>; | ||
export type OperationHandlerTestSetup<AUTH extends OperationHandlerAuth<any, any>, IN, OUT, TCTX> = (handlerTest: OperationHandlerTestAuthConfiguration<AUTH, IN, OUT>) => OperationHandlerTest<AUTH, IN, OUT, TCTX>; | ||
export interface OperationHandlerTestSetupInterface { | ||
configureHandlerTest: <AUTH, IN, OUT, TCTX>(handlerReference: OperationHandlerReference<AUTH, IN, OUT>, handlerTestSetup: OperationHandlerTestSetup<AUTH, IN, OUT, TCTX>) => void; | ||
configureHandlerTest: <AUTH extends OperationHandlerAuth<any, any>, 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 |
@@ -42,5 +42,5 @@ "use strict"; | ||
const readJsonFile = (jsonFilePath) => JSON.parse(fs.readFileSync(jsonFilePath, 'utf8')); | ||
const readAuthJsonFile = (authId) => { | ||
const readContextJsonFile = (ctxName) => { | ||
const callerPath = getCallerModuleFolderPath(); | ||
const authFilePath = pathLib.normalize(pathLib.join(callerPath, '..', `${authId}.auth.json`)); | ||
const authFilePath = pathLib.normalize(pathLib.join(callerPath, '..', `${ctxName}.ctx.json`)); | ||
// TODO validate using auth schema | ||
@@ -50,5 +50,5 @@ return readJsonFile(authFilePath); | ||
class OperationHandlerTestCase { | ||
constructor(description, auth, testContext, givenFunction, whenFunction, thenFunction, finallyFunction) { | ||
constructor(description, ctx, testContext, givenFunction, whenFunction, thenFunction, finallyFunction) { | ||
this.description = description; | ||
this.auth = auth; | ||
this.ctx = ctx; | ||
this.testContext = testContext; | ||
@@ -63,5 +63,5 @@ this.givenFunction = givenFunction; | ||
class OperationHandlerTestCaseFinallyConfiguration { | ||
constructor(description, auth, testContext, givenFunction, whenFunction, thenFunction) { | ||
constructor(description, ctx, testContext, givenFunction, whenFunction, thenFunction) { | ||
this.description = description; | ||
this.auth = auth; | ||
this.ctx = ctx; | ||
this.testContext = testContext; | ||
@@ -73,3 +73,3 @@ this.givenFunction = givenFunction; | ||
finally(finallyFunction) { | ||
return new OperationHandlerTestCase(this.description, this.auth, this.testContext, this.givenFunction, this.whenFunction, this.thenFunction, finallyFunction); | ||
return new OperationHandlerTestCase(this.description, this.ctx, this.testContext, this.givenFunction, this.whenFunction, this.thenFunction, finallyFunction); | ||
} | ||
@@ -82,5 +82,5 @@ finallyDoNothing() { | ||
class OperationHandlerTestCaseThenConfiguration { | ||
constructor(description, auth, testContext, givenFunction, whenFunction) { | ||
constructor(description, ctx, testContext, givenFunction, whenFunction) { | ||
this.description = description; | ||
this.auth = auth; | ||
this.ctx = ctx; | ||
this.testContext = testContext; | ||
@@ -91,3 +91,3 @@ this.givenFunction = givenFunction; | ||
then(thenFunction) { | ||
return new OperationHandlerTestCaseFinallyConfiguration(this.description, this.auth, this.testContext, this.givenFunction, this.whenFunction, thenFunction); | ||
return new OperationHandlerTestCaseFinallyConfiguration(this.description, this.ctx, this.testContext, this.givenFunction, this.whenFunction, thenFunction); | ||
} | ||
@@ -97,5 +97,5 @@ } | ||
class OperationHandlerTestCaseWhenConfiguration { | ||
constructor(description, auth, testContext, givenFunction) { | ||
constructor(description, ctx, testContext, givenFunction) { | ||
this.description = description; | ||
this.auth = auth; | ||
this.ctx = ctx; | ||
this.testContext = testContext; | ||
@@ -105,3 +105,3 @@ this.givenFunction = givenFunction; | ||
when(whenFunction) { | ||
return new OperationHandlerTestCaseThenConfiguration(this.description, this.auth, this.testContext, this.givenFunction, whenFunction); | ||
return new OperationHandlerTestCaseThenConfiguration(this.description, this.ctx, this.testContext, this.givenFunction, whenFunction); | ||
} | ||
@@ -111,11 +111,11 @@ } | ||
class OperationHandlerTestCaseGivenConfiguration { | ||
constructor(description, auth, testContext) { | ||
constructor(description, ctx, testContext) { | ||
this.description = description; | ||
this.auth = auth; | ||
this.ctx = ctx; | ||
this.testContext = testContext; | ||
} | ||
given(givenFunction) { | ||
return new OperationHandlerTestCaseWhenConfiguration(this.description, this.auth, this.testContext, givenFunction); | ||
return new OperationHandlerTestCaseWhenConfiguration(this.description, this.ctx, this.testContext, givenFunction); | ||
} | ||
givenNoContext() { | ||
givenNothing() { | ||
return this.given(() => Promise.resolve(OperationHandler_1.OperationHandlerResult.success({}))); | ||
@@ -126,14 +126,14 @@ } | ||
class OperationHandlerTestCaseAuthConfiguration { | ||
constructor(description, defaultAuth, testContext) { | ||
constructor(description, defaultCtx, testContext) { | ||
this.description = description; | ||
this.defaultAuth = defaultAuth; | ||
this.defaultCtx = defaultCtx; | ||
this.testContext = testContext; | ||
} | ||
usingAuth(authId) { | ||
return new OperationHandlerTestCaseGivenConfiguration(this.description, readAuthJsonFile(authId), this.testContext); | ||
usingHandlerContext(ctxName) { | ||
return new OperationHandlerTestCaseGivenConfiguration(this.description, readContextJsonFile(ctxName), this.testContext); | ||
} | ||
given(givenFunction) { | ||
return new OperationHandlerTestCaseWhenConfiguration(this.description, this.defaultAuth, this.testContext, givenFunction); | ||
return new OperationHandlerTestCaseWhenConfiguration(this.description, this.defaultCtx, this.testContext, givenFunction); | ||
} | ||
givenNoContext() { | ||
givenNothing() { | ||
return this.given(() => Promise.resolve(OperationHandler_1.OperationHandlerResult.success({}))); | ||
@@ -144,9 +144,9 @@ } | ||
class OperationHandlerTestCaseFactory { | ||
constructor(description, auth, testCaseSetup) { | ||
constructor(description, ctx, testCaseSetup) { | ||
this.description = description; | ||
this.auth = auth; | ||
this.ctx = ctx; | ||
this.testCaseSetup = testCaseSetup; | ||
} | ||
testCase(testContext) { | ||
return this.testCaseSetup(new OperationHandlerTestCaseAuthConfiguration(this.description, this.auth, testContext)); | ||
return this.testCaseSetup(new OperationHandlerTestCaseAuthConfiguration(this.description, this.ctx, testContext)); | ||
} | ||
@@ -156,5 +156,5 @@ } | ||
class OperationHandlerTest { | ||
constructor(handlerReference, auth, beforeAllFunction, testCaseFactories, afterAllFunction) { | ||
constructor(handlerReference, ctx, beforeAllFunction, testCaseFactories, afterAllFunction) { | ||
this.handlerReference = handlerReference; | ||
this.auth = auth; | ||
this.ctx = ctx; | ||
this.beforeAllFunction = beforeAllFunction; | ||
@@ -167,5 +167,5 @@ this.testCaseFactories = testCaseFactories; | ||
class OperationHandlerTestAfterAllConfiguration { | ||
constructor(handlerReference, auth, beforeAllFunction, testCaseFactories) { | ||
constructor(handlerReference, ctx, beforeAllFunction, testCaseFactories) { | ||
this.handlerReference = handlerReference; | ||
this.auth = auth; | ||
this.ctx = ctx; | ||
this.beforeAllFunction = beforeAllFunction; | ||
@@ -175,7 +175,7 @@ this.testCaseFactories = testCaseFactories; | ||
testCase(description, testCaseSetup) { | ||
const testCaseFactory = new OperationHandlerTestCaseFactory(description, this.auth, testCaseSetup); | ||
return new OperationHandlerTestAfterAllConfiguration(this.handlerReference, this.auth, this.beforeAllFunction, this.testCaseFactories.concat([testCaseFactory])); | ||
const testCaseFactory = new OperationHandlerTestCaseFactory(description, this.ctx, testCaseSetup); | ||
return new OperationHandlerTestAfterAllConfiguration(this.handlerReference, this.ctx, this.beforeAllFunction, this.testCaseFactories.concat([testCaseFactory])); | ||
} | ||
afterAll(afterAllFunction) { | ||
return new OperationHandlerTest(this.handlerReference, this.auth, this.beforeAllFunction, this.testCaseFactories, afterAllFunction); | ||
return new OperationHandlerTest(this.handlerReference, this.ctx, this.beforeAllFunction, this.testCaseFactories, afterAllFunction); | ||
} | ||
@@ -188,10 +188,10 @@ nothingAfterAll() { | ||
class OperationHandlerTestMandatoryTestCaseConfiguration { | ||
constructor(handlerReference, auth, beforeAllFunction) { | ||
constructor(handlerReference, ctx, beforeAllFunction) { | ||
this.handlerReference = handlerReference; | ||
this.auth = auth; | ||
this.ctx = ctx; | ||
this.beforeAllFunction = beforeAllFunction; | ||
} | ||
testCase(description, testCaseSetup) { | ||
const testCaseFactory = new OperationHandlerTestCaseFactory(description, this.auth, testCaseSetup); | ||
return new OperationHandlerTestAfterAllConfiguration(this.handlerReference, this.auth, this.beforeAllFunction, [testCaseFactory]); | ||
const testCaseFactory = new OperationHandlerTestCaseFactory(description, this.ctx, testCaseSetup); | ||
return new OperationHandlerTestAfterAllConfiguration(this.handlerReference, this.ctx, this.beforeAllFunction, [testCaseFactory]); | ||
} | ||
@@ -201,8 +201,8 @@ } | ||
class OperationHandlerTestBeforeAllConfiguration { | ||
constructor(handlerReference, auth) { | ||
constructor(handlerReference, ctx) { | ||
this.handlerReference = handlerReference; | ||
this.auth = auth; | ||
this.ctx = ctx; | ||
} | ||
beforeAll(beforeAllFunction) { | ||
return new OperationHandlerTestMandatoryTestCaseConfiguration(this.handlerReference, this.auth, beforeAllFunction); | ||
return new OperationHandlerTestMandatoryTestCaseConfiguration(this.handlerReference, this.ctx, beforeAllFunction); | ||
} | ||
@@ -218,4 +218,4 @@ nothingBeforeAll() { | ||
} | ||
usingAuth(authId) { | ||
return new OperationHandlerTestBeforeAllConfiguration(this.handlerReference, readAuthJsonFile(authId)); | ||
usingHandlerContext(ctxName) { | ||
return new OperationHandlerTestBeforeAllConfiguration(this.handlerReference, readContextJsonFile(ctxName)); | ||
} | ||
@@ -222,0 +222,0 @@ } |
@@ -1,7 +0,8 @@ | ||
export type OperationHandlerInputValidationCondition<AUTH, IN> = (auth: AUTH, input: IN) => boolean; | ||
export type OperationHandlerInputValidationErrorMessage<AUTH, IN> = (auth: AUTH, input: IN) => string; | ||
export type OperationHandlerOutputValidationCondition<AUTH, IN, OUT> = (auth: AUTH, input: IN, output: OUT) => boolean; | ||
export type OperationHandlerOutputValidationErrorMessage<AUTH, IN, OUT> = (auth: AUTH, input: IN, output: OUT) => string; | ||
export declare class OperationHandlerValidation<AUTH, IN, OUT> { | ||
static emptyValidation<AUTH, IN, OUT>(): OperationHandlerValidation<AUTH, IN, OUT>; | ||
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>; | ||
readonly inputValidation: Array<OperationHandlerInputValidation<AUTH, IN>>; | ||
@@ -13,3 +14,3 @@ readonly outputValidation: Array<OperationHandlerOutputValidation<AUTH, IN, OUT>>; | ||
} | ||
export declare class OperationHandlerInputValidation<AUTH, IN> { | ||
export declare class OperationHandlerInputValidation<AUTH extends OperationHandlerAuth<any, any>, IN> { | ||
readonly condition: OperationHandlerInputValidationCondition<AUTH, IN>; | ||
@@ -19,3 +20,3 @@ readonly errorMessage: OperationHandlerInputValidationErrorMessage<AUTH, IN>; | ||
} | ||
export declare class OperationHandlerInputValidationErrorMessageConfiguration<AUTH, IN> { | ||
export declare class OperationHandlerInputValidationErrorMessageConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN> { | ||
private condition; | ||
@@ -25,7 +26,7 @@ constructor(condition: OperationHandlerInputValidationCondition<AUTH, IN>); | ||
} | ||
export declare class OperationHandlerInputValidationConditionConfiguration<AUTH, IN> { | ||
export declare class OperationHandlerInputValidationConditionConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN> { | ||
condition(condition: OperationHandlerInputValidationCondition<AUTH, IN>): OperationHandlerInputValidationErrorMessageConfiguration<AUTH, IN>; | ||
} | ||
export type OperationHandlerInputValidationSetup<AUTH, IN> = (inputValidation: OperationHandlerInputValidationConditionConfiguration<AUTH, IN>) => OperationHandlerInputValidation<AUTH, IN>; | ||
export declare class OperationHandlerOutputValidation<AUTH, IN, OUT> { | ||
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> { | ||
readonly condition: OperationHandlerOutputValidationCondition<AUTH, IN, OUT>; | ||
@@ -35,3 +36,3 @@ readonly errorMessage: OperationHandlerOutputValidationErrorMessage<AUTH, IN, OUT>; | ||
} | ||
export declare class OperationHandlerOutputValidationErrorMessageConfiguration<AUTH, IN, OUT> { | ||
export declare class OperationHandlerOutputValidationErrorMessageConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
private condition; | ||
@@ -41,6 +42,6 @@ constructor(condition: OperationHandlerOutputValidationCondition<AUTH, IN, OUT>); | ||
} | ||
export declare class OperationHandlerOutputValidationConditionConfiguration<AUTH, IN, OUT> { | ||
export declare class OperationHandlerOutputValidationConditionConfiguration<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> { | ||
condition(condition: OperationHandlerOutputValidationCondition<AUTH, IN, OUT>): OperationHandlerOutputValidationErrorMessageConfiguration<AUTH, IN, OUT>; | ||
} | ||
export type OperationHandlerOutputValidationSetup<AUTH, IN, OUT> = (outputValidation: OperationHandlerOutputValidationConditionConfiguration<AUTH, IN, OUT>) => OperationHandlerOutputValidation<AUTH, IN, OUT>; | ||
export type OperationHandlerOutputValidationSetup<AUTH extends OperationHandlerAuth<any, any>, IN, OUT> = (outputValidation: OperationHandlerOutputValidationConditionConfiguration<AUTH, IN, OUT>) => OperationHandlerOutputValidation<AUTH, IN, OUT>; | ||
//# sourceMappingURL=OperationHandlerValidation.d.ts.map |
{ | ||
"name": "@trayio/cdk-dsl", | ||
"version": "0.13.0", | ||
"version": "0.14.0", | ||
"description": "A DSL for connector development", | ||
@@ -17,3 +17,3 @@ "exports": { | ||
"dependencies": { | ||
"@trayio/commons": "0.13.0" | ||
"@trayio/commons": "0.14.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
109300
1063
+ Added@trayio/commons@0.14.0(transitive)
- Removed@trayio/commons@0.13.0(transitive)
Updated@trayio/commons@0.14.0