@daffodil/core 0.87.2 → 0.89.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.
Files changed (295) hide show
  1. package/external-script/index.d.ts +95 -1
  2. package/external-script/testing/index.d.ts +44 -1
  3. package/fesm2022/daffodil-core-external-script-testing.mjs +3 -3
  4. package/fesm2022/daffodil-core-external-script-testing.mjs.map +1 -1
  5. package/fesm2022/daffodil-core-external-script.mjs +4 -5
  6. package/fesm2022/daffodil-core-external-script.mjs.map +1 -1
  7. package/fesm2022/daffodil-core-graphql.mjs +3 -3
  8. package/fesm2022/daffodil-core-graphql.mjs.map +1 -1
  9. package/fesm2022/daffodil-core-routing.mjs +4 -38
  10. package/fesm2022/daffodil-core-routing.mjs.map +1 -1
  11. package/fesm2022/daffodil-core-state-testing.mjs +6 -6
  12. package/fesm2022/daffodil-core-state-testing.mjs.map +1 -1
  13. package/fesm2022/daffodil-core-state.mjs +2 -0
  14. package/fesm2022/daffodil-core-state.mjs.map +1 -1
  15. package/fesm2022/daffodil-core-testing.mjs +67 -67
  16. package/fesm2022/daffodil-core-testing.mjs.map +1 -1
  17. package/fesm2022/daffodil-core.mjs +125 -33
  18. package/fesm2022/daffodil-core.mjs.map +1 -1
  19. package/graphql/index.d.ts +64 -1
  20. package/index.d.ts +1305 -1
  21. package/package.json +1 -1
  22. package/routing/index.d.ts +86 -1
  23. package/state/index.d.ts +649 -1
  24. package/state/testing/index.d.ts +46 -1
  25. package/testing/index.d.ts +363 -1
  26. package/async/maybe.type.d.ts +0 -2
  27. package/base64/base64.interface.d.ts +0 -14
  28. package/base64/browser/browser.service.d.ts +0 -12
  29. package/base64/public_api.d.ts +0 -3
  30. package/base64/server/public_api.d.ts +0 -1
  31. package/base64/server/server.service.d.ts +0 -14
  32. package/canonically-locateable/canonically-locateable.interface.d.ts +0 -9
  33. package/collection/build-metadata.d.ts +0 -6
  34. package/collection/build-request.d.ts +0 -6
  35. package/collection/collection.interface.d.ts +0 -16
  36. package/collection/countable.interface.d.ts +0 -9
  37. package/collection/error-map.d.ts +0 -4
  38. package/collection/metadata.interface.d.ts +0 -12
  39. package/collection/page-out-of-bounds.error.d.ts +0 -9
  40. package/collection/paginable.d.ts +0 -10
  41. package/collection/public_api.d.ts +0 -10
  42. package/collection/request.interface.d.ts +0 -27
  43. package/collection/sortable.d.ts +0 -41
  44. package/constructable/constructable.d.ts +0 -24
  45. package/errors/error-map.d.ts +0 -8
  46. package/errors/error.interface.d.ts +0 -17
  47. package/errors/inheritable-error.d.ts +0 -22
  48. package/errors/is-error.d.ts +0 -4
  49. package/errors/public_api.d.ts +0 -4
  50. package/external-script/external-script.service.d.ts +0 -50
  51. package/external-script/interface.d.ts +0 -11
  52. package/external-script/public_api.d.ts +0 -3
  53. package/external-script/script.d.ts +0 -32
  54. package/external-script/testing/constants.d.ts +0 -4
  55. package/external-script/testing/external-script.service.d.ts +0 -37
  56. package/external-script/testing/public_api.d.ts +0 -2
  57. package/filterable/filter-base.d.ts +0 -24
  58. package/filterable/filter-option-base.d.ts +0 -9
  59. package/filterable/filter-option.d.ts +0 -6
  60. package/filterable/filter-request.d.ts +0 -7
  61. package/filterable/filter-toggle-request.d.ts +0 -6
  62. package/filterable/filter.d.ts +0 -9
  63. package/filterable/filterable.d.ts +0 -10
  64. package/filterable/filters.type.d.ts +0 -5
  65. package/filterable/public_api.d.ts +0 -12
  66. package/filterable/type/equal/filter.d.ts +0 -24
  67. package/filterable/type/equal/option.d.ts +0 -19
  68. package/filterable/type/equal/public_api.d.ts +0 -4
  69. package/filterable/type/equal/request.d.ts +0 -18
  70. package/filterable/type/equal/toggle-request.d.ts +0 -18
  71. package/filterable/type/filter-type.d.ts +0 -7
  72. package/filterable/type/range/filter-base.d.ts +0 -23
  73. package/filterable/type/range/option.d.ts +0 -14
  74. package/filterable/type/range/pair.d.ts +0 -20
  75. package/filterable/type/range/public_api.d.ts +0 -6
  76. package/filterable/type/range/request-base.d.ts +0 -20
  77. package/filterable/type/range/request-option.d.ts +0 -14
  78. package/filterable/type/range/separator.d.ts +0 -5
  79. package/filterable/type/range-numeric/filter.d.ts +0 -11
  80. package/filterable/type/range-numeric/public_api.d.ts +0 -3
  81. package/filterable/type/range-numeric/request.d.ts +0 -11
  82. package/filterable/type/range-numeric/toggle-request.d.ts +0 -12
  83. package/filters/array-to-dict/array-to-dict.d.ts +0 -5
  84. package/filters/behaviors/apply/apply-filter.d.ts +0 -8
  85. package/filters/behaviors/apply/apply-request-to-filters.d.ts +0 -8
  86. package/filters/behaviors/apply/apply-requests-to-filters.d.ts +0 -8
  87. package/filters/behaviors/apply/public_api.d.ts +0 -3
  88. package/filters/behaviors/clear/clear-filter.d.ts +0 -8
  89. package/filters/behaviors/clear/clear-filters.d.ts +0 -8
  90. package/filters/behaviors/clear/public_api.d.ts +0 -2
  91. package/filters/behaviors/remove/public_api.d.ts +0 -3
  92. package/filters/behaviors/remove/remove-filter.d.ts +0 -9
  93. package/filters/behaviors/remove/remove-request-from-filters.d.ts +0 -8
  94. package/filters/behaviors/remove/remove-requests-from-filters.d.ts +0 -9
  95. package/filters/behaviors/toggle/public_api.d.ts +0 -2
  96. package/filters/behaviors/toggle/toggle-request-on-filters.d.ts +0 -6
  97. package/filters/behaviors/toggle/toggle.d.ts +0 -6
  98. package/filters/compute-applied-filters/compute-applied-filters.d.ts +0 -6
  99. package/filters/errors/codes.enum.d.ts +0 -9
  100. package/filters/errors/filter-not-found.error.d.ts +0 -8
  101. package/filters/errors/public_api.d.ts +0 -4
  102. package/filters/errors/request-name-mismatch.error.d.ts +0 -9
  103. package/filters/errors/request-type-mismatch.error.d.ts +0 -9
  104. package/filters/errors/unknown-filter-type.error.d.ts +0 -9
  105. package/filters/find-applied/find-applied-options.d.ts +0 -5
  106. package/filters/find-applied/public_api.d.ts +0 -1
  107. package/filters/is-applied/is-filter-applied.d.ts +0 -5
  108. package/filters/is-applied/is-toggle-request-applied-to-filter.d.ts +0 -5
  109. package/filters/is-applied/public_api.d.ts +0 -2
  110. package/filters/public_api.d.ts +0 -13
  111. package/filters/to-request/filter-to-request.d.ts +0 -6
  112. package/filters/to-request/filters-to-requests.d.ts +0 -6
  113. package/filters/to-request/public_api.d.ts +0 -2
  114. package/filters/type/equal/array-to-dict/option.d.ts +0 -5
  115. package/filters/type/equal/behaviors/apply/apply.d.ts +0 -8
  116. package/filters/type/equal/behaviors/clear/clear.d.ts +0 -8
  117. package/filters/type/equal/behaviors/remove/remove.d.ts +0 -11
  118. package/filters/type/equal/behaviors/toggle/toggle.d.ts +0 -11
  119. package/filters/type/equal/is-applied/is-applied.d.ts +0 -5
  120. package/filters/type/equal/is-applied/is-toggle-request-applied-to-filter.d.ts +0 -5
  121. package/filters/type/equal/public_api.d.ts +0 -1
  122. package/filters/type/equal/to-request/filter-to-request.d.ts +0 -5
  123. package/filters/type/range/array-to-dict/pair.d.ts +0 -5
  124. package/filters/type/range/behaviors/apply/apply.d.ts +0 -8
  125. package/filters/type/range/behaviors/clear/clear.d.ts +0 -8
  126. package/filters/type/range/behaviors/remove/remove.d.ts +0 -11
  127. package/filters/type/range/behaviors/toggle/toggle.d.ts +0 -10
  128. package/filters/type/range/compute-pair-label.d.ts +0 -1
  129. package/filters/type/range/is-applied/is-applied.d.ts +0 -5
  130. package/filters/type/range/is-applied/is-toggle-request-applied-to-filter.d.ts +0 -5
  131. package/filters/type/range/public_api.d.ts +0 -2
  132. package/filters/type/range/to-request/filter-to-request.d.ts +0 -5
  133. package/filters/type/range-numeric/to-request/filter-to-request.d.ts +0 -5
  134. package/filters/validators/public_api.d.ts +0 -2
  135. package/filters/validators/request-name-match.d.ts +0 -7
  136. package/filters/validators/request-type-match.d.ts +0 -7
  137. package/graphql/apollo/cacheable-operations/cacheable-operations-link.interface.d.ts +0 -4
  138. package/graphql/apollo/public_api.d.ts +0 -3
  139. package/graphql/apollo/queued-apollo/queued-apollo.service.d.ts +0 -29
  140. package/graphql/apollo/validator/type.d.ts +0 -8
  141. package/graphql/fragments/build-fragment-definition.d.ts +0 -8
  142. package/graphql/fragments/build-fragment-name-spread.d.ts +0 -11
  143. package/graphql/fragments/public_api.d.ts +0 -2
  144. package/graphql/public_api.d.ts +0 -2
  145. package/identifiable/array-to-dict.d.ts +0 -5
  146. package/identifiable/identifiable.interface.d.ts +0 -10
  147. package/identifiable/public_api.d.ts +0 -2
  148. package/injection-tokens/config.factory.d.ts +0 -9
  149. package/injection-tokens/config.type.d.ts +0 -18
  150. package/injection-tokens/multi.factory.d.ts +0 -8
  151. package/injection-tokens/multi.type.d.ts +0 -15
  152. package/injection-tokens/public_api.d.ts +0 -10
  153. package/injection-tokens/services.factory.d.ts +0 -8
  154. package/injection-tokens/services.type.d.ts +0 -15
  155. package/injection-tokens/single.factory.d.ts +0 -8
  156. package/injection-tokens/single.type.d.ts +0 -14
  157. package/injection-tokens/singleton.factory.d.ts +0 -8
  158. package/injection-tokens/singleton.type.d.ts +0 -15
  159. package/injection-tokens/token-constuctor-params.type.d.ts +0 -3
  160. package/kindable/kindable.interface.d.ts +0 -9
  161. package/kindable/public_api.d.ts +0 -1
  162. package/locateable/locateable.interface.d.ts +0 -10
  163. package/merge/merge.d.ts +0 -64
  164. package/merge/mergers/array-concat.d.ts +0 -1
  165. package/merge/mergers/dict-assign.d.ts +0 -1
  166. package/merge/mergers/public_api.d.ts +0 -3
  167. package/merge/mergers/type.d.ts +0 -4
  168. package/merge/public_api.d.ts +0 -3
  169. package/merge/strategy.type.d.ts +0 -8
  170. package/operators/all-of.pipe.d.ts +0 -6
  171. package/operators/any-of.pipe.d.ts +0 -6
  172. package/operators/backoff.pipe.d.ts +0 -7
  173. package/operators/catch-and-arrayify-errors.pipe.d.ts +0 -6
  174. package/operators/public_api.d.ts +0 -4
  175. package/orderable/orderable.d.ts +0 -9
  176. package/public_api.d.ts +0 -19
  177. package/routing/public_api.d.ts +0 -3
  178. package/routing/query-param-filter/public_api.d.ts +0 -2
  179. package/routing/query-param-filter/request-builder/equal.d.ts +0 -6
  180. package/routing/query-param-filter/request-builder/public_api.d.ts +0 -2
  181. package/routing/query-param-filter/request-builder/type.d.ts +0 -6
  182. package/routing/query-param-filter/type.d.ts +0 -16
  183. package/routing/reducers/clear-errors/navigated-entity-reducer-factory.d.ts +0 -7
  184. package/routing/reducers/clear-errors/navigated.reducer.d.ts +0 -6
  185. package/routing/reducers/clear-errors/public_api.d.ts +0 -2
  186. package/routing/reducers/public_api.d.ts +0 -1
  187. package/routing/uri/normalizer.service.d.ts +0 -22
  188. package/routing/uri/public_api.d.ts +0 -2
  189. package/routing/uri/truncation/file-extension.d.ts +0 -9
  190. package/routing/uri/truncation/leading-path-segments.d.ts +0 -5
  191. package/routing/uri/truncation/leading-slash.d.ts +0 -11
  192. package/routing/uri/truncation/public_api.d.ts +0 -4
  193. package/routing/uri/truncation/query-fragment.d.ts +0 -5
  194. package/state/actions/failure.type.d.ts +0 -13
  195. package/state/actions/public_api.d.ts +0 -1
  196. package/state/collection/actions.d.ts +0 -73
  197. package/state/collection/adapter.class.d.ts +0 -35
  198. package/state/collection/facade.d.ts +0 -34
  199. package/state/collection/facade.interface.d.ts +0 -54
  200. package/state/collection/initial-state.d.ts +0 -2
  201. package/state/collection/public_api.d.ts +0 -6
  202. package/state/collection/selector-factory.d.ts +0 -62
  203. package/state/errors/errorable.type.d.ts +0 -7
  204. package/state/errors/public_api.d.ts +0 -3
  205. package/state/errors/state-error.interface.d.ts +0 -18
  206. package/state/errors/transform-error-to-state-error.d.ts +0 -7
  207. package/state/operation/adapter.d.ts +0 -24
  208. package/state/operation/entity/adapter.d.ts +0 -84
  209. package/state/operation/entity/helpers/create-fake-id.d.ts +0 -7
  210. package/state/operation/entity/public_api.d.ts +0 -5
  211. package/state/operation/entity/selectors.d.ts +0 -24
  212. package/state/operation/entity/state.type.d.ts +0 -8
  213. package/state/operation/entity/type.d.ts +0 -15
  214. package/state/operation/facade.type.d.ts +0 -34
  215. package/state/operation/public_api.d.ts +0 -5
  216. package/state/operation/selectors.d.ts +0 -38
  217. package/state/operation/state.d.ts +0 -9
  218. package/state/operators/public_api.d.ts +0 -1
  219. package/state/operators/substream.pipe.d.ts +0 -26
  220. package/state/public_api.d.ts +0 -8
  221. package/state/reducers/create-meta.d.ts +0 -5
  222. package/state/reducers/identity.d.ts +0 -6
  223. package/state/reducers/public_api.d.ts +0 -2
  224. package/state/states/helpers.d.ts +0 -9
  225. package/state/states/loading.d.ts +0 -5
  226. package/state/states/mutable-loading.d.ts +0 -6
  227. package/state/states/public_api.d.ts +0 -5
  228. package/state/states/state.enum.d.ts +0 -48
  229. package/state/states/stateable.interface.d.ts +0 -8
  230. package/state/store/facade.d.ts +0 -3
  231. package/state/testing/mock-collection-facade.d.ts +0 -26
  232. package/state/testing/mock-operation-facade.d.ts +0 -20
  233. package/state/testing/public_api.d.ts +0 -2
  234. package/storage/error/error.d.ts +0 -7
  235. package/storage/error/error.service.d.ts +0 -15
  236. package/storage/error/public_api.d.ts +0 -2
  237. package/storage/localstorage/localstorage.service.d.ts +0 -23
  238. package/storage/noopstorage/noopstorage.service.d.ts +0 -13
  239. package/storage/persistence-server-safe.token.d.ts +0 -2
  240. package/storage/persistence.interface.d.ts +0 -7
  241. package/storage/public_api.d.ts +0 -6
  242. package/storage/server-error/public_api.d.ts +0 -2
  243. package/storage/server-error/server-error.d.ts +0 -11
  244. package/storage/server-error/server-error.service.d.ts +0 -18
  245. package/testing/angular/mocks/pipes/currency.d.ts +0 -13
  246. package/testing/factories/collection/metadata.factory.d.ts +0 -29
  247. package/testing/factories/collection/mock-collection.class.d.ts +0 -18
  248. package/testing/factories/collection/numerically-paginable.factory.d.ts +0 -8
  249. package/testing/factories/collection/public_api.d.ts +0 -7
  250. package/testing/factories/collection/request.factory.d.ts +0 -25
  251. package/testing/factories/collection/sort-option.factory.d.ts +0 -8
  252. package/testing/factories/collection/sort-options.factory.d.ts +0 -9
  253. package/testing/factories/collection/sortable.factory.d.ts +0 -9
  254. package/testing/factories/factory.d.ts +0 -42
  255. package/testing/factories/factory.interface.d.ts +0 -4
  256. package/testing/factories/filters/filter.factory.d.ts +0 -18
  257. package/testing/factories/filters/public_api.d.ts +0 -4
  258. package/testing/factories/filters/request.factory.d.ts +0 -13
  259. package/testing/factories/filters/toggle-request.d.ts +0 -18
  260. package/testing/factories/filters/type/equal/option.d.ts +0 -17
  261. package/testing/factories/filters/type/equal/public_api.d.ts +0 -3
  262. package/testing/factories/filters/type/equal/request.d.ts +0 -16
  263. package/testing/factories/filters/type/equal/toggle-request.d.ts +0 -16
  264. package/testing/factories/filters/type/equal.d.ts +0 -17
  265. package/testing/factories/filters/type/public_api.d.ts +0 -4
  266. package/testing/factories/filters/type/range-numeric/option.d.ts +0 -15
  267. package/testing/factories/filters/type/range-numeric/pair.d.ts +0 -23
  268. package/testing/factories/filters/type/range-numeric/public_api.d.ts +0 -5
  269. package/testing/factories/filters/type/range-numeric/request-option.d.ts +0 -15
  270. package/testing/factories/filters/type/range-numeric/request.d.ts +0 -23
  271. package/testing/factories/filters/type/range-numeric/toggle-request.d.ts +0 -20
  272. package/testing/factories/filters/type/range-numeric.d.ts +0 -19
  273. package/testing/factories/identifiable.factory.d.ts +0 -11
  274. package/testing/factories/public_api.d.ts +0 -5
  275. package/testing/public_api.d.ts +0 -4
  276. package/testing/testing.module.d.ts +0 -7
  277. package/testing/unique/enforce.d.ts +0 -7
  278. package/types/html.type.d.ts +0 -5
  279. package/types/id.type.d.ts +0 -1
  280. package/types/public_api.d.ts +0 -2
  281. package/utils/array-to-dict.d.ts +0 -7
  282. package/utils/collect.d.ts +0 -6
  283. package/utils/identity.d.ts +0 -5
  284. package/utils/long-arithmetic.d.ts +0 -43
  285. package/utils/observe.d.ts +0 -9
  286. package/utils/public_api.d.ts +0 -16
  287. package/utils/random-slice.d.ts +0 -7
  288. package/utils/random-subset.d.ts +0 -7
  289. package/utils/range.d.ts +0 -12
  290. package/utils/sample.d.ts +0 -4
  291. package/utils/shallow-compare.d.ts +0 -6
  292. package/utils/shuffle.d.ts +0 -5
  293. package/utils/unique.d.ts +0 -8
  294. package/validator/field-presence.d.ts +0 -6
  295. package/validator/public_api.d.ts +0 -1
