@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 +1,95 @@
1
- export * from './public_api';
1
+ import { Observable } from 'rxjs';
2
+ import * as i0 from '@angular/core';
3
+
4
+ /**
5
+ * Represents the structure of an external script that can be loaded into a document.
6
+ *
7
+ * @example Using DaffExternalScript interface to define an external script object
8
+ * ```ts
9
+ * const externalScript: DaffExternalScript = {
10
+ * src: 'https://example.com/script.js',
11
+ * async: true,
12
+ * defer: false,
13
+ * 'data-custom-attribute': 'value',
14
+ * };
15
+ * ```
16
+ */
17
+ interface DaffExternalScript {
18
+ /** The source URL of the script. */
19
+ src: string;
20
+ /**
21
+ * Optional. Indicates whether the script should be loaded asynchronously.
22
+ * @default false
23
+ */
24
+ async?: boolean;
25
+ /**
26
+ * Optional. Indicates whether the script should be deferred in loading.
27
+ * @default false
28
+ */
29
+ defer?: boolean;
30
+ /**
31
+ * Optional. Custom attributes for the script.
32
+ * The keys must start with 'data-' followed by any string.
33
+ */
34
+ [key: `data-${string}`]: string;
35
+ }
36
+
37
+ interface DaffExternalScriptServiceInterface {
38
+ /**
39
+ * Load a script into the document.
40
+ * @param name The name of the script.
41
+ * @param script The script object containing details like src, async, defer, and custom attributes.
42
+ * @returns An Observable that emits true when the script is loaded successfully, or emits an error if loading fails.
43
+ */
44
+ load(name: string, script: DaffExternalScript): Observable<boolean>;
45
+ }
46
+
47
+ interface LoadedExternalScript extends DaffExternalScript {
48
+ ready: boolean | undefined;
49
+ subject: Observable<boolean>;
50
+ el: HTMLElement | undefined;
51
+ }
52
+ /**
53
+ * A service for loading external scripts into the document.
54
+ *
55
+ * ### Usage example
56
+ *
57
+ * @example Loading an external script into the document
58
+ *
59
+ * ```ts
60
+ * import { DOCUMENT } from '@angular/common';
61
+ * import { inject } from '@angular/core';
62
+ *
63
+ * import { DaffExternalScriptService } from '@daffodil/core/external-script';
64
+ *
65
+ * const externalScriptService = new DaffExternalScriptService(inject(DOCUMENT));
66
+ *
67
+ * externalScriptService.load('exampleScript', {
68
+ * src: 'https://example.com/script.js',
69
+ * async: true,
70
+ * defer: false,
71
+ * 'data-custom-attribute': 'value',
72
+ * }).subscribe({
73
+ * next: (result) => {
74
+ * console.log('Script loaded successfully:', result);
75
+ * },
76
+ * error: (error) => {
77
+ * console.error('Error loading script:', error);
78
+ * },
79
+ * });
80
+ * ```
81
+ */
82
+ declare class DaffExternalScriptService implements DaffExternalScriptServiceInterface {
83
+ readonly scriptMap: Map<string, LoadedExternalScript>;
84
+ private doc;
85
+ constructor(doc: any);
86
+ /**
87
+ * @inheritdoc
88
+ */
89
+ load(name: string, script: DaffExternalScript): Observable<boolean>;
90
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalScriptService, never>;
91
+ static ɵprov: i0.ɵɵInjectableDeclaration<DaffExternalScriptService>;
92
+ }
93
+
94
+ export { DaffExternalScriptService };
95
+ export type { DaffExternalScript, DaffExternalScriptServiceInterface };
@@ -1 +1,44 @@
1
- export * from './public_api';
1
+ import { Observable } from 'rxjs';
2
+ import { DaffExternalScriptServiceInterface, DaffExternalScript } from '@daffodil/core/external-script';
3
+ import * as i0 from '@angular/core';
4
+
5
+ /**
6
+ * A service for loading external scripts into the document.
7
+ *
8
+ * @example Loading an external script into the document
9
+ *
10
+ * ```ts
11
+ * import { DaffExternalScriptTestingService } from '@daffodil/core/external-script/testing';
12
+ *
13
+ * const externalScriptService = new DaffExternalScriptTestingService();
14
+ *
15
+ * externalScriptService.load(TestScripts.SUCCESS, {
16
+ * src: 'https://example.com/script.js',
17
+ * async: true,
18
+ * defer: false,
19
+ * 'data-custom-attribute': 'value',
20
+ * }).subscribe({
21
+ * next: (result) => {
22
+ * console.log('Script loaded successfully:', result);
23
+ * },
24
+ * error: (error) => {
25
+ * console.error('Error loading script:', error);
26
+ * },
27
+ * });
28
+ * ```
29
+ */
30
+ declare class DaffExternalScriptTestingService implements DaffExternalScriptServiceInterface {
31
+ /**
32
+ * @inheritdoc
33
+ */
34
+ load(name: string, script: DaffExternalScript): Observable<boolean>;
35
+ static ɵfac: i0.ɵɵFactoryDeclaration<DaffExternalScriptTestingService, never>;
36
+ static ɵprov: i0.ɵɵInjectableDeclaration<DaffExternalScriptTestingService>;
37
+ }
38
+
39
+ declare const enum TestScripts {
40
+ SUCCESS = "0",
41
+ FAILURE = "1"
42
+ }
43
+
44
+ export { DaffExternalScriptTestingService, TestScripts };
@@ -39,10 +39,10 @@ class DaffExternalScriptTestingService {
39
39
  return throwError(() => new Error(`Failed to load ${script.src}`));
40
40
  }
41
41
  }
42
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffExternalScriptTestingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
43
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffExternalScriptTestingService, providedIn: 'root' }); }
42
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffExternalScriptTestingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
43
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffExternalScriptTestingService, providedIn: 'root' }); }
44
44
  }
