@daffodil/geography 0.39.11 → 0.40.1

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 (244) hide show
  1. package/daffodil-geography.d.ts +1 -0
  2. package/driver/daffodil-geography-driver.d.ts +1 -0
  3. package/driver/in-memory/backend/geography.service.d.ts +3 -0
  4. package/driver/in-memory/daffodil-geography-driver-in-memory.d.ts +1 -0
  5. package/driver/in-memory/drivers/geography-driver.module.d.ts +5 -0
  6. package/driver/in-memory/drivers/geography.service.d.ts +3 -0
  7. package/driver/in-memory/package.json +5 -6
  8. package/driver/magento/daffodil-geography-driver-magento.d.ts +1 -0
  9. package/driver/magento/errors/transform.d.ts +1 -1
  10. package/driver/magento/geography-driver.module.d.ts +5 -0
  11. package/driver/magento/geography.service.d.ts +4 -1
  12. package/driver/magento/package.json +5 -6
  13. package/driver/magento/queries/fragments/country.d.ts +1 -1
  14. package/driver/magento/queries/fragments/region.d.ts +1 -1
  15. package/driver/magento/queries/get-countries.d.ts +1 -1
  16. package/driver/magento/queries/get-country.d.ts +1 -1
  17. package/driver/magento/transforms/responses/country.service.d.ts +3 -0
  18. package/driver/magento/transforms/responses/subdivision.service.d.ts +3 -0
  19. package/driver/package.json +5 -6
  20. package/driver/testing/daffodil-geography-driver-testing.d.ts +1 -0
  21. package/driver/testing/drivers/geography-driver.module.d.ts +5 -0
  22. package/driver/testing/drivers/geography.service.d.ts +3 -0
  23. package/driver/testing/package.json +5 -6
  24. package/{esm2015/comparators/address.js → esm2020/comparators/address.mjs} +0 -0
  25. package/{esm2015/comparators/personal-address.js → esm2020/comparators/personal-address.mjs} +0 -0
  26. package/{esm2015/comparators/public_api.js → esm2020/comparators/public_api.mjs} +0 -0
  27. package/{esm2015/daffodil-geography.js → esm2020/daffodil-geography.mjs} +0 -0
  28. package/{esm2015/driver/daffodil-geography-driver.js → esm2020/driver/daffodil-geography-driver.mjs} +0 -0
  29. package/{esm2015/driver/errors/country-not-found.js → esm2020/driver/errors/country-not-found.mjs} +0 -0
  30. package/{esm2015/driver/errors/invalid-api-response.js → esm2020/driver/errors/invalid-api-response.mjs} +0 -0
  31. package/{esm2015/driver/errors/public_api.js → esm2020/driver/errors/public_api.mjs} +0 -0
  32. package/esm2020/driver/in-memory/backend/geography.service.mjs +59 -0
  33. package/{esm2015/driver/in-memory/daffodil-geography-driver-in-memory.js → esm2020/driver/in-memory/daffodil-geography-driver-in-memory.mjs} +0 -0
  34. package/esm2020/driver/in-memory/drivers/geography-driver.module.mjs +32 -0
  35. package/esm2020/driver/in-memory/drivers/geography.service.mjs +31 -0
  36. package/{esm2015/driver/in-memory/drivers/public_api.js → esm2020/driver/in-memory/drivers/public_api.mjs} +0 -0
  37. package/{esm2015/driver/in-memory/index.js → esm2020/driver/in-memory/index.mjs} +0 -0
  38. package/{esm2015/driver/in-memory/public_api.js → esm2020/driver/in-memory/public_api.mjs} +0 -0
  39. package/{esm2015/driver/index.js → esm2020/driver/index.mjs} +0 -0
  40. package/{esm2015/driver/interfaces/geography-service.interface.js → esm2020/driver/interfaces/geography-service.interface.mjs} +0 -0
  41. package/{esm2015/driver/magento/daffodil-geography-driver-magento.js → esm2020/driver/magento/daffodil-geography-driver-magento.mjs} +0 -0
  42. package/{esm2015/driver/magento/errors/codes.js → esm2020/driver/magento/errors/codes.mjs} +0 -0
  43. package/{esm2015/driver/magento/errors/map.js → esm2020/driver/magento/errors/map.mjs} +0 -0
  44. package/{esm2015/driver/magento/errors/transform.js → esm2020/driver/magento/errors/transform.mjs} +0 -0
  45. package/esm2020/driver/magento/geography-driver.module.mjs +32 -0
  46. package/esm2020/driver/magento/geography.service.mjs +45 -0
  47. package/{esm2015/driver/magento/index.js → esm2020/driver/magento/index.mjs} +0 -0
  48. package/{esm2015/driver/magento/models/responses/country.js → esm2020/driver/magento/models/responses/country.mjs} +0 -0
  49. package/{esm2015/driver/magento/models/responses/public_api.js → esm2020/driver/magento/models/responses/public_api.mjs} +0 -0
  50. package/{esm2015/driver/magento/models/responses/region.js → esm2020/driver/magento/models/responses/region.mjs} +0 -0
  51. package/{esm2015/driver/magento/public_api.js → esm2020/driver/magento/public_api.mjs} +0 -0
  52. package/esm2020/driver/magento/queries/fragments/country.mjs +11 -0
  53. package/{esm2015/driver/magento/queries/fragments/public_api.js → esm2020/driver/magento/queries/fragments/public_api.mjs} +0 -0
  54. package/{esm2015/driver/magento/queries/fragments/region.js → esm2020/driver/magento/queries/fragments/region.mjs} +2 -2
  55. package/{esm2015/driver/magento/queries/get-countries.js → esm2020/driver/magento/queries/get-countries.mjs} +2 -2
  56. package/esm2020/driver/magento/queries/get-country.mjs +15 -0
  57. package/{esm2015/driver/magento/queries/public_api.js → esm2020/driver/magento/queries/public_api.mjs} +0 -0
  58. package/{esm2015/driver/magento/queries/responses/get-countries.js → esm2020/driver/magento/queries/responses/get-countries.mjs} +0 -0
  59. package/{esm2015/driver/magento/queries/responses/get-country.js → esm2020/driver/magento/queries/responses/get-country.mjs} +0 -0
  60. package/{esm2015/driver/magento/queries/responses/public_api.js → esm2020/driver/magento/queries/responses/public_api.mjs} +0 -0
  61. package/esm2020/driver/magento/transforms/responses/country.service.mjs +38 -0
  62. package/esm2020/driver/magento/transforms/responses/subdivision.service.mjs +27 -0
  63. package/{esm2015/driver/magento/validators/get-countries.js → esm2020/driver/magento/validators/get-countries.mjs} +0 -0
  64. package/{esm2015/driver/magento/validators/public_api.js → esm2020/driver/magento/validators/public_api.mjs} +0 -0
  65. package/{esm2015/driver/testing/daffodil-geography-driver-testing.js → esm2020/driver/testing/daffodil-geography-driver-testing.mjs} +0 -0
  66. package/esm2020/driver/testing/drivers/geography-driver.module.mjs +32 -0
  67. package/esm2020/driver/testing/drivers/geography.service.mjs +32 -0
  68. package/{esm2015/driver/testing/drivers/public_api.js → esm2020/driver/testing/drivers/public_api.mjs} +0 -0
  69. package/{esm2015/driver/testing/index.js → esm2020/driver/testing/index.mjs} +0 -0
  70. package/{esm2015/driver/testing/public_api.js → esm2020/driver/testing/public_api.mjs} +0 -0
  71. package/{esm2015/index.js → esm2020/index.mjs} +0 -0
  72. package/{esm2015/injection-tokens/error-matcher.token.js → esm2020/injection-tokens/error-matcher.token.mjs} +0 -0
  73. package/{esm2015/injection-tokens/public_api.js → esm2020/injection-tokens/public_api.mjs} +0 -0
  74. package/{esm2015/models/address.js → esm2020/models/address.mjs} +0 -0
  75. package/{esm2015/models/country.js → esm2020/models/country.mjs} +0 -0
  76. package/{esm2015/models/personal-address.js → esm2020/models/personal-address.mjs} +0 -0
  77. package/{esm2015/models/public_api.js → esm2020/models/public_api.mjs} +0 -0
  78. package/{esm2015/models/subdivision.js → esm2020/models/subdivision.mjs} +0 -0
  79. package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
  80. package/{esm2015/state/actions/geography.actions.js → esm2020/state/actions/geography.actions.mjs} +0 -0
  81. package/{esm2015/state/actions/public_api.js → esm2020/state/actions/public_api.mjs} +0 -0
  82. package/esm2020/state/daffodil-geography-state.mjs +5 -0
  83. package/esm2020/state/effects/geography.effects.mjs +30 -0
  84. package/{esm2015/state/facades/geography/geography-facade.interface.js → esm2020/state/facades/geography/geography-facade.interface.mjs} +0 -0
  85. package/esm2020/state/facades/geography/geography.facade.mjs +44 -0
  86. package/esm2020/state/geography-state.module.mjs +30 -0
  87. package/{esm2015/state/index.js → esm2020/state/index.mjs} +0 -0
  88. package/{esm2015/state/reducers/country-entities/country-entities-adapter.js → esm2020/state/reducers/country-entities/country-entities-adapter.mjs} +5 -7
  89. package/{esm2015/state/reducers/country-entities/country-entities-initial-state.js → esm2020/state/reducers/country-entities/country-entities-initial-state.mjs} +0 -0
  90. package/{esm2015/state/reducers/country-entities/country-entities-state.interface.js → esm2020/state/reducers/country-entities/country-entities-state.interface.mjs} +0 -0
  91. package/esm2020/state/reducers/country-entities/country-entities.reducer.mjs +29 -0
  92. package/{esm2015/state/reducers/country-entities/public_api.js → esm2020/state/reducers/country-entities/public_api.mjs} +0 -0
  93. package/{esm2015/state/reducers/geography/geography-initial-state.js → esm2020/state/reducers/geography/geography-initial-state.mjs} +0 -0
  94. package/{esm2015/state/reducers/geography/geography-state.interface.js → esm2020/state/reducers/geography/geography-state.interface.mjs} +0 -0
  95. package/{esm2015/state/reducers/geography/geography.reducer.js → esm2020/state/reducers/geography/geography.reducer.mjs} +13 -5
  96. package/{esm2015/state/reducers/geography/public_api.js → esm2020/state/reducers/geography/public_api.mjs} +0 -0
  97. package/{esm2015/state/reducers/geography-reducers-state.interface.js → esm2020/state/reducers/geography-reducers-state.interface.mjs} +0 -0
  98. package/{esm2015/state/reducers/geography-reducers.js → esm2020/state/reducers/geography-reducers.mjs} +0 -0
  99. package/{esm2015/state/reducers/geography-store-feature-key.js → esm2020/state/reducers/geography-store-feature-key.mjs} +0 -0
  100. package/{esm2015/state/reducers/public_api.js → esm2020/state/reducers/public_api.mjs} +0 -0
  101. package/esm2020/state/selectors/country-entities.selector.mjs +48 -0
  102. package/esm2020/state/selectors/geography-all.selector.mjs +12 -0
  103. package/esm2020/state/selectors/geography-feature.selector.mjs +9 -0
  104. package/esm2020/state/selectors/geography.selector.mjs +18 -0
  105. package/{esm2015/state/selectors/public_api.js → esm2020/state/selectors/public_api.mjs} +0 -0
  106. package/{esm2015/state/testing/daffodil-geography-state-testing.js → esm2020/state/testing/daffodil-geography-state-testing.mjs} +0 -0
  107. package/esm2020/state/testing/geography-testing.module.mjs +20 -0
  108. package/{esm2015/state/testing/index.js → esm2020/state/testing/index.mjs} +0 -0
  109. package/esm2020/state/testing/mock-geography-facade.mjs +34 -0
  110. package/{esm2015/state/testing/public_api.js → esm2020/state/testing/public_api.mjs} +0 -0
  111. package/{esm2015/testing/daffodil-geography-testing.js → esm2020/testing/daffodil-geography-testing.mjs} +0 -0
  112. package/esm2020/testing/factories/address.factory.mjs +28 -0
  113. package/esm2020/testing/factories/country.factory.mjs +28 -0
  114. package/esm2020/testing/factories/personal-address.factory.mjs +31 -0
  115. package/{esm2015/testing/factories/public_api.js → esm2020/testing/factories/public_api.mjs} +0 -0
  116. package/esm2020/testing/factories/subdivision.factory.mjs +25 -0
  117. package/{esm2015/testing/index.js → esm2020/testing/index.mjs} +0 -0
  118. package/{esm2015/testing/public_api.js → esm2020/testing/public_api.mjs} +0 -0
  119. package/fesm2015/daffodil-geography-driver-in-memory.mjs +121 -0
  120. package/fesm2015/daffodil-geography-driver-in-memory.mjs.map +1 -0
  121. package/fesm2015/{daffodil-geography-driver-magento.js → daffodil-geography-driver-magento.mjs} +42 -37
  122. package/fesm2015/daffodil-geography-driver-magento.mjs.map +1 -0
  123. package/fesm2015/daffodil-geography-driver-testing.mjs +67 -0
  124. package/fesm2015/daffodil-geography-driver-testing.mjs.map +1 -0
  125. package/fesm2015/{daffodil-geography-driver.js → daffodil-geography-driver.mjs} +1 -1
  126. package/fesm2015/daffodil-geography-driver.mjs.map +1 -0
  127. package/fesm2015/daffodil-geography-state-testing.mjs +58 -0
  128. package/fesm2015/daffodil-geography-state-testing.mjs.map +1 -0
  129. package/fesm2015/{daffodil-geography-state.js → daffodil-geography-state.mjs} +62 -72
  130. package/fesm2015/daffodil-geography-state.mjs.map +1 -0
  131. package/fesm2015/daffodil-geography-testing.mjs +106 -0
  132. package/fesm2015/daffodil-geography-testing.mjs.map +1 -0
  133. package/fesm2015/{daffodil-geography.js → daffodil-geography.mjs} +1 -1
  134. package/fesm2015/daffodil-geography.mjs.map +1 -0
  135. package/fesm2020/daffodil-geography-driver-in-memory.mjs +121 -0
  136. package/fesm2020/daffodil-geography-driver-in-memory.mjs.map +1 -0
  137. package/fesm2020/daffodil-geography-driver-magento.mjs +197 -0
  138. package/fesm2020/daffodil-geography-driver-magento.mjs.map +1 -0
  139. package/fesm2020/daffodil-geography-driver-testing.mjs +67 -0
  140. package/fesm2020/daffodil-geography-driver-testing.mjs.map +1 -0
  141. package/fesm2020/daffodil-geography-driver.mjs +27 -0
  142. package/fesm2020/daffodil-geography-driver.mjs.map +1 -0
  143. package/fesm2020/daffodil-geography-state-testing.mjs +58 -0
  144. package/fesm2020/daffodil-geography-state-testing.mjs.map +1 -0
  145. package/fesm2020/daffodil-geography-state.mjs +300 -0
  146. package/fesm2020/daffodil-geography-state.mjs.map +1 -0
  147. package/fesm2020/daffodil-geography-testing.mjs +106 -0
  148. package/fesm2020/daffodil-geography-testing.mjs.map +1 -0
  149. package/fesm2020/daffodil-geography.mjs +54 -0
  150. package/fesm2020/daffodil-geography.mjs.map +1 -0
  151. package/package.json +79 -11
  152. package/state/daffodil-geography-state.d.ts +1 -1
  153. package/state/effects/geography.effects.d.ts +5 -2
  154. package/state/facades/geography/geography.facade.d.ts +3 -0
  155. package/state/geography-state.module.d.ts +6 -0
  156. package/state/package.json +5 -6
  157. package/state/testing/daffodil-geography-state-testing.d.ts +1 -0
  158. package/state/testing/geography-testing.module.d.ts +4 -0
  159. package/state/testing/mock-geography-facade.d.ts +3 -0
  160. package/state/testing/package.json +5 -6
  161. package/testing/daffodil-geography-testing.d.ts +1 -0
  162. package/testing/factories/address.factory.d.ts +3 -0
  163. package/testing/factories/country.factory.d.ts +3 -0
  164. package/testing/factories/personal-address.factory.d.ts +3 -0
  165. package/testing/factories/subdivision.factory.d.ts +3 -0
  166. package/testing/package.json +5 -6
  167. package/bundles/daffodil-geography-driver-in-memory.umd.js +0 -129
  168. package/bundles/daffodil-geography-driver-in-memory.umd.js.map +0 -1
  169. package/bundles/daffodil-geography-driver-in-memory.umd.min.js +0 -2
  170. package/bundles/daffodil-geography-driver-in-memory.umd.min.js.map +0 -1
  171. package/bundles/daffodil-geography-driver-magento.umd.js +0 -490
  172. package/bundles/daffodil-geography-driver-magento.umd.js.map +0 -1
  173. package/bundles/daffodil-geography-driver-magento.umd.min.js +0 -2
  174. package/bundles/daffodil-geography-driver-magento.umd.min.js.map +0 -1
  175. package/bundles/daffodil-geography-driver-testing.umd.js +0 -72
  176. package/bundles/daffodil-geography-driver-testing.umd.js.map +0 -1
  177. package/bundles/daffodil-geography-driver-testing.umd.min.js +0 -2
  178. package/bundles/daffodil-geography-driver-testing.umd.min.js.map +0 -1
  179. package/bundles/daffodil-geography-driver.umd.js +0 -360
  180. package/bundles/daffodil-geography-driver.umd.js.map +0 -1
  181. package/bundles/daffodil-geography-driver.umd.min.js +0 -16
  182. package/bundles/daffodil-geography-driver.umd.min.js.map +0 -1
  183. package/bundles/daffodil-geography-state-testing.umd.js +0 -60
  184. package/bundles/daffodil-geography-state-testing.umd.js.map +0 -1
  185. package/bundles/daffodil-geography-state-testing.umd.min.js +0 -2
  186. package/bundles/daffodil-geography-state-testing.umd.min.js.map +0 -1
  187. package/bundles/daffodil-geography-state.umd.js +0 -649
  188. package/bundles/daffodil-geography-state.umd.js.map +0 -1
  189. package/bundles/daffodil-geography-state.umd.min.js +0 -16
  190. package/bundles/daffodil-geography-state.umd.min.js.map +0 -1
  191. package/bundles/daffodil-geography-testing.umd.js +0 -450
  192. package/bundles/daffodil-geography-testing.umd.js.map +0 -1
  193. package/bundles/daffodil-geography-testing.umd.min.js +0 -16
  194. package/bundles/daffodil-geography-testing.umd.min.js.map +0 -1
  195. package/bundles/daffodil-geography.umd.js +0 -63
  196. package/bundles/daffodil-geography.umd.js.map +0 -1
  197. package/bundles/daffodil-geography.umd.min.js +0 -2
  198. package/bundles/daffodil-geography.umd.min.js.map +0 -1
  199. package/daffodil-geography.metadata.json +0 -1
  200. package/driver/daffodil-geography-driver.metadata.json +0 -1
  201. package/driver/in-memory/daffodil-geography-driver-in-memory.metadata.json +0 -1
  202. package/driver/magento/daffodil-geography-driver-magento.metadata.json +0 -1
  203. package/driver/testing/daffodil-geography-driver-testing.metadata.json +0 -1
  204. package/esm2015/driver/in-memory/backend/geography.service.js +0 -62
  205. package/esm2015/driver/in-memory/drivers/geography-driver.module.js +0 -25
  206. package/esm2015/driver/in-memory/drivers/geography.service.js +0 -33
  207. package/esm2015/driver/magento/geography-driver.module.js +0 -25
  208. package/esm2015/driver/magento/geography.service.js +0 -48
  209. package/esm2015/driver/magento/queries/fragments/country.js +0 -11
  210. package/esm2015/driver/magento/queries/get-country.js +0 -15
  211. package/esm2015/driver/magento/transforms/responses/country.service.js +0 -32
  212. package/esm2015/driver/magento/transforms/responses/subdivision.service.js +0 -20
  213. package/esm2015/driver/testing/drivers/geography-driver.module.js +0 -25
  214. package/esm2015/driver/testing/drivers/geography.service.js +0 -35
  215. package/esm2015/state/daffodil-geography-state.js +0 -6
  216. package/esm2015/state/effects/geography.effects.js +0 -43
  217. package/esm2015/state/facades/geography/geography.facade.js +0 -46
  218. package/esm2015/state/geography-state.module.js +0 -18
  219. package/esm2015/state/reducers/country-entities/country-entities.reducer.js +0 -24
  220. package/esm2015/state/selectors/country-entities.selector.js +0 -51
  221. package/esm2015/state/selectors/geography-all.selector.js +0 -10
  222. package/esm2015/state/selectors/geography-feature.selector.js +0 -11
  223. package/esm2015/state/selectors/geography.selector.js +0 -21
  224. package/esm2015/state/testing/geography-testing.module.js +0 -13
  225. package/esm2015/state/testing/mock-geography-facade.js +0 -32
  226. package/esm2015/testing/factories/address.factory.js +0 -28
  227. package/esm2015/testing/factories/country.factory.js +0 -28
  228. package/esm2015/testing/factories/personal-address.factory.js +0 -31
  229. package/esm2015/testing/factories/subdivision.factory.js +0 -25
  230. package/fesm2015/daffodil-geography-driver-in-memory.js +0 -119
  231. package/fesm2015/daffodil-geography-driver-in-memory.js.map +0 -1
  232. package/fesm2015/daffodil-geography-driver-magento.js.map +0 -1
  233. package/fesm2015/daffodil-geography-driver-testing.js +0 -63
  234. package/fesm2015/daffodil-geography-driver-testing.js.map +0 -1
  235. package/fesm2015/daffodil-geography-driver.js.map +0 -1
  236. package/fesm2015/daffodil-geography-state-testing.js +0 -49
  237. package/fesm2015/daffodil-geography-state-testing.js.map +0 -1
  238. package/fesm2015/daffodil-geography-state.js.map +0 -1
  239. package/fesm2015/daffodil-geography-testing.js +0 -105
  240. package/fesm2015/daffodil-geography-testing.js.map +0 -1
  241. package/fesm2015/daffodil-geography.js.map +0 -1
  242. package/state/daffodil-geography-state.metadata.json +0 -1
  243. package/state/testing/daffodil-geography-state-testing.metadata.json +0 -1
  244. package/testing/daffodil-geography-testing.metadata.json +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daffodil-geography-driver.mjs","sources":["../../../libs/geography/driver/src/errors/country-not-found.ts","../../../libs/geography/driver/src/errors/invalid-api-response.ts","../../../libs/geography/driver/src/interfaces/geography-service.interface.ts","../../../libs/geography/driver/src/daffodil-geography-driver.ts"],"sourcesContent":["import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport class DaffCountryNotFoundError extends DaffInheritableError implements DaffError {\n public readonly code: string = 'DAFF_GEOGRAPHY_COUNTRY_NOT_FOUND';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import {\n DaffError,\n DaffInheritableError,\n} from '@daffodil/core';\n\nexport class DaffGeographyInvalidAPIResponseError extends DaffInheritableError implements DaffError {\n public readonly code: string = 'DAFF_GEOGRAPHY_INVALID_API_RESPONSE';\n\n constructor(public message: string) {\n super(message);\n }\n}\n","import { InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { DaffCountry } from '@daffodil/geography';\n\nexport const DaffGeographyDriver = new InjectionToken<DaffGeographyServiceInterface>('DaffGeographyDriver');\n\nexport interface DaffGeographyServiceInterface<T extends DaffCountry = DaffCountry> {\n\t/**\n\t * Retrieves the list of countries available to the given store.\n\t */\n\tlist(): Observable<T[]>;\n\n\t/**\n\t * Retrieve precise information about a specific country.\n\t */\n\tget(id: T['id']): Observable<T>;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAKM,MAAO,wBAAyB,SAAQ,oBAAoB,CAAA;AAGhE,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;AADE,QAAA,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;AAFlB,QAAA,IAAI,CAAA,IAAA,GAAW,kCAAkC,CAAC;KAIjE;AACF;;ACNK,MAAO,oCAAqC,SAAQ,oBAAoB,CAAA;AAG5E,IAAA,WAAA,CAAmB,OAAe,EAAA;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;AADE,QAAA,IAAO,CAAA,OAAA,GAAP,OAAO,CAAQ;AAFlB,QAAA,IAAI,CAAA,IAAA,GAAW,qCAAqC,CAAC;KAIpE;AACF;;MCNY,mBAAmB,GAAG,IAAI,cAAc,CAAgC,qBAAqB;;ACL1G;;AAEG;;;;"}
@@ -0,0 +1,58 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, NgModule } from '@angular/core';
3
+ import { DaffGeographyFacade } from '@daffodil/geography/state';
4
+ import { BehaviorSubject } from 'rxjs';
5
+
6
+ /**
7
+ * @inheritdoc
8
+ */
9
+ class MockDaffGeographyFacade {
10
+ constructor() {
11
+ this.loading$ = new BehaviorSubject(null);
12
+ this.errors$ = new BehaviorSubject([]);
13
+ this.countries$ = new BehaviorSubject([]);
14
+ this.countryIds$ = new BehaviorSubject([]);
15
+ this.countryCount$ = new BehaviorSubject(null);
16
+ this.countryEntities$ = new BehaviorSubject(null);
17
+ }
18
+ getCountry(id) {
19
+ return new BehaviorSubject(null);
20
+ }
21
+ getCountrySubdivisions(id) {
22
+ return new BehaviorSubject([]);
23
+ }
24
+ isCountryFullyLoaded(id) {
25
+ return new BehaviorSubject(false);
26
+ }
27
+ dispatch(action) { }
28
+ ;
29
+ }
30
+ /** @nocollapse */ /** @nocollapse */ MockDaffGeographyFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MockDaffGeographyFacade, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
31
+ /** @nocollapse */ /** @nocollapse */ MockDaffGeographyFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MockDaffGeographyFacade, providedIn: 'root' });
32
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: MockDaffGeographyFacade, decorators: [{
33
+ type: Injectable,
34
+ args: [{ providedIn: 'root' }]
35
+ }] });
36
+
37
+ class DaffGeographyTestingModule {
38
+ }
39
+ /** @nocollapse */ /** @nocollapse */ DaffGeographyTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
40
+ /** @nocollapse */ /** @nocollapse */ DaffGeographyTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyTestingModule });
41
+ /** @nocollapse */ /** @nocollapse */ DaffGeographyTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyTestingModule, providers: [
42
+ { provide: DaffGeographyFacade, useExisting: MockDaffGeographyFacade },
43
+ ] });
44
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyTestingModule, decorators: [{
45
+ type: NgModule,
46
+ args: [{
47
+ providers: [
48
+ { provide: DaffGeographyFacade, useExisting: MockDaffGeographyFacade },
49
+ ],
50
+ }]
51
+ }] });
52
+
53
+ /**
54
+ * Generated bundle index. Do not edit.
55
+ */
56
+
57
+ export { DaffGeographyTestingModule, MockDaffGeographyFacade };
58
+ //# sourceMappingURL=daffodil-geography-state-testing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daffodil-geography-state-testing.mjs","sources":["../../../libs/geography/state/testing/src/mock-geography-facade.ts","../../../libs/geography/state/testing/src/geography-testing.module.ts","../../../libs/geography/state/testing/src/daffodil-geography-state-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Dictionary } from '@ngrx/entity';\nimport { Action } from '@ngrx/store';\nimport { BehaviorSubject } from 'rxjs';\n\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffCountry } from '@daffodil/geography';\nimport { DaffGeographyFacadeInterface } from '@daffodil/geography/state';\n\n/**\n * @inheritdoc\n */\n@Injectable({ providedIn: 'root' })\nexport class MockDaffGeographyFacade implements DaffGeographyFacadeInterface {\n loading$: BehaviorSubject<boolean> = new BehaviorSubject(null);\n errors$: BehaviorSubject<DaffStateError[]> = new BehaviorSubject([]);\n countries$: BehaviorSubject<DaffCountry[]> = new BehaviorSubject([]);\n countryIds$: BehaviorSubject<DaffCountry['id'][]> = new BehaviorSubject([]);\n countryCount$: BehaviorSubject<number> = new BehaviorSubject(null);\n countryEntities$: BehaviorSubject<Dictionary<DaffCountry>> = new BehaviorSubject(null);\n\n getCountry(id) {\n return new BehaviorSubject(null);\n }\n\n getCountrySubdivisions(id) {\n return new BehaviorSubject([]);\n }\n\n isCountryFullyLoaded(id) {\n return new BehaviorSubject(false);\n }\n\n dispatch(action: Action) {};\n}\n","import { NgModule } from '@angular/core';\n\nimport { DaffGeographyFacade } from '@daffodil/geography/state';\n\nimport { MockDaffGeographyFacade } from './mock-geography-facade';\n\n@NgModule({\n providers: [\n { provide: DaffGeographyFacade, useExisting: MockDaffGeographyFacade },\n ],\n})\nexport class DaffGeographyTestingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AASA;;AAEG;MAEU,uBAAuB,CAAA;AADpC,IAAA,WAAA,GAAA;QAEE,IAAA,CAAA,QAAQ,GAA6B,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC;QAC/D,IAAA,CAAA,OAAO,GAAsC,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;QACrE,IAAA,CAAA,UAAU,GAAmC,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;QACrE,IAAA,CAAA,WAAW,GAAyC,IAAI,eAAe,CAAC,EAAE,CAAC,CAAC;QAC5E,IAAA,CAAA,aAAa,GAA4B,IAAI,eAAe,CAAC,IAAI,CAAC,CAAC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A,EAAA,CAAA,CAAA;2FAEU,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBALtC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,uBAAuB,EAAE;AACvE,qBAAA;iBACF,CAAA;;;ACVD;;AAEG;;;;"}
@@ -1,7 +1,10 @@
1
- import { createFeatureSelector, createSelector, defaultMemoize, select, Store, StoreModule } from '@ngrx/store';
1
+ import * as i1 from '@ngrx/store';
2
+ import { createFeatureSelector, createSelector, defaultMemoize, select, StoreModule } from '@ngrx/store';
2
3
  import { createEntityAdapter } from '@ngrx/entity';
