@daffodil/core 0.90.0 → 0.92.3-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -600,6 +600,21 @@ declare const daffCollectionBuildMetadataFromRequest: (request: DaffCollectionRe
600
600
  */
601
601
  declare const daffCollectionBuildRequestFromMetadata: (metadata: DaffCollectionMetadata) => Partial<DaffCollectionRequest>;
602
602
 
603
+ /**
604
+ * Represents an entity that has a creation date.
605
+ */
606
+ interface DaffCreateable {
607
+ /**
608
+ * The date at which this entity was created.
609
+ */
610
+ createdAt: string;
611
+ }
612
+
613
+ /**
614
+ * Finds and returns the most recently created entity.
615
+ */
616
+ declare function daffCreateableMostRecent<T extends DaffCreateable = DaffCreateable>(createables: T[]): T | null | undefined;
617
+
603
618
  /**
604
619
  * A utility decorator that delays method execution until after a specified delay period has elapsed since the last invocation.
605
620
  *
@@ -837,6 +852,10 @@ interface DaffSingleInjectionToken<T = unknown> {
837
852
  * A helper function to provide a value to the token.
838
853
  */
839
854
  provider: <R extends T = T>(value: R) => ValueProvider;
855
+ /**
856
+ * A helper function to provide factories to the token.
857
+ */
858
+ factoryProvider: <R extends T = T>(factory: () => R) => FactoryProvider;
840
859
  }
841
860
 
842
861
  type TokenDesc<T> = ConstructorParameters<typeof InjectionToken<T>>[0];
@@ -862,6 +881,10 @@ interface DaffMultiInjectionToken<T = unknown> {
862
881
  * A helper function to provide values to the token.
863
882
  */
864
883
  provider: <R extends T = T>(...values: Array<R>) => Array<ValueProvider>;
884
+ /**
885
+ * A helper function to provide factories to the token.
886
+ */
887
+ factoryProvider: <R extends T = T>(...factories: Array<() => R>) => Array<FactoryProvider>;
865
888
  }
866
889
 
