Skip to content

Latest commit

 

History

History
596 lines (415 loc) · 21.3 KB

CHANGELOG.md

File metadata and controls

596 lines (415 loc) · 21.3 KB

@daiso-tech/core

0.26.1

Patch Changes

  • 2128106: Fixed a but LockProvider class

0.26.0

Minor Changes

  • a93ee80: The Pipeline class invoke method can now take function, async function, LazyPromise and reguler value
  • 70e2494: Changed IInvokableObject method name
  • b34c3dc: The LazyPromise defer method now accepts callbacks onSuccess, onFailure, and onFinally.
  • 70e2494: Removed IEventListenerObject and EventListener types.
  • 84e333c: Added new Pipeline utility class makes it easy to chain multiple functions and IInvokableObject instances together. Each function or object in the pipeline can inspect or modify the input as it passes through. The Pipeline class is immutable, so you can safely extend or modify it without causing issues.
  • 0cc289d: Changed the serialization, deserialization of the TimeSpan class

0.25.0

Minor Changes

  • a4349e5: Renamed ILockListener contract to ILockListenable.
  • a4349e5: Renamed ICacheListener contract to ICacheListenable.
  • 92d7dd3: The LockProvider class and LockProviderFactory class uses MemoryEventBusAdapter by default now.
  • 76063a4: Renamed IEventListener contract to IEventListenable.
  • 89aa51e: Added 2 new methods for ILock contract, acquireBlocking and runBlocking. They retry acquiring the lock at a set interval until the timeout is reached."
  • 76063a4: Renamed Listener type to EventListener
  • 76063a4: Enhanced the IEventListenable contract to support both function, object literal and class instance listeners, providing greater flexibility in event handling.
  • afa57c7: Added new method asPromise to the IEventBus. The asPromise method returns LazyPromise objecet that resolves once the BaseEvent is dispatched.

Patch Changes

  • 57e4bb5: Updated documentation
  • 92d7dd3: The Cache class and CacehFactory class uses MemoryEventBusAdapter by default now.

0.24.0

Minor Changes

  • 1f1b344: Renamed function registerEventBusErrors to registerEventBusErrorsToSerde.
  • 78bad79: Made ListCollection and IterableCollection class serializable and deserializable.
  • 1f1b344: Renamed function registerCacheErrors to registerCacheErrorsToSerde
  • 8253d62: Changed Lock class so it now doesn't implement ISerdeTransformer contract.
  • fadaaeb: - Changes
    • Converted the project to ESM only module.
    • Removed the main entrypoint and multiple entry points to the project via package.json exports field.
  • 4e4b1b8: Added new Serde class that implements IFlexibleSerded and that can be derivied from IFlexibleSerdeAdapter.
  • 1f1b344: Renamed function registerCacheEvents to registerCacheEventsToSerde
  • 66215ea: The ISerdeTransformer contract name field can now be bot a string and string[].

Patch Changes

  • 7055619: Improved lock component documentation
  • 8253d62: Fixed a bug with Lock class serialization and deserialization
  • 1f1b344: Added new functions registerCollectionsToSerde and registerCollectionErrorsToSerde

0.23.0

Minor Changes

  • 9160158: Renamed UnownedExtendLockError to UnownedRefreshLockError
  • ebd0666: Removed IDatabaseLockAdapter inheritance from IDeinitizable and IInitizable to simplify the contract.
  • 4a4b537: Removed the ISerdeRegistrable contract
  • ebd0666: Removed isLocked method and getRemainingTime method from ILockAdapter.

Patch Changes

  • 4a4b537: Updated READNE.md and package.json.
  • ebd0666: - Lock class
    • Fixed a bug in acquireOrFail, it now correctly throws an error.

0.22.2

Patch Changes

  • e456cbe: Updated READNE.md and package.json.

0.22.1

Patch Changes

  • c2a6a79: Added more documentation for the lock component

0.22.0