3
- import { ɵɵdefineInjectable, ɵɵinject, Injectable, Inject, NgModule } from '@angular/core';
4
- import { ofType, Actions, Effect, EffectsModule } from '@ngrx/effects';
4
+ import * as i0 from '@angular/core';
5
+ import { Injectable, Inject, NgModule } from '@angular/core';
6
+ import * as i1$1 from '@ngrx/effects';
7
+ import { createEffect, ofType, EffectsModule } from '@ngrx/effects';
5
8
  import { of } from 'rxjs';
6
9
  import { switchMap, map, catchError } from 'rxjs/operators';
7
10
  import { DAFF_GEOGRAPHY_ERROR_MATCHER } from '@daffodil/geography';
@@ -52,14 +55,13 @@ class DaffCountryListFailure {
52
55
  }
53
56
  }
54
57
 
55
- const ɵ0 = () => {
56
- let cache;
57
- return () => cache = cache || createEntityAdapter();
58
- };
59
58
  /**
60
59
  * Country Adapter for changing/overwriting entity state.
61
60
  */
62
- const getCountryAdapter = (ɵ0)();
61
+ const getCountryAdapter = (() => {
62
+ let cache;
63
+ return () => cache = cache || createEntityAdapter();
64
+ })();
63
65
 
64
66
  /**
65
67
  * Initial state for country entity state.
@@ -118,13 +120,12 @@ const daffGeographyReducers = {
118
120
 
119
121
  const DAFF_GEOGRAPHY_STORE_FEATURE_KEY = 'daffGeography';
120
122
 
121
- const ɵ0$1 = () => {
123
+ const getDaffGeographyFeatureStateSelector = (() => {
122
124
  let cache;
123
125
  return () => cache = cache || {
124
126
  selectGeographyFeatureState: createFeatureSelector(DAFF_GEOGRAPHY_STORE_FEATURE_KEY),
125
127
  };
126
- };
127
- const getDaffGeographyFeatureStateSelector = (ɵ0$1)();
128
+ })();
128
129
 
129
130
  const createCountryEntitySelectors = () => {
130
131
  const { selectGeographyFeatureState } = getDaffGeographyFeatureStateSelector();
@@ -166,12 +167,10 @@ const createCountryEntitySelectors = () => {
166
167
  selectIsCountryFullyLoaded,
167
168
  };
168
169
  };
169
- const ɵ0$2 = createCountryEntitySelectors;
170
- const ɵ1 = () => {
170
+ const getDaffCountryEntitySelectors = (() => {
171
171
  let cache;
172
172
  return () => cache = cache || createCountryEntitySelectors();
173
- };
174
- const getDaffCountryEntitySelectors = (ɵ1)();
173
+ })();
175
174
 
176
175
  const createGeographySelectors = () => {
177
176
  const { selectGeographyFeatureState } = getDaffGeographyFeatureStateSelector();
@@ -184,18 +183,15 @@ const createGeographySelectors = () => {
184
183
  selectGeographyErrors,
185
184
  };
186
185
  };
187
- const ɵ0$3 = createGeographySelectors;
188
- const ɵ1$1 = () => {
186
+ const getGeographySelectors = (() => {
189
187
  let cache;
190
188
  return () => cache = cache || createGeographySelectors();
191
- };
192
- const getGeographySelectors = (ɵ1$1)();
189
+ })();
193
190
 
194
- const ɵ0$4 = () => {
191
+ const getDaffGeographySelectors = (() => {
195
192
  let cache;
196
193
  return () => cache = cache || Object.assign(Object.assign(Object.assign({}, getGeographySelectors()), getDaffCountryEntitySelectors()), getDaffGeographyFeatureStateSelector());
197
- };
198
- const getDaffGeographySelectors = (ɵ0$4)();
194
+ })();
199
195
 
200
196
  /**
201
197
  * @inheritdoc
@@ -227,69 +223,63 @@ class DaffGeographyFacade {
227
223
  this.store.dispatch(action);
228
224
  }
229
225
  }
230
- /** @nocollapse */ DaffGeographyFacade.ɵprov = ɵɵdefineInjectable({ factory: function DaffGeographyFacade_Factory() { return new DaffGeographyFacade(ɵɵinject(Store)); }, token: DaffGeographyFacade, providedIn: "root" });
231
- DaffGeographyFacade.decorators = [
232
- { type: Injectable, args: [{
233
- providedIn: 'root',
234
- },] }
235
- ];
236
- /** @nocollapse */
237
- DaffGeographyFacade.ctorParameters = () => [
238
- { type: Store }
239
- ];
226
+ /** @nocollapse */ /** @nocollapse */ DaffGeographyFacade.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyFacade, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable });
227
+ /** @nocollapse */ /** @nocollapse */ DaffGeographyFacade.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyFacade, providedIn: 'root' });
228
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyFacade, decorators: [{
229
+ type: Injectable,
230
+ args: [{
231
+ providedIn: 'root',
232
+ }]
233
+ }], ctorParameters: function () { return [{ type: i1.Store }]; } });
240
234
 
