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.0.1 to 1.0.2

6

dist/cjs/command/command.js

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

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var tuple = function tuple() {

@@ -34,2 +36,6 @@ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {

(0, _classCallCheck2["default"])(this, Command);
(0, _defineProperty2["default"])(this, "_types", void 0);
(0, _defineProperty2["default"])(this, "commandId", void 0);
(0, _defineProperty2["default"])(this, "requiredEventStores", void 0);
(0, _defineProperty2["default"])(this, "handler", void 0);
this.commandId = commandId;

@@ -36,0 +42,0 @@ this.requiredEventStores = requiredEventStores;

@@ -18,2 +18,4 @@ "use strict";

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _eventAlreadyExists = require("../../errors/eventAlreadyExists");

@@ -50,2 +52,10 @@

(0, _classCallCheck2["default"])(this, JSONSchemaCommand);
(0, _defineProperty2["default"])(this, "_types", void 0);
(0, _defineProperty2["default"])(this, "commandId", void 0);
(0, _defineProperty2["default"])(this, "requiredEventStores", void 0);
(0, _defineProperty2["default"])(this, "inputSchema", void 0);
(0, _defineProperty2["default"])(this, "outputSchema", void 0);
(0, _defineProperty2["default"])(this, "eventAlreadyExistsRetries", void 0);
(0, _defineProperty2["default"])(this, "onEventAlreadyExists", void 0);
(0, _defineProperty2["default"])(this, "handler", void 0);
this.commandId = commandId;

@@ -52,0 +62,0 @@ this.requiredEventStores = requiredEventStores;

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

var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

@@ -23,2 +25,4 @@

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }

@@ -41,2 +45,5 @@

_this = _super.call(this, "Event already exists for ".concat(eventStoreId !== null && eventStoreId !== void 0 ? eventStoreId : '', " aggregate ").concat(aggregateId, " and version ").concat(version));
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "eventStoreId", void 0);
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "aggregateId", void 0);
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "version", void 0);
_this.aggregateId = aggregateId;

@@ -43,0 +50,0 @@ _this.version = version;

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

var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));

@@ -23,2 +25,4 @@

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }

@@ -39,2 +43,3 @@

_this = _super.call(this, "Storage Adapter undefined for event store ".concat(eventStoreId, " "));
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "eventStoreId", void 0);
_this.eventStoreId = eventStoreId;

@@ -41,0 +46,0 @@ return _this;

4

dist/cjs/event/eventType.js

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

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var EventType = /*#__PURE__*/(0, _createClass2["default"])( // @ts-ignore _types only

@@ -19,2 +21,4 @@ function EventType(_ref) {

(0, _classCallCheck2["default"])(this, EventType);
(0, _defineProperty2["default"])(this, "_types", void 0);
(0, _defineProperty2["default"])(this, "type", void 0);
this.type = type;

@@ -21,0 +25,0 @@ });

65

dist/cjs/eventStore.js

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

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

@@ -21,2 +19,4 @@

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _undefinedStorageAdapterError = require("./errors/undefinedStorageAdapterError");

@@ -41,2 +41,15 @@

(0, _classCallCheck2["default"])(this, EventStore);
(0, _defineProperty2["default"])(this, "_types", void 0);
(0, _defineProperty2["default"])(this, "eventStoreId", void 0);
(0, _defineProperty2["default"])(this, "eventStoreEvents", void 0);
(0, _defineProperty2["default"])(this, "reduce", void 0);
(0, _defineProperty2["default"])(this, "simulateSideEffect", void 0);
(0, _defineProperty2["default"])(this, "getEvents", void 0);
(0, _defineProperty2["default"])(this, "pushEvent", void 0);
(0, _defineProperty2["default"])(this, "pushEventTransaction", void 0);
(0, _defineProperty2["default"])(this, "listAggregateIds", void 0);
(0, _defineProperty2["default"])(this, "buildAggregate", void 0);
(0, _defineProperty2["default"])(this, "getAggregate", void 0);
(0, _defineProperty2["default"])(this, "simulateAggregate", void 0);
(0, _defineProperty2["default"])(this, "storageAdapter", void 0);
this.eventStoreId = eventStoreId;

@@ -124,27 +137,33 @@ this.eventStoreEvents = eventStoreEvents;