Minor Changes

  • ecabc49: - Changes
    • Remove static settings methods and settings builder classes from:
      • EventBus class
      • EventBusFactory class
      • MemoryEventBusAdapter class
      • RedisPubSubEventBusAdapter class
  • 1c41caf: - New features
    • Added new ILock UnexpectedLockErrorEvent that will dispatched when error occurs.
    • Added event listeners to ILockProvider, enabling monitoring of lock events from multiple locks.
    • Changes
      • Made all the ILock events defered when dispatched.
  • 1821d46: - New features
    • Added new ICache UnexpectedCacheErrorEvent that will dispatched when error occurs.
    • Changes
      • Made all the ICache events defered when dispatched.
  • 9a0c764: - Changes
    • Remove static settings methods and settings builder classes from:
      • Cache class
      • CacheFactory class
      • MemoryCacheAdapter class
      • MongodbCacheAdapter class
      • LibsqlCacheAdapter class
      • SqliteCacheAdapter class
      • RedisCacheAdapter class
  • 9ef0a81: - New features
    • Added distributed lock.
      • Contracts
        • Added IDatabaseLockAdapter
        • Added ILockAdapter
        • ILockProvider
        • ILockProviderFactory
        • ILock
      • Derivables
        • Added LockProvider class.
        • Added LockProviderFactory class.
      • Adapter
        • LibsqlLockAdapter
        • MemoryLockAdapter
        • MongodbLockAdapter
        • RedisLockAdapter
        • SqliteLockAdapter
  • 0dfe16c: - Changes
    • Simplified the cacheAdapterTestSuite
    • Simplified the cacheTestSuite
  • 8fa218c: - Changes
    • Simplified the eventBusAdapterTestSuite
    • Simplified the eventBusTestSuite
  • e2f6d79: - Changes
    • IAsyncCollection: You can now pass in LazyPromise as default value in the following methods.
      • firstOr
      • lastOr
      • beforeOr
      • afterOr
    • Cache: You can now pass in LazyPromise as default value in the following methods.
      • getOr
      • getOrAdd

Patch Changes

  • ef2315b: Fixed a minor type bug
  • d486046: Added missing exports
  • 604e43f: - Improved documentations

0.21.1

Patch Changes

  • c3aaf06: - Fixed bugs with LazyPromise class
  • ccf442d: - Removed exists mehtod from the ICacheAdapter contract and all classes that implement the contract.

0.21.0

Minor Changes

  • afdd280: - Removed shouldRegisterEvents and shouldRegisterErrors from CacheSettings.
    • Removed shouldRegisterErrors from EventBusSettings.
  • 81396af: - Updated the documentation and made CacheSettings.eventBus field required.

0.20.0

Minor Changes

  • 3dfbd75: - Updated the ICacheAdapter contract: The withGroup method now accepts only a string as its argument.
    • Updated the IEventBusAdapter contract: The withGroup method now accepts only a string as its argument.

0.19.0

Minor Changes

  • 615e616: - Added new settings to the Cache class, allowing you to decide whether to register all Cache related events and errors.

0.18.0

Minor Changes

  • 29334ad: ### Changes
    • Simplified the event registration process by removing the registerCacheEvents function.
    • All cache-related events are now registered directly within the Cache class constructor for improved clarity and maintainability.
  • a6fe783: ### Changes
    • Made all the cahce related Error serializable and deserializable
    • All cache related error are registered directly within the Cache class constructor for improved clarity and maintainability
  • 97a3934: ### Changes
    • Made all the event bus related Error serializable and deserializable
    • All event bus related error are registered directly within the EventBus class constructor for improved clarity and maintainability
  • f64191c: ### Changes
    • Introduced a new method, registerCustom, in the IFlexibleSerde contract. This method enables support for custom serialization and deserialization processes.

0.17.4

Patch Changes

  • 29aa4d7: Improved documentation

0.17.3

Patch Changes

  • 6d9dd94: Updated documentation

0.17.2

Patch Changes

  • c31871e: Added missing imports

0.17.1

Patch Changes

  • 5f8076b: Improved documentation

0.17.0

Minor Changes

  • e21e0ce: ### Changes

    • ICache and ICacheAdapter Enhancements:
      • All ICache and ICacheAdapter classes now take a single constructor argument.
      • A settings builder has been introduced for all ICache and ICacheAdapter classes.
    • IEventBus and IEventBusAdapter Enhancements:
      • All IEventBus and IEventBusAdapter classes now take a single constructor argument.
      • A settings builder has been introduced for all IEventBus and IEventBusAdapter classes.
    • LazyPromise class Enhancements:
      • Removed the settings from LazyPromise class.
      • Renamed to methods to use set as prefix

Patch Changes

  • e21e0ce: ### Changes
    • Generic Type Defaults: Added default generic types for the following interfaces and classes
    • Caching
      • ICache contract
      • Cache class
      • ICacheAdapter contract
      • MemoryCacheAdapter class
      • SqliteCacheAdapter class
      • LibsqlCacheAdapter class
      • RedisCacheAdapter class
      • MongodbCacheAdapter class
    • Event bus:
      • IEventBus contract
      • EventBus class
    • Collections:
      • IAsyncCollection contract
      • AsyncIterableCollection class
      • ICollection contract
      • IterableCollection class
      • ListCollection class
  • caa9f36: ## Changes
    • Ensured consistent serialization and deserialization in all the cache adapters and event bus adapters.
  • e21e0ce: ### Changes
    • Remove withType method from ICacheFactory and IEventBusFactory.

0.16.0