241
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
242
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
243
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
244
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
245
- return c > 3 && r && Object.defineProperty(target, key, r), r;
246
- };
247
- var __metadata = (this && this.__metadata) || function (k, v) {
248
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
249
- };
250
235
  class DaffGeographyEffects {
251
236
  constructor(actions$, driver, errorMatcher) {
252
237
  this.actions$ = actions$;
253
238
  this.driver = driver;
254
239
  this.errorMatcher = errorMatcher;
255
- this.get$ = this.actions$.pipe(ofType(DaffGeographyActionTypes.CountryLoadAction), switchMap((action) => this.driver.get(action.payload).pipe(map(resp => new DaffCountryLoadSuccess(resp)), catchError((error) => of(new DaffCountryLoadFailure(this.errorMatcher(error)))))));
256
- this.list$ = this.actions$.pipe(ofType(DaffGeographyActionTypes.CountryListAction), switchMap((action) => this.driver.list().pipe(map(resp => new DaffCountryListSuccess(resp)), catchError((error) => of(new DaffCountryListFailure(this.errorMatcher(error)))))));
240
+ this.get$ = createEffect(() => this.actions$.pipe(ofType(DaffGeographyActionTypes.CountryLoadAction), switchMap((action) => this.driver.get(action.payload).pipe(map(resp => new DaffCountryLoadSuccess(resp)), catchError((error) => of(new DaffCountryLoadFailure(this.errorMatcher(error))))))));
241
+ this.list$ = createEffect(() => this.actions$.pipe(ofType(DaffGeographyActionTypes.CountryListAction), switchMap((action) => this.driver.list().pipe(map(resp => new DaffCountryListSuccess(resp)), catchError((error) => of(new DaffCountryListFailure(this.errorMatcher(error))))))));
257
242
  }
258
243
  }
259
- DaffGeographyEffects.decorators = [
260
- { type: Injectable }
261
- ];
262
- /** @nocollapse */
263
- DaffGeographyEffects.ctorParameters = () => [
264
- { type: Actions },
265
- { type: undefined, decorators: [{ type: Inject, args: [DaffGeographyDriver,] }] },
266
- { type: undefined, decorators: [{ type: Inject, args: [DAFF_GEOGRAPHY_ERROR_MATCHER,] }] }
267
- ];
268
- __decorate([
269
- Effect(),
270
- __metadata("design:type", Object)
271
- ], DaffGeographyEffects.prototype, "get$", void 0);
272
- __decorate([
273
- Effect(),
274
- __metadata("design:type", Object)
275
- ], DaffGeographyEffects.prototype, "list$", void 0);
244
+ /** @nocollapse */ /** @nocollapse */ DaffGeographyEffects.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyEffects, deps: [{ token: i1$1.Actions }, { token: DaffGeographyDriver }, { token: DAFF_GEOGRAPHY_ERROR_MATCHER }], target: i0.ɵɵFactoryTarget.Injectable });
245
+ /** @nocollapse */ /** @nocollapse */ DaffGeographyEffects.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyEffects });
246
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyEffects, decorators: [{
247
+ type: Injectable
248
+ }], ctorParameters: function () {
249
+ return [{ type: i1$1.Actions }, { type: undefined, decorators: [{
250
+ type: Inject,
251
+ args: [DaffGeographyDriver]
252
+ }] }, { type: undefined, decorators: [{
253
+ type: Inject,
254
+ args: [DAFF_GEOGRAPHY_ERROR_MATCHER]
255
+ }] }];
256
+ } });
276
257
 
277
258
  class DaffGeographyStateModule {
278
259
  }
279
- DaffGeographyStateModule.decorators = [
280
- { type: NgModule, args: [{
281
- imports: [
282
- StoreModule.forFeature(DAFF_GEOGRAPHY_STORE_FEATURE_KEY, daffGeographyReducers),
283
- EffectsModule.forFeature([
284
- DaffGeographyEffects,
285
- ]),
286
- ],
287
- },] }
288
- ];
260
+ /** @nocollapse */ /** @nocollapse */ DaffGeographyStateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyStateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
261
+ /** @nocollapse */ /** @nocollapse */ DaffGeographyStateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyStateModule, imports: [i1.StoreFeatureModule, i1$1.EffectsFeatureModule] });
262
+ /** @nocollapse */ /** @nocollapse */ DaffGeographyStateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyStateModule, imports: [[
263
+ StoreModule.forFeature(DAFF_GEOGRAPHY_STORE_FEATURE_KEY, daffGeographyReducers),
264
+ EffectsModule.forFeature([
265
+ DaffGeographyEffects,
266
+ ]),
267
+ ]] });
268
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyStateModule, decorators: [{
269
+ type: NgModule,
270
+ args: [{
271
+ imports: [
272
+ StoreModule.forFeature(DAFF_GEOGRAPHY_STORE_FEATURE_KEY, daffGeographyReducers),
273
+ EffectsModule.forFeature([
274
+ DaffGeographyEffects,
275
+ ]),
276
+ ],
277
+ }]
278
+ }] });
289
279
 