@@ -1,7 +0,0 @@
1
- import { DaffStateError } from './state-error.interface';
2
- export interface DaffErrorable {
3
- /**
4
- * A list of errors applicable only to this entity.
5
- */
6
- daffErrors: DaffStateError[];
7
- }
@@ -1,3 +0,0 @@
1
- export { DaffStateError } from './state-error.interface';
2
- export { DaffErrorable } from './errorable.type';
3
- export { daffTransformErrorToStateError, ErrorTransformer, } from './transform-error-to-state-error';
@@ -1,18 +0,0 @@
1
- /**
2
- * An error object that can be serialized in state.
3
- */
4
- export interface DaffStateError {
5
- /**
6
- * The error code that uniquely identifies the type of error.
7
- */
8
- code: string;
9
- /**
10
- * A message that describes the error.
11
- */
12
- message: string;
13
- /**
14
- * Whether the error is non-critical and recoverable or catastrophic and unrecoverable.
15
- * This field is optional. If omitted, the error is assumed to be unrecoverable.
16
- */
17
- recoverable?: boolean;
18
- }
@@ -1,7 +0,0 @@
1
- import { DaffError } from '@daffodil/core';
2
- import { DaffStateError } from './state-error.interface';
3
- export type ErrorTransformer = (DaffError: any) => DaffStateError;
4
- /**
5
- * Transforms an error instance to a state error object.
6
- */
7
- export declare function daffTransformErrorToStateError({ code, message, recoverable }: DaffError): DaffStateError;
@@ -1,24 +0,0 @@
1
- import { DaffOperationState } from './state';
2
- /**
3
- * Puts the state in a "resolving" state that correspondes to loading platform data in a GET fashion.
4
- * Sets loading to `DaffState.Resolving`
5
- */
6
- export declare function daffStartResolution<T extends DaffOperationState = DaffOperationState>(state: T): T;
7
- /**
8
- * Puts the state in a "mutating" state that correspondes to loading platform data in a POST or PUT fashion.
9
- */
10
- export declare function daffStartMutation<T extends DaffOperationState = DaffOperationState>(state: T): T;
11
- /**
12
- * Indicates a successfully completed operation.
13
- * Sets loading to stable and resets errors.
14
- */
15
- export declare function daffCompleteOperation<T extends DaffOperationState = DaffOperationState>(state: T): T;
16
- /**
17
- * Indicates a failed operation.
18
- * Sets loading to stable and stores errors.
19
- */
20
- export declare function daffOperationFailed<T extends DaffOperationState = DaffOperationState>(errors: T['daffErrors'], state: T): T;
21
- /**
22
- * Resets errors.
23
- */
24
- export declare function daffClearErrors<T extends DaffOperationState = DaffOperationState>(state: T): T;
@@ -1,84 +0,0 @@
1
- import { EntityAdapter } from '@ngrx/entity';
2
- import { DaffIdentifiable } from '@daffodil/core';
3
- import { DaffOperationEntityStateSelectors } from './selectors';
4
- import { DaffOperationEntityState } from './state.type';
5
- import { DaffOperationEntity } from './type';
6
- import { DaffStateError } from '../../errors/public_api';
7
- /**
8
- * An entity state adapter that takes care of managing contextual operation and error state for entities.
9
- */
10
- export interface DaffOperationEntityStateAdapterInterface<T extends DaffIdentifiable = DaffIdentifiable> {
11
- /**
12
- * Stores a list of entities in state and resets them all to stable.
13
- */
14
- list<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entities: T[], state: S): S;
15
- /**
16
- * Optimistically adds a placeholder entity into state if necessary and sets the entity to resolving.
17
- */
18
- preload<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(id: string, state: S): S;
19
- /**
20
- * Upserts the entity into state and resets operation state and errors.
21
- */
22
- load<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S): S;
23
- /**
24
- * Adds a placeholder entity into state if `placeholderId` is specified and sets state to adding.
25
- */
26
- preadd<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S, placeholderId?: string): S;
27
- /**
28
- * Adds the entity into state, sets operation state to added, and resets errors.
29
- */
30
- add<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S, placeholderId?: string): S;
31
- /**
32
- * Sets the entity's operation state to mutating.
33
- */
34
- preupdate<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: Partial<T> & DaffIdentifiable, state: S): S;
35
- /**
36
- * Upserts the entity into state, sets operation state to mutated, and resets errors.
37
- */
38
- update<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: Partial<T> & DaffIdentifiable, state: S): S;
39
- /**
40
- * Sets the entity's operation state to deleting.
41
- */
42
- preremove<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;
43
- /**
44
- * Removes the entity from state.
45
- */
46
- remove<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;
47
- /**
48
- * Resets the entity's operation state and stores errors on the entity.
49
- */
50
- operationFailed<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, errors: DaffStateError[], state: S): S;
51
- /**
52
- * Resets the entity's operation state to stable.
53
- */
54
- resetState<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;
55
- /**
56
- * Gets an empty entity state.
57
- */
58
- getInitialState<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(state?: S): S;
59
- /**
60
- * Gets entity selectors.
61
- */
62
- getSelectors<TRootState>(selectState: (state: TRootState) => DaffOperationEntityState<T>): DaffOperationEntityStateSelectors<TRootState, T>;
63
- }
64
- /**
65
- * @inheritdoc
66
- */
67
- export declare class DaffOperationEntityStateAdapter<T extends DaffIdentifiable = DaffIdentifiable> implements DaffOperationEntityStateAdapterInterface<T> {
68
- protected adapter: EntityAdapter<DaffOperationEntity<T>>;
69
- constructor(adapter?: EntityAdapter<DaffOperationEntity<T>>);
70
- list<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entities: T[], state: S): S;
71
- preload<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(id: string, state: S): S;
72
- load<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S): S;
73
- preadd<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S, placeholderId?: string): S;
74
- add<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: T, state: S, placeholderId?: string): S;
75
- preupdate<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: Partial<T> & DaffIdentifiable, state: S): S;
76
- update<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(entity: Partial<T> & DaffIdentifiable, state: S): S;
77
- preremove<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;
78
- remove<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;
79
- operationFailed<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, errors: DaffStateError[], state: S): S;
80
- resetState<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(key: string, state: S): S;
81
- getInitialState<S extends DaffOperationEntityState<T> = DaffOperationEntityState<T>>(state?: S): S;
82
- getSelectors<TRootState>(selectState: (state: TRootState) => DaffOperationEntityState<T>): DaffOperationEntityStateSelectors<TRootState, T>;
83
- }
84
- export declare function daffCreateOperationEntityStateAdapter<T extends DaffIdentifiable = DaffIdentifiable>(adapter?: EntityAdapter<DaffOperationEntity<T>>): DaffOperationEntityStateAdapter<T>;
@@ -1,7 +0,0 @@
1
- /**
2
- * Generate a fake ID for use with placeholder entities.
3
- *
4
- * @param key An optional key that can augment the randomly generated ID.
5
- * @returns A string cont
6
- */
7
- export declare function daffOperationEntityCreateFakeId(key?: string): string;
@@ -1,5 +0,0 @@
1
- export * from './adapter';
2
- export * from './selectors';
3
- export * from './helpers/create-fake-id';
4
- export { DaffOperationEntity } from './type';
5
- export { DaffOperationEntityState } from './state.type';
@@ -1,24 +0,0 @@
1
- import type { EntitySelectors } from '@ngrx/entity/src/models';
2
- import { MemoizedSelector } from '@ngrx/store';
3
- import { DaffIdentifiable } from '@daffodil/core';
4
- import { DaffOperationEntity } from './type';
5
- /**
6
- * Selectors for an operation state.
7
- */
8
- export interface DaffOperationEntityStateSelectors<TRootState, T extends DaffIdentifiable = DaffIdentifiable> extends EntitySelectors<DaffOperationEntity<T>, TRootState> {
9
- /**
10
- * Selects an entity by ID.
11
- */
12
- selectEntity: (id: T['id']) => MemoizedSelector<TRootState, DaffOperationEntity<T>>;
13
- /**
14
- * Optimistically selects the list of entities.
15
- * This excludes temporary entities with errors.
16
- */
17
- selectOptimisticList: MemoizedSelector<TRootState, DaffOperationEntity<T>[]>;
18
- }
19
- /**
20
- * Creates a set of selectors for an entity operation state.
21
- *
22
- * @param selectState The feature selector for the entity operation state.
23
- */
24
- export declare function daffOperationEntityStateSelectorFactory<TRootState, T extends DaffIdentifiable = DaffIdentifiable>(entitySelectors: EntitySelectors<DaffOperationEntity<T>, TRootState>): DaffOperationEntityStateSelectors<TRootState, T>;
@@ -1,8 +0,0 @@
1
- import { EntityState } from '@ngrx/entity';
2
- import { DaffIdentifiable } from '@daffodil/core';
3
- import { DaffOperationEntity } from './type';
4
- /**
5
- * An operation entity state.
6
- * Stores the current state of an operation and any associated errors directly on the entity for context.
7
- */
8
- export type DaffOperationEntityState<T extends DaffIdentifiable = DaffIdentifiable> = EntityState<DaffOperationEntity<T>>;
@@ -1,15 +0,0 @@
1
- import { DaffIdentifiable } from '@daffodil/core';
2
- import { DaffErrorable } from '../../errors/public_api';
3
- import { DaffStateable } from '../../states/public_api';
4
- /**
5
- * An entity that is responsible for storing its own errors and loading state.
6
- * Its possible to be an "optimistic" entity, i.e. only temporary while the real entity is in some loading state.
7
- */
8
- export type DaffOperationEntity<T extends DaffIdentifiable = DaffIdentifiable> = DaffStateable & DaffErrorable & T & {
9
- /**
10
- * Whether this entity is temporary.
11
- * A temporary entity is a placeholder for the optimistic success of an entity operation
12
- * and will appear in entity state during `get` and `add` operations, if necessary.
13
- */
14
- daffTemp: boolean;
15
- };
@@ -1,34 +0,0 @@
1
- import { Action } from '@ngrx/store';
2
- import { Observable } from 'rxjs';
3
- import { DaffOperationState } from './state';
4
- import { DaffStoreFacade } from '../store/facade';
5
- /**
6
- * A facade for an operation state.
7
- */
8
- export interface DaffOperationStateFacadeInterface<TState extends DaffOperationState = DaffOperationState> extends DaffStoreFacade<Action> {
9
- /**
10
- * The loading state enum.
11
- */
12
- loadingState$: Observable<TState['daffState']>;
13
- /**
14
- * Whether the operation state is in any of the loading states.
15
- */
16
- loading$: Observable<boolean>;
17
- /**
18
- * Whether the operation state is resolving.
19
- */
20
- resolving$: Observable<boolean>;
21
- /**
22
- * Whether the operation state is mutating.
23
- */
24
- mutating$: Observable<boolean>;
25
- /**
26
- * The errors in the operation state.
27
- */
28
- errors$: Observable<TState['daffErrors']>;
29
- /**
30
- * Whether the operation state has any errors.
31
- * If so, it should be considered to be in an "error" state.
32
- */
33
- hasErrors$: Observable<boolean>;
34
- }
@@ -1,5 +0,0 @@
1
- export * from './adapter';
2
- export { DaffOperationState, daffOperationInitialState, } from './state';
3
- export { daffOperationStateSelectorFactory, DaffOperationStateSelectors, } from './selectors';
4
- export { DaffOperationStateFacadeInterface } from './facade.type';
5
- export * from './entity/public_api';
@@ -1,38 +0,0 @@
1
- import { MemoizedSelector, Selector } from '@ngrx/store';
2
- import { DaffOperationState } from './state';
3
- /**
4
- * Selectors for an operation state.
5
- */
6
- export interface DaffOperationStateSelectors<TRootState, TState extends DaffOperationState = DaffOperationState> {
7
- /**
8
- * Selects the loading state enum.
9
- */
10
- selectLoadingState: MemoizedSelector<TRootState, TState['daffState']>;
11
- /**
12
- * Selects whether the operation state is in any of the loading states.
13
- */
14
- selectLoading: MemoizedSelector<TRootState, boolean>;
15
- /**
16
- * Selects whether the operation state is resolving.
17
- */
18
- selectResolving: MemoizedSelector<TRootState, boolean>;
19
- /**
20
- * Selects whether the operation state is mutating.
21
- */
22
- selectMutating: MemoizedSelector<TRootState, boolean>;
23
- /**
24
- * Selects the errors in the operation state.
25
- */
26
- selectErrors: MemoizedSelector<TRootState, TState['daffErrors']>;
27
- /**
28
- * Selects whether the operation state has any errors.
29
- * If so, it should be considered to be in an "error" state.
30
- */
31
- selectHasErrors: MemoizedSelector<TRootState, boolean>;
32
- }
33
- /**
34
- * Creates a set of selectors for an operation state.
35
- *
36
- * @param selectState The feature selector for the operation state.
37
- */
38
- export declare function daffOperationStateSelectorFactory<TRootState, TState extends DaffOperationState = DaffOperationState>(selectState: Selector<TRootState, TState>): DaffOperationStateSelectors<TRootState, TState>;
@@ -1,9 +0,0 @@
1
- import { DaffErrorable } from '../errors/public_api';
2
- import { DaffStateable } from '../states/public_api';
3
- /**
4
- * A basic operation state.
5
- * Represents the current state of an operation and any associated errors.
6
- */
7
- export interface DaffOperationState extends DaffErrorable, DaffStateable {
8
- }
9
- export declare const daffOperationInitialState: DaffOperationState;
@@ -1 +0,0 @@
1
- export * from './substream.pipe';
@@ -1,26 +0,0 @@
1
- import { Action } from '@ngrx/store';
2
- export type ActionType = Action['type'];
3
- export type ActionSequenceStep = ActionType | ActionType[];
4
- export type ActionSequence = ActionSequenceStep[];
5
- /**
6
- * Watches for a particular stream of actions in the specified order and
7
- * emits a list of those actions once all sequence steps have been matched.
8
- *
9
- * This will find the first occurence of the substream and not necessarily the most concise or recent substream.
10
- * For example, substream([A, B]) encountering an action stream of [A1, A2, B1, B2] will emit [A1, B1].
11
- * When a substream is found and emitted, the list is reset and it will continue to listen to the action stream.
12
- *
13
- * You can indicate that a particular step in the sequence can be matched by mutiple actions by passing an array for that step.
14
- * For example, if the first step of the sequence could be action A or action B: substream([[A, B], C]).
15
- * An action stream of [A1, C1] would cause substream to emit [A1, C1].
16
- * An action stream of [B1, C1] would cause substream to emit [B1, C1].
17
- * An action stream of [A1, B1, C1] would cause substream to emit [A1, C1].
18
- *
19
- * You can optionally pass a list of terminators.
20
- * If a terminator is encountered in the action stream, any partially matched substream is reset.
21
- * For example, substream([A, B], C) would not emit anything for an action stream of [A1, C1, B1].
22
- *
23
- * @param sequence The sequence of action types that define the substream to listen for.
24
- * @param terminators A list of terminators, any of which interrupt and reset a partially matched substream.
25
- */
26
- export declare const substream: (sequence: ActionSequence, ...terminators: ActionType[]) => import("rxjs").UnaryFunction<import("rxjs").Observable<Action<string>>, import("rxjs").Observable<any>>;
@@ -1,8 +0,0 @@
1
- export * from './actions/public_api';
2
- export * from './collection/public_api';
3
- export * from './errors/public_api';
4
- export * from './operation/public_api';
5
- export * from './operators/public_api';
6
- export * from './reducers/public_api';
7
- export * from './states/public_api';
8
- export { DaffStoreFacade } from './store/facade';
@@ -1,5 +0,0 @@
1
- import { Action, ActionReducer } from '@ngrx/store';
2
- /**
3
- * Creates and returns a composite reducer that invokes each of the passed reducers in turn.
4
- */
5
- export declare function daffComposeReducers<T, V extends Action = Action>(reducers: ActionReducer<T, V>[]): ActionReducer<T, V>;
@@ -1,6 +0,0 @@
1
- import { Action } from '@ngrx/store';
2
- /**
3
- * A simple reducer that simply returns the passed state.
4
- * This is useful for stubbing out parts of state that are not covered in an injected extra reducer map.
5
- */
6
- export declare const daffIdentityReducer: <T = unknown>(state: T, action: Action) => T;
@@ -1,2 +0,0 @@
1
- export { daffComposeReducers } from './create-meta';
2
- export { daffIdentityReducer } from './identity';
@@ -1,9 +0,0 @@
1
- import { DaffState } from './state.enum';
2
- /**
3
- * Returns whether the state is one that represents an operation in progress.
4
- */
5
- export declare function daffStateIsLoading(daffState: DaffState): boolean;
6
- /**
7
- * Returns whether the state is one that represents a mutable operation in progress.
8
- */
9
- export declare function daffStateIsMutating(daffState: DaffState): boolean;
@@ -1,5 +0,0 @@
1
- import { DaffState } from './state.enum';
2
- /**
3
- * A state description for an object that is read-only.
4
- */
5
- export type DaffLoadingState = DaffState.Resolving | DaffState.Stable;
@@ -1,6 +0,0 @@
1
- import { DaffLoadingState } from './loading';
2
- import { DaffState } from './state.enum';
3
- /**
4
- * A description for an object that is both readable and writable.
5
- */
6
- export type DaffMutableLoadingState = DaffLoadingState | DaffState.Updating;
@@ -1,5 +0,0 @@
1
- export { DaffState } from './state.enum';
2
- export { DaffMutableLoadingState } from './mutable-loading';
3
- export { DaffLoadingState } from './loading';
4
- export { DaffStateable } from './stateable.interface';
5
- export * from './helpers';
@@ -1,48 +0,0 @@
1
- /**
2
- * The DaffState enumerates the vast majority of state modifications that can exist
3
- * in UI applications.
4
- */
5
- export declare const enum DaffState {
6
- /**
7
- * The 'Stable' state represents when no action is being taken upon an object.
8
- */
9
- Stable = "Stable",
10
- /**
11
- * The 'Resolving' state represents when there's uncertainty in the current status
12
- * of a state, e.g. when we're loading something that hasn't been loaded into
13
- * state before.
14
- */
15
- Resolving = "Resolving",
16
- /**
17
- * The 'Adding' state represents a temporary period while an item is being
18
- * added to state.
19
- */
20
- Adding = "Adding",
21
- /**
22
- * The 'Added' state represents when an object was recently added to state.
23
- * This typically is associated with a subsequent decay to a 'Stable' state.
24
- */
25
- Added = "Added",
26
- /**
27
- * The 'Updating' state describes when an object that currently exists in state
28
- * is being changed in some way.
29
- *
30
- * Disambiguation: This has nothing to do with immutability.
31
- */
32
- Updating = "Updating",
33
- /**
34
- * The 'Mutated' state describes when an object has recently been modified in
35
- * state. This state is typically associated with a subsequent decay into a
36
- * 'Stable' state.
37
- */
38
- Updated = "Updated",
39
- /**
40
- * The "Deleting" state occurs when an object is in the process of being
41
- * removed from state.
42
- */
43
- Deleting = "Deleting",
44
- /**
45
- * Indicates that the most recent operation specififc to this entity has failed.
46
- */
47
- Error = "Error"
48
- }
@@ -1,8 +0,0 @@
1
- import { DaffState } from './state.enum';
2
- /**
3
- * The interface an object must implement to consistently describe its current
4
- * state.
5
- */
6
- export interface DaffStateable<T extends DaffState = DaffState> {
7
- daffState: T;
8
- }
@@ -1,3 +0,0 @@
1
- export interface DaffStoreFacade<T> {
2
- dispatch(action: T): any;
3
- }
@@ -1,26 +0,0 @@
1
- import { Action } from '@ngrx/store';
2
- import { BehaviorSubject } from 'rxjs';
3
- import { DaffCollectionMetadata, DaffCollectionRequest, DaffFilters, DaffSortDirectionEnum, DaffSortOption } from '@daffodil/core';
4
- import { DaffCollectionFacadeInterface } from '@daffodil/core/state';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * Can be used to mock out the {@link DaffCollectionFacade} in testing environments.
8
- *
9
- * @inheritdoc
10
- */
11
- export declare class MockDaffCollectionFacade implements DaffCollectionFacadeInterface {
12
- metadata$: BehaviorSubject<DaffCollectionMetadata>;
13
- request$: BehaviorSubject<DaffCollectionRequest>;
14
- count$: BehaviorSubject<number>;
15
- currentPage$: BehaviorSubject<number>;
16
- totalPages$: BehaviorSubject<number>;
17
- pageSize$: BehaviorSubject<number>;
18
- sortOptions$: BehaviorSubject<DaffSortOption[]>;
19
- appliedSortOption$: BehaviorSubject<string>;
20
- appliedSortDirection$: BehaviorSubject<DaffSortDirectionEnum>;
21
- filters$: BehaviorSubject<DaffFilters>;
22
- appliedFilters$: BehaviorSubject<DaffFilters>;
23
- dispatch(action: Action): void;
24
- static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffCollectionFacade, never>;
25
- static ɵprov: i0.ɵɵInjectableDeclaration<MockDaffCollectionFacade>;
26
- }
@@ -1,20 +0,0 @@
1
- import { Action } from '@ngrx/store';
2
- import { BehaviorSubject } from 'rxjs';
3
- import { DaffOperationStateFacadeInterface, DaffState, DaffStateError } from '@daffodil/core/state';
4
- import * as i0 from "@angular/core";
5
- /**
6
- * Can be used to mock out the {@link DaffOperationStateFacade} in testing environments.
7
- *
8
- * @inheritdoc
9
- */
10
- export declare class MockDaffOperationStateFacade implements DaffOperationStateFacadeInterface {
11
- loadingState$: BehaviorSubject<DaffState>;
12
- loading$: BehaviorSubject<boolean>;
13
- resolving$: BehaviorSubject<boolean>;
14
- mutating$: BehaviorSubject<boolean>;
15
- errors$: BehaviorSubject<DaffStateError[]>;
16
- hasErrors$: BehaviorSubject<boolean>;
17
- dispatch(action: Action): void;
18
- static ɵfac: i0.ɵɵFactoryDeclaration<MockDaffOperationStateFacade, never>;
19
- static ɵprov: i0.ɵɵInjectableDeclaration<MockDaffOperationStateFacade>;
20
- }
@@ -1,2 +0,0 @@
1
- export { MockDaffCollectionFacade } from './mock-collection-facade';
2
- export { MockDaffOperationStateFacade } from './mock-operation-facade';
@@ -1,7 +0,0 @@
1
- import { DaffError, DaffInheritableError } from '../../errors/public_api';
2
- export declare const DAFF_STORAGE_SERVICE_ERROR_CODE = "DAFF_STORAGE_FAILURE";
3
- export declare class DaffStorageServiceError extends DaffInheritableError implements DaffError {
4
- message: string;
5
- readonly code: string;
6
- constructor(message: string);
7
- }
@@ -1,15 +0,0 @@
1
- import { DaffPersistenceService } from '../persistence.interface';
2
- import * as i0 from "@angular/core";
3
- /**
4
- * @inheritdoc
5
- */
6
- export declare class DaffErrorStorageService implements DaffPersistenceService {
7
- static readonly ERROR_MESSAGE = "The DaffErrorStorageService always throws an error.";
8
- setItem(key: string, value: any): void;
9
- getItem(key: string): any;
10
- removeItem(key: string): any;
11
- clear(): void;
12
- private throwError;
13
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffErrorStorageService, never>;
14
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffErrorStorageService>;
15
- }
@@ -1,2 +0,0 @@
1
- export { DaffStorageServiceError, DAFF_STORAGE_SERVICE_ERROR_CODE, } from './error';
2
- export { DaffErrorStorageService } from './error.service';
@@ -1,23 +0,0 @@
1
- import { DaffPersistenceService } from '../persistence.interface';
2
- import * as i0 from "@angular/core";
3
- /**
4
- * @inheritdoc
5
- */
6
- export declare class DaffLocalStorageService implements DaffPersistenceService {
7
- constructor(platformId: string);
8
- /**
9
- * Persist the given item into local storage.
10
- */
11
- setItem(key: string, value: any): void;
12
- /**
13
- * Retrieve the given item from localstorage.
14
- */
15
- getItem(key: string): any;
16
- /**
17
- * Remove a given item from localstorage
18
- */
19
- removeItem(key: string): any;
20
- clear(): void;
21
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffLocalStorageService, never>;
22
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffLocalStorageService>;
23
- }
@@ -1,13 +0,0 @@
1
- import { DaffPersistenceService } from '../persistence.interface';
2
- import * as i0 from "@angular/core";
3
- /**
4
- * @inheritdoc
5
- */
6
- export declare class DaffNoopStorageService implements DaffPersistenceService {
7
- setItem(key: string, value: any): void;
8
- getItem(key: string): any;
9
- clear(): void;
10
- removeItem(key: string): void;
11
- static ɵfac: i0.ɵɵFactoryDeclaration<DaffNoopStorageService, never>;
12
- static ɵprov: i0.ɵɵInjectableDeclaration<DaffNoopStorageService>;
13
- }
@@ -1,2 +0,0 @@
1
- import { DaffPersistenceService } from './persistence.interface';
2
- export declare const DaffServerSafePersistenceServiceToken: import("@angular/core").InjectionToken<DaffPersistenceService>, provideDaffServerSafePersistenceServiceToken: <R extends DaffPersistenceService = DaffPersistenceService>(value: R) => import("@angular/core").ValueProvider;
@@ -1,7 +0,0 @@
1
- export interface DaffPersistenceService {
2
- setItem(key: string, value: any): void;
3
- getItem(key: string): any;
4
- clear(): void;
5
- removeItem(key: string): void;
6
- }
7
- export declare const DaffPersistenceServiceToken: import("@angular/core").InjectionToken<DaffPersistenceService>, provideDaffPersistenceService: <R extends DaffPersistenceService = DaffPersistenceService>(value: R) => import("@angular/core").ValueProvider;
@@ -1,6 +0,0 @@
1
- export * from './error/public_api';
2
- export * from './server-error/public_api';
3
- export { DaffLocalStorageService } from './localstorage/localstorage.service';
4
- export { DaffNoopStorageService } from './noopstorage/noopstorage.service';
5
- export { DaffPersistenceService, DaffPersistenceServiceToken, } from './persistence.interface';
6
- export { DaffServerSafePersistenceServiceToken } from './persistence-server-safe.token';
@@ -1,2 +0,0 @@
1
- export { DaffServerSideStorageError, DAFF_SERVER_STORAGE_SERVICE_ERROR_CODE, } from './server-error';
2
- export { DaffServerErrorStorageService } from './server-error.service';
@@ -1,11 +0,0 @@
1
- import { DaffError } from '../../errors/public_api';
2
- import { DaffStorageServiceError } from '../error/error';
3
- export declare const DAFF_SERVER_STORAGE_SERVICE_ERROR_CODE = "DAFF_SERVER_STORAGE_FAILURE";
4
- /**
5
- * An error thrown when there is an attempt to access storage on the server and none is available.
6
- */
7
- export declare class DaffServerSideStorageError extends DaffStorageServiceError implements DaffError {
8
- message: string;
9
- readonly code: string;
10
- constructor(message: string);
11
- }