45
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffExternalScriptTestingService, decorators: [{
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffExternalScriptTestingService, decorators: [{
46
46
  type: Injectable,
47
47
  args: [{
48
48
  providedIn: 'root',
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-core-external-script-testing.mjs","sources":["../../../libs/core/external-script/testing/src/external-script.service.ts","../../../libs/core/external-script/testing/src/daffodil-core-external-script-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n throwError,\n} from 'rxjs';\n\nimport { DaffExternalScriptServiceInterface } from '@daffodil/core/external-script';\nimport { DaffExternalScript } from '@daffodil/core/external-script';\n\nimport { TestScripts } from './constants';\n\n/**\n * A service for loading external scripts into the document.\n *\n * @example Loading an external script into the document\n *\n * ```ts\n * import { DaffExternalScriptTestingService } from '@daffodil/core/external-script/testing';\n *\n * const externalScriptService = new DaffExternalScriptTestingService();\n *\n * externalScriptService.load(TestScripts.SUCCESS, {\n * src: 'https://example.com/script.js',\n * async: true,\n * defer: false,\n * 'data-custom-attribute': 'value',\n * }).subscribe({\n * next: (result) => {\n * console.log('Script loaded successfully:', result);\n * },\n * error: (error) => {\n * console.error('Error loading script:', error);\n * },\n * });\n * ```\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffExternalScriptTestingService implements DaffExternalScriptServiceInterface {\n\n /**\n * @inheritdoc\n */\n load(name: string, script: DaffExternalScript): Observable<boolean> {\n switch(name) {\n case TestScripts.SUCCESS:\n return of(true);\n default:\n return throwError(() => new Error(`Failed to load ${ script.src }`));\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAYA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;MAIU,gCAAgC,CAAA;AAE3C;;AAEG;IACH,IAAI,CAAC,IAAY,EAAE,MAA0B,EAAA;QAC3C,QAAO,IAAI;AACT,YAAA,KAAA,GAAA;AACE,gBAAA,OAAO,EAAE,CAAC,IAAI,CAAC;AACjB,YAAA;AACE,gBAAA,OAAO,UAAU,CAAC,MAAM,IAAI,KAAK,CAAC,CAAA,eAAA,EAAmB,MAAM,CAAC,GAAI,CAAE,CAAA,CAAC,CAAC;;;kIAV/D,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAhC,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,cAF/B,MAAM,EAAA,CAAA,CAAA;;4FAEP,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAH5C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACvCD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-core-external-script-testing.mjs","sources":["../../../libs/core/external-script/testing/src/external-script.service.ts","../../../libs/core/external-script/testing/src/daffodil-core-external-script-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n Observable,\n of,\n throwError,\n} from 'rxjs';\n\nimport {\n DaffExternalScriptServiceInterface ,\n DaffExternalScript,\n} from '@daffodil/core/external-script';\n\nimport { TestScripts } from './constants';\n\n/**\n * A service for loading external scripts into the document.\n *\n * @example Loading an external script into the document\n *\n * ```ts\n * import { DaffExternalScriptTestingService } from '@daffodil/core/external-script/testing';\n *\n * const externalScriptService = new DaffExternalScriptTestingService();\n *\n * externalScriptService.load(TestScripts.SUCCESS, {\n * src: 'https://example.com/script.js',\n * async: true,\n * defer: false,\n * 'data-custom-attribute': 'value',\n * }).subscribe({\n * next: (result) => {\n * console.log('Script loaded successfully:', result);\n * },\n * error: (error) => {\n * console.error('Error loading script:', error);\n * },\n * });\n * ```\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffExternalScriptTestingService implements DaffExternalScriptServiceInterface {\n\n /**\n * @inheritdoc\n */\n load(name: string, script: DaffExternalScript): Observable<boolean> {\n switch(name) {\n case TestScripts.SUCCESS:\n return of(true);\n default:\n return throwError(() => new Error(`Failed to load ${ script.src }`));\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAcA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;MAIU,gCAAgC,CAAA;AAE3C;;AAEG;IACH,IAAI,CAAC,IAAY,EAAE,MAA0B,EAAA;QAC3C,QAAO,IAAI;AACT,YAAA,KAAA,GAAA;AACE,gBAAA,OAAO,EAAE,CAAC,IAAI,CAAC;AACjB,YAAA;AACE,gBAAA,OAAO,UAAU,CAAC,MAAM,IAAI,KAAK,CAAC,CAAA,eAAA,EAAmB,MAAM,CAAC,GAAI,CAAA,CAAE,CAAC,CAAC;;IAE1E;iIAZW,gCAAgC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAhC,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gCAAgC,cAF/B,MAAM,EAAA,CAAA,CAAA;;2FAEP,gCAAgC,EAAA,UAAA,EAAA,CAAA;kBAH5C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACzCD;;AAEG;;;;"}
@@ -1,6 +1,5 @@
1
- import { DOCUMENT } from '@angular/common';
2
1
  import * as i0 from '@angular/core';
3
- import { Inject, Injectable } from '@angular/core';
2
+ import { DOCUMENT, Inject, Injectable } from '@angular/core';
4
3
  import { BehaviorSubject } from 'rxjs';
5
4
  import { filter } from 'rxjs/operators';
6
5
 
@@ -76,10 +75,10 @@ class DaffExternalScriptService {
76
75
  this.scriptMap.set(name, { ...script, ready: undefined, subject: readySubject, el: scriptEl });
77
76
  return readySubject.pipe(filter((s) => s !== undefined));
78
77
  }
79
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffExternalScriptService, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
80
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffExternalScriptService, providedIn: 'root' }); }
78
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffExternalScriptService, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
79
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffExternalScriptService, providedIn: 'root' }); }
81
80
  }
82
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffExternalScriptService, decorators: [{
81
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffExternalScriptService, decorators: [{
83
82
  type: Injectable,
84
83
  args: [{
85
84
  providedIn: 'root',
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-core-external-script.mjs","sources":["../../../libs/core/external-script/src/external-script.service.ts","../../../libs/core/external-script/src/daffodil-core-external-script.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport {\n Inject,\n Injectable,\n} from '@angular/core';\nimport {\n BehaviorSubject,\n Observable,\n} from 'rxjs';\nimport { filter } from 'rxjs/operators';\n\nimport { DaffExternalScriptServiceInterface } from './interface';\nimport { DaffExternalScript } from './script';\n\nexport interface LoadedExternalScript extends DaffExternalScript {\n ready: boolean | undefined;\n subject: Observable<boolean>;\n el: HTMLElement | undefined;\n}\n\n/**\n * A service for loading external scripts into the document.\n *\n * ### Usage example\n *\n * @example Loading an external script into the document\n *\n * ```ts\n * import { DOCUMENT } from '@angular/common';\n * import { inject } from '@angular/core';\n *\n * import { DaffExternalScriptService } from '@daffodil/core/external-script';\n *\n * const externalScriptService = new DaffExternalScriptService(inject(DOCUMENT));\n *\n * externalScriptService.load('exampleScript', {\n * src: 'https://example.com/script.js',\n * async: true,\n * defer: false,\n * 'data-custom-attribute': 'value',\n * }).subscribe({\n * next: (result) => {\n * console.log('Script loaded successfully:', result);\n * },\n * error: (error) => {\n * console.error('Error loading script:', error);\n * },\n * });\n * ```\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffExternalScriptService implements DaffExternalScriptServiceInterface {\n readonly scriptMap: Map<string, LoadedExternalScript> = new Map();\n private doc: Document;\n\n constructor(\n @Inject(DOCUMENT) doc,\n ) {\n this.doc = doc;\n }\n\n /**\n * @inheritdoc\n */\n load(name: string, script: DaffExternalScript): Observable<boolean> {\n // Don't load the same script twice.\n if(this.scriptMap.has(name)){\n return this.scriptMap.get(name).subject;\n }\n\n const scriptEl = this.doc.createElement('script');\n\n scriptEl.setAttribute('type', 'text/javascript');\n\n scriptEl.setAttribute('src', script.src);\n\n scriptEl.setAttribute('charset', 'utf-8');\n\n // Set custom attributes prefixed with 'data-'.\n Object.keys(script).filter(key => key.startsWith('data-')).map((key) => {\n // setAttribute would lowercase the value of \"key\", which isn't always correct.\n // setAttributeNS maintains key casing.\n scriptEl.setAttributeNS(null, key,script[key]);\n });\n\n if(script.async) {\n scriptEl.async = true;\n }\n\n if(script.defer) {\n scriptEl.defer = true;\n }\n\n const readySubject = new BehaviorSubject<boolean | undefined>(undefined);\n\n scriptEl.onload = () => {\n this.scriptMap.get(name).ready = true;\n readySubject.next(true);\n };\n\n scriptEl.onerror = () => {\n this.scriptMap.get(name).ready = false;\n readySubject.error(new Error(`Failed to load ${ script.src }`));\n };\n\n this.doc.body.appendChild(scriptEl);\n this.scriptMap.set(name, { ...script, ready: undefined, subject: readySubject, el: scriptEl });\n\n return readySubject.pipe(\n filter((s) => s !== undefined),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAoBA;;;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A,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;0BAMI,MAAM;2BAAC,QAAQ;;;AC1DpB;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-core-external-script.mjs","sources":["../../../libs/core/external-script/src/external-script.service.ts","../../../libs/core/external-script/src/daffodil-core-external-script.ts"],"sourcesContent":["\nimport {\n Inject,\n Injectable,\n DOCUMENT,\n} from '@angular/core';\nimport {\n BehaviorSubject,\n Observable,\n} from 'rxjs';\nimport { filter } from 'rxjs/operators';\n\nimport { DaffExternalScriptServiceInterface } from './interface';\nimport { DaffExternalScript } from './script';\n\nexport interface LoadedExternalScript extends DaffExternalScript {\n ready: boolean | undefined;\n subject: Observable<boolean>;\n el: HTMLElement | undefined;\n}\n\n/**\n * A service for loading external scripts into the document.\n *\n * ### Usage example\n *\n * @example Loading an external script into the document\n *\n * ```ts\n * import { DOCUMENT } from '@angular/common';\n * import { inject } from '@angular/core';\n *\n * import { DaffExternalScriptService } from '@daffodil/core/external-script';\n *\n * const externalScriptService = new DaffExternalScriptService(inject(DOCUMENT));\n *\n * externalScriptService.load('exampleScript', {\n * src: 'https://example.com/script.js',\n * async: true,\n * defer: false,\n * 'data-custom-attribute': 'value',\n * }).subscribe({\n * next: (result) => {\n * console.log('Script loaded successfully:', result);\n * },\n * error: (error) => {\n * console.error('Error loading script:', error);\n * },\n * });\n * ```\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffExternalScriptService implements DaffExternalScriptServiceInterface {\n readonly scriptMap: Map<string, LoadedExternalScript> = new Map();\n private doc: Document;\n\n constructor(\n @Inject(DOCUMENT) doc,\n ) {\n this.doc = doc;\n }\n\n /**\n * @inheritdoc\n */\n load(name: string, script: DaffExternalScript): Observable<boolean> {\n // Don't load the same script twice.\n if(this.scriptMap.has(name)){\n return this.scriptMap.get(name).subject;\n }\n\n const scriptEl = this.doc.createElement('script');\n\n scriptEl.setAttribute('type', 'text/javascript');\n\n scriptEl.setAttribute('src', script.src);\n\n scriptEl.setAttribute('charset', 'utf-8');\n\n // Set custom attributes prefixed with 'data-'.\n Object.keys(script).filter(key => key.startsWith('data-')).map((key) => {\n // setAttribute would lowercase the value of \"key\", which isn't always correct.\n // setAttributeNS maintains key casing.\n scriptEl.setAttributeNS(null, key,script[key]);\n });\n\n if(script.async) {\n scriptEl.async = true;\n }\n\n if(script.defer) {\n scriptEl.defer = true;\n }\n\n const readySubject = new BehaviorSubject<boolean | undefined>(undefined);\n\n scriptEl.onload = () => {\n this.scriptMap.get(name).ready = true;\n readySubject.next(true);\n };\n\n scriptEl.onerror = () => {\n this.scriptMap.get(name).ready = false;\n readySubject.error(new Error(`Failed to load ${ script.src }`));\n };\n\n this.doc.body.appendChild(scriptEl);\n this.scriptMap.set(name, { ...script, ready: undefined, subject: readySubject, el: scriptEl });\n\n return readySubject.pipe(\n filter((s) => s !== undefined),\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAqBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BG;MAIU,yBAAyB,CAAA;AAIpC,IAAA,WAAA,CACoB,GAAG,EAAA;AAJd,QAAA,IAAA,CAAA,SAAS,GAAsC,IAAI,GAAG,EAAE;AAM/D,QAAA,IAAI,CAAC,GAAG,GAAG,GAAG;IAChB;AAEA;;AAEG;IACH,IAAI,CAAC,IAAY,EAAE,MAA0B,EAAA;;QAE3C,IAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAC;YAC1B,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO;QACzC;QAEA,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,QAAQ,CAAC;AAEjD,QAAA,QAAQ,CAAC,YAAY,CAAC,MAAM,EAAE,iBAAiB,CAAC;QAEhD,QAAQ,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,GA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AAQ,EAAE,CAAC;AAE9F,QAAA,OAAO,YAAY,CAAC,IAAI,CACtB,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,CAC/B;IACH;AA5DW,uBAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,kBAK1B,QAAQ,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AALP,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,cAFxB,MAAM,EAAA,CAAA,CAAA;;2FAEP,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAHrC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;0BAMI,MAAM;2BAAC,QAAQ;;;AC3DpB;;AAEG;;;;"}
@@ -89,10 +89,10 @@ class DaffQueuedApollo {
89
89
  this.queue.shift();
90
90
  this.queue[0]?.();
91
91
  }
92
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffQueuedApollo, deps: [{ token: i1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable }); }
93
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffQueuedApollo, providedIn: 'root' }); }
92
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffQueuedApollo, deps: [{ token: i1.Apollo }], target: i0.ɵɵFactoryTarget.Injectable }); }
93
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffQueuedApollo, providedIn: 'root' }); }
94
94
  }
