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

@castore/core

Package Overview
Dependencies
Maintainers
4
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@castore/core - npm Package Compare versions

Comparing version 1.1.3 to 1.2.0

29

dist/cjs/eventStore.js

@@ -33,2 +33,14 @@ "use strict";

var EventStore = /*#__PURE__*/(0, _createClass2["default"])( // @ts-ignore _types only
/**
* @debt v2 "rename as eventTypes"
*/
/**
* @debt v2 "rename as reducer"
*/
/**
* @debt v2 "rename as eventStorageAdapter"
*/
function EventStore(_ref) {

@@ -53,3 +65,2 @@ var _this = this;

(0, _defineProperty2["default"])(this, "pushEvent", void 0);
(0, _defineProperty2["default"])(this, "pushEventTransaction", void 0);
(0, _defineProperty2["default"])(this, "listAggregateIds", void 0);

@@ -65,2 +76,6 @@ (0, _defineProperty2["default"])(this, "buildAggregate", void 0);

this.simulateSideEffect = simulateSideEffect;
/**
* @debt v2 "rename as eventStorageAdapter"
*/
this.storageAdapter = storageAdapter;

@@ -132,14 +147,2 @@

this.pushEventTransaction = function (eventDetail) {
if (!_this.storageAdapter) {
throw new _undefinedStorageAdapterError.UndefinedStorageAdapterError({
eventStoreId: _this.eventStoreId
});
}
_this.storageAdapter.pushEventTransaction(eventDetail, {
eventStoreId: _this.eventStoreId
});
};
this.listAggregateIds = /*#__PURE__*/function () {

@@ -146,0 +149,0 @@ var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(options) {

@@ -36,8 +36,2 @@ "use strict";

});
Object.defineProperty(exports, "JSONSchemaCommand", {
enumerable: true,
get: function get() {
return _jsonSchema.JSONSchemaCommand;
}
});
Object.defineProperty(exports, "StorageAdapter", {

@@ -75,4 +69,2 @@ enumerable: true,

var _command = require("./command/command");
var _jsonSchema = require("./command/implementations/jsonSchema");
//# sourceMappingURL=index.js.map

@@ -19,3 +19,2 @@ "use strict";

pushEvent = _ref.pushEvent,
pushEventTransaction = _ref.pushEventTransaction,
listAggregateIds = _ref.listAggregateIds;

@@ -25,7 +24,5 @@ (0, _classCallCheck2["default"])(this, StorageAdapter);

(0, _defineProperty2["default"])(this, "pushEvent", void 0);
(0, _defineProperty2["default"])(this, "pushEventTransaction", void 0);
(0, _defineProperty2["default"])(this, "listAggregateIds", void 0);
this.getEvents = getEvents;
this.pushEvent = pushEvent;
this.pushEventTransaction = pushEventTransaction;
this.listAggregateIds = listAggregateIds;

@@ -32,0 +29,0 @@ });

@@ -17,2 +17,14 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";

export var EventStore = /*#__PURE__*/_createClass( // @ts-ignore _types only
/**
* @debt v2 "rename as eventTypes"
*/
/**
* @debt v2 "rename as reducer"
*/
/**
* @debt v2 "rename as eventStorageAdapter"
*/
function EventStore(_ref) {

@@ -46,4 +58,2 @@ var _this = this;

_defineProperty(this, "pushEventTransaction", void 0);
_defineProperty(this, "listAggregateIds", void 0);

@@ -65,2 +75,6 @@

this.simulateSideEffect = simulateSideEffect;
/**
* @debt v2 "rename as eventStorageAdapter"
*/
this.storageAdapter = storageAdapter;

@@ -132,14 +146,2 @@

this.pushEventTransaction = function (eventDetail) {
if (!_this.storageAdapter) {
throw new UndefinedStorageAdapterError({
eventStoreId: _this.eventStoreId
});
}
_this.storageAdapter.pushEventTransaction(eventDetail, {
eventStoreId: _this.eventStoreId
});
};
this.listAggregateIds = /*#__PURE__*/function () {

@@ -146,0 +148,0 @@ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(options) {

@@ -8,3 +8,2 @@ export { EventType } from "./event/eventType";

export { Command, tuple } from "./command/command";
export { JSONSchemaCommand } from "./command/implementations/jsonSchema";
//# sourceMappingURL=index.js.map

@@ -7,3 +7,2 @@ import _createClass from "@babel/runtime/helpers/createClass";

pushEvent = _ref.pushEvent,
pushEventTransaction = _ref.pushEventTransaction,
listAggregateIds = _ref.listAggregateIds;

@@ -17,4 +16,2 @@

_defineProperty(this, "pushEventTransaction", void 0);
_defineProperty(this, "listAggregateIds", void 0);

@@ -24,5 +21,4 @@

this.pushEvent = pushEvent;
this.pushEventTransaction = pushEventTransaction;
this.listAggregateIds = listAggregateIds;
});
//# sourceMappingURL=storageAdapter.js.map

@@ -21,3 +21,2 @@ import type { Aggregate } from "./aggregate";

pushEvent: (eventDetail: D) => Promise<void>;
pushEventTransaction: (eventDetail: D) => unknown;
listAggregateIds: (listAggregateOptions?: ListAggregateIdsOptions) => Promise<ListAggregateIdsOutput>;

@@ -45,4 +44,7 @@ buildAggregate: (events: D[]) => A | undefined;

}
export declare type EventStoreId<E extends EventStore> = E['eventStoreId'];
export declare type EventStoreEventsTypes<E extends EventStore> = E['eventStoreEvents'];
export declare type EventStoreEventsDetails<E extends EventStore> = E['_types']['details'];
export declare type EventStoreReducer<E extends EventStore> = E['reduce'];
export declare type EventStoreAggregate<E extends EventStore> = E['_types']['aggregate'];
//# sourceMappingURL=eventStore.d.ts.map

@@ -6,3 +6,2 @@ /// <reference types="jest" />

export declare const pushEventMock: jest.Mock<any, any>;
export declare const pushEventTransactionMock: jest.Mock<any, any>;
export declare const getEventsMock: jest.Mock<any, any>;

@@ -9,0 +8,0 @@ export declare const listAggregateIdsMock: jest.Mock<any, any>;

@@ -9,8 +9,6 @@ export type { Aggregate } from './aggregate';

export { StorageAdapter } from './storageAdapter';
export type { EventsQueryOptions, PushEventContext, PushEventTransactionContext, ListAggregateIdsOptions, ListAggregateIdsOutput, } from './storageAdapter';
export type { EventsQueryOptions, PushEventContext, ListAggregateIdsOptions, ListAggregateIdsOutput, } from './storageAdapter';
export { EventStore } from './eventStore';
export type { SimulationOptions, EventStoreEventsDetails, EventStoreAggregate, } from './eventStore';
export type { SimulationOptions, EventStoreId, EventStoreEventsTypes, EventStoreEventsDetails, EventStoreReducer, EventStoreAggregate, } from './eventStore';
export { Command, tuple } from './command/command';
export { JSONSchemaCommand } from './command/implementations/jsonSchema';
export type { OnEventAlreadyExistsCallback } from './command/implementations/jsonSchema';
//# sourceMappingURL=index.d.ts.map

@@ -8,5 +8,2 @@ import { EventDetail } from "./event/eventDetail";

};
export declare type PushEventTransactionContext = {
eventStoreId?: string;
};
export declare type ListAggregateIdsOptions = {

@@ -25,5 +22,4 @@ limit?: number;

pushEvent: (eventDetail: EventDetail, context: PushEventContext) => Promise<void>;
pushEventTransaction: (eventDetail: EventDetail, context: PushEventTransactionContext) => unknown;
listAggregateIds: (options?: ListAggregateIdsOptions) => Promise<ListAggregateIdsOutput>;
constructor({ getEvents, pushEvent, pushEventTransaction, listAggregateIds, }: {
constructor({ getEvents, pushEvent, listAggregateIds, }: {
getEvents: (aggregateId: string, options?: EventsQueryOptions) => Promise<{

@@ -33,3 +29,2 @@ events: EventDetail[];

pushEvent: (eventDetail: EventDetail, context: PushEventContext) => Promise<void>;
pushEventTransaction: (eventDetail: EventDetail, context: PushEventTransactionContext) => unknown;
listAggregateIds: (options?: ListAggregateIdsOptions) => Promise<ListAggregateIdsOutput>;

@@ -36,0 +31,0 @@ });

@@ -55,3 +55,2 @@ {

"jest": "^27.5.1",
"json-schema-to-ts": "^2.5.4",
"prettier": "^2.6.2",

@@ -78,6 +77,3 @@ "ts-node": "^10.7.0",

},
"peerDependencies": {
"json-schema-to-ts": "^2.0.0"
},
"version": "1.1.3"
"version": "1.2.0"
}

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc