@trayio/cdk-dsl
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -118,2 +118,3 @@ import * as O from 'fp-ts/Option'; | ||
} | ||
export type OperationHandlerTestRegistryOnRegistrationFunction<AUTH, IN, OUT> = (reference: OperationHandlerReference<AUTH, IN, OUT>) => void; | ||
export declare class OperationHandlerTestRegistry { | ||
@@ -123,6 +124,9 @@ private static instance; | ||
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; | ||
private registry; | ||
private observers; | ||
private constructor(); | ||
private register; | ||
private resolve; | ||
private onRegistration; | ||
} | ||
@@ -129,0 +133,0 @@ export type OperationHandlerTestSetup<AUTH, IN, OUT, TCTX> = (handlerTest: OperationHandlerTestAuthConfiguration<AUTH, IN, OUT>) => OperationHandlerTest<AUTH, IN, OUT, TCTX>; |
@@ -190,3 +190,3 @@ "use strict"; | ||
static register(handlerTest) { | ||
return OperationHandlerTestRegistry.instance.register(handlerTest); | ||
OperationHandlerTestRegistry.instance.register(handlerTest); | ||
} | ||
@@ -196,7 +196,13 @@ static resolve(reference) { | ||
} | ||
static onRegistration(onRegistrationFunction) { | ||
OperationHandlerTestRegistry.instance.onRegistration(onRegistrationFunction); | ||
} | ||
constructor() { | ||
this.registry = new Map(); | ||
this.observers = []; | ||
} | ||
register(handlerTest) { | ||
this.registry.set(handlerTest.handlerReference.name, handlerTest); | ||
const { handlerReference } = handlerTest; | ||
this.registry.set(handlerReference.name, handlerTest); | ||
this.observers.forEach((observer) => observer(handlerReference)); | ||
} | ||
@@ -210,2 +216,5 @@ resolve(reference) { | ||
} | ||
onRegistration(onRegistrationFunction) { | ||
this.observers.push(onRegistrationFunction); | ||
} | ||
} | ||
@@ -212,0 +221,0 @@ exports.OperationHandlerTestRegistry = OperationHandlerTestRegistry; |
{ | ||
"name": "@trayio/cdk-dsl", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "CDK DSL Interface for building connectors", | ||
@@ -5,0 +5,0 @@ "exports": { |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
67618
856
0