290
280
  /**
291
281
  * Generated bundle index. Do not edit.
292
282
  */
293
283
 
294
- export { DAFF_GEOGRAPHY_STORE_FEATURE_KEY, DaffCountryList, DaffCountryListFailure, DaffCountryListSuccess, DaffCountryLoad, DaffCountryLoadFailure, DaffCountryLoadSuccess, DaffGeographyActionTypes, DaffGeographyFacade, DaffGeographyStateModule, daffCountryEntitiesInitialState, daffCountryEntitiesReducer, daffGeographyInitialState, daffGeographyReducer, daffGeographyReducers, getCountryAdapter, getDaffGeographySelectors, ɵ0$4 as ɵ0, DaffGeographyEffects as ɵa };
295
- //# sourceMappingURL=daffodil-geography-state.js.map
284
+ export { DAFF_GEOGRAPHY_STORE_FEATURE_KEY, DaffCountryList, DaffCountryListFailure, DaffCountryListSuccess, DaffCountryLoad, DaffCountryLoadFailure, DaffCountryLoadSuccess, DaffGeographyActionTypes, DaffGeographyFacade, DaffGeographyStateModule, daffCountryEntitiesInitialState, daffCountryEntitiesReducer, daffGeographyInitialState, daffGeographyReducer, daffGeographyReducers, getCountryAdapter, getDaffGeographySelectors };
285
+ //# sourceMappingURL=daffodil-geography-state.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daffodil-geography-state.mjs","sources":["../../../libs/geography/state/src/actions/geography.actions.ts","../../../libs/geography/state/src/reducers/country-entities/country-entities-adapter.ts","../../../libs/geography/state/src/reducers/country-entities/country-entities-initial-state.ts","../../../libs/geography/state/src/reducers/country-entities/country-entities.reducer.ts","../../../libs/geography/state/src/reducers/geography/geography-initial-state.ts","../../../libs/geography/state/src/reducers/geography/geography.reducer.ts","../../../libs/geography/state/src/reducers/geography-reducers.ts","../../../libs/geography/state/src/reducers/geography-store-feature-key.ts","../../../libs/geography/state/src/selectors/geography-feature.selector.ts","../../../libs/geography/state/src/selectors/country-entities.selector.ts","../../../libs/geography/state/src/selectors/geography.selector.ts","../../../libs/geography/state/src/selectors/geography-all.selector.ts","../../../libs/geography/state/src/facades/geography/geography.facade.ts","../../../libs/geography/state/src/effects/geography.effects.ts","../../../libs/geography/state/src/geography-state.module.ts","../../../libs/geography/state/src/daffodil-geography-state.ts"],"sourcesContent":["import { Action } from '@ngrx/store';\n\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffCountry } from '@daffodil/geography';\n\nexport enum DaffGeographyActionTypes {\n CountryLoadAction = '[DaffGeography] Country Load Action',\n CountryLoadSuccessAction = '[DaffGeography] Country Load Success Action',\n CountryLoadFailureAction = '[DaffGeography] Country Load Failure Action',\n CountryListAction = '[DaffGeography] Country List Action',\n CountryListSuccessAction = '[DaffGeography] Country List Success Action',\n CountryListFailureAction = '[DaffGeography] Country List Failure Action',\n}\n\nexport class DaffCountryLoad<T extends DaffCountry> implements Action {\n readonly type = DaffGeographyActionTypes.CountryLoadAction;\n\n constructor(public payload: T['id']) {}\n}\n\nexport class DaffCountryLoadSuccess<T extends DaffCountry> implements Action {\n readonly type = DaffGeographyActionTypes.CountryLoadSuccessAction;\n\n constructor(public payload: T) {}\n}\n\nexport class DaffCountryLoadFailure implements Action {\n readonly type = DaffGeographyActionTypes.CountryLoadFailureAction;\n\n constructor(public payload: DaffStateError) {}\n}\n\nexport class DaffCountryList implements Action {\n readonly type = DaffGeographyActionTypes.CountryListAction;\n}\n\nexport class DaffCountryListSuccess<T extends DaffCountry> implements Action {\n readonly type = DaffGeographyActionTypes.CountryListSuccessAction;\n\n constructor(public payload: T[]) {}\n}\n\nexport class DaffCountryListFailure implements Action {\n readonly type = DaffGeographyActionTypes.CountryListFailureAction;\n\n constructor(public payload: DaffStateError) {}\n}\n\nexport type DaffGeographyActions<T extends DaffCountry> =\n | DaffCountryLoad<T>\n | DaffCountryLoadSuccess<T>\n | DaffCountryLoadFailure\n | DaffCountryList\n | DaffCountryListSuccess<T>\n | DaffCountryListFailure;\n","import {\n EntityAdapter,\n createEntityAdapter,\n} from '@ngrx/entity';\n\nimport { DaffCountry } from '@daffodil/geography';\n\n/**\n * Country Adapter for changing/overwriting entity state.\n */\nexport const getCountryAdapter = (() => {\n let cache;\n return <T extends DaffCountry = DaffCountry>(): EntityAdapter<T> =>\n cache = cache || createEntityAdapter<T>();\n})();\n","import { getCountryAdapter } from './country-entities-adapter';\nimport { DaffCountryEntityState } from './country-entities-state.interface';\n\n/**\n * Initial state for country entity state.\n */\nexport const daffCountryEntitiesInitialState: DaffCountryEntityState<any> = getCountryAdapter().getInitialState();\n","import { DaffCountry } from '@daffodil/geography';\n\nimport {\n DaffGeographyActions,\n DaffGeographyActionTypes,\n} from '../../actions/public_api';\nimport { getCountryAdapter } from './country-entities-adapter';\nimport { daffCountryEntitiesInitialState } from './country-entities-initial-state';\nimport { DaffCountryEntityState } from './country-entities-state.interface';\n\n/**\n * Reducer function that catches actions and changes/overwrites country entities state.\n */\nexport function daffCountryEntitiesReducer<T extends DaffCountry = DaffCountry>(\n state = daffCountryEntitiesInitialState,\n action: DaffGeographyActions<T>,\n): DaffCountryEntityState<T> {\n const adapter = getCountryAdapter<T>();\n\n switch (action.type) {\n case DaffGeographyActionTypes.CountryLoadSuccessAction:\n return adapter.upsertOne({\n ...action.payload,\n loaded: true,\n }, state);\n\n case DaffGeographyActionTypes.CountryListSuccessAction:\n return adapter.upsertMany(\n action.payload.map(country => ({\n ...country,\n // defer to the loaded state of the country already in state (if it exists) but init field to false if it does not\n loaded: (state.entities[country.id] && state.entities[country.id].loaded) || false,\n // if the country coming in has no subdivisions and the same country in state does, use the subdivisions in state\n subdivisions: country.subdivisions.length === 0 && state.entities[country.id] && state.entities[country.id].subdivisions.length > 0\n ? state.entities[country.id].subdivisions\n : country.subdivisions,\n })),\n state,\n );\n\n default:\n return state;\n }\n}\n","import { DaffGeographyReducerState } from './geography-state.interface';\n\nexport const daffGeographyInitialState: DaffGeographyReducerState = {\n loading: false,\n errors: [],\n};\n","import { DaffCountry } from '@daffodil/geography';\n\nimport {\n DaffGeographyActions,\n DaffGeographyActionTypes,\n} from '../../actions/public_api';\nimport { daffGeographyInitialState } from './geography-initial-state';\nimport { DaffGeographyReducerState } from './geography-state.interface';\n\nexport function daffGeographyReducer<T extends DaffCountry>(\n state = daffGeographyInitialState,\n action: DaffGeographyActions<T>,\n): DaffGeographyReducerState {\n switch (action.type) {\n case DaffGeographyActionTypes.CountryLoadAction:\n case DaffGeographyActionTypes.CountryListAction:\n return { ...state, loading: true };\n\n case DaffGeographyActionTypes.CountryLoadSuccessAction:\n case DaffGeographyActionTypes.CountryListSuccessAction:\n return {\n ...state,\n errors: [],\n loading: false,\n };\n\n case DaffGeographyActionTypes.CountryLoadFailureAction:\n case DaffGeographyActionTypes.CountryListFailureAction:\n return {\n ...state,\n errors: [\n ...state.errors,\n action.payload,\n ],\n loading: false,\n };\n\n default:\n return state;\n }\n}\n","import { daffCountryEntitiesReducer } from './country-entities/country-entities.reducer';\nimport { daffGeographyReducer } from './geography/geography.reducer';\n\nexport const daffGeographyReducers = {\n geography: daffGeographyReducer,\n countries: daffCountryEntitiesReducer,\n};\n","export const DAFF_GEOGRAPHY_STORE_FEATURE_KEY = 'daffGeography';\n","import {\n createFeatureSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffCountry } from '@daffodil/geography';\n\nimport { DaffGeographyStateRootSlice } from '../reducers/geography-reducers-state.interface';\nimport {\n DaffGeographyFeatureState,\n DAFF_GEOGRAPHY_STORE_FEATURE_KEY,\n} from '../reducers/public_api';\n\nexport interface DaffGeographyFeatureSelector<T extends DaffCountry = DaffCountry> {\n selectGeographyFeatureState: MemoizedSelector<DaffGeographyStateRootSlice<T>, DaffGeographyFeatureState<T>>;\n}\n\nexport const getDaffGeographyFeatureStateSelector = (() => {\n let cache;\n return <T extends DaffCountry = DaffCountry>(): DaffGeographyFeatureSelector<T> =>\n cache = cache || {\n selectGeographyFeatureState: createFeatureSelector<DaffGeographyFeatureState<T>>(DAFF_GEOGRAPHY_STORE_FEATURE_KEY),\n };\n})();\n","import { Dictionary } from '@ngrx/entity';\nimport {\n createSelector,\n MemoizedSelector,\n defaultMemoize,\n} from '@ngrx/store';\n\nimport { DaffCountry } from '@daffodil/geography';\n\nimport { DaffGeographyStateRootSlice } from '../reducers/geography-reducers-state.interface';\nimport {\n getCountryAdapter,\n DaffCountryEntityState,\n} from '../reducers/public_api';\nimport { getDaffGeographyFeatureStateSelector } from './geography-feature.selector';\n\nexport interface DaffCountryEntitySelectors<T extends DaffCountry = DaffCountry> {\n selectCountryEntitiesState: MemoizedSelector<DaffGeographyStateRootSlice<T>, DaffCountryEntityState<T>>;\n selectCountryIds: MemoizedSelector<DaffGeographyStateRootSlice<T>, T['id'][]>;\n selectCountryEntities: MemoizedSelector<DaffGeographyStateRootSlice<T>, Dictionary<T>>;\n selectAllCountries: MemoizedSelector<DaffGeographyStateRootSlice<T>, T[]>;\n selectCountryTotal: MemoizedSelector<DaffGeographyStateRootSlice<T>, number>;\n selectCountry: (id: T['id']) => MemoizedSelector<DaffGeographyStateRootSlice<T>, T>;\n selectCountrySubdivisions: (id: T['id']) => MemoizedSelector<DaffGeographyStateRootSlice<T>, T['subdivisions']>;\n selectIsCountryFullyLoaded: (id: T['id']) => MemoizedSelector<DaffGeographyStateRootSlice<T>, boolean>;\n}\n\nconst createCountryEntitySelectors = <T extends DaffCountry = DaffCountry>() => {\n const { selectGeographyFeatureState } = getDaffGeographyFeatureStateSelector<T>();\n const selectCountryEntitiesState = createSelector(\n selectGeographyFeatureState,\n state => state.countries,\n );\n const { selectIds, selectEntities, selectAll, selectTotal } = getCountryAdapter<T>().getSelectors(selectCountryEntitiesState);\n\n const selectCountry = defaultMemoize((countryId: T['id']) => createSelector(\n selectEntities,\n (countries: Dictionary<T>) => countries[countryId],\n )).memoized;\n\n const selectCountrySubdivisions = defaultMemoize((countryId: T['id']) => createSelector(\n selectCountry(countryId),\n (country: T) => country?.subdivisions || [],\n )).memoized;\n\n const selectIsCountryFullyLoaded = defaultMemoize((countryId: T['id']) => createSelector(\n selectCountry(countryId),\n (country: T) => country?.loaded,\n )).memoized;\n\n return {\n selectCountryEntitiesState,\n /**\n * Selector for country IDs.\n */\n selectCountryIds: selectIds,\n /**\n * Selector for country entities.\n */\n selectCountryEntities: selectEntities,\n /**\n * Selector for all countries.\n */\n selectAllCountries: selectAll,\n /**\n * Selector for total number of countries.\n */\n selectCountryTotal: selectTotal,\n /**\n * Selector for a specific country.\n */\n selectCountry,\n /**\n * Selector for a specific country's subdivisions.\n */\n selectCountrySubdivisions,\n /**\n * Selector for checking if a country has been fully loaded.\n * If true, then a country's subdivisions will be populated if any exist.\n */\n selectIsCountryFullyLoaded,\n };\n};\n\nexport const getDaffCountryEntitySelectors = (() => {\n let cache;\n return <T extends DaffCountry>(): DaffCountryEntitySelectors<T> =>\n cache = cache || createCountryEntitySelectors<T>();\n})();\n\n","import {\n createSelector,\n MemoizedSelector,\n} from '@ngrx/store';\n\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffCountry } from '@daffodil/geography';\n\nimport { DaffGeographyStateRootSlice } from '../reducers/geography-reducers-state.interface';\nimport { DaffGeographyReducerState } from '../reducers/public_api';\nimport { getDaffGeographyFeatureStateSelector } from './geography-feature.selector';\n\nexport interface DaffGeographySelectors {\n selectGeographyState: MemoizedSelector<DaffGeographyStateRootSlice, DaffGeographyReducerState>;\n selectGeographyLoading: MemoizedSelector<DaffGeographyStateRootSlice, boolean>;\n selectGeographyErrors: MemoizedSelector<DaffGeographyStateRootSlice, DaffStateError[]>;\n}\n\nconst createGeographySelectors = <T extends DaffCountry = DaffCountry>() => {\n const { selectGeographyFeatureState } = getDaffGeographyFeatureStateSelector<T>();\n const selectGeographyState = createSelector(\n selectGeographyFeatureState,\n state => state.geography,\n );\n\n const selectGeographyLoading = createSelector(\n selectGeographyState,\n state => state.loading,\n );\n\n const selectGeographyErrors = createSelector(\n selectGeographyState,\n state => state.errors,\n );\n\n return {\n selectGeographyState,\n selectGeographyLoading,\n selectGeographyErrors,\n };\n};\n\nexport const getGeographySelectors = (() => {\n let cache;\n return <T extends DaffCountry = DaffCountry>(): DaffGeographySelectors =>\n cache = cache || createGeographySelectors<T>();\n})();\n","import { DaffCountry } from '@daffodil/geography';\n\nimport {\n DaffCountryEntitySelectors,\n getDaffCountryEntitySelectors,\n} from './country-entities.selector';\nimport {\n DaffGeographyFeatureSelector,\n getDaffGeographyFeatureStateSelector,\n} from './geography-feature.selector';\nimport {\n DaffGeographySelectors,\n getGeographySelectors,\n} from './geography.selector';\n\nexport interface DaffGeographyAllSelectors<T extends DaffCountry = DaffCountry> extends\n DaffCountryEntitySelectors<T>,\n DaffGeographySelectors,\n DaffGeographyFeatureSelector<T> {}\n\nexport const getDaffGeographySelectors = (() => {\n let cache;\n return <T extends DaffCountry = DaffCountry>(): DaffGeographyAllSelectors<T> =>\n cache = cache || {\n ...getGeographySelectors<T>(),\n ...getDaffCountryEntitySelectors<T>(),\n ...getDaffGeographyFeatureStateSelector<T>(),\n };\n})();\n","import { Injectable } from '@angular/core';\nimport { Dictionary } from '@ngrx/entity';\nimport {\n Action,\n Store,\n select,\n} from '@ngrx/store';\nimport { Observable } from 'rxjs';\n\nimport { DaffStateError } from '@daffodil/core/state';\nimport { DaffCountry } from '@daffodil/geography';\n\nimport { DaffGeographyStateRootSlice } from '../../reducers/public_api';\nimport {\n getDaffGeographySelectors,\n DaffGeographyAllSelectors,\n} from '../../selectors/public_api';\nimport { DaffGeographyFacadeInterface } from './geography-facade.interface';\n\n/**\n * @inheritdoc\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffGeographyFacade<T extends DaffCountry = DaffCountry> implements DaffGeographyFacadeInterface<T> {\n loading$: Observable<boolean>;\n errors$: Observable<DaffStateError[]>;\n\n countries$: Observable<T[]>;\n countryIds$: Observable<T['id'][]>;\n countryCount$: Observable<number>;\n countryEntities$: Observable<Dictionary<T>>;\n\n private _selectCountry: DaffGeographyAllSelectors<T>['selectCountry'];\n private _selectCountrySubdivisions: DaffGeographyAllSelectors<T>['selectCountrySubdivisions'];\n private _selectIsCountryFullyLoaded: DaffGeographyAllSelectors<T>['selectIsCountryFullyLoaded'];\n\n constructor(private store: Store<DaffGeographyStateRootSlice<T>>) {\n const {\n selectCountryIds,\n selectCountryEntities,\n selectAllCountries,\n selectCountryTotal,\n selectGeographyLoading,\n selectGeographyErrors,\n selectCountry,\n selectCountrySubdivisions,\n selectIsCountryFullyLoaded,\n } = getDaffGeographySelectors<T>();\n\n this._selectCountry = selectCountry;\n this._selectCountrySubdivisions = selectCountrySubdivisions;\n this._selectIsCountryFullyLoaded = selectIsCountryFullyLoaded;\n\n this.loading$ = this.store.pipe(select(selectGeographyLoading));\n this.errors$ = this.store.pipe(select(selectGeographyErrors));\n\n this.countries$ = this.store.pipe(select(selectAllCountries));\n this.countryIds$ = this.store.pipe(select(selectCountryIds));\n this.countryCount$ = this.store.pipe(select(selectCountryTotal));\n this.countryEntities$ = this.store.pipe(select(selectCountryEntities));\n }\n\n getCountry(id: T['id']): Observable<T> {\n return this.store.pipe(select(this._selectCountry(id)));\n }\n\n getCountrySubdivisions(id: T['id']): Observable<T['subdivisions']> {\n return this.store.pipe(select(this._selectCountrySubdivisions(id)));\n }\n\n isCountryFullyLoaded(id: T['id']): Observable<boolean> {\n return this.store.pipe(select(this._selectIsCountryFullyLoaded(id)));\n }\n\n dispatch(action: Action) {\n this.store.dispatch(action);\n }\n}\n","import {\n Injectable,\n Inject,\n} from '@angular/core';\nimport {\n Actions,\n createEffect,\n ofType,\n} from '@ngrx/effects';\nimport { of } from 'rxjs';\nimport {\n switchMap,\n map,\n catchError,\n} from 'rxjs/operators';\n\nimport { DaffError } from '@daffodil/core';\nimport { ErrorTransformer } from '@daffodil/core/state';\nimport {\n DaffCountry,\n DAFF_GEOGRAPHY_ERROR_MATCHER,\n} from '@daffodil/geography';\nimport {\n DaffGeographyServiceInterface,\n DaffGeographyDriver,\n} from '@daffodil/geography/driver';\n\nimport {\n DaffGeographyActionTypes,\n DaffCountryLoad,\n DaffCountryLoadSuccess,\n DaffCountryLoadFailure,\n DaffCountryList,\n DaffCountryListSuccess,\n DaffCountryListFailure,\n} from '../actions/public_api';\n\n@Injectable()\nexport class DaffGeographyEffects<T extends DaffCountry> {\n constructor(\n private actions$: Actions,\n @Inject(DaffGeographyDriver) private driver: DaffGeographyServiceInterface<T>,\n @Inject(DAFF_GEOGRAPHY_ERROR_MATCHER) private errorMatcher: ErrorTransformer,\n ) {}\n\n\n get$ = createEffect(() => this.actions$.pipe(\n ofType(DaffGeographyActionTypes.CountryLoadAction),\n switchMap((action: DaffCountryLoad<T>) => this.driver.get(action.payload).pipe(\n map(resp => new DaffCountryLoadSuccess(resp)),\n catchError((error: DaffError) => of(new DaffCountryLoadFailure(this.errorMatcher(error)))),\n )),\n ));\n\n\n list$ = createEffect(() => this.actions$.pipe(\n ofType(DaffGeographyActionTypes.CountryListAction),\n switchMap((action: DaffCountryList) => this.driver.list().pipe(\n map(resp => new DaffCountryListSuccess(resp)),\n catchError((error: DaffError) => of(new DaffCountryListFailure(this.errorMatcher(error)))),\n )),\n ));\n}\n","import { NgModule } from '@angular/core';\nimport { EffectsModule } from '@ngrx/effects';\nimport { StoreModule } from '@ngrx/store';\n\nimport { DaffGeographyEffects } from './effects/geography.effects';\nimport {\n daffGeographyReducers,\n DAFF_GEOGRAPHY_STORE_FEATURE_KEY,\n} from './reducers/public_api';\n\n@NgModule({\n imports: [\n StoreModule.forFeature(DAFF_GEOGRAPHY_STORE_FEATURE_KEY, daffGeographyReducers),\n EffectsModule.forFeature([\n DaffGeographyEffects,\n ]),\n ],\n})\nexport class DaffGeographyStateModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;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AAqB,CAAC;wBAC/E,aAAa,CAAC,UAAU,CAAC;4BACvB,oBAAoB;yBACrB,CAAC;AACH,qBAAA;iBACF,CAAA;;;ACjBD;;AAEG;;;;"}
@@ -0,0 +1,106 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable } from '@angular/core';
3
+ import * as faker from '@faker-js/faker/locale/en_US';
4
+ import { DaffModelFactory } from '@daffodil/core/testing';
5
+
6
+ class MockDaffAddress {
7
+ constructor() {
8
+ this.street = faker.address.streetName();
9
+ this.street2 = faker.address.secondaryAddress();
10
+ this.city = faker.address.city();
11
+ this.region = faker.address.stateAbbr();
12
+ this.postcode = faker.address.zipCode();
13
+ this.country = faker.address.zipCode();
14
+ }
15
+ }
16
+ class DaffAddressFactory extends DaffModelFactory {
17
+ constructor() {
18
+ super(MockDaffAddress);
19
+ }
20
+ }
21
+ /** @nocollapse */ /** @nocollapse */ DaffAddressFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAddressFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
22
+ /** @nocollapse */ /** @nocollapse */ DaffAddressFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAddressFactory, providedIn: 'root' });
23
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffAddressFactory, decorators: [{
24
+ type: Injectable,
25
+ args: [{
26
+ providedIn: 'root',
27
+ }]
28
+ }], ctorParameters: function () { return []; } });
29
+
30
+ class MockDaffPersonalAddress extends MockDaffAddress {
31
+ constructor() {
32
+ super(...arguments);
33
+ this.prefix = faker.name.prefix();
34
+ this.suffix = faker.name.suffix();
35
+ this.firstname = faker.name.firstName();
36
+ this.middlename = faker.name.firstName();
37
+ this.lastname = faker.name.lastName();
38
+ this.email = faker.internet.email();
39
+ this.telephone = faker.phone.phoneNumber();
40
+ }
41
+ }
42
+ class DaffPersonalAddressFactory extends DaffModelFactory {
43
+ constructor() {
44
+ super(MockDaffPersonalAddress);
45
+ }
46
+ }
47
+ /** @nocollapse */ /** @nocollapse */ DaffPersonalAddressFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffPersonalAddressFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
48
+ /** @nocollapse */ /** @nocollapse */ DaffPersonalAddressFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffPersonalAddressFactory, providedIn: 'root' });
49
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffPersonalAddressFactory, decorators: [{
50
+ type: Injectable,
51
+ args: [{
52
+ providedIn: 'root',
53
+ }]
54
+ }], ctorParameters: function () { return []; } });
55
+
56
+ class MockCountry {
57
+ constructor() {
58
+ this.id = faker.datatype.uuid();
59
+ this.name = faker.random.word();
60
+ this.name_en = faker.random.word();
61
+ this.alpha2 = faker.random.alphaNumeric(2);
62
+ this.alpha3 = faker.random.alphaNumeric(3);
63
+ this.subdivisions = [];
64
+ }
65
+ }
66
+ class DaffCountryFactory extends DaffModelFactory {
67
+ constructor() {
68
+ super(MockCountry);
69
+ }
70
+ }
71
+ /** @nocollapse */ /** @nocollapse */ DaffCountryFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCountryFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
72
+ /** @nocollapse */ /** @nocollapse */ DaffCountryFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCountryFactory, providedIn: 'root' });
73
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffCountryFactory, decorators: [{
74
+ type: Injectable,
75
+ args: [{
76
+ providedIn: 'root',
77
+ }]
78
+ }], ctorParameters: function () { return []; } });
79
+
80
+ class MockSubdivision {
81
+ constructor() {
82
+ this.id = faker.datatype.uuid();
83
+ this.name = faker.random.word();
84
+ this.iso_3166_2 = faker.random.alphaNumeric(2);
85
+ }
86
+ }
87
+ class DaffSubdivisionFactory extends DaffModelFactory {
88
+ constructor() {
89
+ super(MockSubdivision);
90
+ }
91
+ }
92
+ /** @nocollapse */ /** @nocollapse */ DaffSubdivisionFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffSubdivisionFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
93
+ /** @nocollapse */ /** @nocollapse */ DaffSubdivisionFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffSubdivisionFactory, providedIn: 'root' });
94
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffSubdivisionFactory, decorators: [{
95
+ type: Injectable,
96
+ args: [{
97
+ providedIn: 'root',
98
+ }]
99
+ }], ctorParameters: function () { return []; } });
100
+
101
+ /**
102
+ * Generated bundle index. Do not edit.
103
+ */
104
+
105
+ export { DaffAddressFactory, DaffCountryFactory, DaffPersonalAddressFactory, DaffSubdivisionFactory, MockCountry, MockDaffAddress, MockDaffPersonalAddress, MockSubdivision };
106
+ //# sourceMappingURL=daffodil-geography-testing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daffodil-geography-testing.mjs","sources":["../../../libs/geography/testing/src/factories/address.factory.ts","../../../libs/geography/testing/src/factories/personal-address.factory.ts","../../../libs/geography/testing/src/factories/country.factory.ts","../../../libs/geography/testing/src/factories/subdivision.factory.ts","../../../libs/geography/testing/src/daffodil-geography-testing.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffAddress } from '@daffodil/geography';\n\n\nexport class MockDaffAddress implements DaffAddress {\n street = faker.address.streetName();\n street2 = faker.address.secondaryAddress();\n city = faker.address.city();\n region = faker.address.stateAbbr();\n postcode = faker.address.zipCode();\n country = faker.address.zipCode();\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffAddressFactory extends DaffModelFactory<DaffAddress>{\n constructor(){\n super(MockDaffAddress);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffPersonalAddress } from '@daffodil/geography';\n\nimport { MockDaffAddress } from './address.factory';\n\nexport class MockDaffPersonalAddress extends MockDaffAddress implements DaffPersonalAddress {\n prefix = faker.name.prefix();\n suffix = faker.name.suffix();\n firstname = faker.name.firstName();\n middlename = faker.name.firstName();\n lastname = faker.name.lastName();\n email = faker.internet.email();\n telephone = faker.phone.phoneNumber();\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffPersonalAddressFactory extends DaffModelFactory<DaffPersonalAddress>{\n constructor() {\n super(MockDaffPersonalAddress);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffCountry } from '@daffodil/geography';\n\nexport class MockCountry implements DaffCountry {\n id = faker.datatype.uuid();\n name = faker.random.word();\n\tname_en = faker.random.word();\n\talpha2 = faker.random.alphaNumeric(2);\n\talpha3 = faker.random.alphaNumeric(3);\n\tsubdivisions = [];\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffCountryFactory extends DaffModelFactory<DaffCountry> {\n constructor() {\n super(MockCountry);\n }\n}\n","import { Injectable } from '@angular/core';\nimport * as faker from '@faker-js/faker/locale/en_US';\n\nimport { DaffModelFactory } from '@daffodil/core/testing';\nimport { DaffSubdivision } from '@daffodil/geography';\n\nexport class MockSubdivision implements DaffSubdivision {\n id = faker.datatype.uuid();\n name = faker.random.word();\n\tiso_3166_2 = faker.random.alphaNumeric(2);\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DaffSubdivisionFactory extends DaffModelFactory<DaffSubdivision> {\n constructor() {\n super(MockSubdivision);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAOa,eAAe,CAAA;AAA5B,IAAA,WAAA,GAAA;QACE,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACpC,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;QAC3C,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAC5B,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;QACnC,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QACnC,IAAA,CAAA,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;KACnC;AAAA,CAAA;AAKK,MAAO,kBAAmB,SAAQ,gBAA6B,CAAA;AACnE,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,eAAe,CAAC,CAAC;KACxB;;qJAHU,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAlB,sCAAA,kBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,cAFjB,MAAM,EAAA,CAAA,CAAA;2FAEP,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAH9B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;A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AAY,CAAC,CAAC,CAAC,CAAC;KAC1C;AAAA,CAAA;AAKK,MAAO,sBAAuB,SAAQ,gBAAiC,CAAA;AAC3E,IAAA,WAAA,GAAA;QACE,KAAK,CAAC,eAAe,CAAC,CAAC;KACxB;;yJAHU,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAtB,sCAAA,sBAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,cAFrB,MAAM,EAAA,CAAA,CAAA;2FAEP,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAHlC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;iBACnB,CAAA;;;ACdD;;AAEG;;;;"}
@@ -51,4 +51,4 @@ const DAFF_GEOGRAPHY_ERROR_MATCHER = new InjectionToken('DAFF_GEOGRAPHY_ERROR_MA
51
51
  */
52
52
 
53
53
  export { DAFF_GEOGRAPHY_ERROR_MATCHER, daffCompareAddresses, daffComparePersonalAddresses };
54
- //# sourceMappingURL=daffodil-geography.js.map
54
+ //# sourceMappingURL=daffodil-geography.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"daffodil-geography.mjs","sources":["../../../libs/geography/src/comparators/address.ts","../../../libs/geography/src/comparators/personal-address.ts","../../../libs/geography/src/injection-tokens/error-matcher.token.ts","../../../libs/geography/src/public_api.ts","../../../libs/geography/src/daffodil-geography.ts"],"sourcesContent":["import { DaffAddress } from '../models/address';\n\n/**\n * Compares two addresses and returns true if all of their fields are equal.\n *\n * @param address0 An address.\n * @param address1 An address.\n */\nexport function daffCompareAddresses(address0: DaffAddress, address1: DaffAddress): boolean {\n return !!(address0 && address1 &&\n address0.street === address1.street &&\n address0.street2 === address1.street2 &&\n address0.city === address1.city &&\n address0.region === address1.region &&\n address0.country === address1.country &&\n address0.country_id === address1.country_id &&\n address0.postcode === address1.postcode);\n}\n","import { DaffPersonalAddress } from '../models/personal-address';\nimport { daffCompareAddresses } from './address';\n\n/**\n * Compares two personal addresses and returns true if all of their fields are equal.\n *\n * @param address0 A personal address.\n * @param address1 A personal address.\n */\nexport function daffComparePersonalAddresses(address0: DaffPersonalAddress, address1: DaffPersonalAddress): boolean {\n return !!(address0 && address1 &&\n address0.prefix === address1.prefix &&\n address0.suffix === address1.suffix &&\n address0.firstname === address1.firstname &&\n address0.middlename === address1.middlename &&\n address0.lastname === address1.lastname &&\n address0.telephone === address1.telephone &&\n address0.email === address1.email &&\n daffCompareAddresses(address0, address1));\n}\n","import { InjectionToken } from '@angular/core';\n\nimport { daffTransformErrorToStateError } from '@daffodil/core/state';\n\n/**\n * Transforms `DaffError`s into `DaffStateError`s before they are serialized into state.\n * Can be used to further refine Daffodil errors into more specific app errors.\n */\nexport const DAFF_GEOGRAPHY_ERROR_MATCHER = new InjectionToken<typeof daffTransformErrorToStateError>(\n 'DAFF_GEOGRAPHY_ERROR_MATCHER',\n { factory: () => daffTransformErrorToStateError },\n);\n","/*\n * Public API Surface of @daffodil/geography\n */\nexport * from './models/public_api';\nexport * from './comparators/public_api';\nexport * from './injection-tokens/public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA;;;;;AAKG;AACa,SAAA,oBAAoB,CAAC,QAAqB,EAAE,QAAqB,EAAA;AAC/E,IAAA,OAAO,CAAC,EAAE,QAAQ,IAAI,QAAQ;AAC5B,QAAA,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;AACnC,QAAA,QAAQ,CAAC,OAAO,KAAK,QAAQ,CAAC,OAAO;AACrC,QAAA,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,IAAI;AAC/B,QAAA,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;AACnC,QAAA,QAAQ,CAAC,OAAO,KAAK,QAAQ,CAAC,OAAO;AACrC,QAAA,QAAQ,CAAC,UAAU,KAAK,QAAQ,CAAC,UAAU;AAC3C,QAAA,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC7C;;ACdA;;;;;AAKG;AACa,SAAA,4BAA4B,CAAC,QAA6B,EAAE,QAA6B,EAAA;AACvG,IAAA,OAAO,CAAC,EAAE,QAAQ,IAAI,QAAQ;AAC5B,QAAA,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;AACnC,QAAA,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;AACnC,QAAA,QAAQ,CAAC,SAAS,KAAK,QAAQ,CAAC,SAAS;AACzC,QAAA,QAAQ,CAAC,UAAU,KAAK,QAAQ,CAAC,UAAU;AAC3C,QAAA,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ;AACvC,QAAA,QAAQ,CAAC,SAAS,KAAK,QAAQ,CAAC,SAAS;AACzC,QAAA,QAAQ,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK;AACjC,QAAA,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC9C;;ACfA;;;AAGG;AACU,MAAA,4BAA4B,GAAG,IAAI,cAAc,CAC5D,8BAA8B,EAC9B,EAAE,OAAO,EAAE,MAAM,8BAA8B,EAAE;;ACVnD;;AAEG;;ACFH;;AAEG;;;;"}
@@ -0,0 +1,121 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { Injectable, NgModule } from '@angular/core';
4
+ import { DaffCountryNotFoundError, DaffGeographyDriver } from '@daffodil/geography/driver';
5
+ import * as i1 from '@angular/common/http';
6
+ import { throwError } from 'rxjs';
7
+ import { catchError, map } from 'rxjs/operators';
8
+ import { STATUS } from 'angular-in-memory-web-api';
9
+ import * as i1$1 from '@daffodil/geography/testing';
10
+
11
+ /**
12
+ * @inheritdoc
13
+ */
14
+ class DaffInMemoryGeographyService {
15
+ constructor(http) {
16
+ this.http = http;
17
+ this.url = '/api/countries';
18
+ }
19
+ get(countryId) {
20
+ return this.http.get(`${this.url}/${countryId}`).pipe(catchError((error) => throwError(DaffCountryNotFoundError)), map(result => result));
21
+ }
22
+ list() {
23
+ return this.http.get(`${this.url}/`);
24
+ }
25
+ }
26
+ /** @nocollapse */ /** @nocollapse */ DaffInMemoryGeographyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffInMemoryGeographyService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
27
+ /** @nocollapse */ /** @nocollapse */ DaffInMemoryGeographyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffInMemoryGeographyService, providedIn: 'root' });
28
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffInMemoryGeographyService, decorators: [{
29
+ type: Injectable,
30
+ args: [{
31
+ providedIn: 'root',
32
+ }]
33
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
34
+
35
+ class DaffGeographyInMemoryDriverModule {
36
+ static forRoot() {
37
+ return {
38
+ ngModule: DaffGeographyInMemoryDriverModule,
39
+ providers: [
40
+ {
41
+ provide: DaffGeographyDriver,
42
+ useExisting: DaffInMemoryGeographyService,
43
+ },
44
+ ],
45
+ };
46
+ }
47
+ }
48
+ /** @nocollapse */ /** @nocollapse */ DaffGeographyInMemoryDriverModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyInMemoryDriverModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
49
+ /** @nocollapse */ /** @nocollapse */ DaffGeographyInMemoryDriverModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyInMemoryDriverModule, imports: [CommonModule] });
50
+ /** @nocollapse */ /** @nocollapse */ DaffGeographyInMemoryDriverModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyInMemoryDriverModule, imports: [[
51
+ CommonModule,
52
+ ]] });
53
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffGeographyInMemoryDriverModule, decorators: [{
54
+ type: NgModule,
55
+ args: [{
56
+ imports: [
57
+ CommonModule,
58
+ ],
59
+ }]
60
+ }] });
61
+
62
+ /**
63
+ * An in-memory service that stubs out the backend services for getting countries.
64
+ *
65
+ * @inheritdoc
66
+ */
67
+ class DaffInMemoryBackendGeographyService {
68
+ constructor(countryFactory, subdivisionFactory) {
69
+ this.countryFactory = countryFactory;
70
+ this.subdivisionFactory = subdivisionFactory;
71
+ this.countries = this.countryFactory.createMany(5);
72
+ this.countries.forEach(country => country.subdivisions = this.subdivisionFactory.createMany(5));
73
+ }
74
+ /**
75
+ * Creates a fake database of countries for the geography inmemory backend service.
76
+ *
77
+ * @docs-private
78
+ * @returns A fake database of an array of countries
79
+ */
80
+ createDb(reqInfo) {
81
+ if (reqInfo) {
82
+ const seedData = reqInfo.utils.getJsonBody(reqInfo.req).countries;
83
+ if (seedData) {
84
+ this.countries = seedData;
85
+ }
86
+ }
87
+ return {
88
+ countries: this.countries,
89
+ };
90
+ }
91
+ /**
92
+ * Responds to GET requests.
93
+ */
94
+ get(reqInfo) {
95
+ return reqInfo.utils.createResponse$(() => ({
96
+ body: reqInfo.id ? this.getCountry(reqInfo) : this.listCountries(reqInfo),
97
+ status: STATUS.OK,
98
+ }));
99
+ }
100
+ getCountry(reqInfo) {
101
+ return reqInfo.collection.find(country => country.id === reqInfo.id);
102
+ }
103
+ listCountries(reqInfo) {
104
+ return reqInfo.collection;
105
+ }
106
+ }
107
+ /** @nocollapse */ /** @nocollapse */ DaffInMemoryBackendGeographyService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffInMemoryBackendGeographyService, deps: [{ token: i1$1.DaffCountryFactory }, { token: i1$1.DaffSubdivisionFactory }], target: i0.ɵɵFactoryTarget.Injectable });
108
+ /** @nocollapse */ /** @nocollapse */ DaffInMemoryBackendGeographyService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffInMemoryBackendGeographyService, providedIn: 'root' });
109
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.0", ngImport: i0, type: DaffInMemoryBackendGeographyService, decorators: [{
110
+ type: Injectable,
111
+ args: [{
112
+ providedIn: 'root',
113
+ }]
114
+ }], ctorParameters: function () { return [{ type: i1$1.DaffCountryFactory }, { type: i1$1.DaffSubdivisionFactory }]; } });
115
+
116
+ /**
117
+ * Generated bundle index. Do not edit.
118
+ */
119
+
120
+ export { DaffGeographyInMemoryDriverModule, DaffInMemoryBackendGeographyService, DaffInMemoryGeographyService };
121
+ //# sourceMappingURL=daffodil-geography-driver-in-memory.mjs.map