Minor Changes

  • 9197902: ## Changes

    • Moved cache group logic from the Cache class into the adapters classes.
      • Key Impact: Each adapter is now required to implement the getGroup and withGroup methods.
      • This change enhances flexibility for adapter-specific logic.
  • 7d07f5d: ## New Features

    • Introduced new static helper methods for the LazyPromise class:

      • all
      • allSettled
      • race
      • any

      These methods are similar to JavaScript Promise methods but execute lazily.

  • 29bfdf2: ## Changes

    • Renamed everything that start with namespace to group.
  • cd2342b: ## Changes

    • Renamed all instances of the ISerializer contract to ISerde.
    • Added two new contracts:
      • IDeserializer: Handles only deserialization.
      • ISerializer: Handles olny serialization.

    New Features

    • Introduced the ISerializable contract, enabling classes to be marked as serializable.
    • Added the IFlexibleSerde contract, allowing registration of custom classes for serialization and deserialization.
    • Implemented the ISerializable contract the TimeSpan class.
  • 46d2474: ## New features

    • Introduced a new static helper method wrapFn for the LazyPromise class. This method simplifies the process of wrapping asynchronous functions with LazyPromise.
  • d3eec52: ## Changes

    • Removed abstract BaseCache class
    • Removed abstract BaseEventBus class
    • Added lazyPromiseSettings for AsyncIterableCollection class
    • Added lazyPromiseSettings for Cache class
    • Added lazyPromiseSettings for EventBus class
  • 5e7dae8: ## New features

    • Introduced a instance static method listenOnce for the IEventBus contract and EventBus class. This method simplifies add listener that will only execute once.

    Changes

    • Moved event bus group logic from the Cache class into the adapters classes.
      • Key Impact: Each adapter is now required to implement the getGroup and withGroup methods.
      • This change enhances flexibility for adapter-specific logic.
  • 67ec890: ## New Features

    • Introduced new static helper methods for the AsyncIterableCollection, IterableCollection and ListCollection classes:
      • concat
      • difference
      • zip

0.15.0

Minor Changes

  • e08c7d6: ## Changes
    • Changed IEventBus contract to use event maps types.
  • 18e68be: ## Changes
    • Removed abort, retry, timeout methods.
    • Added these methods as part of the LazyPromise class for better developer experience.

Patch Changes

  • 2cc89b6: ## Minor features
    • Added reusable tests for ICace contract.

0.14.0

Minor Changes

  • 8b27f63: ## Changes
    • Added: A new NoOpCacheAdapter for mocking cache operations in testing environments.
    • Updated: All cache and eventbus adapters now require a serializer to be explicitly provided, ensuring consistent serialization behavior.
    • Removed: The validation feature has been removed from the EventBus and EventBusFactory classes.
    • Added: A new abstract class BaseEventBus to simplify the implementation of IEventBus. This allows direct use without needing IEventBusAdapter.

0.13.0

Minor Changes

  • 29e7aee: ### ICollection

    • Added toRecord: Converts a collection to a Record if the items are tuples of two elements, where the first element is a string, number, or symbol.
    • Added toMap: Converts a collection to a Map if the items are tuples of two elements.

    IAsyncCollection

    • Added toRecord: Converts a collection to a Record if the items are tuples of two elements, where the first element is a string, number, or symbol.
    • Added toMap: Converts a collection to a Map if the items are tuples of two elements.

0.12.0

Minor Changes

  • dc33da1: ## Changes

    • Added Cache module that can work ttl keys and none ttl keys.
    • Remove Storage module in favor of the Cache module because it can with ttl keys and none ttl keys.
    • Added MongodbCacheAdapter
    • Added SqliteCacheAdapter
    • Added LibsqlCacheAdapter
    • Added RedisCacheAdapter
    • Added MemoryCacheAdapter

    Changes

    • Added Cache module: Introduced a new Cache module that supports both TTL (time-to-live) keys and non-TTL keys.
    • Removed Storage module: Its functionality has been replaced by the more versatile Cache module, which supports both TTL and non-TTL keys.
      • New Cache Adapters: Added the following cache adapters for improved flexibility and compatibility:
      • MongodbCacheAdapter
      • SqliteCacheAdapter
      • LibsqlCacheAdapter
      • RedisCacheAdapter
      • MemoryCacheAdapter

0.11.0

Minor Changes

  • 6308641: ## Changes
    • Enhanced the IStorageFactory, so the will throw runtime erros.
    • Enhanced the IEventBusFactory, so the will throw runtime erros.
    • Simplified the IStorage contract
    • Simplified the IStorageAdapter contract
    • Simplified Storage class
    • Rewrote all the adapters

0.10.0