this.listAggregateIds = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
return _regenerator["default"].wrap(function _callee3$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
if (_this.storageAdapter) {
_context3.next = 2;
break;
}
this.listAggregateIds = /*#__PURE__*/function () {
var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(options) {
return _regenerator["default"].wrap(function _callee3$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
if (_this.storageAdapter) {
_context3.next = 2;
break;
}
throw new _undefinedStorageAdapterError.UndefinedStorageAdapterError({
eventStoreId: _this.eventStoreId
});
throw new _undefinedStorageAdapterError.UndefinedStorageAdapterError({
eventStoreId: _this.eventStoreId
});
case 2:
return _context3.abrupt("return", _this.storageAdapter.listAggregateIds());
case 2:
return _context3.abrupt("return", _this.storageAdapter.listAggregateIds(options));
case 3:
case "end":
return _context3.stop();
case 3:
case "end":
return _context3.stop();
}
}
}
}, _callee3);
}));
}, _callee3);
}));
return function (_x4) {
return _ref4.apply(this, arguments);
};
}();
this.buildAggregate = function (eventDetails) {

@@ -184,3 +203,3 @@ return eventDetails.reduce(_this.reduce, undefined);

return function (_x4, _x5) {
return function (_x5, _x6) {
return _ref5.apply(this, arguments);

@@ -187,0 +206,0 @@ };

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

var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var StorageAdapter = /*#__PURE__*/(0, _createClass2["default"])(function StorageAdapter(_ref) {

@@ -21,2 +23,6 @@ var getEvents = _ref.getEvents,

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

@@ -23,0 +29,0 @@ this.pushEvent = pushEvent;

import _createClass from "@babel/runtime/helpers/createClass";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
export var tuple = function tuple() {

@@ -22,2 +23,10 @@ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {

_defineProperty(this, "_types", void 0);
_defineProperty(this, "commandId", void 0);
_defineProperty(this, "requiredEventStores", void 0);
_defineProperty(this, "handler", void 0);
this.commandId = commandId;

@@ -24,0 +33,0 @@ this.requiredEventStores = requiredEventStores;

import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
import _createClass from "@babel/runtime/helpers/createClass";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _regeneratorRuntime from "@babel/runtime/regenerator";

@@ -37,2 +38,18 @@ import { EventAlreadyExistsError } from "../../errors/eventAlreadyExists";

_defineProperty(this, "_types", void 0);
_defineProperty(this, "commandId", void 0);
_defineProperty(this, "requiredEventStores", void 0);
_defineProperty(this, "inputSchema", void 0);
_defineProperty(this, "outputSchema", void 0);
_defineProperty(this, "eventAlreadyExistsRetries", void 0);
_defineProperty(this, "onEventAlreadyExists", void 0);
_defineProperty(this, "handler", void 0);
this.commandId = commandId;

@@ -39,0 +56,0 @@ this.requiredEventStores = requiredEventStores;

import _createClass from "@babel/runtime/helpers/createClass";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
import _inherits from "@babel/runtime/helpers/inherits";

@@ -7,2 +8,3 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";

import _wrapNativeSuper from "@babel/runtime/helpers/wrapNativeSuper";
import _defineProperty from "@babel/runtime/helpers/defineProperty";

@@ -28,2 +30,9 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

_this = _super.call(this, "Event already exists for ".concat(eventStoreId !== null && eventStoreId !== void 0 ? eventStoreId : '', " aggregate ").concat(aggregateId, " and version ").concat(version));
_defineProperty(_assertThisInitialized(_this), "eventStoreId", void 0);
_defineProperty(_assertThisInitialized(_this), "aggregateId", void 0);
_defineProperty(_assertThisInitialized(_this), "version", void 0);
_this.aggregateId = aggregateId;

@@ -30,0 +39,0 @@ _this.version = version;

import _createClass from "@babel/runtime/helpers/createClass";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
import _inherits from "@babel/runtime/helpers/inherits";

@@ -7,2 +8,3 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";

import _wrapNativeSuper from "@babel/runtime/helpers/wrapNativeSuper";
import _defineProperty from "@babel/runtime/helpers/defineProperty";

@@ -26,2 +28,5 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }

_this = _super.call(this, "Storage Adapter undefined for event store ".concat(eventStoreId, " "));
_defineProperty(_assertThisInitialized(_this), "eventStoreId", void 0);
_this.eventStoreId = eventStoreId;

@@ -28,0 +33,0 @@ return _this;

import _createClass from "@babel/runtime/helpers/createClass";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
export var EventType = /*#__PURE__*/_createClass( // @ts-ignore _types only

@@ -9,4 +10,8 @@ function EventType(_ref) {

_defineProperty(this, "_types", void 0);
_defineProperty(this, "type", void 0);
this.type = type;
});
//# sourceMappingURL=eventType.js.map
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _createClass from "@babel/runtime/helpers/createClass";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _regeneratorRuntime from "@babel/runtime/regenerator";

@@ -27,2 +27,28 @@

_defineProperty(this, "_types", void 0);
_defineProperty(this, "eventStoreId", void 0);
_defineProperty(this, "eventStoreEvents", void 0);
_defineProperty(this, "reduce", void 0);
_defineProperty(this, "simulateSideEffect", void 0);
_defineProperty(this, "getEvents", void 0);
_defineProperty(this, "pushEvent", void 0);
_defineProperty(this, "pushEventTransaction", void 0);
_defineProperty(this, "listAggregateIds", void 0);
_defineProperty(this, "buildAggregate", void 0);
_defineProperty(this, "getAggregate", void 0);
_defineProperty(this, "simulateAggregate", void 0);
_defineProperty(this, "storageAdapter", void 0);
this.eventStoreId = eventStoreId;

@@ -110,27 +136,33 @@ this.eventStoreEvents = eventStoreEvents;

this.listAggregateIds = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
if (_this.storageAdapter) {
_context3.next = 2;
break;
}
this.listAggregateIds = /*#__PURE__*/function () {
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(options) {
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
while (1) {
switch (_context3.prev = _context3.next) {
case 0:
if (_this.storageAdapter) {
_context3.next = 2;
break;
}
throw new UndefinedStorageAdapterError({
eventStoreId: _this.eventStoreId
});
throw new UndefinedStorageAdapterError({
eventStoreId: _this.eventStoreId
});
case 2:
return _context3.abrupt("return", _this.storageAdapter.listAggregateIds());
case 2:
return _context3.abrupt("return", _this.storageAdapter.listAggregateIds(options));
case 3:
case "end":
return _context3.stop();
case 3:
case "end":
return _context3.stop();
}
}
}
}, _callee3);
}));
}, _callee3);
}));
return function (_x4) {
return _ref4.apply(this, arguments);
};
}();
this.buildAggregate = function (eventDetails) {

@@ -170,3 +202,3 @@ return eventDetails.reduce(_this.reduce, undefined);

return function (_x4, _x5) {
return function (_x5, _x6) {
return _ref5.apply(this, arguments);

@@ -173,0 +205,0 @@ };

import _createClass from "@babel/runtime/helpers/createClass";
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
export var StorageAdapter = /*#__PURE__*/_createClass(function StorageAdapter(_ref) {

@@ -11,2 +12,10 @@ var getEvents = _ref.getEvents,

_defineProperty(this, "getEvents", void 0);
_defineProperty(this, "pushEvent", void 0);
_defineProperty(this, "pushEventTransaction", void 0);
_defineProperty(this, "listAggregateIds", void 0);
this.getEvents = getEvents;

@@ -13,0 +22,0 @@ this.pushEvent = pushEvent;

import { Aggregate } from './aggregate';
import { EventDetail } from './event/eventDetail';
import { EventType, EventTypesDetails } from './event/eventType';
import { EventsQueryOptions, StorageAdapter } from './storageAdapter';
import { EventsQueryOptions, ListAggregateIdsOptions, ListAggregateIdsOutput, StorageAdapter } from './storageAdapter';
export declare type SimulationOptions = {

@@ -18,14 +18,12 @@ simulationDate?: string;

getEvents: (aggregateId: string, options?: EventsQueryOptions) => Promise<{
events: D[];
events: $D[];
}>;
pushEvent: (eventDetail: D) => Promise<void>;
pushEventTransaction: (eventDetail: D) => unknown;
listAggregateIds: () => Promise<{
aggregateIds: string[];
}>;
listAggregateIds: (listAggregateOptions?: ListAggregateIdsOptions) => Promise<ListAggregateIdsOutput>;
buildAggregate: (events: D[]) => A | undefined;
getAggregate: (aggregateId: string, options?: EventsQueryOptions) => Promise<{
aggregate: A | undefined;
events: D[];
lastEvent: D | undefined;
events: $D[];
lastEvent: $D | undefined;
}>;

@@ -32,0 +30,0 @@ simulateAggregate: (events: D[], options?: SimulationOptions) => A | undefined;

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

export { StorageAdapter } from './storageAdapter';
export type { EventsQueryOptions, PushEventContext, PushEventTransactionContext, } from './storageAdapter';
export type { EventsQueryOptions, PushEventContext, PushEventTransactionContext, ListAggregateIdsOptions, ListAggregateIdsOutput, } from './storageAdapter';
export { EventStore } from './eventStore';

@@ -11,0 +11,0 @@ export type { SimulationOptions, EventStoreEventsDetails, EventStoreAggregate, } from './eventStore';

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

};
export declare type ListAggregateIdsOptions = {
limit?: number;
pageToken?: string;
};
export declare type ListAggregateIdsOutput = {
aggregateIds: string[];
nextPageToken?: string;
};
export declare class StorageAdapter {

@@ -18,5 +26,3 @@ getEvents: (aggregateId: string, options?: EventsQueryOptions) => Promise<{

pushEventTransaction: (eventDetail: EventDetail, context: PushEventTransactionContext) => unknown;
listAggregateIds: () => Promise<{
aggregateIds: string[];
}>;
listAggregateIds: (options?: ListAggregateIdsOptions) => Promise<ListAggregateIdsOutput>;
constructor({ getEvents, pushEvent, pushEventTransaction, listAggregateIds, }: {

@@ -28,7 +34,5 @@ getEvents: (aggregateId: string, options?: EventsQueryOptions) => Promise<{

pushEventTransaction: (eventDetail: EventDetail, context: PushEventTransactionContext) => unknown;
listAggregateIds: () => Promise<{
aggregateIds: string[];
}>;
listAggregateIds: (options?: ListAggregateIdsOptions) => Promise<ListAggregateIdsOutput>;
});
}
//# sourceMappingURL=storageAdapter.d.ts.map
{
"name": "@castore/core",
"version": "1.0.1",
"version": "1.0.2",
"license": "MIT",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/theodo/castore#readme",

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

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