Skip to content

Releases: salient-labs/toolkit

v0.21.0

06 Nov 14:05
v0.21.0
51f37f8

Choose a tag to compare

Changed

  • Sync: rename HydrationFlag to HydrationPolicy and rework related methods

    ISyncContext:

    • Rename:
      • withHydrationFlags() -> withHydrationPolicy()
      • maybeApplyFilterPolicy() -> applyFilterPolicy()
      • getHydrationFlags() -> getHydrationPolicy()
    • Add:
      • online()
      • offline()
      • offlineFirst()
      • getOffline()

    ISyncEntityProvider:

    • Rename:
      • withoutResolvingDeferrals() -> doNotResolve()
      • withoutHydration() -> doNotHydrate()
      • withHydration() -> hydrate()
    • Add:
      • resolveEarly()
      • resolveLate()
      • offlineFirst()

    SyncEntityProvider:

    • Track online/offline status in ISyncContext
    • Remove deprecated getFuzzyResolver()

v0.20.89

06 Nov 14:01
v0.20.89
f7aa895

Choose a tag to compare

Fixed

  • Create a separate cURL handle for each request that returns paginated data via a generator to resolve errors arising from multiple Curler instances sharing one handle

v0.20.88

06 Nov 02:39
v0.20.88
560e084

Choose a tag to compare

Added

  • Add IPipeline::cc() to allow more flexible workflows, e.g. in sync entity pipelines
  • Add IPipeline::collectThenIf() for completeness

v0.20.87

05 Nov 18:05
v0.20.87
7ab83f6

Choose a tag to compare

Added

  • Sync: add SyncInvalidRequestException

Changed

  • Sync: improve entity deferral and hydration

    • Optionally limit hydration flag scope to a given depth
    • Add ISyncEntityProvider::withoutResolvingDeferrals(), withoutHydration() and withHydration() to simplify manipulation of the underlying context
    • Sync::deferredEntity(): ignore hydration flags in favour of deferral policy
    • Sync::resolveDeferred(): resolve relationships first to take advantage of more entities per round trip
    • In SyncEntityResolver::getByName(), catch SyncFilterPolicyViolationException and make a second attempt without the filter
    • When resolving named parameters in HttpSyncDefinition::runHttpOperation(), claim matching filters before checking for matching values, reversing the previous order
  • lk-util generate sync entity:

    • Generate sync entities with relationships and parent/child properties
    • Allow properties in the reference entity to be skipped
    • Treat entity properties with suffix _id or _ids as relationships
  • Convert::valueToCode(): improve string escaping and add support for multiline arrays

  • Declare Builder::getTerminators() so subclasses don't need to

Removed

  • Sync: remove dangerous HydrationFlag::NO_FILTER option

Fixed

  • Sync: fix issue where deferred entities that are immediately resolved by the provider are not assigned to the variable originally passed by reference
  • Sync: fix issue where checks are performed against the child of the intended context during entity and relationship deferral
  • Sync: fix issue where hydration flags are incorrectly performed on the receiving entity
  • Fix CliCommand::getEffectiveArgument() issue where short arguments with name "0" are not returned correctly

v0.20.86

03 Nov 02:25
v0.20.86
69891ce

Choose a tag to compare

Added

  • Sync: implement hydration of relationships

    • Add HydrationFlag
    • Allow hydration flags to be applied to sync contexts globally or per-entity
    • Implement suppressed, lazy, deferred and eager hydration of relationships
    • Apply parent/child relationships via addChild()/setParent()
    • Register entities with the entity store before processing deferred entities and relationships to prevent race conditions and infinite recursion
    • Add magic methods to DeferredSyncEntity for on-demand resolution of deferred entities (similar to lazy hydration implemented via IteratorAggregate in DeferredRelationship)
    • Add Sync::resolveDeferred()
    • Allow deferred entities and relationships to be resolved via callback instead of assignment
    • Store resolved entities and relationships in DeferredSyncEntity and DeferredRelationship so they can forward property actions and method calls until they go out of scope
    • Throw an exception if an attempt is made to resolve the same deferred entity or relationship multiple times
    • In Sync::resolveDeferredEntities(), remove attempt to resolve multiple entities via getListA() in favour of resolving the first instance of each entity in its own context to ensure parent entities are surfaced to providers
  • Sync: add protected DbSyncProvider::first() method to simplify retrieval of a single entity

  • Add Convert::toValue()

  • Add Test::isFloatValue()