Minor Changes

  • f675866: ## Changes
    • Changed IAsyncCollection contract to use LazyPromise instead PromiseLike.
    • Changed IEventBus contract to use LazyPromise instead PromiseLike.
    • Changed IStorage contract to use LazyPromise instead PromiseLike.
    • Changed ISerializer contract to use PrommiseLike instead Promise.

0.9.0

Minor Changes

  • adfe30a: ## Changes
    • Added get, getOrFail and set methods for the ICollection and IAsyncCollection contracts
      • get method makes it easy to retrieve an item based on index. If item is not found null will be returned.
      • getOr method makes it easy to retrieve an item based on index. If item is not found an error will be thrown.
      • set method makes it easy to set item by index.

0.8.1

Patch Changes

  • 0684e61: ## Changes
    • Improved the IEventBusManager
    • Improved the IStorageManager

0.8.0

Minor Changes

  • a462c8f: ## New features

    • Added EventBus class and IEventBus contract that includes methods that are useful for multitennacy.
    • Added IEventBusAdapter, RedisEventBusAdapter and MemoryEventBusAdapter.

    Improvements

    • Improvevd IStorage so they trigger events that can be listenable
    • Improved IStorage by adding new methods that that are useful for multitennacy

    New Features

    • Introduced the EventBus class and the IEventBus contract, which provide essential methods for supporting multitenancy.
    • Added IEventBusAdapter contract the following event bus adapters:
      • RedisEventBusAdapter
      • MemoryEventBusAdapter

    Improvements

    • Enhanced IStorage to trigger events that can be subscribed to for better event-driven behavior.
    • Expanded IStorage with new methods designed to support multitenancy effectively.

0.7.0

Minor Changes

  • 99c4671: Simplified the storage contracts

0.6.0

Minor Changes

  • f324fc1: # Storage
    • Simplified StorageAdapter contract
    • Changed the StorageAdapter and Storage contract to use PromiseLike instead of Promise.
    • Changed the Storage class to use LazyPromise instead of Promise.
    • Removed unnecessary try catches from Storage class so unknown error can propagate up

0.5.0

Minor Changes

  • 790a76c: # IAsyncCollection and AsyncIterableCollection Changed IAsyncCollection contract to use PromiseLike instead of Promise. Changed AsyncIterableCollection to use LazyPromise instead of Promise. Removed all try catches catched unknown errors. Renamed timeout to takeUntilTimeout, and abort to takeUntilAbort.

0.4.0

Minor Changes

  • e2031da: # New features

    Async utilities

    • Added abortable async utility function.
    • Added abortableIterable utility function.
    • Added delay async utility function.
    • Added delayIterable utility function.
    • Added retry async utility function.
    • Added retryIterable utility function.
    • Added timeout async utility function.
    • Added timeoutIterable utility function.
    • Added LazyPromise class utility.
    • Added constant, exponential, linear and polynomial backoff policies.

    Utilities

    • Added TimeSpan class that makes easy to work time intervals.
  • d070f85: Introduced a new namespace feature for the Storage contract. This enhancement enables the creation of a new Storage instance with a specified prefixed namespace, derived from the current Storage.

Patch Changes

  • d070f85: Removed AsyncDispose for StorageContract

0.3.0

Minor Changes

  • ff9b885: ## Cache

    Contracts

    • Added cache contract
    • Added cache adapter contract.

    Adapters

    • Added redis cache adapter
    • Added mongodb cache adapter
    • Added sqlite cache adapter.

    Serializer

    Contracts

    • Added serializer contract

    Adapters

    • Added super json serializer adapter
    • Added redis serializer adapter
    • Added mongodb serializer adapter
    • Added sqlite serializer adapter.

0.2.1

Patch Changes

  • fad301c: Removed documentation for internal functions

0.2.0

Minor Changes

  • 7cb54cb: ## ICollection and IAsyncCollection changes Removed the throwOnIndexOverflow setting from all ICollection and IAsyncCollection methods. This change was made because the setting throwOnIndexOverflow was unnecessary; it only applied to very large collections, where using JavaScript is not advisable.

    Changed the slice method signature to align with the JavaScript version.

    Changed the shuffle method to accept a custom Math.random function, making it easier for testing.

    Changed the sum, average, median, min, max, and percentage methods to throw an error when the collection is empty.

    Changed the crossJoin method signature and its usage to ensure proper type inference.

0.1.5

Patch Changes

  • 7206c93: Updated the docs

0.1.4

Patch Changes

  • 218a64c: Added link to docs in readme

0.1.3

Patch Changes

  • 60c686d: Added proper documentation, changed som method names, added 2 new methods

0.1.2

Patch Changes

  • a10193f: Empty collection class instances can be created without passing in empty arrays

0.1.1

Patch Changes

  • 25b7503: Added npmignore

0.1.0

Minor Changes

  • First release