95
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffQueuedApollo, decorators: [{
95
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffQueuedApollo, decorators: [{
96
96
  type: Injectable,
97
97
  args: [{
98
98
  providedIn: 'root',
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-core-graphql.mjs","sources":["../../../libs/core/graphql/src/fragments/build-fragment-name-spread.ts","../../../libs/core/graphql/src/fragments/build-fragment-definition.ts","../../../libs/core/graphql/src/apollo/queued-apollo/queued-apollo.service.ts","../../../libs/core/graphql/src/daffodil-core-graphql.ts"],"sourcesContent":["import {\n DocumentNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nimport { unique } from '@daffodil/core';\n\nexport const getFragmentNames = (fragment: DocumentNode) =>\n fragment.definitions.filter(def =>\n def.kind === 'FragmentDefinition',\n ).map(def =>\n (<FragmentDefinitionNode>def).name.value,\n );\n\n/**\n * Builds a list of the first fragment name present inside the specified GraphQL document nodes.\n * Returns an empty array if no fragments have been defined or if null is passed.\n *\n * @param fragments The created fragments.\n */\nconst daffGetFragmentNames = (...fragments: DocumentNode[]): string[] =>\n fragments.reduce((acc, fragment) => {\n const names = getFragmentNames(fragment);\n if (names[0]) {\n acc.push(names[0]);\n }\n return acc;\n }, []);\n\n/**\n * Builds a string of fragment names that can be interpolated into a GraphQL query.\n * Each name is separated by a newline character: '\\n'.\n * If an empty array is passed, an empty string is returned.\n * Only the first fragment name from each passed fragment is returned.\n *\n * @param fragments A list of GraphQL documents that contain fragments.\n */\nexport const daffBuildFragmentNameSpread = (...fragments: DocumentNode[]): string =>\n unique(daffGetFragmentNames(...fragments)).reduce((acc, name) => acc.concat(`...${name}\\n`), '');\n","import { DocumentNode } from 'graphql';\n\n/**\n * Builds a string of fragment definitions that can be interpolated into a GraphQL query.\n * Each definition is separated by a newline character: '\\n'.\n *\n * @param documents A list of GraphQL documents that should only contain fragments.\n */\nexport const daffBuildFragmentDefinition = (...documents: DocumentNode[]): string =>\n documents.reduce((acc, fragment) => acc.concat(`${fragment.loc.source.body}\\n`), '');\n","import { Injectable } from '@angular/core';\nimport {\n MutationOptions,\n FetchResult,\n} from '@apollo/client/core';\nimport { Apollo } from 'apollo-angular';\nimport {\n Observable,\n Subscriber,\n Subscription,\n} from 'rxjs';\n\n/**\n * A service that will queue mutate calls to Apollo.\n * It will not send subsequent mutate requests until the previous one has been completed.\n * This is useful for avoiding race conditions on the backend.\n * This should be used alongside Apollo.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffQueuedApollo {\n queue: (() => void)[] = [];\n\n constructor(\n private apollo: Apollo,\n ) {}\n\n /**\n * Queue up a mutate request.\n * The request will not actually be queued until the returned observable is subscribed.\n * If the queue is empty, the request will be sent when it enters the queue.\n * Otherwise, it will be sent when it reaches the front of the queue.\n * The observable will complete after it emits once.\n *\n * @param options Mutation options.\n */\n mutate<T, V = Record<string, any>>(options: MutationOptions<T, V>): Observable<FetchResult<T>> {\n return new Observable(subscriber => this.addRequestToQueue(subscriber, this.apollo.mutate(options)));\n }\n\n private addRequestToQueue(subscriber: Subscriber<any>, request: Observable<any>): void {\n this.queue.push(() => {\n const sub = request.subscribe({\n next: response => {\n // emit the outer observable\n subscriber.next(response);\n subscriber.complete();\n\n this.finishRequestSubscription(sub);\n },\n error: error => {\n subscriber.error(error);\n this.finishRequestSubscription(sub);\n },\n complete: () => {\n subscriber.complete();\n this.finishRequestSubscription(sub);\n },\n });\n });\n\n // start the queue if previously empty\n if (this.queue.length === 1) {\n this.queue[0]();\n }\n }\n\n private finishRequestSubscription(requestSubscription: Subscription): void {\n requestSubscription.unsubscribe();\n\n // process queue\n this.queue.shift();\n this.queue[0]?.();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAOO,MAAM,gBAAgB,GAAG,CAAC,QAAsB,KACrD,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,IAC7B,GAAG,CAAC,IAAI,KAAK,oBAAoB,CAClC,CAAC,GAAG,CAAC,GAAG,IACkB,GAAI,CAAC,IAAI,CAAC,KAAK,CACzC;AAEH;;;;;AAKG;AACH,MAAM,oBAAoB,GAAG,CAAC,GAAG,SAAyB,KACxD,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAI;AACjC,IAAA,MAAM,KAAK,GAAG,gBAAgB,CAAC,QAAQ,CAAC;AACxC,IAAA,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE;QACZ,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;;AAEpB,IAAA,OAAO,GAAG;AACZ,CAAC,EAAE,EAAE,CAAC;AAER;;;;;;;AAOG;AACU,MAAA,2BAA2B,GAAG,CAAC,GAAG,SAAyB,KACtE,MAAM,CAAC,oBAAoB,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,CAAA,EAAA,CAAI,CAAC,EAAE,EAAE;;ACpCjG;;;;;AAKG;AACU,MAAA,2BAA2B,GAAG,CAAC,GAAG,SAAyB,KACtE,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAK,GAAG,CAAC,MAAM,CAAC,CAAA,EAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAA,EAAA,CAAI,CAAC,EAAE,EAAE;;ACGrF;;;;;AAKG;MAIU,gBAAgB,CAAA;AAG3B,IAAA,WAAA,CACU,MAAc,EAAA;QAAd,IAAM,CAAA,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EAAA,EAAA,CAAA,MAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAhB,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cAFf,MAAM,EAAA,CAAA,CAAA;;4FAEP,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACpBD;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-core-graphql.mjs","sources":["../../../libs/core/graphql/src/fragments/build-fragment-name-spread.ts","../../../libs/core/graphql/src/fragments/build-fragment-definition.ts","../../../libs/core/graphql/src/apollo/queued-apollo/queued-apollo.service.ts","../../../libs/core/graphql/src/daffodil-core-graphql.ts"],"sourcesContent":["import {\n DocumentNode,\n FragmentDefinitionNode,\n} from 'graphql';\n\nimport { unique } from '@daffodil/core';\n\nexport const getFragmentNames = (fragment: DocumentNode) =>\n fragment.definitions.filter(def =>\n def.kind === 'FragmentDefinition',\n ).map(def =>\n (<FragmentDefinitionNode>def).name.value,\n );\n\n/**\n * Builds a list of the first fragment name present inside the specified GraphQL document nodes.\n * Returns an empty array if no fragments have been defined or if null is passed.\n *\n * @param fragments The created fragments.\n */\nconst daffGetFragmentNames = (...fragments: DocumentNode[]): string[] =>\n fragments.reduce((acc, fragment) => {\n const names = getFragmentNames(fragment);\n if (names[0]) {\n acc.push(names[0]);\n }\n return acc;\n }, []);\n\n/**\n * Builds a string of fragment names that can be interpolated into a GraphQL query.\n * Each name is separated by a newline character: '\\n'.\n * If an empty array is passed, an empty string is returned.\n * Only the first fragment name from each passed fragment is returned.\n *\n * @param fragments A list of GraphQL documents that contain fragments.\n */\nexport const daffBuildFragmentNameSpread = (...fragments: DocumentNode[]): string =>\n unique(daffGetFragmentNames(...fragments)).reduce((acc, name) => acc.concat(`...${name}\\n`), '');\n","import { DocumentNode } from 'graphql';\n\n/**\n * Builds a string of fragment definitions that can be interpolated into a GraphQL query.\n * Each definition is separated by a newline character: '\\n'.\n *\n * @param documents A list of GraphQL documents that should only contain fragments.\n */\nexport const daffBuildFragmentDefinition = (...documents: DocumentNode[]): string =>\n documents.reduce((acc, fragment) => acc.concat(`${fragment.loc.source.body}\\n`), '');\n","import { Injectable } from '@angular/core';\nimport {\n MutationOptions,\n FetchResult,\n} from '@apollo/client/core';\nimport { Apollo } from 'apollo-angular';\nimport {\n Observable,\n Subscriber,\n Subscription,\n} from 'rxjs';\n\n/**\n * A service that will queue mutate calls to Apollo.\n * It will not send subsequent mutate requests until the previous one has been completed.\n * This is useful for avoiding race conditions on the backend.\n * This should be used alongside Apollo.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffQueuedApollo {\n queue: (() => void)[] = [];\n\n constructor(\n private apollo: Apollo,\n ) {}\n\n /**\n * Queue up a mutate request.\n * The request will not actually be queued until the returned observable is subscribed.\n * If the queue is empty, the request will be sent when it enters the queue.\n * Otherwise, it will be sent when it reaches the front of the queue.\n * The observable will complete after it emits once.\n *\n * @param options Mutation options.\n */\n mutate<T, V = Record<string, any>>(options: MutationOptions<T, V>): Observable<FetchResult<T>> {\n return new Observable(subscriber => this.addRequestToQueue(subscriber, this.apollo.mutate(options)));\n }\n\n private addRequestToQueue(subscriber: Subscriber<any>, request: Observable<any>): void {\n this.queue.push(() => {\n const sub = request.subscribe({\n next: response => {\n // emit the outer observable\n subscriber.next(response);\n subscriber.complete();\n\n this.finishRequestSubscription(sub);\n },\n error: error => {\n subscriber.error(error);\n this.finishRequestSubscription(sub);\n },\n complete: () => {\n subscriber.complete();\n this.finishRequestSubscription(sub);\n },\n });\n });\n\n // start the queue if previously empty\n if (this.queue.length === 1) {\n this.queue[0]();\n }\n }\n\n private finishRequestSubscription(requestSubscription: Subscription): void {\n requestSubscription.unsubscribe();\n\n // process queue\n this.queue.shift();\n this.queue[0]?.();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAOO,MAAM,gBAAgB,GAAG,CAAC,QAAsB,KACrD,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,IAC7B,GAAG,CAAC,IAAI,KAAK,oBAAoB,CAClC,CAAC,GAAG,CAAC,GAAG,IACkB,GAAI,CAAC,IAAI,CAAC,KAAK,CACzC;AAEH;;;;;AAKG;AACH,MAAM,oBAAoB,GAAG,CAAC,GAAG,SAAyB,KACxD,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAI;AACjC,IAAA,MAAM,KAAK,GAAG,gBAAgB,CAAC,QAAQ,CAAC;AACxC,IAAA,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE;QACZ,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACpB;AACA,IAAA,OAAO,GAAG;AACZ,CAAC,EAAE,EAAE,CAAC;AAER;;;;;;;AAOG;AACI,MAAM,2BAA2B,GAAG,CAAC,GAAG,SAAyB,KACtE,MAAM,CAAC,oBAAoB,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,GAAG,CAAC,MAAM,CAAC,MAAM,IAAI,CAAA,EAAA,CAAI,CAAC,EAAE,EAAE;;ACpCjG;;;;;AAKG;AACI,MAAM,2BAA2B,GAAG,CAAC,GAAG,SAAyB,KACtE,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAK,GAAG,CAAC,MAAM,CAAC,CAAA,EAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAA,EAAA,CAAI,CAAC,EAAE,EAAE;;ACGrF;;;;;AAKG;MAIU,gBAAgB,CAAA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AA,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;IACnB;iIArDW,gBAAgB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,MAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAhB,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,cAFf,MAAM,EAAA,CAAA,CAAA;;2FAEP,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAH5B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACpBD;;AAEG;;;;"}
@@ -2,8 +2,6 @@ import * as i0 from '@angular/core';
2
2
  import { Injectable } from '@angular/core';
3
3
  import * as i1 from '@angular/router';
4
4
  import { PRIMARY_OUTLET } from '@angular/router';
5
- import { createEntityAdapter } from '@ngrx/entity';
6
- import { ROUTER_NAVIGATED } from '@ngrx/router-store';
7
5
  import { DaffFilterType } from '@daffodil/core';
8
6
 
9
7
  /**
@@ -69,48 +67,16 @@ class DaffRoutingUriNormalizer {
69
67
  };
70
68
  return this.urlParser.serialize(urlTree);
71
69
  }
72
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffRoutingUriNormalizer, deps: [{ token: i1.UrlSerializer }], target: i0.ɵɵFactoryTarget.Injectable }); }
73
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffRoutingUriNormalizer, providedIn: 'root' }); }
70
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffRoutingUriNormalizer, deps: [{ token: i1.UrlSerializer }], target: i0.ɵɵFactoryTarget.Injectable }); }
71
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffRoutingUriNormalizer, providedIn: 'root' }); }
74
72
  }
75
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: DaffRoutingUriNormalizer, decorators: [{
73
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: DaffRoutingUriNormalizer, decorators: [{
76
74
  type: Injectable,
77
75
  args: [{
78
76
  providedIn: 'root',
79
77
  }]
80
78
  }], ctorParameters: () => [{ type: i1.UrlSerializer }] });
81
79
 
82
- /**
83
- * Creates a reducer that will clear all contextual errors from entities in state when `ROUTER_NAVIGATED` is dispatched.
84
- */
85
- function daffRouterStateNavigatedClearEntityErrorsReducerFactory(adapter = createEntityAdapter()) {
86
- return (state, action) => {
87
- switch (action.type) {
88
- case ROUTER_NAVIGATED:
89
- return adapter.map((entity) => ({
90
- ...entity,
91
- daffErrors: [],
92
- }), state);
93
- default:
94
- return state;
95
- }
96
- };
97
- }
98
-
99
- /**
100
- * A reducer that will clear all errors from state when `ROUTER_NAVIGATED` is dispatched.
101
- */
102
- function daffRouterStateNavigatedClearErrorsReducer(state, action) {
103
- switch (action.type) {
104
- case ROUTER_NAVIGATED:
105
- return {
106
- ...state,
107
- daffErrors: [],
108
- };
109
- default:
110
- return state;
111
- }
112
- }
113
-
114
80
  /**
115
81
  * A standard filter request builder that creates an equal filter request with the query params values.
116
82
  */
@@ -124,5 +90,5 @@ const daffRoutingQueryParamFilterRequestEqualBuilder = (filterName, qpValue) =>
124
90
  * Generated bundle index. Do not edit.
125
91
  */
126
92
 
127
- export { DAFF_TRUNCATE_FILE_EXTENSION_REGEX, DAFF_TRUNCATE_LEADING_SLASH_REGEX, DaffRoutingUriNormalizer, daffRouterStateNavigatedClearEntityErrorsReducerFactory, daffRouterStateNavigatedClearErrorsReducer, daffRoutingQueryParamFilterRequestEqualBuilder, daffUriTruncateFileExtension, daffUriTruncateLeadingPathSegments, daffUriTruncateLeadingSlash, daffUriTruncateQueryFragment };
93
+ export { DAFF_TRUNCATE_FILE_EXTENSION_REGEX, DAFF_TRUNCATE_LEADING_SLASH_REGEX, DaffRoutingUriNormalizer, daffRoutingQueryParamFilterRequestEqualBuilder, daffUriTruncateFileExtension, daffUriTruncateLeadingPathSegments, daffUriTruncateLeadingSlash, daffUriTruncateQueryFragment };
128
94
  //# sourceMappingURL=daffodil-core-routing.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-core-routing.mjs","sources":["../../../libs/core/routing/src/uri/truncation/file-extension.ts","../../../libs/core/routing/src/uri/truncation/leading-path-segments.ts","../../../libs/core/routing/src/uri/truncation/leading-slash.ts","../../../libs/core/routing/src/uri/truncation/query-fragment.ts","../../../libs/core/routing/src/uri/normalizer.service.ts","../../../libs/core/routing/src/reducers/clear-errors/navigated-entity-reducer-factory.ts","../../../libs/core/routing/src/reducers/clear-errors/navigated.reducer.ts","../../../libs/core/routing/src/query-param-filter/request-builder/equal.ts","../../../libs/core/routing/src/daffodil-core-routing.ts"],"sourcesContent":["/**\n * Truncates the file extension from the end of the URI.\n * Captures the truncated URI in the `uri` named group.\n */\nexport const DAFF_TRUNCATE_FILE_EXTENSION_REGEX = /(.*)(?=\\.)/;\n/**\n * Truncates the file extension from the end of the URI.\n */\nexport const daffUriTruncateFileExtension = (uri: string): string => uri.match(DAFF_TRUNCATE_FILE_EXTENSION_REGEX)?.[0] || uri;\n","/**\n * Truncates leading path segments from a URI.\n * e.g. /foo/bar/baz.html -> baz.html\n */\nexport const daffUriTruncateLeadingPathSegments = (uri: string): string =>\n uri.split('/').pop();\n","/**\n * A regex to truncate the leading slash from a URI,\n * capturing the truncated in the `uri` group.\n * e.g. /foo/bar/baz.html -> foo/bar/baz.html\n */\nexport const DAFF_TRUNCATE_LEADING_SLASH_REGEX = /^\\/?(?<uri>.+)$/;\n/**\n * Truncates the leading slash from a URI.\n * e.g. /foo/bar/baz.html -> foo/bar/baz.html\n */\nexport const daffUriTruncateLeadingSlash = (uri: string): string =>\n uri.match(DAFF_TRUNCATE_LEADING_SLASH_REGEX)?.groups.uri || uri;\n","/**\n * Truncates query parameters and fragments from a URI.\n * e.g. /foo/bar/baz.html?thing=test#id -> /foo/bar/baz.html\n */\nexport const daffUriTruncateQueryFragment = (uri: string): string => {\n if(uri[0] !== '/') {\n uri = `/${uri}`;\n }\n return uri.replace(/(\\?.*)|(#.*)/, '');\n};\n","import { Injectable } from '@angular/core';\nimport {\n UrlSerializer,\n UrlTree,\n PRIMARY_OUTLET,\n} from '@angular/router';\n\n/**\n * Processes URIs to remove extraneous Angular-specific information.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffRoutingUriNormalizer {\n constructor(\n private urlParser: UrlSerializer,\n ) {}\n\n /**\n * Normalizes an Angular router path into a useable URI.\n * e.g. `normalize('some/url.html(secondary:outlet)?query=param#fragment')` -> `'some/url.html?query=param#fragment'`\n *\n * Optionally accepts an outlet to target.\n * e.g. `normalize('some/url.html(secondary:outlet)?query=param#fragment', 'secondary')` -> `'outlet?query=param#fragment'`\n *\n * @param uri The URI to normalize.\n * @param outlet An optional outlet to process into a URI.\n */\n normalize(uri: string, outlet = PRIMARY_OUTLET): string {\n const urlTree: UrlTree = this.urlParser.parse(uri);\n urlTree.root.children = {\n [PRIMARY_OUTLET]: urlTree.root.children[outlet],\n };\n\n return this.urlParser.serialize(urlTree);\n }\n}\n","import {\n createEntityAdapter,\n EntityAdapter,\n EntityState,\n} from '@ngrx/entity';\nimport {\n RouterAction,\n ROUTER_NAVIGATED,\n} from '@ngrx/router-store';\n\nimport { DaffErrorable } from '@daffodil/core/state';\n\n/**\n * Creates a reducer that will clear all contextual errors from entities in state when `ROUTER_NAVIGATED` is dispatched.\n */\nexport function daffRouterStateNavigatedClearEntityErrorsReducerFactory<T extends DaffErrorable = DaffErrorable>(adapter: EntityAdapter<T> = createEntityAdapter<T>()) {\n return (state: EntityState<T>, action: RouterAction<unknown>): EntityState<T> => {\n switch (action.type) {\n case ROUTER_NAVIGATED:\n return adapter.map(\n (entity) => ({\n ...entity,\n daffErrors: [],\n }),\n state,\n );\n\n default:\n return state;\n }\n };\n}\n","import {\n RouterAction,\n ROUTER_NAVIGATED,\n} from '@ngrx/router-store';\n\nimport { DaffErrorable } from '@daffodil/core/state';\n\n/**\n * A reducer that will clear all errors from state when `ROUTER_NAVIGATED` is dispatched.\n */\nexport function daffRouterStateNavigatedClearErrorsReducer<T extends DaffErrorable = DaffErrorable>(state: T, action: RouterAction<unknown>): T {\n switch (action.type) {\n case ROUTER_NAVIGATED:\n return {\n ...state,\n daffErrors: [],\n };\n\n default:\n return state;\n }\n}\n","import {\n DaffFilterEqualRequest,\n DaffFilterType,\n} from '@daffodil/core';\n\nimport { DaffRoutingQueryParamFilterRequestBuilder } from './type';\n\n/**\n * A standard filter request builder that creates an equal filter request with the query params values.\n */\nexport const daffRoutingQueryParamFilterRequestEqualBuilder: DaffRoutingQueryParamFilterRequestBuilder<DaffFilterEqualRequest>\n = (filterName, qpValue) => ({\n type: DaffFilterType.Equal,\n name: filterName,\n value: qpValue,\n });\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;AAGG;AACI,MAAM,kCAAkC,GAAG;AAClD;;AAEG;MACU,4BAA4B,GAAG,CAAC,GAAW,KAAa,GAAG,CAAC,KAAK,CAAC,kCAAkC,CAAC,GAAG,CAAC,CAAC,IAAI;;ACR3H;;;AAGG;AACU,MAAA,kCAAkC,GAAG,CAAC,GAAW,KAC5D,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG;;ACLpB;;;;AAIG;AACI,MAAM,iCAAiC,GAAG;AACjD;;;AAGG;MACU,2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AA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA;;;ACAD;;AAEG;AACa,SAAA,uDAAuD,CAA0C,OAAA,GAA4B,mBAAmB,EAAK,EAAA;AACnK,IAAA,OAAO,CAAC,KAAqB,EAAE,MAA6B,KAAoB;AAC9E,QAAA,QAAQ,MAAM,CAAC,IAAI;AACjB,YAAA,KAAK,gBAAgB;gBACnB,OAAO,OAAO,CAAC,GAAG,CAChB,CAAC,MAAM,MAAM;AACX,oBAAA,GAAG,MAAM;AACT,oBAAA,UAAU,EAAE,EAAE;iBACf,CAAC,EACF,KAAK,CACN;AAEH,YAAA;AACE,gBAAA,OAAO,KAAK;;AAElB,KAAC;AACH;;ACxBA;;AAEG;AACa,SAAA,0CAA0C,CAA0C,KAAQ,EAAE,MAA6B,EAAA;AACzI,IAAA,QAAQ,MAAM,CAAC,IAAI;AACjB,QAAA,KAAK,gBAAgB;YACnB,OAAO;AACL,gBAAA,GAAG,KAAK;AACR,gBAAA,UAAU,EAAE,EAAE;aACf;AAEH,QAAA;AACE,YAAA,OAAO,KAAK;;AAElB;;ACdA;;AAEG;AACU,MAAA,8CAA8C,GACxD,CAAC,UAAU,EAAE,OAAO,MAAM;IAC1B,IAAI,EAAE,cAAc,CAAC,KAAK;AAC1B,IAAA,IAAI,EAAE,UAAU;AAChB,IAAA,KAAK,EAAE,OAAO;AACf,CAAA;;ACfF;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-core-routing.mjs","sources":["../../../libs/core/routing/src/uri/truncation/file-extension.ts","../../../libs/core/routing/src/uri/truncation/leading-path-segments.ts","../../../libs/core/routing/src/uri/truncation/leading-slash.ts","../../../libs/core/routing/src/uri/truncation/query-fragment.ts","../../../libs/core/routing/src/uri/normalizer.service.ts","../../../libs/core/routing/src/query-param-filter/request-builder/equal.ts","../../../libs/core/routing/src/daffodil-core-routing.ts"],"sourcesContent":["/**\n * Truncates the file extension from the end of the URI.\n * Captures the truncated URI in the `uri` named group.\n */\nexport const DAFF_TRUNCATE_FILE_EXTENSION_REGEX = /(.*)(?=\\.)/;\n/**\n * Truncates the file extension from the end of the URI.\n */\nexport const daffUriTruncateFileExtension = (uri: string): string => uri.match(DAFF_TRUNCATE_FILE_EXTENSION_REGEX)?.[0] || uri;\n","/**\n * Truncates leading path segments from a URI.\n * e.g. /foo/bar/baz.html -> baz.html\n */\nexport const daffUriTruncateLeadingPathSegments = (uri: string): string =>\n uri.split('/').pop();\n","/**\n * A regex to truncate the leading slash from a URI,\n * capturing the truncated in the `uri` group.\n * e.g. /foo/bar/baz.html -> foo/bar/baz.html\n */\nexport const DAFF_TRUNCATE_LEADING_SLASH_REGEX = /^\\/?(?<uri>.+)$/;\n/**\n * Truncates the leading slash from a URI.\n * e.g. /foo/bar/baz.html -> foo/bar/baz.html\n */\nexport const daffUriTruncateLeadingSlash = (uri: string): string =>\n uri.match(DAFF_TRUNCATE_LEADING_SLASH_REGEX)?.groups.uri || uri;\n","/**\n * Truncates query parameters and fragments from a URI.\n * e.g. /foo/bar/baz.html?thing=test#id -> /foo/bar/baz.html\n */\nexport const daffUriTruncateQueryFragment = (uri: string): string => {\n if(uri[0] !== '/') {\n uri = `/${uri}`;\n }\n return uri.replace(/(\\?.*)|(#.*)/, '');\n};\n","import { Injectable } from '@angular/core';\nimport {\n UrlSerializer,\n UrlTree,\n PRIMARY_OUTLET,\n} from '@angular/router';\n\n/**\n * Processes URIs to remove extraneous Angular-specific information.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffRoutingUriNormalizer {\n constructor(\n private urlParser: UrlSerializer,\n ) {}\n\n /**\n * Normalizes an Angular router path into a useable URI.\n * e.g. `normalize('some/url.html(secondary:outlet)?query=param#fragment')` -> `'some/url.html?query=param#fragment'`\n *\n * Optionally accepts an outlet to target.\n * e.g. `normalize('some/url.html(secondary:outlet)?query=param#fragment', 'secondary')` -> `'outlet?query=param#fragment'`\n *\n * @param uri The URI to normalize.\n * @param outlet An optional outlet to process into a URI.\n */\n normalize(uri: string, outlet = PRIMARY_OUTLET): string {\n const urlTree: UrlTree = this.urlParser.parse(uri);\n urlTree.root.children = {\n [PRIMARY_OUTLET]: urlTree.root.children[outlet],\n };\n\n return this.urlParser.serialize(urlTree);\n }\n}\n","import {\n DaffFilterEqualRequest,\n DaffFilterType,\n} from '@daffodil/core';\n\nimport { DaffRoutingQueryParamFilterRequestBuilder } from './type';\n\n/**\n * A standard filter request builder that creates an equal filter request with the query params values.\n */\nexport const daffRoutingQueryParamFilterRequestEqualBuilder: DaffRoutingQueryParamFilterRequestBuilder<DaffFilterEqualRequest>\n = (filterName, qpValue) => ({\n type: DaffFilterType.Equal,\n name: filterName,\n value: qpValue,\n });\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;AAGG;AACI,MAAM,kCAAkC,GAAG;AAClD;;AAEG;MACU,4BAA4B,GAAG,CAAC,GAAW,KAAa,GAAG,CAAC,KAAK,CAAC,kCAAkC,CAAC,GAAG,CAAC,CAAC,IAAI;;ACR3H;;;AAGG;AACI,MAAM,kCAAkC,GAAG,CAAC,GAAW,KAC5D,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG;;ACLpB;;;;AAIG;AACI,MAAM,iCAAiC,GAAG;AACjD;;;AAGG;MACU,2BAA2B,GAAG,CAAC,GAAW,KACrD,GAAG,CAAC,KAAK,CAAC,iCAAiC,CAAC,EAAE,MAAM,CAAC,GAAG,IAAI;;ACX9D;;;AAGG;AACI,MAAM,4BAA4B,GAAG,CAAC,GAAW,KAAY;AAClE,IAAA,IAAG,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;AACjB,QAAA,GAAG,GAAG,CAAA,CAAA,EAAI,GAAG,CAAA,CAAE;IACjB;IACA,OAAO,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;AACxC;;ACFA;;AAEG;MAIU,wBAAwB,CAAA;AACnC,IAAA,WAAA,CACU,SA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.11", ngImport: i0, type: MockDaffCollectionFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
27
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MockDaffCollectionFacade, providedIn: 'root' }); }
26
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: MockDaffCollectionFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
27
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: MockDaffCollectionFacade, providedIn: 'root' }); }
28
28
  }
29
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MockDaffCollectionFacade, decorators: [{
29
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: MockDaffCollectionFacade, decorators: [{
30
30
  type: Injectable,
31
31
  args: [{ providedIn: 'root' }]
32
32
  }] });
@@ -47,10 +47,10 @@ class MockDaffOperationStateFacade {
47
47
  }
48
48
  dispatch(action) { }
49
49
  ;
50
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MockDaffOperationStateFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
51
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MockDaffOperationStateFacade, providedIn: 'root' }); }
50
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: MockDaffOperationStateFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
51
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: MockDaffOperationStateFacade, providedIn: 'root' }); }
52
52
  }