867
890
  /**
@@ -1318,5 +1341,5 @@ interface DaffOrderable {
1318
1341
  order: number;
1319
1342
  }
1320
1343
 
1321
- export { DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS_ERROR_CODE, DAFF_SERVER_STORAGE_SERVICE_ERROR_CODE, DAFF_STORAGE_SERVICE_ERROR_CODE, DaffBase64ServiceToken, DaffBrowserBase64Service, DaffCollectionPageOutOfBoundsError, DaffErrorStorageService, DaffFilterFromToFilterSeparator, DaffFilterNotFound, DaffFilterRequestNameMismatch, DaffFilterRequestTypeMismatch, DaffFilterType, DaffFilterUnknownType, DaffInheritableError, DaffLocalStorageService, DaffMemoryStorageService, DaffNoopStorageService, DaffPersistenceServiceToken, DaffServerBase64Service, DaffServerErrorStorageService, DaffServerSafePersistenceServiceToken, DaffServerSideStorageError, DaffSortDirectionEnum, DaffStorageServiceError, allOf, anyOf, backoff, catchAndArrayifyErrors, collect, createConfigInjectionToken, createMultiInjectionToken, createServicesInjectionToken, createSingleInjectionToken, createSingletonInjectionToken, daffAdd, daffApplyFilter, daffApplyRequestToFilters, daffApplyRequestsToFilters, daffArrayConcatMerger, daffArrayToDict, daffClearFilter, daffClearFilters, daffCollectionBuildMetadataFromRequest, daffCollectionBuildRequestFromMetadata, daffCollectionErrorMap, daffComputeAppliedFilters, daffDictAssignMerger, daffDivide, daffFilterArrayToDict, daffFilterComputeRangePairLabel, daffFilterEqualOptionArrayToDict, daffFilterFindAppliedOptions, daffFilterRangePairArrayToDict, daffFilterToRequest, daffFilterValidateRequestNameMatch, daffFilterValidateRequestTypeMatch, daffFiltersToRequests, daffIdentifiableArrayToDict, daffIsError, daffIsFilterApplied, daffIsToggleRequestAppliedToFilter, daffMerge, daffMultiply, daffPrecision, daffRemoveFilter, daffRemoveRequestFromFilters, daffRemoveRequestsFromFilters, daffSubtract, daffToggleFilter, daffToggleRequestOnFilters, debounce, identity, observe, provideVercelImageLoader, randomSlice, randomSubset, range, sample, shallowCompare, shuffle, unique, validateFieldPresence };
1322
- export type { Constructable, DaffBase64Service, DaffCanonicallyLocatable, DaffCollection, DaffCollectionMetadata, DaffCollectionRequest, DaffConfigInjectionToken, DaffCountable, DaffError, DaffErrorCodeMap, DaffFilter, DaffFilterBase, DaffFilterEqual, DaffFilterEqualOption, DaffFilterEqualRequest, DaffFilterEqualToggleRequest, DaffFilterOption, DaffFilterOptionBase, DaffFilterRangeBase, DaffFilterRangeNumeric, DaffFilterRangeNumericRequest, DaffFilterRangeNumericToggleRequest, DaffFilterRangeOption, DaffFilterRangePair, DaffFilterRangeRequestBase, DaffFilterRangeRequestOption, DaffFilterRequest, DaffFilterToggleRequest, DaffFilterable, DaffFilters, DaffIdentifiable, DaffKindable, DaffLocatable, DaffMergeStrategy, DaffMerger, DaffMultiInjectionToken, DaffNumericallyPaginable, DaffOrderable, DaffPersistenceService, DaffServicesInjectionToken, DaffSingleInjectionToken, DaffSingletonInjectionToken, DaffSortOption, DaffSortOptions, DaffSortable, HTML, ID, MaybeAsync };
1344
+ export { DAFF_COLLECTION_PAGE_OUT_OF_BOUNDS_ERROR_CODE, DAFF_SERVER_STORAGE_SERVICE_ERROR_CODE, DAFF_STORAGE_SERVICE_ERROR_CODE, DaffBase64ServiceToken, DaffBrowserBase64Service, DaffCollectionPageOutOfBoundsError, DaffErrorStorageService, DaffFilterFromToFilterSeparator, DaffFilterNotFound, DaffFilterRequestNameMismatch, DaffFilterRequestTypeMismatch, DaffFilterType, DaffFilterUnknownType, DaffInheritableError, DaffLocalStorageService, DaffMemoryStorageService, DaffNoopStorageService, DaffPersistenceServiceToken, DaffServerBase64Service, DaffServerErrorStorageService, DaffServerSafePersistenceServiceToken, DaffServerSideStorageError, DaffSortDirectionEnum, DaffStorageServiceError, allOf, anyOf, backoff, catchAndArrayifyErrors, collect, createConfigInjectionToken, createMultiInjectionToken, createServicesInjectionToken, createSingleInjectionToken, createSingletonInjectionToken, daffAdd, daffApplyFilter, daffApplyRequestToFilters, daffApplyRequestsToFilters, daffArrayConcatMerger, daffArrayToDict, daffClearFilter, daffClearFilters, daffCollectionBuildMetadataFromRequest, daffCollectionBuildRequestFromMetadata, daffCollectionErrorMap, daffComputeAppliedFilters, daffCreateableMostRecent, daffDictAssignMerger, daffDivide, daffFilterArrayToDict, daffFilterComputeRangePairLabel, daffFilterEqualOptionArrayToDict, daffFilterFindAppliedOptions, daffFilterRangePairArrayToDict, daffFilterToRequest, daffFilterValidateRequestNameMatch, daffFilterValidateRequestTypeMatch, daffFiltersToRequests, daffIdentifiableArrayToDict, daffIsError, daffIsFilterApplied, daffIsToggleRequestAppliedToFilter, daffMerge, daffMultiply, daffPrecision, daffRemoveFilter, daffRemoveRequestFromFilters, daffRemoveRequestsFromFilters, daffSubtract, daffToggleFilter, daffToggleRequestOnFilters, debounce, identity, observe, provideVercelImageLoader, randomSlice, randomSubset, range, sample, shallowCompare, shuffle, unique, validateFieldPresence };
1345
+ export type { Constructable, DaffBase64Service, DaffCanonicallyLocatable, DaffCollection, DaffCollectionMetadata, DaffCollectionRequest, DaffConfigInjectionToken, DaffCountable, DaffCreateable, DaffError, DaffErrorCodeMap, DaffFilter, DaffFilterBase, DaffFilterEqual, DaffFilterEqualOption, DaffFilterEqualRequest, DaffFilterEqualToggleRequest, DaffFilterOption, DaffFilterOptionBase, DaffFilterRangeBase, DaffFilterRangeNumeric, DaffFilterRangeNumericRequest, DaffFilterRangeNumericToggleRequest, DaffFilterRangeOption, DaffFilterRangePair, DaffFilterRangeRequestBase, DaffFilterRangeRequestOption, DaffFilterRequest, DaffFilterToggleRequest, DaffFilterable, DaffFilters, DaffIdentifiable, DaffKindable, DaffLocatable, DaffMergeStrategy, DaffMerger, DaffMultiInjectionToken, DaffNumericallyPaginable, DaffOrderable, DaffPersistenceService, DaffServicesInjectionToken, DaffSingleInjectionToken, DaffSingletonInjectionToken, DaffSortOption, DaffSortOptions, DaffSortable, HTML, ID, MaybeAsync };
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@daffodil/core","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/core"]}}},"version":"0.90.0","description":"Interfaces built for daffodil/state","repository":{"type":"git","url":"https://github.com/graycoreio/daffodil"},"author":"Graycore LLC","license":"MIT","bugs":{"url":"https://github.com/graycoreio/daffodil/issues"},"homepage":"https://github.com/graycoreio/daffodil","peerDependencies":{"@angular/core":"^20.0.0","@angular/common":"^20.0.0","rxjs":"^7.0.0"},"optionalDependencies":{"graphql":"^16.10.0","@angular/router":"^20.0.0","@apollo/client":"^3.12.6","@ngrx/store":"^20.0.0","angular-in-memory-web-api":"^0.20.0","apollo-angular":"^11.0.0","@faker-js/faker":"^9.8.0","enforce-unique":"^1.3.0"},"module":"fesm2022/daffodil-core.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","default":"./fesm2022/daffodil-core.mjs"},"./external-script":{"types":"./external-script/index.d.ts","default":"./fesm2022/daffodil-core-external-script.mjs"},"./graphql":{"types":"./graphql/index.d.ts","default":"./fesm2022/daffodil-core-graphql.mjs"},"./routing":{"types":"./routing/index.d.ts","default":"./fesm2022/daffodil-core-routing.mjs"},"./state":{"types":"./state/index.d.ts","default":"./fesm2022/daffodil-core-state.mjs"},"./testing":{"types":"./testing/index.d.ts","default":"./fesm2022/daffodil-core-testing.mjs"},"./external-script/testing":{"types":"./external-script/testing/index.d.ts","default":"./fesm2022/daffodil-core-external-script-testing.mjs"},"./state/testing":{"types":"./state/testing/index.d.ts","default":"./fesm2022/daffodil-core-state-testing.mjs"}},"sideEffects":false,"dependencies":{"tslib":"^2.6.2"}}
1
+ {"name":"@daffodil/core","nx":{"targets":{"build":{"outputs":["{workspaceRoot}/dist/core"]}}},"version":"0.92.3-rc.0","description":"Foundational interfaces, utilities, and helpers shared across all Daffodil packages. Part of the Daffodil ecommerce framework.","repository":{"type":"git","url":"https://github.com/graycoreio/daffodil"},"author":"Graycore LLC","license":"MIT","bugs":{"url":"https://github.com/graycoreio/daffodil/issues"},"homepage":"https://github.com/graycoreio/daffodil","peerDependencies":{"@angular/core":"^20.0.0","@angular/common":"^20.0.0","rxjs":"^7.0.0"},"optionalDependencies":{"graphql":"^16.10.0","@angular/router":"^20.0.0","@apollo/client":"^3.12.6","@ngrx/store":"^20.0.0","angular-in-memory-web-api":"^0.20.0","apollo-angular":"^11.0.0","@faker-js/faker":"^10.3.0","enforce-unique":"^1.3.0"},"module":"fesm2022/daffodil-core.mjs","typings":"index.d.ts","exports":{"./package.json":{"default":"./package.json"},".":{"types":"./index.d.ts","default":"./fesm2022/daffodil-core.mjs"},"./graphql":{"types":"./graphql/index.d.ts","default":"./fesm2022/daffodil-core-graphql.mjs"},"./external-script":{"types":"./external-script/index.d.ts","default":"./fesm2022/daffodil-core-external-script.mjs"},"./routing":{"types":"./routing/index.d.ts","default":"./fesm2022/daffodil-core-routing.mjs"},"./state":{"types":"./state/index.d.ts","default":"./fesm2022/daffodil-core-state.mjs"},"./testing":{"types":"./testing/index.d.ts","default":"./fesm2022/daffodil-core-testing.mjs"},"./external-script/testing":{"types":"./external-script/testing/index.d.ts","default":"./fesm2022/daffodil-core-external-script-testing.mjs"},"./state/testing":{"types":"./state/testing/index.d.ts","default":"./fesm2022/daffodil-core-state-testing.mjs"}},"sideEffects":false,"dependencies":{"tslib":"^2.6.2"}}
@@ -30,7 +30,7 @@ declare const enforceUnique: <T extends Func>(func: T, options?: EnforceOptions)
30
30
  interface IDaffModelFactory<T> {
31
31
  create<R extends T = T>(partial: Partial<T> & T extends R ? Partial<T> : R): T & R;
32
32
  create(partial?: Partial<T>): T;
33
- createMany(qty: number, partial: Partial<T>): T[];
33
+ createMany(qty: number, partial?: Partial<T>): T[];
34
34
  }
35
35
 
36
36
  /**