Changed

  • Sync: simplify filter policy API

    • Add ISyncProvider::getFilterPolicy() so providers can specify a default without implementing getDefinition()
    • Add SyncProvider::run() to minimise the need for boilerplate safety checks in providers where sync operations are performed by declared methods
  • Sync: improve error reporting

    • Remove $toConsole parameter from Sync::error()
    • Add Sync::enableErrorReporting() and disableErrorReporting()
    • Fix issue where output from Sync::reportErrors() is not unescaped
  • Sync: rename classes and methods:

    • DeferredSyncEntity -> DeferredEntity
    • DeferredSyncEntityPolicy -> DeferralPolicy
    • SyncFilterPolicy -> FilterPolicy
    • Sync::getDeferredEntityCheckpoint() -> getDeferralCheckpoint()
    • ISyncContext::withDeferredSyncEntityPolicy() -> withDeferralPolicy()
    • ISyncContext::getDeferredSyncEntityPolicy() -> getDeferralPolicy()
  • Add optional $count parameter to Console::message{,Once}()

  • DbConnector: use DB2CODEPAGE to enable UTF-8 before connecting to Db2

  • DbSyncProvider: remove UTF-8 locale assertion

  • Convert/Test: accept leading and trailing spaces in integer and boolean strings

Removed

  • Remove unused entity deferral methods from SyncEntity and SyncEntityProvider
  • Remove references to DeferredSyncEntity::$Entity's unsupported nullability

Fixed

  • In ConsoleFormatter::escapeTags(), mitigate PREG_JIT_STACKLIMIT_ERROR when printing long Console messages with many special characters (e.g. JSON-encoded values) by only escaping recognised tag delimiters
  • Fix Event::listen() callback signature

v0.20.85

31 Oct 05:18
v0.20.85
e87614a

Choose a tag to compare

Changed

  • ICliApplication: rework to allow chained methods after run()
    • Return $this from ICliApplication::run()
    • Surface the most recent return value via ICliApplication::getLastExitStatus()
    • Add ICliApplication::exit()

v0.20.84

31 Oct 03:42
v0.20.84
6e4b932

Choose a tag to compare

Added

  • Add Inflect class with indefinite() method that determines which indefinite article ("a" or "an") to use before a word
  • Add Arr::first() and Arr::last()

Changed

generate sync entity command:

  • Add a default description to entity classes

generate sync provider command:

  • Only use FluentIteratorInterface as a magic method return type

  • Add .gitattributes file to reduce package size

Removed

  • Remove --extend option from generate sync provider command

v0.20.83

30 Oct 06:55
v0.20.83
15310b2

Choose a tag to compare

Added

  • Add FilesystemErrorException and throw it instead of returning false from (most) File methods
  • Add InvalidRuntimeConfigurationException
  • Add Graph::from() to allow passing the initial object or array by value

Changed

  • Rename Filesystem to File
  • Finalise deprecation of File::find() as a standalone method, replacing it with a RecursiveFilesystemIterator() factory
  • Rename methods:
    • File::createTemporaryDirectory() -> createTempDir()
    • File::maybeCreate() -> create()
    • File::maybeCreateDirectory() -> createDir()
    • File::maybeDelete() -> delete()
    • File::maybeDeleteDirectory() -> deleteDir()
    • File::pruneDirectory() -> pruneDir()
    • Graph::getInnerGraph() -> inner()

Removed

  • Remove File facade (Lkrms\Utility\File is a drop-in replacement after adopting the method names above)

Fixed

  • Make non-strict comparisons in File strict

v0.20.82

29 Oct 23:45
v0.20.82
9dab397

Choose a tag to compare

Added

  • Add Graph, a unified interface for arbitrarily nested objects and arrays

v0.20.81

28 Oct 09:18
v0.20.81
d9a0ff3

Choose a tag to compare

Added

  • Sync: add SyncInvalidEntityException

Fixed

  • Sync: fix definition builder issue where generic types fail to propagate
    • "generate builder": always add a declared method for parameters and properties that receive a class-wide generic type