New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ditto-ts

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ditto-ts - npm Package Compare versions

Comparing version

to
0.1.0-alpha14

145

lib/index.d.ts

@@ -8,4 +8,4 @@ import * as E from "fp-ts/lib/Either";

};
export declare const getT: (config: Optional<MainConfig>, defaultC?: MainConfig) => {
withC: (newC: Optional<MainConfig>) => any;
export declare const base: {
config: MainConfig;
timed: {

@@ -76,4 +76,4 @@ of: <A>(t: import("fp-ts/lib/TaskEither").TaskEither<Error, A>, onTime: (delay: number) => void) => import("fp-ts/lib/TaskEither").TaskEither<Error, A>;

};
export declare const T: {
withC: (newC: Optional<MainConfig>) => any;
export declare const getT: (config: Optional<MainConfig>, defaultC?: MainConfig) => {
config: MainConfig;
timed: {

@@ -144,1 +144,138 @@ of: <A>(t: import("fp-ts/lib/TaskEither").TaskEither<Error, A>, onTime: (delay: number) => void) => import("fp-ts/lib/TaskEither").TaskEither<Error, A>;

};
export declare const c: {
timed: {
prefix: (prefix: string, instance: {
config: MainConfig;
timed: {
of: <A>(t: import("fp-ts/lib/TaskEither").TaskEither<Error, A>, onTime: (delay: number) => void) => import("fp-ts/lib/TaskEither").TaskEither<Error, A>;
log: (message: string) => void;
};
eventLogOps: {
queryAll: (aggregate: import("./Aggregate").Aggregate) => import("fp-ts/lib/TaskEither").TaskEither<Error, import("./entities/EventLog").EventLog[]>;
};
aggregate: {
of: (aggregate: {
aggregate: string;
handlers: import("./Event").Handler<import("./ClassType").ClassType>[];
entities: import("./ClassType").ClassType[];
dbConfig: import("./Aggregate").DbConfig;
kafkaConfig?: import("kafka-node").KafkaClientOptions;
cleanAfterPublished?: boolean;
}) => import("./Aggregate").Aggregate;
};
event: {
of: (kind: string) => <T extends import("./ClassType").ClassType>(clazz: T) => import("./Event").EventKind<T>;
new: <T_1 extends import("./ClassType").ClassType>(event: import("./Event").EventKind<T_1>) => (body: import("./ClassType").ClassTypeProps<T_1>) => import("./Event").EventPayload;
handle: <T_2 extends import("./ClassType").ClassType>(event: import("./Event").EventKind<T_2>) => (f: (event: import("./ClassType").ClassTypeProps<T_2>, tx: import("typeorm").EntityManager) => import("fp-ts/lib/TaskEither").TaskEither<Error, void>) => import("./Event").Handler<T_2>;
};
projector: {
of: (aggregate: import("./Aggregate").Aggregate) => (name: string, mode?: string) => (handlers: import("./Event").Handler<import("./ClassType").ClassType>[]) => import("./Projector").ProjectorConfig;
start: (projector: import("./Projector").ProjectorConfig) => import("fp-ts/lib/TaskEither").TaskEither<Error, void>;
stop: (projector: import("./Projector").ProjectorConfig) => import("fp-ts/lib/TaskEither").TaskEither<Error, void>;
};
dispatcher: {
start: (aggregate: import("./Aggregate").Aggregate) => import("fp-ts/lib/TaskEither").TaskEither<Error, void>;
stop: (aggregate: import("./Aggregate").Aggregate) => import("fp-ts/lib/TaskEither").TaskEither<Error, void>;
};
cmd: {
of: <C, R>(f: import("./Command").CommandFn<C, R>) => import("./Command").CommandFn<C, R>;
execute: (aggregate: import("./Aggregate").Aggregate) => <C_1, R_1>(fn: import("./Command").CommandFn<C_1, R_1>) => (rootId: string, commandId?: string) => (payload: C_1) => import("fp-ts/lib/TaskEither").TaskEither<Error, R_1>;
executeInTx: (tx: import("typeorm").EntityManager) => (aggregate: import("./Aggregate").Aggregate) => <C_2, R_2>(fn: import("./Command").CommandFn<C_2, R_2>) => (rootId: string, commandId?: string) => (payload: C_2) => import("fp-ts/lib/TaskEither").TaskEither<Error, R_2>;
};
loop: {
start: (process: import("./Loop").Process) => import("fp-ts/lib/TaskEither").TaskEither<Error, void>;
stop: (process: import("./Loop").Process) => import("fp-ts/lib/TaskEither").TaskEither<Error, void>;
};
rightIO: <T_3>(io: import("fp-ts/lib/IO").IO<T_3>) => import("fp-ts/lib/TaskEither").TaskEither<Error, T_3>;
tryCatchAsync: <T_4>(t: () => Promise<T_4>) => import("fp-ts/lib/TaskEither").TaskEither<Error, T_4>;
tryCatch: <T_5>(t: () => T_5) => import("fp-ts/lib/TaskEither").TaskEither<Error, T_5>;
orThrow: <T_6>(task: import("fp-ts/lib/TaskEither").TaskEither<Error, T_6>) => Promise<T_6>;
right: <T_7>(v: T_7) => import("fp-ts/lib/TaskEither").TaskEither<Error, T_7>;
fromTE: <T_8>(v: import("fp-ts/lib/TaskEither").TaskEither<Error, T_8>) => import("fp-ts/lib/TaskEither").TaskEither<Error, T_8>;
toTE: <T_9>(v: import("fp-ts/lib/TaskEither").TaskEither<Error, T_9>) => import("fp-ts/lib/TaskEither").TaskEither<Error, T_9>;
call: <T_10>(task: import("fp-ts/lib/TaskEither").TaskEither<Error, T_10>) => Promise<E.Either<Error, T_10>>;
callIgnore: <T_11>(task: import("fp-ts/lib/TaskEither").TaskEither<Error, T_11>) => void;
callAndLog: <T_12>(task: import("fp-ts/lib/TaskEither").TaskEither<Error, T_12>) => void;
left: <T_13>(error: Error) => import("fp-ts/lib/TaskEither").TaskEither<Error, T_13>;
if: (condition: boolean) => (task: import("fp-ts/lib/TaskEither").TaskEither<Error, void>) => import("fp-ts/lib/TaskEither").TaskEither<Error, void>;
of: <E, A_1>(a: A_1) => import("fp-ts/lib/TaskEither").TaskEither<E, A_1>;
ap: <E_1, A_2, B>(fab: import("fp-ts/lib/TaskEither").TaskEither<E_1, (a: A_2) => B>, fa: import("fp-ts/lib/TaskEither").TaskEither<E_1, A_2>) => import("fp-ts/lib/TaskEither").TaskEither<E_1, B>;
URI: "TaskEither";
map: <E_2, A_3, B_1>(fa: import("fp-ts/lib/TaskEither").TaskEither<E_2, A_3>, f: (a: A_3) => B_1) => import("fp-ts/lib/TaskEither").TaskEither<E_2, B_1>;
chain: <E_3, A_4, B_2>(fa: import("fp-ts/lib/TaskEither").TaskEither<E_3, A_4>, f: (a: A_4) => import("fp-ts/lib/TaskEither").TaskEither<E_3, B_2>) => import("fp-ts/lib/TaskEither").TaskEither<E_3, B_2>;
db: {
new: (aggregate: import("./Aggregate").Aggregate) => import("fp-ts/lib/TaskEither").TaskEither<Error, import("typeorm").Connection>;
transaction: (db: import("fp-ts/lib/TaskEither").TaskEither<Error, import("typeorm").Connection>) => <T_14>(task: (tx: import("typeorm").EntityManager) => import("fp-ts/lib/TaskEither").TaskEither<Error, T_14>) => import("fp-ts/lib/TaskEither").TaskEither<Error, T_14>;
advisoryLock: (lock: string) => (tx: import("typeorm").EntityManager) => import("fp-ts/lib/TaskEither").TaskEither<Error, void>;
};
isRight: typeof E.isRight;
isLeft: typeof E.isLeft;
}) => {
config: MainConfig;
timed: {
of: <A>(t: import("fp-ts/lib/TaskEither").TaskEither<Error, A>, onTime: (delay: number) => void) => import("fp-ts/lib/TaskEither").TaskEither<Error, A>;
log: (message: string) => void;
};
eventLogOps: {
queryAll: (aggregate: import("./Aggregate").Aggregate) => import("fp-ts/lib/TaskEither").TaskEither<Error, import("./entities/EventLog").EventLog[]>;
};
aggregate: {
of: (aggregate: {
aggregate: string;
handlers: import("./Event").Handler<import("./ClassType").ClassType>[];
entities: import("./ClassType").ClassType[];
dbConfig: import("./Aggregate").DbConfig;
kafkaConfig?: import("kafka-node").KafkaClientOptions;
cleanAfterPublished?: boolean;
}) => import("./Aggregate").Aggregate;
};
event: {
of: (kind: string) => <T extends import("./ClassType").ClassType>(clazz: T) => import("./Event").EventKind<T>;
new: <T_1 extends import("./ClassType").ClassType>(event: import("./Event").EventKind<T_1>) => (body: import("./ClassType").ClassTypeProps<T_1>) => import("./Event").EventPayload;
handle: <T_2 extends import("./ClassType").ClassType>(event: import("./Event").EventKind<T_2>) => (f: (event: import("./ClassType").ClassTypeProps<T_2>, tx: import("typeorm").EntityManager) => import("fp-ts/lib/TaskEither").TaskEither<Error, void>) => import("./Event").Handler<T_2>;
};
projector: {
of: (aggregate: import("./Aggregate").Aggregate) => (name: string, mode?: string) => (handlers: import("./Event").Handler<import("./ClassType").ClassType>[]) => import("./Projector").ProjectorConfig;
start: (projector: import("./Projector").ProjectorConfig) => import("fp-ts/lib/TaskEither").TaskEither<Error, void>;
stop: (projector: import("./Projector").ProjectorConfig) => import("fp-ts/lib/TaskEither").TaskEither<Error, void>;
};
dispatcher: {
start: (aggregate: import("./Aggregate").Aggregate) => import("fp-ts/lib/TaskEither").TaskEither<Error, void>;
stop: (aggregate: import("./Aggregate").Aggregate) => import("fp-ts/lib/TaskEither").TaskEither<Error, void>;
};
cmd: {
of: <C, R>(f: import("./Command").CommandFn<C, R>) => import("./Command").CommandFn<C, R>;
execute: (aggregate: import("./Aggregate").Aggregate) => <C_1, R_1>(fn: import("./Command").CommandFn<C_1, R_1>) => (rootId: string, commandId?: string) => (payload: C_1) => import("fp-ts/lib/TaskEither").TaskEither<Error, R_1>;
executeInTx: (tx: import("typeorm").EntityManager) => (aggregate: import("./Aggregate").Aggregate) => <C_2, R_2>(fn: import("./Command").CommandFn<C_2, R_2>) => (rootId: string, commandId?: string) => (payload: C_2) => import("fp-ts/lib/TaskEither").TaskEither<Error, R_2>;
};
loop: {
start: (process: import("./Loop").Process) => import("fp-ts/lib/TaskEither").TaskEither<Error, void>;
stop: (process: import("./Loop").Process) => import("fp-ts/lib/TaskEither").TaskEither<Error, void>;
};
rightIO: <T_3>(io: import("fp-ts/lib/IO").IO<T_3>) => import("fp-ts/lib/TaskEither").TaskEither<Error, T_3>;
tryCatchAsync: <T_4>(t: () => Promise<T_4>) => import("fp-ts/lib/TaskEither").TaskEither<Error, T_4>;
tryCatch: <T_5>(t: () => T_5) => import("fp-ts/lib/TaskEither").TaskEither<Error, T_5>;
orThrow: <T_6>(task: import("fp-ts/lib/TaskEither").TaskEither<Error, T_6>) => Promise<T_6>;
right: <T_7>(v: T_7) => import("fp-ts/lib/TaskEither").TaskEither<Error, T_7>;
fromTE: <T_8>(v: import("fp-ts/lib/TaskEither").TaskEither<Error, T_8>) => import("fp-ts/lib/TaskEither").TaskEither<Error, T_8>;
toTE: <T_9>(v: import("fp-ts/lib/TaskEither").TaskEither<Error, T_9>) => import("fp-ts/lib/TaskEither").TaskEither<Error, T_9>;
call: <T_10>(task: import("fp-ts/lib/TaskEither").TaskEither<Error, T_10>) => Promise<E.Either<Error, T_10>>;
callIgnore: <T_11>(task: import("fp-ts/lib/TaskEither").TaskEither<Error, T_11>) => void;
callAndLog: <T_12>(task: import("fp-ts/lib/TaskEither").TaskEither<Error, T_12>) => void;
left: <T_13>(error: Error) => import("fp-ts/lib/TaskEither").TaskEither<Error, T_13>;
if: (condition: boolean) => (task: import("fp-ts/lib/TaskEither").TaskEither<Error, void>) => import("fp-ts/lib/TaskEither").TaskEither<Error, void>;
of: <E, A_1>(a: A_1) => import("fp-ts/lib/TaskEither").TaskEither<E, A_1>;
ap: <E_1, A_2, B>(fab: import("fp-ts/lib/TaskEither").TaskEither<E_1, (a: A_2) => B>, fa: import("fp-ts/lib/TaskEither").TaskEither<E_1, A_2>) => import("fp-ts/lib/TaskEither").TaskEither<E_1, B>;
URI: "TaskEither";
map: <E_2, A_3, B_1>(fa: import("fp-ts/lib/TaskEither").TaskEither<E_2, A_3>, f: (a: A_3) => B_1) => import("fp-ts/lib/TaskEither").TaskEither<E_2, B_1>;
chain: <E_3, A_4, B_2>(fa: import("fp-ts/lib/TaskEither").TaskEither<E_3, A_4>, f: (a: A_4) => import("fp-ts/lib/TaskEither").TaskEither<E_3, B_2>) => import("fp-ts/lib/TaskEither").TaskEither<E_3, B_2>;
db: {
new: (aggregate: import("./Aggregate").Aggregate) => import("fp-ts/lib/TaskEither").TaskEither<Error, import("typeorm").Connection>;
transaction: (db: import("fp-ts/lib/TaskEither").TaskEither<Error, import("typeorm").Connection>) => <T_14>(task: (tx: import("typeorm").EntityManager) => import("fp-ts/lib/TaskEither").TaskEither<Error, T_14>) => import("fp-ts/lib/TaskEither").TaskEither<Error, T_14>;
advisoryLock: (lock: string) => (tx: import("typeorm").EntityManager) => import("fp-ts/lib/TaskEither").TaskEither<Error, void>;
};
isRight: typeof E.isRight;
isLeft: typeof E.isLeft;
};
};
};

@@ -41,6 +41,18 @@ "use strict";

var merge = function (defaultC, optional) { return (__assign(__assign({}, defaultC), optional)); };
exports.base = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ isRight: E.isRight, isLeft: E.isLeft }, dbTask), Program_1.programTask), loopTask), commandTask(defaultConfig)), dispatcherTask), Projector_1.projector(__assign(__assign(__assign(__assign({}, Program_1.programTask), loopTask), dbTask), FailFast_1.failFast(Program_1.programTask)))), Event_1.event()), Aggregate_1.aggregate()), EventLogOps_1.eventLogOps(__assign(__assign({}, Program_1.programTask), dbTask))), Timed_1.timed(defaultConfig)(__assign({}, Program_1.programTask))), { config: defaultConfig });
exports.getT = function (config, defaultC) {
if (defaultC === void 0) { defaultC = defaultConfig; }
return (__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ isRight: E.isRight, isLeft: E.isLeft }, dbTask), Program_1.programTask), loopTask), commandTask(merge(defaultC, config))), dispatcherTask), Projector_1.projector(__assign(__assign(__assign(__assign({}, Program_1.programTask), loopTask), dbTask), FailFast_1.failFast(Program_1.programTask)))), Event_1.event()), Aggregate_1.aggregate()), EventLogOps_1.eventLogOps(__assign(__assign({}, Program_1.programTask), dbTask))), Timed_1.timed(merge(defaultC, config))(__assign({}, Program_1.programTask))), { withC: function (newC) { return exports.getT(newC, merge(defaultC, config)); } }));
return (__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({ isRight: E.isRight, isLeft: E.isLeft }, dbTask), Program_1.programTask), loopTask), commandTask(merge(defaultC, config))), dispatcherTask), Projector_1.projector(__assign(__assign(__assign(__assign({}, Program_1.programTask), loopTask), dbTask), FailFast_1.failFast(Program_1.programTask)))), Event_1.event()), Aggregate_1.aggregate()), EventLogOps_1.eventLogOps(__assign(__assign({}, Program_1.programTask), dbTask))), Timed_1.timed(merge(defaultC, config))(__assign({}, Program_1.programTask))), { config: merge(defaultC, config) }));
};
exports.T = exports.getT({});
exports.c = {
timed: {
prefix: function (prefix, instance) {
return exports.getT({
timed: {
enabled: true,
prefix: prefix
}
}, instance.config);
}
}
};

2

package.json
{
"name": "ditto-ts",
"version": "0.1.0-alpha13",
"version": "0.1.0-alpha14",
"license": "SEE LICENSE IN LICENCE.md",

@@ -5,0 +5,0 @@ "main": "lib/index.js",