53
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MockDaffOperationStateFacade, decorators: [{
53
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.1", ngImport: i0, type: MockDaffOperationStateFacade, decorators: [{
54
54
  type: Injectable,
55
55
  args: [{ providedIn: 'root' }]
56
56
  }] });
@@ -1 +1 @@
1
- {"version":3,"file":"daffodil-core-state-testing.mjs","sources":["../../../libs/core/state/testing/src/mock-collection-facade.ts","../../../libs/core/state/testing/src/mock-operation-facade.ts","../../../libs/core/state/testing/src/daffodil-core-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport {\n DaffCollectionMetadata,\n DaffCollectionRequest,\n DaffFilters,\n DaffSortDirectionEnum,\n DaffSortOption,\n} from '@daffodil/core';\nimport { DaffCollectionFacadeInterface } from '@daffodil/core/state';\n\n/**\n * Can be used to mock out the {@link DaffCollectionFacade} in testing environments.\n *\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffCollectionFacade implements DaffCollectionFacadeInterface {\n metadata$: BehaviorSubject<DaffCollectionMetadata> = new BehaviorSubject(null);\n request$: BehaviorSubject<DaffCollectionRequest> = new BehaviorSubject(null);\n count$: BehaviorSubject<number> = new BehaviorSubject(0);\n currentPage$: BehaviorSubject<number> = new BehaviorSubject(0);\n totalPages$: BehaviorSubject<number> = new BehaviorSubject(0);\n pageSize$: BehaviorSubject<number> = new BehaviorSubject(0);\n sortOptions$: BehaviorSubject<DaffSortOption[]> = new BehaviorSubject([]);\n appliedSortOption$: BehaviorSubject<string> = new BehaviorSubject(null);\n appliedSortDirection$: BehaviorSubject<DaffSortDirectionEnum> = new BehaviorSubject(null);\n filters$: BehaviorSubject<DaffFilters> = new BehaviorSubject({});\n appliedFilters$: BehaviorSubject<DaffFilters> = new BehaviorSubject({});\n\n dispatch(action: Action) {};\n}\n","import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport {\n DaffOperationStateFacadeInterface,\n DaffState,\n DaffStateError,\n} from '@daffodil/core/state';\n\n/**\n * Can be used to mock out the {@link DaffOperationStateFacade} in testing environments.\n *\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffOperationStateFacade implements DaffOperationStateFacadeInterface {\n loadingState$ = new BehaviorSubject<DaffState>(DaffState.Stable);\n loading$ = new BehaviorSubject<boolean>(false);\n resolving$ = new BehaviorSubject<boolean>(false);\n mutating$ = new BehaviorSubject<boolean>(false);\n errors$ = new BehaviorSubject<DaffStateError[]>([]);\n hasErrors$ = new BehaviorSubject<boolean>(false);\n\n dispatch(action: Action) {};\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAaA;;;;AAIG;MAEU,wBAAwB,CAAA;AADrC,IAAA,WAAA,GAAA;AAEE,QAAA,IAAA,CAAA,SAAS,GAA4C,IAAI,eAAe,CAAC,IAAI,CAAC;AAC9E,QAAA,IAAA,CAAA,QAAQ,GAA2C,IAAI,eAAe,CAAC,IAAI,CAAC;AAC5E,QAAA,IAAA,CAAA,MAAM,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC;AACxD,QAAA,IAAA,CAAA,YAAY,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC;AAC9D,QAAA,IAAA,CAAA,WAAW,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC;AAC7D,QAAA,IAAA,CAAA,SAAS,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC;AAC3D,QAAA,IAAA,CAAA,YAAY,GAAsC,IAAI,eAAe,CAAC,EAAE,CAAC;AACzE,QAAA,IAAA,CAAA,kBAAkB,GAA4B,IAAI,eAAe,CAAC,IAAI,C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,UAAA,EAAA,CAAA,CAAA;AAA5B,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,4BAA4B,cADf,MAAM,EAAA,CAAA,CAAA;;4FACnB,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBADxC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACflC;;AAEG;;;;"}
1
+ {"version":3,"file":"daffodil-core-state-testing.mjs","sources":["../../../libs/core/state/testing/src/mock-collection-facade.ts","../../../libs/core/state/testing/src/mock-operation-facade.ts","../../../libs/core/state/testing/src/daffodil-core-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport {\n DaffCollectionMetadata,\n DaffCollectionRequest,\n DaffFilters,\n DaffSortDirectionEnum,\n DaffSortOption,\n} from '@daffodil/core';\nimport { DaffCollectionFacadeInterface } from '@daffodil/core/state';\n\n/**\n * Can be used to mock out the {@link DaffCollectionFacade} in testing environments.\n *\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffCollectionFacade implements DaffCollectionFacadeInterface {\n metadata$: BehaviorSubject<DaffCollectionMetadata> = new BehaviorSubject(null);\n request$: BehaviorSubject<DaffCollectionRequest> = new BehaviorSubject(null);\n count$: BehaviorSubject<number> = new BehaviorSubject(0);\n currentPage$: BehaviorSubject<number> = new BehaviorSubject(0);\n totalPages$: BehaviorSubject<number> = new BehaviorSubject(0);\n pageSize$: BehaviorSubject<number> = new BehaviorSubject(0);\n sortOptions$: BehaviorSubject<DaffSortOption[]> = new BehaviorSubject([]);\n appliedSortOption$: BehaviorSubject<string> = new BehaviorSubject(null);\n appliedSortDirection$: BehaviorSubject<DaffSortDirectionEnum> = new BehaviorSubject(null);\n filters$: BehaviorSubject<DaffFilters> = new BehaviorSubject({});\n appliedFilters$: BehaviorSubject<DaffFilters> = new BehaviorSubject({});\n\n dispatch(action: Action) {};\n}\n","import { Injectable } from '@angular/core';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport {\n DaffOperationStateFacadeInterface,\n DaffState,\n DaffStateError,\n} from '@daffodil/core/state';\n\n/**\n * Can be used to mock out the {@link DaffOperationStateFacade} in testing environments.\n *\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffOperationStateFacade implements DaffOperationStateFacadeInterface {\n loadingState$ = new BehaviorSubject<DaffState>(DaffState.Stable);\n loading$ = new BehaviorSubject<boolean>(false);\n resolving$ = new BehaviorSubject<boolean>(false);\n mutating$ = new BehaviorSubject<boolean>(false);\n errors$ = new BehaviorSubject<DaffStateError[]>([]);\n hasErrors$ = new BehaviorSubject<boolean>(false);\n\n dispatch(action: Action) {};\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAaA;;;;AAIG;MAEU,wBAAwB,CAAA;AADrC,IAAA,WAAA,GAAA;AAEE,QAAA,IAAA,CAAA,SAAS,GAA4C,IAAI,eAAe,CAAC,IAAI,CAAC;AAC9E,QAAA,IAAA,CAAA,QAAQ,GAA2C,IAAI,eAAe,CAAC,IAAI,CAAC;AAC5E,QAAA,IAAA,CAAA,MAAM,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC;AACxD,QAAA,IAAA,CAAA,YAAY,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC;AAC9D,QAAA,IAAA,CAAA,WAAW,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC;AAC7D,QAAA,IAAA,CAAA,SAAS,GAA4B,IAAI,eAAe,CAAC,CAAC,CAAC;AAC3D,QAAA,IAAA,CAAA,YAAY,GAAsC,IAAI,eAAe,CAAC,EAAE,CAAC;AACzE,QAAA,IAAA,CAAA,kBAAkB,GAA4B,IAAI,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EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA5B,uBAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,4BAA4B,cADf,MAAM,EAAA,CAAA,CAAA;;2FACnB,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBADxC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACflC;;AAEG;;;;"}
@@ -273,6 +273,8 @@ function daffOperationStateSelectorFactory(selectState) {
273
273
  }
274
274
  ;
275
275
 
276
+ // ngrx does not export EntitySelectors so we gotta do this nonsense
277
+ const giveMeType = (adapter) => adapter.getSelectors((state) => ({ ids: [], entities: {} }));
276
278
  /**
277
279
  * Creates a set of selectors for an entity operation state.
278
280
  *