@kosdev-code/kos-ddk-models 2.1.2 → 3.0.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 (217) hide show
  1. package/constants.d.ts.map +1 -1
  2. package/index.d.ts.map +1 -1
  3. package/index.js +3102 -1
  4. package/index.js.map +1 -0
  5. package/index.mjs +2190 -1597
  6. package/index.mjs.map +1 -0
  7. package/lib/agitation-control/agitation-control-model.d.ts +4 -5
  8. package/lib/agitation-control/agitation-control-model.d.ts.map +1 -1
  9. package/lib/agitation-control/agitation-control-registration.d.ts +2 -3
  10. package/lib/agitation-control/agitation-control-registration.d.ts.map +1 -1
  11. package/lib/agitation-control/index.d.ts.map +1 -1
  12. package/lib/agitation-control/types/index.d.ts +1 -3
  13. package/lib/animation/animation-model.d.ts +1 -2
  14. package/lib/animation/animation-model.d.ts.map +1 -1
  15. package/lib/animation/animation-registration.d.ts +1 -2
  16. package/lib/animation/animation-registration.d.ts.map +1 -1
  17. package/lib/animation/index.d.ts.map +1 -1
  18. package/lib/animation/services/animation-services.d.ts +1 -1
  19. package/lib/animation/services/animation-services.d.ts.map +1 -1
  20. package/lib/animation/services/index.d.ts.map +1 -1
  21. package/lib/animation/types/index.d.ts +1 -3
  22. package/lib/application/application-model.d.ts +5 -6
  23. package/lib/application/application-model.d.ts.map +1 -1
  24. package/lib/application/application-registration.d.ts +1 -2
  25. package/lib/application/application-registration.d.ts.map +1 -1
  26. package/lib/application/index.d.ts.map +1 -1
  27. package/lib/application/services/application-services.d.ts +3 -3
  28. package/lib/application/services/application-services.d.ts.map +1 -1
  29. package/lib/application/services/index.d.ts.map +1 -1
  30. package/lib/application/types/index.d.ts +2 -4
  31. package/lib/auth/auth-model.d.ts +2 -3
  32. package/lib/auth/auth-model.d.ts.map +1 -1
  33. package/lib/auth/auth-registration.d.ts +1 -2
  34. package/lib/auth/auth-registration.d.ts.map +1 -1
  35. package/lib/auth/index.d.ts.map +1 -1
  36. package/lib/auth/services/auth-services.d.ts +1 -2
  37. package/lib/auth/services/auth-services.d.ts.map +1 -1
  38. package/lib/auth/services/index.d.ts.map +1 -1
  39. package/lib/auth/types/index.d.ts +1 -3
  40. package/lib/carb-water/carb-water-model.d.ts +3 -4
  41. package/lib/carb-water/carb-water-model.d.ts.map +1 -1
  42. package/lib/carb-water/carb-water-registration.d.ts +2 -3
  43. package/lib/carb-water/carb-water-registration.d.ts.map +1 -1
  44. package/lib/carb-water/index.d.ts.map +1 -1
  45. package/lib/carb-water/services/carb-water-services.d.ts.map +1 -1
  46. package/lib/carb-water/services/index.d.ts.map +1 -1
  47. package/lib/copy-logs/copy-logs-model.d.ts +4 -5
  48. package/lib/copy-logs/copy-logs-model.d.ts.map +1 -1
  49. package/lib/copy-logs/index.d.ts +1 -1
  50. package/lib/copy-logs/index.d.ts.map +1 -1
  51. package/lib/copy-logs/services/copy-logs-services.d.ts +1 -2
  52. package/lib/copy-logs/services/copy-logs-services.d.ts.map +1 -1
  53. package/lib/copy-logs/services/index.d.ts.map +1 -1
  54. package/lib/dashboard-operations/dashboard-operations-model.d.ts +4 -5
  55. package/lib/dashboard-operations/dashboard-operations-model.d.ts.map +1 -1
  56. package/lib/dashboard-operations/dashboard-operations-registration.d.ts +1 -2
  57. package/lib/dashboard-operations/dashboard-operations-registration.d.ts.map +1 -1
  58. package/lib/dashboard-operations/index.d.ts.map +1 -1
  59. package/lib/dashboard-operations/services/dashboard-operations-services.d.ts +2 -2
  60. package/lib/dashboard-operations/services/dashboard-operations-services.d.ts.map +1 -1
  61. package/lib/dashboard-operations/services/index.d.ts.map +1 -1
  62. package/lib/dashboard-operations/types/index.d.ts +1 -3
  63. package/lib/dispenser/dispenser-model.d.ts +1 -2
  64. package/lib/dispenser/dispenser-model.d.ts.map +1 -1
  65. package/lib/dispenser/dispenser-registration.d.ts +1 -2
  66. package/lib/dispenser/dispenser-registration.d.ts.map +1 -1
  67. package/lib/dispenser/index.d.ts.map +1 -1
  68. package/lib/dispenser/services/dispenser-services.d.ts +1 -1
  69. package/lib/dispenser/services/dispenser-services.d.ts.map +1 -1
  70. package/lib/dispenser/services/index.d.ts.map +1 -1
  71. package/lib/dispenser/types/index.d.ts +1 -3
  72. package/lib/dispenser-info/dispenser-info-model.d.ts +1 -2
  73. package/lib/dispenser-info/dispenser-info-model.d.ts.map +1 -1
  74. package/lib/dispenser-info/dispenser-info-registration.d.ts +1 -2
  75. package/lib/dispenser-info/dispenser-info-registration.d.ts.map +1 -1
  76. package/lib/dispenser-info/index.d.ts.map +1 -1
  77. package/lib/dispenser-info/services/dispenser-info-services.d.ts +1 -1
  78. package/lib/dispenser-info/services/dispenser-info-services.d.ts.map +1 -1
  79. package/lib/dispenser-info/services/index.d.ts.map +1 -1
  80. package/lib/dispenser-info/types/index.d.ts +1 -3
  81. package/lib/door/door-model.d.ts +1 -2
  82. package/lib/door/door-model.d.ts.map +1 -1
  83. package/lib/door/door-registration.d.ts +2 -3
  84. package/lib/door/door-registration.d.ts.map +1 -1
  85. package/lib/door/index.d.ts.map +1 -1
  86. package/lib/enrollment/enrollment-model.d.ts +1 -2
  87. package/lib/enrollment/enrollment-model.d.ts.map +1 -1
  88. package/lib/enrollment/enrollment-registration.d.ts +1 -2
  89. package/lib/enrollment/enrollment-registration.d.ts.map +1 -1
  90. package/lib/enrollment/index.d.ts.map +1 -1
  91. package/lib/enrollment/services/enrollment-services.d.ts +1 -1
  92. package/lib/enrollment/services/enrollment-services.d.ts.map +1 -1
  93. package/lib/enrollment/services/index.d.ts.map +1 -1
  94. package/lib/enrollment/types/index.d.ts +1 -3
  95. package/lib/extension/index.d.ts.map +1 -1
  96. package/lib/ingredient-summary/index.d.ts.map +1 -1
  97. package/lib/ingredient-summary/ingredient-summary-model.d.ts +4 -5
  98. package/lib/ingredient-summary/ingredient-summary-model.d.ts.map +1 -1
  99. package/lib/ingredient-summary/ingredient-summary-registration.d.ts +1 -2
  100. package/lib/ingredient-summary/ingredient-summary-registration.d.ts.map +1 -1
  101. package/lib/ingredient-summary/types/index.d.ts +2 -4
  102. package/lib/lockout/index.d.ts.map +1 -1
  103. package/lib/lockout/lockout-model.d.ts +1 -2
  104. package/lib/lockout/lockout-model.d.ts.map +1 -1
  105. package/lib/lockout/lockout-registration.d.ts +2 -3
  106. package/lib/lockout/lockout-registration.d.ts.map +1 -1
  107. package/lib/lockout/services/index.d.ts.map +1 -1
  108. package/lib/lockout/services/lockout-services.d.ts +1 -1
  109. package/lib/lockout/services/lockout-services.d.ts.map +1 -1
  110. package/lib/macro-assignment/index.d.ts.map +1 -1
  111. package/lib/macro-assignment/macro-assignment-model.d.ts +5 -6
  112. package/lib/macro-assignment/macro-assignment-model.d.ts.map +1 -1
  113. package/lib/macro-assignment/macro-assignment-registration.d.ts +1 -2
  114. package/lib/macro-assignment/macro-assignment-registration.d.ts.map +1 -1
  115. package/lib/macro-assignment/services/index.d.ts.map +1 -1
  116. package/lib/macro-assignment/services/macro-assignment-services.d.ts +1 -1
  117. package/lib/macro-assignment/services/macro-assignment-services.d.ts.map +1 -1
  118. package/lib/macro-assignment/types/index.d.ts +2 -4
  119. package/lib/network-test/index.d.ts.map +1 -1
  120. package/lib/network-test/network-test-container-model.d.ts +3 -4
  121. package/lib/network-test/network-test-container-model.d.ts.map +1 -1
  122. package/lib/network-test/network-test-container-registration.d.ts +1 -2
  123. package/lib/network-test/network-test-container-registration.d.ts.map +1 -1
  124. package/lib/network-test/network-test-model.d.ts +2 -3
  125. package/lib/network-test/network-test-model.d.ts.map +1 -1
  126. package/lib/network-test/network-test-registration.d.ts +1 -2
  127. package/lib/network-test/network-test-registration.d.ts.map +1 -1
  128. package/lib/network-test/services/index.d.ts.map +1 -1
  129. package/lib/network-test/services/network-test-services.d.ts +2 -3
  130. package/lib/network-test/services/network-test-services.d.ts.map +1 -1
  131. package/lib/network-test/types/index.d.ts +1 -3
  132. package/lib/nutritive-sweetener/index.d.ts.map +1 -1
  133. package/lib/nutritive-sweetener/nutritive-sweetener-model.d.ts +7 -8
  134. package/lib/nutritive-sweetener/nutritive-sweetener-model.d.ts.map +1 -1
  135. package/lib/nutritive-sweetener/nutritive-sweetener-registration.d.ts +2 -3
  136. package/lib/nutritive-sweetener/nutritive-sweetener-registration.d.ts.map +1 -1
  137. package/lib/nutritive-sweetener/services/index.d.ts.map +1 -1
  138. package/lib/nutritive-sweetener/services/nutritive-sweetener-services.d.ts.map +1 -1
  139. package/lib/plain-water/index.d.ts.map +1 -1
  140. package/lib/plain-water/plain-water-model.d.ts +4 -5
  141. package/lib/plain-water/plain-water-model.d.ts.map +1 -1
  142. package/lib/plain-water/plain-water-registration.d.ts +2 -3
  143. package/lib/plain-water/plain-water-registration.d.ts.map +1 -1
  144. package/lib/plain-water/services/index.d.ts.map +1 -1
  145. package/lib/plain-water/services/plain-water-services.d.ts.map +1 -1
  146. package/lib/reboot/index.d.ts.map +1 -1
  147. package/lib/reboot/reboot-model.d.ts +1 -2
  148. package/lib/reboot/reboot-model.d.ts.map +1 -1
  149. package/lib/reboot/reboot-registration.d.ts +1 -2
  150. package/lib/reboot/reboot-registration.d.ts.map +1 -1
  151. package/lib/reboot/services/index.d.ts.map +1 -1
  152. package/lib/reboot/services/reboot-services.d.ts +1 -1
  153. package/lib/reboot/services/reboot-services.d.ts.map +1 -1
  154. package/lib/reboot/types/index.d.ts +1 -3
  155. package/lib/registration.d.ts +1 -2
  156. package/lib/registration.d.ts.map +1 -1
  157. package/lib/settings/index.d.ts.map +1 -1
  158. package/lib/settings/services/index.d.ts.map +1 -1
  159. package/lib/settings/services/settings-services.d.ts +2 -3
  160. package/lib/settings/services/settings-services.d.ts.map +1 -1
  161. package/lib/settings/settings-model.d.ts +1 -2
  162. package/lib/settings/settings-model.d.ts.map +1 -1
  163. package/lib/settings/settings-registration.d.ts +1 -2
  164. package/lib/settings/settings-registration.d.ts.map +1 -1
  165. package/lib/settings/types/index.d.ts +1 -3
  166. package/lib/setup-step/index.d.ts.map +1 -1
  167. package/lib/setup-step/services/index.d.ts.map +1 -1
  168. package/lib/setup-step/services/setup-step-services.d.ts +2 -2
  169. package/lib/setup-step/services/setup-step-services.d.ts.map +1 -1
  170. package/lib/setup-step/setup-step-container-model.d.ts +3 -4
  171. package/lib/setup-step/setup-step-container-model.d.ts.map +1 -1
  172. package/lib/setup-step/setup-step-container-registration.d.ts +1 -2
  173. package/lib/setup-step/setup-step-container-registration.d.ts.map +1 -1
  174. package/lib/setup-step/setup-step-model.d.ts +1 -2
  175. package/lib/setup-step/setup-step-model.d.ts.map +1 -1
  176. package/lib/setup-step/setup-step-registration.d.ts +1 -2
  177. package/lib/setup-step/setup-step-registration.d.ts.map +1 -1
  178. package/lib/setup-step/types/index.d.ts +1 -3
  179. package/lib/trouble-action/index.d.ts.map +1 -1
  180. package/lib/trouble-action/trouble-action-model.d.ts +2 -3
  181. package/lib/trouble-action/trouble-action-model.d.ts.map +1 -1
  182. package/lib/utilities/index.d.ts.map +1 -1
  183. package/lib/utilities/services/index.d.ts.map +1 -1
  184. package/lib/utilities/services/utilities-services.d.ts.map +1 -1
  185. package/lib/utilities/types/index.d.ts +1 -3
  186. package/lib/utilities/utilities-container-model.d.ts +1 -2
  187. package/lib/utilities/utilities-container-model.d.ts.map +1 -1
  188. package/lib/utilities/utilities-container-registration.d.ts +1 -2
  189. package/lib/utilities/utilities-container-registration.d.ts.map +1 -1
  190. package/lib/utilities/utilities-model.d.ts +1 -2
  191. package/lib/utilities/utilities-model.d.ts.map +1 -1
  192. package/lib/utilities/utilities-registration.d.ts +1 -2
  193. package/lib/utilities/utilities-registration.d.ts.map +1 -1
  194. package/lib/utils/assembly-utils.d.ts +2 -3
  195. package/lib/utils/assembly-utils.d.ts.map +1 -1
  196. package/lib/utils/holder-view-extension.d.ts +1 -2
  197. package/lib/utils/holder-view-extension.d.ts.map +1 -1
  198. package/lib/utils/index.d.ts.map +1 -1
  199. package/lib/utils/time-utils.d.ts.map +1 -1
  200. package/lib/utils/trouble-visibility-filter.d.ts +1 -2
  201. package/lib/utils/trouble-visibility-filter.d.ts.map +1 -1
  202. package/package.json +5 -5
  203. package/start/index.d.ts.map +1 -1
  204. package/start/services/index.d.ts.map +1 -1
  205. package/start/services/start-services.d.ts +1 -1
  206. package/start/services/start-services.d.ts.map +1 -1
  207. package/start/start-model.d.ts +1 -2
  208. package/start/start-model.d.ts.map +1 -1
  209. package/start/start-registration.d.ts +2 -3
  210. package/start/start-registration.d.ts.map +1 -1
  211. package/types/global.d.ts.map +1 -1
  212. package/types/index.d.ts.map +1 -1
  213. package/utils/openapi-index.d.ts.map +1 -1
  214. package/utils/services/kosdev.ddk/snapshot/service.d.ts +47 -48
  215. package/utils/services/kosdev.ddk/snapshot/service.d.ts.map +1 -1
  216. package/utils/services-index.d.ts.map +1 -1
  217. package/kos-models.json +0 -358
package/index.mjs.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../packages/kos-ddk-models/src/constants.ts","../../../packages/kos-ddk-models/src/lib/auth/services/auth-services.ts","../../../packages/kos-ddk-models/src/lib/auth/auth-model.ts","../../../packages/kos-ddk-models/src/lib/auth/auth-registration.ts","../../../packages/kos-ddk-models/src/lib/door/door-model.ts","../../../packages/kos-ddk-models/src/lib/door/door-registration.ts","../../../packages/kos-ddk-models/src/lib/setup-step/services/setup-step-services.ts","../../../packages/kos-ddk-models/src/lib/setup-step/setup-step-model.ts","../../../packages/kos-ddk-models/src/lib/setup-step/setup-step-registration.ts","../../../packages/kos-ddk-models/src/lib/setup-step/setup-step-container-model.ts","../../../packages/kos-ddk-models/src/lib/setup-step/setup-step-container-registration.ts","../../../packages/kos-ddk-models/src/lib/application/services/application-services.ts","../../../packages/kos-ddk-models/src/lib/application/application-model.ts","../../../packages/kos-ddk-models/src/lib/application/application-registration.ts","../../../packages/kos-ddk-models/src/lib/utils/trouble-visibility-filter.ts","../../../packages/kos-ddk-models/src/lib/agitation-control/agitation-control-model.ts","../../../packages/kos-ddk-models/src/lib/agitation-control/agitation-control-registration.ts","../../../packages/kos-ddk-models/src/lib/animation/animation-model.ts","../../../packages/kos-ddk-models/src/lib/animation/animation-registration.ts","../../../packages/kos-ddk-models/src/lib/animation/services/animation-services.ts","../../../packages/kos-ddk-models/src/lib/carb-water/carb-water-model.ts","../../../packages/kos-ddk-models/src/lib/carb-water/carb-water-registration.ts","../../../packages/kos-ddk-models/src/lib/copy-logs/services/copy-logs-services.ts","../../../packages/kos-ddk-models/src/lib/copy-logs/copy-logs-model.ts","../../../packages/kos-ddk-models/src/lib/copy-logs/index.ts","../../../packages/kos-ddk-models/src/lib/dashboard-operations/services/dashboard-operations-services.ts","../../../packages/kos-ddk-models/src/lib/dashboard-operations/dashboard-operations-model.ts","../../../packages/kos-ddk-models/src/lib/dashboard-operations/dashboard-operations-registration.ts","../../../packages/kos-ddk-models/src/lib/dispenser/dispenser-model.ts","../../../packages/kos-ddk-models/src/lib/dispenser/dispenser-registration.ts","../../../packages/kos-ddk-models/src/lib/dispenser/services/dispenser-services.ts","../../../packages/kos-ddk-models/src/lib/dispenser-info/dispenser-info-model.ts","../../../packages/kos-ddk-models/src/lib/dispenser-info/dispenser-info-registration.ts","../../../packages/kos-ddk-models/src/lib/dispenser-info/services/dispenser-info-services.ts","../../../packages/kos-ddk-models/src/lib/enrollment/enrollment-model.ts","../../../packages/kos-ddk-models/src/lib/enrollment/enrollment-registration.ts","../../../packages/kos-ddk-models/src/lib/enrollment/services/enrollment-services.ts","../../../packages/kos-ddk-models/src/lib/utils/assembly-utils.ts","../../../packages/kos-ddk-models/src/lib/utils/holder-view-extension.ts","../../../packages/kos-ddk-models/src/lib/utils/time-utils.ts","../../../packages/kos-ddk-models/src/lib/ingredient-summary/ingredient-summary-model.ts","../../../packages/kos-ddk-models/src/lib/ingredient-summary/ingredient-summary-registration.ts","../../../packages/kos-ddk-models/src/lib/lockout/services/lockout-services.ts","../../../packages/kos-ddk-models/src/lib/lockout/lockout-model.ts","../../../packages/kos-ddk-models/src/lib/lockout/lockout-registration.ts","../../../packages/kos-ddk-models/src/lib/macro-assignment/services/macro-assignment-services.ts","../../../packages/kos-ddk-models/src/lib/macro-assignment/macro-assignment-model.ts","../../../packages/kos-ddk-models/src/lib/macro-assignment/macro-assignment-registration.ts","../../../packages/kos-ddk-models/src/lib/network-test/network-test-model.ts","../../../packages/kos-ddk-models/src/lib/network-test/network-test-registration.ts","../../../packages/kos-ddk-models/src/lib/network-test/services/network-test-services.ts","../../../packages/kos-ddk-models/src/lib/network-test/network-test-container-model.ts","../../../packages/kos-ddk-models/src/lib/network-test/network-test-container-registration.ts","../../../packages/kos-ddk-models/src/lib/nutritive-sweetener/nutritive-sweetener-model.ts","../../../packages/kos-ddk-models/src/lib/nutritive-sweetener/nutritive-sweetener-registration.ts","../../../packages/kos-ddk-models/src/lib/plain-water/plain-water-model.ts","../../../packages/kos-ddk-models/src/lib/plain-water/plain-water-registration.ts","../../../packages/kos-ddk-models/src/lib/reboot/services/reboot-services.ts","../../../packages/kos-ddk-models/src/lib/reboot/reboot-model.ts","../../../packages/kos-ddk-models/src/lib/reboot/reboot-registration.ts","../../../packages/kos-ddk-models/src/lib/settings/settings-model.ts","../../../packages/kos-ddk-models/src/lib/settings/settings-registration.ts","../../../packages/kos-ddk-models/src/lib/settings/services/settings-services.ts","../../../packages/kos-ddk-models/src/lib/utilities/utilities-model.ts","../../../packages/kos-ddk-models/src/lib/utilities/utilities-registration.ts","../../../packages/kos-ddk-models/src/lib/utilities/services/utilities-services.ts","../../../packages/kos-ddk-models/src/lib/utilities/utilities-container-model.ts","../../../packages/kos-ddk-models/src/lib/utilities/utilities-container-registration.ts","../../../packages/kos-ddk-models/src/lib/registration.ts","../../../packages/kos-ddk-models/src/lib/trouble-action/trouble-action-model.ts","../../../packages/kos-ddk-models/src/start/services/start-services.ts","../../../packages/kos-ddk-models/src/start/start-model.ts","../../../packages/kos-ddk-models/src/start/start-registration.ts"],"sourcesContent":["export const TROUBLE_TYPE_PURGE = \"PurgeTrouble\";\nexport const TROUBLE_TYPE_PRIME = \"PrimeTrouble\";\n","import {\n KosLog,\n KosServiceResponse,\n ServiceFactory,\n resolveServiceUrl,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"AUTH_SERVICE\");\nconst { getOne, postModel } = ServiceFactory.build({\n basePath: `${URL}/api/auth`,\n});\n\nconst log = KosLog.createLogger({ name: \"auth-service\", group: \"Services\" });\nexport type AuthResponse = \"CREW\" | \"MANGER\" | \"TECHNICIAN\";\n/**\n * @category Service\n * Retrieves the initial auth data.\n */\nexport const getCurrentRole = async () => {\n log.debug(\"sending GET for auth\");\n const response = await getOne<AuthResponse>({\n urlOverride: `${URL}/api/app/kosdev.ddk/auth/role`,\n });\n return response;\n};\n\nexport const sendPinCode = async (pinCode: string) => {\n log.debug(\"sending POST for auth\");\n const response: KosServiceResponse<boolean> | undefined = await postModel({\n urlOverride: `${URL}/api/app/kosdev.ddk/auth/pincode/${pinCode}`,\n model: {},\n });\n return response;\n};\n","import type {\n IKosDataModel,\n KosContextLogger,\n KosCreationContext,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { kosAction, kosModel, kosTopicHandler } from \"@kosdev-code/kos-ui-sdk\";\nimport { getCurrentRole, sendPinCode, type AuthResponse } from \"./services\";\nimport type { AuthModel, AuthOptions, NcuiRole } from \"./types\";\n\nexport const MODEL_TYPE = \"auth-model\";\n\nconst convertAuthResponse = (response: AuthResponse): NcuiRole =>\n response.toLowerCase() as NcuiRole;\n/**\n * @kosService ddk.auth\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class AuthModelImpl implements AuthModel, IKosDataModel {\n id: string;\n private logger: KosContextLogger;\n currentRole: NcuiRole;\n constructor(\n modelId: string,\n options: AuthOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this.currentRole = \"crew\";\n if (options) {\n // Assign options properties here.\n }\n }\n\n async authorize(pinCode: string) {\n if (!pinCode) {\n return false;\n }\n const response = await sendPinCode(pinCode);\n if (response?.status === 200) {\n return response.data;\n } else {\n return false;\n }\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing auth ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading auth ${this.id}`);\n const response = await getCurrentRole();\n if (response?.status === 200) {\n this.logger.debug(`response ${response.data}`);\n kosAction(() => {\n this.currentRole = convertAuthResponse(response.data);\n });\n }\n }\n\n @kosTopicHandler({\n topic: \"/app/kosdev.ddk/auth/role\",\n websocket: true,\n })\n handleRoleChange(role: AuthResponse) {\n this.currentRole = convertAuthResponse(role);\n }\n forceRole(role: NcuiRole) {\n this.currentRole = role;\n }\n}\n","import { Kos, isKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { KosModelRegistrationBean } from \"@kosdev-code/kos-ui-sdk\";\nimport type { AuthModel, AuthOptions } from \"./types\";\nimport { AuthModelImpl, MODEL_TYPE } from \"./auth-model\";\n\n/**\n * # Auth\n *\n * The registration bean includes convenience methods for creating and working with AuthModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: Auth.type, id: \"authId\"})\n * private authModel: AuthModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new AuthModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = Auth.factory(\"authId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a AuthModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (Auth.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to AuthModel\n * // and the compiler will know that the model has the AuthModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { Auth } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...Auth.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The auth model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const Auth: Readonly<KosModelRegistrationBean<AuthModel, AuthOptions>> =\n {\n registration: {\n [MODEL_TYPE]: {\n class: AuthModelImpl,\n singleton: false,\n },\n },\n type: MODEL_TYPE,\n predicate: isKosModel(MODEL_TYPE),\n factory: Kos.Factory.create<AuthModel, AuthOptions>(MODEL_TYPE),\n };\n","import type {\n IKosDataModel,\n IKosIdentifiable,\n KosConfigProperty,\n KosContextLogger,\n KosCreationContext,\n KosStateProp,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n createPropKey,\n kosConfigProperty,\n kosModel,\n kosStateProp,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { DoorOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"door-model\";\n\nexport type DoorModel = PublicModelInterface<DoorModelImpl>;\n\nconst PROP_PATH = createPropKey<DoorModel>(\"doorPath\");\n\nexport enum DoorState {\n OPEN = \"OPEN\",\n CLOSED = \"CLOSED\",\n UNKNOWN = \"UNKNOWN\",\n}\n/**\n * @kosService ddk.door\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class DoorModelImpl implements IKosDataModel, IKosIdentifiable {\n id: string;\n private logger: KosContextLogger;\n readonly doorPath: string;\n\n @kosStateProp({ path: PROP_PATH, attribute: \"state\" })\n private open!: KosStateProp<boolean>;\n\n @kosConfigProperty({\n path: \"app:kosdev.ddk:app\",\n attribute: \"ncui.ignoreDoorStateOnExit\",\n })\n ignoreDoor!: KosConfigProperty<boolean>;\n\n constructor(\n modelId: string,\n options: DoorOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n\n this.doorPath = options.doorPath;\n }\n\n get currentState(): DoorState {\n if (this.open.value === undefined) {\n return DoorState.UNKNOWN;\n }\n\n return this.open.value ? DoorState.OPEN : DoorState.CLOSED;\n }\n\n get isOpen(): boolean {\n // treat an unknown door state as \"OPEN\"\n const value = this.open.value === undefined ? true : this.open.value;\n const ignore = this.ignoreDoor.value;\n if (ignore) {\n this.logger.debug(\n `Door state is being ignored (treating as closed) due to ignoreDoor config property being true.`\n );\n return false;\n }\n return value;\n }\n}\n","import { KosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { DoorOptions } from \"./types\";\nimport { DoorModelImpl, MODEL_TYPE } from \"./door-model\";\nimport type { DoorModel } from \"./door-model\";\n\n/**\n * # Door\n *\n * The registration bean includes convenience methods for creating and working with DoorModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: Door.type, id: \"doorId\"})\n * private doorModel: DoorModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new DoorModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = Door.factory(\"doorId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a DoorModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (Door.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to DoorModel\n * // and the compiler will know that the model has the DoorModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { Door } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(Door);\n * ```\n *\n * ## registration.singleton\n \n * The door model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const Door = new KosModelRegistrationFactory<DoorModel, DoorOptions>({\n class: DoorModelImpl,\n type: MODEL_TYPE,\n});\n","import {\n ServiceFactory,\n resolveServiceUrl,\n KosLog,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"SETUP-STEP_SERVICE\");\nconst { getAll, postModel } = ServiceFactory.build({\n basePath: `${URL}/api/setup-step`,\n});\n\nconst log = KosLog.createLogger({\n name: \"setup-step-service\",\n group: \"Services\",\n});\nexport interface SetupStepResponse {\n name: string;\n complete: boolean;\n preStep: boolean;\n exclusive: boolean;\n}\n\n/**\n * @category Service\n * Retrieves the initial setup-step data.\n */\nexport const getSetupSteps = async () => {\n log.debug(\"sending GET for setup-step\");\n const response = await getAll<SetupStepResponse>({\n urlOverride: `${URL}/api/app/kosdev.ddk/setup/steps`,\n });\n return response;\n};\n\nexport const markStepComplete = async (stepId: string) => {\n log.debug(\"sending POST for setup-step\");\n const response = await postModel({\n urlOverride: `${URL}/api/app/kosdev.ddk/setup/complete/${stepId}`,\n model: {},\n });\n return response;\n};\n","import type {\n IKosDataModel,\n KosContextLogger,\n KosCreationContext,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { kosAction, kosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport { markStepComplete } from \"./services\";\nimport type { SetupStepModel, SetupStepOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"setup-step-model\";\n\n/**\n * @kosService ddk.setup-step\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class SetupStepModelImpl implements SetupStepModel, IKosDataModel {\n id: string;\n idx: number;\n name: string;\n complete: boolean;\n preStep: boolean;\n exclusive: boolean;\n\n private logger: KosContextLogger;\n constructor(\n modelId: string,\n options: SetupStepOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.idx = options.idx;\n this.logger = context.logger;\n this.name = options.name;\n this.complete = options.complete;\n this.preStep = options.preStep;\n this.exclusive = options.exclusive;\n }\n\n updateModel(options: SetupStepOptions): void {\n this.name = options.name;\n this.idx = options.idx;\n this.complete = options.complete;\n this.preStep = options.preStep;\n this.exclusive = options.exclusive;\n }\n\n get titleKey() {\n return `setup.${this.name}.title`;\n }\n\n get bodyKey() {\n return `setup.${this.name}.body`;\n }\n\n async completeStep() {\n const response = await markStepComplete(this.name);\n if (response?.status === 200) {\n kosAction(() => {\n this.complete = true;\n });\n }\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing setup-step ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading setup-step ${this.id}`);\n }\n}\n","import { Kos, isKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { KosModelRegistrationBean } from \"@kosdev-code/kos-ui-sdk\";\nimport type { SetupStepModel, SetupStepOptions } from \"./types\";\nimport { SetupStepModelImpl, MODEL_TYPE } from \"./setup-step-model\";\n\n/**\n * # SetupStep\n *\n * The registration bean includes convenience methods for creating and working with SetupStepModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: SetupStep.type, id: \"setupStepId\"})\n * private setupStepModel: SetupStepModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new SetupStepModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = SetupStep.factory(\"setupStepId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a SetupStepModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (SetupStep.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to SetupStepModel\n * // and the compiler will know that the model has the SetupStepModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { SetupStep } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...SetupStep.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The setupStep model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const SetupStep: Readonly<\n KosModelRegistrationBean<SetupStepModel, SetupStepOptions>\n> = {\n registration: {\n [MODEL_TYPE]: {\n class: SetupStepModelImpl,\n singleton: false,\n },\n },\n type: MODEL_TYPE,\n predicate: isKosModel(MODEL_TYPE),\n factory: Kos.Factory.create<SetupStepModel, SetupStepOptions>(MODEL_TYPE),\n};\n","import type {\n IKosModelContainer,\n KosContextLogger,\n KosCreationContext,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n KosModelContainer,\n kosChild,\n kosDependency,\n kosModel,\n kosTopicHandler,\n resolveContainerDeltas,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { Auth, type AuthModel } from \"../auth\";\nimport { getSetupSteps, type SetupStepResponse } from \"./services\";\nimport { SetupStep } from \"./setup-step-registration\";\nimport type {\n IdentifiableStep,\n SetupStepContainerModel,\n SetupStepContainerOptions,\n SetupStepModel,\n} from \"./types\";\n\nexport const MODEL_TYPE = \"setup-step-container-model\";\n\nfunction addStep(container: SetupStepContainerModel) {\n return (step: IdentifiableStep) => {\n const model = SetupStep.factory(step.id)(step);\n model.updateModel(step);\n container.addModel(model);\n };\n}\n\nfunction removeStep(container: SetupStepContainerModel) {\n return (id: string) => {\n container.removeModel(id);\n };\n}\n/**\n * @kosService ddk.setup-step\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class SetupStepContainerModelImpl implements SetupStepContainerModel {\n id: string;\n private _currentStep?: SetupStepModel;\n private logger: KosContextLogger;\n @kosChild models: IKosModelContainer<SetupStepModel>;\n\n @kosDependency({ modelType: Auth.type })\n authModel!: AuthModel;\n\n constructor(\n modelId: string,\n options: SetupStepContainerOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n\n this._currentStep = undefined;\n this.models = new KosModelContainer<SetupStepModel>({\n parentId: modelId,\n sortKey: \"idx\",\n });\n if (options) {\n // Assign options properties here.\n }\n }\n\n get currentStep() {\n return this._currentStep;\n }\n\n setCurrentStep(id: string) {\n const step = this.models.getModel(id);\n if (step) {\n this._currentStep = step;\n }\n }\n nextStep() {\n if (!this._currentStep) {\n this._currentStep = this.firstIncompleteStep;\n } else {\n const currentIdx = this._currentStep.idx;\n const nextStep = this.models.data.find((step) => step.idx > currentIdx);\n if (nextStep) {\n this._currentStep = nextStep;\n }\n }\n }\n\n get hasIncompletePreSteps() {\n return this.models.data.some((step) => step.preStep && !step.complete);\n }\n\n get setupRequired() {\n return this.models.data.some((step) => !step.complete);\n }\n get firstIncompleteStep() {\n return this.models.data.find((step) => !step.complete);\n }\n get isLastStep() {\n return (\n this.models.data[this.models.data.length - 1].id === this._currentStep?.id\n );\n }\n\n get data() {\n return this.models.data;\n }\n\n getModel(id: string) {\n return this.models.getModel(id);\n }\n\n addModel(model: SetupStepModel) {\n this.models.addModel(model);\n }\n\n removeModel(id: string) {\n this.models.removeModel(id);\n }\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing setup-step-container container ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading setup-step-container container ${this.id}`);\n const response = await getSetupSteps();\n if (response?.data) {\n const identifiableSteps: IdentifiableStep[] = response.data.map(\n (step, index) => {\n return {\n ...step,\n idx: index,\n id: `setup-${step.name}`,\n };\n }\n );\n resolveContainerDeltas({\n container: this.models,\n onAddItem: addStep(this),\n onRemoveItem: removeStep(this),\n })(identifiableSteps);\n }\n\n this.nextStep();\n }\n\n @kosTopicHandler({\n topic: \"/app/kosdev.ddk/setup/steps\",\n websocket: true,\n })\n handleStepChanges(steps: SetupStepResponse[]) {\n const identifiableSteps: IdentifiableStep[] = steps.map((step, index) => {\n return {\n ...step,\n idx: index,\n id: `setup-${step.name}`,\n };\n });\n\n resolveContainerDeltas({\n container: this.models,\n onAddItem: addStep(this),\n onRemoveItem: removeStep(this),\n })(identifiableSteps);\n }\n}\n","import { Kos, isKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { SingletonKosModelRegistrationBean } from \"@kosdev-code/kos-ui-sdk\";\nimport { SetupStep } from \"./setup-step-registration\";\nimport type {\n SetupStepContainerModel,\n SetupStepContainerOptions,\n} from \"./types\";\nimport {\n SetupStepContainerModelImpl,\n MODEL_TYPE,\n} from \"./setup-step-container-model\";\n\n/**\n * # SetupStepContainer\n *\n * The registration bean includes convenience methods for creating and working with SetupStepContainerModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: SetupStepContainer.type, id: \"setupStepContainerId\"})\n * private setupStepContainerModel: SetupStepContainerModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new SetupStepContainerModel instances.\n *\n \n * As this is a singleton model, the factory function accepts the model options as its argument.\n *\n * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = SetupStepContainer.factory({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a SetupStepContainerModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (SetupStepContainer.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to SetupStepContainerModel\n * // and the compiler will know that the model has the SetupStepContainerModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { SetupStepContainer } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...SetupStepContainer.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The setupStepContainer model is a singleton model. This means that each time the factory function is called , the same instance will be returned.\n * If the model does not yet exist, it will be created passing in the provided options to initialize it.\n *\n * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.\n \n * */\nexport const SetupStepContainer: Readonly<\n SingletonKosModelRegistrationBean<\n SetupStepContainerModel,\n SetupStepContainerOptions\n >\n> = {\n registration: {\n [MODEL_TYPE]: {\n class: SetupStepContainerModelImpl,\n singleton: true,\n },\n ...SetupStep.registration,\n },\n type: MODEL_TYPE,\n predicate: isKosModel(MODEL_TYPE),\n factory: Kos.Singleton.create<\n SetupStepContainerModel,\n SetupStepContainerOptions\n >(MODEL_TYPE),\n};\n","import {\n KosLog,\n ServiceFactory,\n resolveServiceUrl,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"AUTH_SERVICE\");\nconst { getOne, getAll } = ServiceFactory.build({\n basePath: `${URL}/api/app/kosdev.ddk/ncui/`,\n});\n\nconst log = KosLog.createLogger({ name: \"auth-service\", group: \"Services\" });\nexport interface LanguageResponse {\n languages: {\n name: string;\n locale: string;\n }[];\n}\n\nexport interface CuiResponse {\n name: string;\n basePath: string;\n sectionName: string;\n appId: string;\n}\n\nexport interface NavigationItem {\n name: string;\n roles: string[];\n root?: boolean;\n options?: {\n embed?: boolean;\n };\n children?: NavigationItem[];\n}\n/**\n * @category Service\n * Retrieves the initial language data.\n */\nexport const getLanguages = async () => {\n log.debug(\"sending GET for languages\");\n const response = await getOne<LanguageResponse>({\n urlOverride: `${URL}/api/app/kosdev.ddk/ncui/languages`,\n });\n return response;\n};\n\nexport const getCuis = async () => {\n log.debug(\"sending GET for cuis\");\n const response = await getAll<CuiResponse>({\n urlOverride: `${URL}/api/app/kosdev.ddk/cui`,\n });\n\n if (response?.status !== 200) {\n throw new Error(\"Failed to retrieve cuis\");\n }\n return response.data;\n};\n\nexport const getDescriptor = async <T extends Record<string, any> = any>(\n path: string\n): Promise<T> => {\n log.debug(\"sending GET for navigation\");\n\n try {\n const extensionResponse = await getOne<T>({\n urlOverride: `${URL}/api/kos/descriptor/app:kosdev.ddk:ncuiDescriptor/${path}`,\n });\n\n if (extensionResponse?.status !== 200) {\n log.info(`no extensions found, using base data`);\n const response = await getOne<T>({\n urlOverride: `${URL}/api/kos/descriptor/system:app/${path}`,\n });\n\n return response?.data ?? ({} as T);\n }\n return extensionResponse?.data ?? ({} as T);\n } catch (error) {\n const response = await getOne<T>({\n urlOverride: `${URL}/api/kos/descriptor/system:app/${path}`,\n });\n\n return response?.data ?? ({} as T);\n }\n};\n\nexport const getNavigation = async () => {\n log.debug(\"sending GET for navigation\");\n\n try {\n const extensionResponse = await getAll<NavigationItem>({\n urlOverride: `${URL}/api/kos/descriptor/app:kosdev.ddk:ncuiDescriptor/kondra.ncui.navigations`,\n });\n\n if (extensionResponse?.status !== 200) {\n log.info(`no extensions found, using base data`);\n const response = await getAll<NavigationItem>({\n urlOverride: `${URL}/api/kos/descriptor/system:app/kondra.ncui.navigations`,\n });\n\n return response?.data ?? [];\n }\n return extensionResponse?.data ?? [];\n } catch (error) {\n const response = await getAll<NavigationItem>({\n urlOverride: `${URL}/api/kos/descriptor/system:app/kondra.ncui.navigations`,\n });\n\n return response?.data ?? [];\n }\n};\n\nexport const navigateToCui = async () => {\n log.debug(\"navigating to CUI\");\n const response = await getOne({\n urlOverride: `${URL}/api/app/kosdev.ddk/cui/open`,\n });\n return response;\n};\n\nexport const navigateToNCui = async () => {\n log.debug(\"navigating to NCUI\");\n const response = await getOne({\n urlOverride: `${URL}/api/app/kosdev.ddk/ncui/open`,\n });\n return response;\n};\n","import type {\n DeviceModel,\n IKosDataModel,\n KosConfigProperty,\n KosContextLogger,\n KosCreationContext,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n Device,\n kosChild,\n kosConfigProperty,\n kosDependency,\n kosModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { Auth, type AuthModel } from \"../auth\";\nimport { Door, type DoorModel } from \"../door\";\nimport {\n SetupStepContainer,\n type SetupStepContainerModel,\n} from \"../setup-step\";\nimport {\n getCuis,\n getNavigation,\n navigateToCui,\n navigateToNCui,\n type CuiResponse,\n type NavigationItem,\n} from \"./services\";\nimport type { ApplicationModel, ApplicationOptions, Language } from \"./types\";\n\nexport const MODEL_TYPE = \"application-model\";\n\nconst flattenNavigationItems = (\n items: NavigationItem[],\n path = \"\"\n): Record<string, NavigationItem> =>\n items.reduce((acc, item) => {\n const itemPath = path ? `${path}.${item.name}` : item.name;\n acc[itemPath] = { ...item, root: !path };\n if (item.children) {\n const childItems = flattenNavigationItems(item.children, itemPath);\n Object.keys(childItems).forEach((key) => {\n acc[key] = childItems[key];\n });\n }\n\n return acc;\n }, {});\n/**\n * @kosService ddk.application\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class ApplicationModelImpl implements ApplicationModel, IKosDataModel {\n id: string;\n\n @kosDependency({ modelType: Device.type })\n device!: DeviceModel;\n\n @kosDependency({ modelType: Auth.type })\n authModel!: AuthModel;\n\n @kosDependency({ modelType: SetupStepContainer.type })\n setupStepContainer!: SetupStepContainerModel;\n\n @kosChild\n door: DoorModel;\n\n @kosConfigProperty({\n path: \"app:kosdev.ddk:app\",\n attribute: \"ncui.ncuiLanguage\", //updated attribute for language config property\n })\n ncuiLanguage!: KosConfigProperty<string>;\n\n @kosConfigProperty({\n path: \"app:kosdev.ddk:service:cui\",\n attribute: \"activeCui\",\n })\n activeCui!: KosConfigProperty<string>;\n\n @kosConfigProperty({\n path: \"app:kosdev.ddk:service:cui\",\n attribute: \"fallbackCui\",\n })\n fallbackCui!: KosConfigProperty<string>;\n\n private _cuis: CuiResponse[] = [];\n\n private _navigationItems: NavigationItem[] = [];\n // @kosConfigProperty({\n // path: 'somewhere.enable.dial.animation',\n // attribute: 'enableDialAnimation',\n // })\n // enableDialAnimation!: KosConfigProperty<boolean>;\n\n // @kosConfigProperty({\n // path: 'somewhere.enable.modal.animation',\n // attribute: 'enableModalAnimation',\n // })\n // enableModalAnimation!: KosConfigProperty<boolean>;\n\n // @kosConfigProperty({\n // path: 'somewhere.enable.sidebar.animation',\n // attribute: 'enableSidebarAnimation',\n // })\n // enableSidebarAnimation!: KosConfigProperty<boolean>;\n\n languages: Language[];\n\n private logger: KosContextLogger;\n\n constructor(\n modelId: string,\n _options: ApplicationOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.languages = [];\n this._cuis = [];\n this.logger = context.logger;\n this.door = Door.instance(\"app:kosdev.ddk:service:door:door\")\n .options({\n doorPath: \"app:kosdev.ddk:service:door:door\",\n })\n .build();\n }\n\n get setupRequired() {\n return this.authModel.currentRole === \"crew\"\n ? false\n : this.setupStepContainer.setupRequired;\n }\n\n get currentRole() {\n return this.authModel.currentRole;\n }\n\n get cuis() {\n return this._cuis.reduce((acc, cui) => {\n acc[cui.appId] = cui;\n return acc;\n }, {});\n }\n\n get navigationItems() {\n return flattenNavigationItems(this._navigationItems);\n }\n\n get hasCuiDefined() {\n return !!this.activeCui.value || !!this.fallbackCui.value;\n }\n\n get doorIsOpen() {\n return this.door.isOpen;\n }\n\n async enter() {\n this.logger.info(\"navigating to NCUI\");\n await navigateToNCui();\n }\n\n async exit() {\n this.logger.info(\"navigating to CUI\");\n await navigateToCui();\n }\n // -------------------LIFECYCLE----------------------------\n\n async load(): Promise<void> {\n this.logger.debug(`loading application ${this.id}`);\n\n const navigationItems = await getNavigation();\n this._navigationItems = navigationItems;\n const cuis = await getCuis();\n this._cuis = cuis;\n // Todo: This code forces the NCUI into technician mode when we detect that\n // the setup pre-steps are incomplete. This logic will be moving to the\n // backend, and this code will need to be updated or removed.\n if (this.setupStepContainer?.hasIncompletePreSteps) {\n this.authModel?.forceRole(\"technician\");\n }\n\n this.languages = [\n {\n name: \"English\",\n locale: \"en\",\n },\n ];\n // const response = await getLanguages();\n // if (response?.status === 200) {\n // kosAction(() => {\n // this.languages = response.data.languages.map((lang) => {\n // return {\n // name: lang.name,\n // locale: lang.locale,\n // };\n // });\n // });\n // }\n }\n}\n","import { Kos, isKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { SingletonKosModelRegistrationBean } from \"@kosdev-code/kos-ui-sdk\";\nimport type { ApplicationModel, ApplicationOptions } from \"./types\";\nimport { ApplicationModelImpl, MODEL_TYPE } from \"./application-model\";\n\n/**\n * # Application\n *\n * The registration bean includes convenience methods for creating and working with ApplicationModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: Application.type, id: \"applicationId\"})\n * private applicationModel: ApplicationModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new ApplicationModel instances.\n *\n \n * As this is a singleton model, the factory function accepts the model options as its argument.\n *\n * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = Application.factory({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a ApplicationModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (Application.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to ApplicationModel\n * // and the compiler will know that the model has the ApplicationModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { Application } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...Application.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The application model is a singleton model. This means that each time the factory function is called , the same instance will be returned.\n * If the model does not yet exist, it will be created passing in the provided options to initialize it.\n *\n * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.\n \n * */\nexport const Application: Readonly<\n SingletonKosModelRegistrationBean<ApplicationModel, ApplicationOptions>\n> = {\n registration: {\n [MODEL_TYPE]: {\n class: ApplicationModelImpl,\n singleton: true,\n },\n },\n type: MODEL_TYPE,\n predicate: isKosModel(MODEL_TYPE),\n factory: Kos.Singleton.create<ApplicationModel, ApplicationOptions>(\n MODEL_TYPE\n ),\n};\n","import { AGITATION_REQUIRED_TROUBLE } from \"@kosdev-code/kos-freestyle-sdk\";\nimport type { TroubleModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { NcuiRole } from \"../auth/types\";\n\nconst RoleMap: Record<NcuiRole, number> = {\n none: 999,\n crew: 0,\n technician: 1,\n manager: 2,\n};\n\nexport const troubleVisibilityFilter =\n (currentRole?: NcuiRole) => (trouble: TroubleModel) => {\n // Hide agitation required trouble from dashboard\n if (trouble.type === AGITATION_REQUIRED_TROUBLE) {\n return false;\n }\n const visibleRole = trouble?.role || \"technician\";\n if (currentRole && visibleRole) {\n const currentRoleIndex =\n RoleMap[currentRole.toLowerCase()] ?? RoleMap[\"crew\"];\n const visibleRoleIndex =\n RoleMap[visibleRole.toLowerCase()] ?? RoleMap[\"crew\"];\n return currentRoleIndex >= visibleRoleIndex;\n }\n return false;\n };\n","import {\n type FutureAwareContainer,\n type FutureContainer,\n FutureEndState,\n type IFutureModel,\n type IKosDataModel,\n type IKosIdentifiable,\n kosAction,\n type KosContextLogger,\n type KosCreationContext,\n kosDependency,\n kosFuture,\n kosModel,\n kosModelEffect,\n kosTopicHandler,\n MultipleFutureHandler,\n type PublicModelInterface,\n type TroubleContainerModel,\n Troubles,\n TroubleServices,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { AgitationControlOptions } from \"./types\";\n\nimport {\n AGITATION_REQUIRED_TROUBLE,\n CartridgeAgitatorEvents,\n} from \"@kosdev-code/kos-freestyle-sdk\";\nimport { Application, type ApplicationModel } from \"../application\";\nimport { troubleVisibilityFilter } from \"../utils/trouble-visibility-filter\";\n\nexport const MODEL_TYPE = \"agitation-control-model\";\nexport const FUTURE_RESOLVE = \"resolve\";\nexport const FUTURE_AGITATE = \"agitate\";\nexport type AgitationControlModel =\n PublicModelInterface<AgitationControlModelImpl>;\n\n/**\n * @kosService ddk.agitation-control\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class AgitationControlModelImpl\n implements IKosDataModel, IKosIdentifiable, FutureContainer\n{\n id: string;\n futureHandler: FutureAwareContainer;\n private logger: KosContextLogger;\n private troubleContainer: TroubleContainerModel;\n private _agitationFutureId?: string;\n private _canExit = true;\n private _exiting = false;\n private _isFailed = false;\n private disposer?: VoidFunction;\n @kosDependency({ modelType: Application.type })\n private application!: ApplicationModel;\n constructor(\n modelId: string,\n options: AgitationControlOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n\n this.troubleContainer = options.companionParent;\n this.futureHandler = new MultipleFutureHandler(this, FUTURE_RESOLVE);\n if (options) {\n // Assign options properties here.\n }\n }\n\n set isFailed(value: boolean) {\n this._isFailed = value;\n }\n get isFailed() {\n return this._isFailed;\n }\n get isDoorClosed() {\n // Uncomment this line to force the door state to be closed\n //return true;\n return !this.application.doorIsOpen;\n }\n\n get isAgitating() {\n return !!this._agitationFutureId;\n }\n\n set exiting(value: boolean) {\n this._exiting = value;\n }\n\n get exiting() {\n return this._exiting;\n }\n\n get canExit() {\n const allDeferredCount = this.queuedTroubles.length;\n\n return allDeferredCount === 0 && this._canExit;\n }\n\n clearAll() {\n this.queuedTroubles.forEach((trouble) => {\n trouble.clearDefer();\n });\n }\n\n get readyToResolve() {\n const allDeferredCount = this.queuedTroubles.length;\n const notResolvable = this.queuedTroubles.filter((t) => t.shouldDefer);\n const _readyToResolve = allDeferredCount > 0 && notResolvable.length === 0;\n return this.isDoorClosed && _readyToResolve && this.exiting;\n }\n onFutureUpdate(future: IFutureModel<Record<string, unknown>>) {\n if (future.endState === FutureEndState.Success) {\n this.logger.debug(\n `Resolve deferred troubles future ${future.id} completed successfully`\n );\n this.queuedTroubles.forEach((trouble) => {\n trouble.clearDefer();\n });\n kosAction(() => {\n this._canExit = true;\n this._isFailed = false;\n });\n } else if (\n future.endState === FutureEndState.Fail ||\n future.endState === FutureEndState.Canceled ||\n future.endState === FutureEndState.Aborted\n ) {\n this.logger.error(`Resolve deferred troubles future ${future.id} failed`);\n this.clearAll();\n kosAction(() => {\n this._canExit = false;\n this._isFailed = true;\n });\n }\n }\n\n private inProgress: string[] = [];\n @kosFuture({ alias: FUTURE_RESOLVE })\n async resolveDeferredTroubles(tracker?: string) {\n const toResolve = this.queuedTroubles\n .filter((t) => !t.shouldDefer)\n .map((trouble) => trouble.rawId)\n .filter((id) => !this.inProgress.includes(id));\n\n this.inProgress.push(...toResolve);\n\n if (toResolve.length === 0) {\n return undefined;\n }\n const response = await TroubleServices.bulkResolveTroubles(\n toResolve,\n undefined,\n tracker\n );\n return response;\n }\n\n get hasQueuedTroubles() {\n return this.queuedTroubles.length > 0;\n }\n get queuedTroubles() {\n return this.troubleContainer.troubles.getIndexByKey(\n Troubles.INDEX_TROUBLES_BY_DEFERRED,\n Troubles.TROUBLES_DEFERRED\n );\n }\n\n get visibleTroubles() {\n const currentRole = this.application.currentRole;\n return this.troubleContainer.troubles.data\n .filter(troubleVisibilityFilter(currentRole))\n .filter((trouble) => trouble.type !== AGITATION_REQUIRED_TROUBLE);\n }\n // -------------------LIFECYCLE----------------------------\n\n get future() {\n return this.futureHandler.future;\n }\n\n get resolveFuture() {\n return this.futureHandler.getFuture(FUTURE_RESOLVE);\n }\n\n get agitateFuture() {\n return this.futureHandler.getFuture(FUTURE_AGITATE);\n }\n\n @kosTopicHandler({ topic: CartridgeAgitatorEvents.TOPIC_AGITATION_STARTED })\n handleAgitationStarted(event: { path: string; futureId: number }) {\n this.logger.info(`Agitation started for ${event.path}`);\n this._agitationFutureId = String(event.futureId);\n }\n\n @kosTopicHandler({ topic: CartridgeAgitatorEvents.TOPIC_AGITATION_ENDED })\n handleAgitationEnded(event: { path: string }) {\n this.logger.info(`Agitation ended for ${event.path}`);\n this._agitationFutureId = undefined;\n }\n\n async init(): Promise<void> {\n this.logger.debug(`initializing agitation-control ${this.id}`);\n }\n\n unload() {\n this.logger.debug(`unloading agitation-control ${this.id}`);\n if (this.disposer) {\n this.disposer();\n }\n }\n\n @kosModelEffect({\n dependencies: (model) => [model.readyToResolve, model._agitationFutureId],\n })\n handleReadyToResolve() {\n if (this.readyToResolve) {\n this.logger.info(`AgitationControl - Resolving deferred troubles`);\n this.resolveDeferredTroubles();\n }\n\n if (this._agitationFutureId) {\n this.logger.info(`AgitationControl - Agitation started`);\n }\n }\n async load(): Promise<void> {\n this.logger.debug(`loading agitation-control ${this.id}`);\n }\n}\n","import { SingletonKosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { AgitationControlOptions } from \"./types\";\nimport {\n AgitationControlModelImpl,\n MODEL_TYPE,\n} from \"./agitation-control-model\";\nimport type { AgitationControlModel } from \"./agitation-control-model\";\n\n/**\n * # AgitationControl\n *\n * The registration bean includes convenience methods for creating and working with AgitationControlModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: AgitationControl.type, id: \"agitationControlId\"})\n * private agitationControlModel: AgitationControlModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new AgitationControlModel instances.\n *\n \n * As this is a singleton model, the factory function accepts the model options as its argument.\n *\n * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = AgitationControl.factory({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a AgitationControlModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (AgitationControl.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to AgitationControlModel\n * // and the compiler will know that the model has the AgitationControlModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { AgitationControl } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(AgitationControl);\n * ```\n *\n * ## registration.singleton\n \n * The agitationControl model is a singleton model. This means that each time the factory function is called , the same instance will be returned.\n * If the model does not yet exist, it will be created passing in the provided options to initialize it.\n *\n * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.\n \n * */\nexport const AgitationControl = new SingletonKosModelRegistrationFactory<\n AgitationControlModel,\n AgitationControlOptions\n>({\n class: AgitationControlModelImpl,\n type: MODEL_TYPE,\n});\n","import type {\n IKosDataModel,\n KosConfigProperty,\n KosContextLogger,\n KosCreationContext,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { kosConfigProperty, kosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { AnimationModel, AnimationOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"animation-model\";\n\n/**\n * @kosService ddk.animation\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class AnimationModelImpl implements AnimationModel, IKosDataModel {\n id: string;\n private logger: KosContextLogger;\n\n @kosConfigProperty({\n path: \"app:kosdev.ddk:app\",\n attribute: \"ncui.uiConfig.animations.disableAll\",\n })\n disableAll!: KosConfigProperty<boolean>;\n\n @kosConfigProperty({\n path: \"app:kosdev.ddk:app\",\n attribute: \"ncui.uiConfig.animations.enableDial\",\n })\n enableDial!: KosConfigProperty<boolean>;\n\n @kosConfigProperty({\n path: \"app:kosdev.ddk:app\",\n attribute: \"ncui.uiConfig.animations.enableModal\",\n })\n enableModal!: KosConfigProperty<boolean>;\n\n @kosConfigProperty({\n path: \"app:kosdev.ddk:app\",\n attribute: \"ncui.uiConfig.animations.enableSideBar\",\n })\n enableSideBar!: KosConfigProperty<boolean>;\n\n constructor(\n modelId: string,\n options: AnimationOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n if (options) {\n // Assign options properties here.\n }\n }\n}\n","import { Kos, isKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { SingletonKosModelRegistrationBean } from \"@kosdev-code/kos-ui-sdk\";\nimport type { AnimationModel, AnimationOptions } from \"./types\";\nimport { AnimationModelImpl, MODEL_TYPE } from \"./animation-model\";\n\n/**\n * # Animation\n *\n * The registration bean includes convenience methods for creating and working with AnimationModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: Animation.type, id: \"animationId\"})\n * private animationModel: AnimationModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new AnimationModel instances.\n *\n \n * As this is a singleton model, the factory function accepts the model options as its argument.\n *\n * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = Animation.factory({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a AnimationModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (Animation.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to AnimationModel\n * // and the compiler will know that the model has the AnimationModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { Animation } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...Animation.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The animation model is a singleton model. This means that each time the factory function is called , the same instance will be returned.\n * If the model does not yet exist, it will be created passing in the provided options to initialize it.\n *\n * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.\n \n * */\nexport const Animation: Readonly<\n SingletonKosModelRegistrationBean<AnimationModel, AnimationOptions>\n> = {\n registration: {\n [MODEL_TYPE]: {\n class: AnimationModelImpl,\n singleton: true,\n },\n },\n type: MODEL_TYPE,\n predicate: isKosModel(MODEL_TYPE),\n factory: Kos.Singleton.create<AnimationModel, AnimationOptions>(MODEL_TYPE),\n};\n","import {\n ServiceFactory,\n resolveServiceUrl,\n KosLog,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"ANIMATION_SERVICE\");\nconst { getAll } = ServiceFactory.build({\n basePath: `${URL}/api/animation`,\n});\n\nconst log = KosLog.createLogger({\n name: \"animation-service\",\n group: \"Services\",\n});\ninterface AnimationResponse {\n id: string;\n}\n/**\n * @category Service\n * Retrieves the initial animation data.\n */\nexport const getAnimations = async () => {\n log.debug(\"sending GET for animation\");\n const response = await getAll<AnimationResponse>({});\n return response;\n};\n","import { Assembly, type AssemblyModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport {\n FcmPump,\n type FcmPumpModel,\n type PumpAware,\n} from \"@kosdev-code/kos-freestyle-sdk\";\nimport type {\n IKosDataModel,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n getKosCompanionModel,\n kosDependency,\n kosModel,\n} from \"@kosdev-code/kos-ui-sdk\";\n\nimport type { CarbWaterOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"carb-water-model\";\n\nexport type CarbWaterModel = PublicModelInterface<CarbWaterModelImpl>;\n\n/**\n * @kosService ddk.carb-water\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class CarbWaterModelImpl\n implements CarbWaterModel, IKosDataModel, PumpAware\n{\n id: string;\n\n @kosDependency({ modelType: Assembly.type })\n assemblyModel!: AssemblyModel;\n\n private logger: KosContextLogger;\n\n constructor(\n modelId: string,\n _options: CarbWaterOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n }\n\n getPump(): FcmPumpModel {\n const carbHolder = this.assemblyModel.getHoldersByGroup(\"carb\")[0];\n\n const pump = carbHolder.pumps.data[0];\n\n const model = getKosCompanionModel<FcmPumpModel>(pump, FcmPump.type);\n\n return model;\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing carb-water ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading carb-water ${this.id}`);\n }\n}\n","import { Kos, isKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { KosModelRegistrationBean } from \"@kosdev-code/kos-ui-sdk\";\nimport {\n CarbWaterModel,\n CarbWaterModelImpl,\n MODEL_TYPE,\n} from \"./carb-water-model\";\nimport type { CarbWaterOptions } from \"./types\";\n\n/**\n * # CarbWater\n *\n * The registration bean includes convenience methods for creating and working with CarbWaterModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: CarbWater.type, id: \"carbWaterId\"})\n * private carbWaterModel: CarbWaterModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new CarbWaterModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = CarbWater.factory(\"carbWaterId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a CarbWaterModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (CarbWater.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to CarbWaterModel\n * // and the compiler will know that the model has the CarbWaterModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { CarbWater } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...CarbWater.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The carbWater model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const CarbWater: Readonly<\n KosModelRegistrationBean<CarbWaterModel, CarbWaterOptions>\n> = {\n registration: {\n [MODEL_TYPE]: {\n class: CarbWaterModelImpl,\n singleton: false,\n },\n },\n type: MODEL_TYPE,\n predicate: isKosModel(MODEL_TYPE),\n factory: Kos.Factory.create<CarbWaterModel, CarbWaterOptions>(MODEL_TYPE),\n};\n","import {\n FetchError,\n KosLog,\n ServiceFactory,\n resolveServiceUrl,\n type FutureResponse,\n type KosServiceResponse,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"COPY-LOGS_SERVICE\");\nconst { getAll, getOne, postModel, deleteModel } = ServiceFactory.build({\n basePath: `${URL}/api/copy-logs`,\n});\n\nconst log = KosLog.createLogger({\n name: \"copy-logs-service\",\n group: \"Services\",\n});\ninterface CopyLogsResponse {\n id: string;\n info: {\n totalBytes: number;\n freeBytes: number;\n };\n}\n\ntype LogFileSizeResponse = [string | undefined, string | undefined];\n\ntype VolumeSizeResponse = [string | undefined, CopyLogsResponse[] | undefined];\n\nexport const eraseVolume = async (\n volumeId: string,\n tracker: string\n): Promise<FutureResponse> => {\n const response: KosServiceResponse<FutureResponse> | undefined =\n await deleteModel({\n tracker,\n id: volumeId,\n urlOverride: `${URL}/api/app/kosdev.ddk/copyLogs/${volumeId}`,\n });\n\n if (!response?.data) {\n throw new Error(\"No response from server\");\n }\n return response.data;\n};\n\nexport const eraseAndCopyLogsToVolume = async (\n volumeId: string,\n tracker: string\n): Promise<FutureResponse> => {\n const response: KosServiceResponse<FutureResponse> | undefined =\n await postModel({\n model: {},\n tracker,\n urlOverride: `${URL}/api/app/kosdev.ddk/copyLogs/eraseAndCopy/${volumeId}`,\n });\n\n if (!response?.data) {\n throw new Error(\"No response from server\");\n }\n return response.data;\n};\nexport const copyLogFromVolume = async (\n volumeId: string,\n tracker: string\n): Promise<FutureResponse> => {\n const response: KosServiceResponse<FutureResponse> | undefined =\n await postModel({\n model: {},\n tracker,\n urlOverride: `${URL}/api/app/kosdev.ddk/copyLogs/${volumeId}`,\n });\n\n if (!response?.data) {\n throw new Error(\"No response from server\");\n }\n return response.data;\n};\n\n/**\n * @category Service\n * Retrieves the initial copy-logs data.\n */\nexport const getVolumes = async (): Promise<VolumeSizeResponse> => {\n log.debug(\"sending GET for copy-logs\");\n\n try {\n const response = await getAll<CopyLogsResponse>({\n urlOverride: `${URL}/api/app/kosdev.ddk/copyLogs/volumes/size`,\n });\n\n return [undefined, response?.data];\n } catch (error) {\n if (error instanceof FetchError) {\n log.error(`Error fetching log file size: ${error.payload.error}`);\n return [error.payload.error, undefined];\n }\n }\n\n return [\"unknownError\", undefined];\n};\n\nexport const getLogFileSize = async (): Promise<LogFileSizeResponse> => {\n log.debug(\"sending GET for log file size\");\n\n try {\n const response = await getOne<string>({\n urlOverride: `${URL}/api/app/kosdev.ddk/copyLogs/files/size`,\n });\n\n return [undefined, response?.data];\n } catch (error) {\n if (error instanceof FetchError) {\n log.error(`Error fetching log file size: ${error.payload.error}`);\n return [error.payload.error, undefined];\n }\n }\n\n return [\"unknownError\", undefined];\n};\n","/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\nimport type {\n ExternalFutureInterface,\n IFutureModel,\n IKosDataContainer,\n IKosDataModel,\n IKosIdentifiable,\n KosLoggerAware,\n KosModelRegistrationType,\n PublicModelInterface,\n StorageDeviceContainerModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n FutureEndState,\n kosAction,\n KosDataContainer,\n kosDependency,\n kosFuture,\n kosFutureAware,\n KosFutureAwareFull,\n kosLoggerAware,\n kosModel,\n kosModelEffect,\n StorageDeviceContainer,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n copyLogFromVolume,\n eraseAndCopyLogsToVolume,\n eraseVolume,\n getLogFileSize,\n getVolumes,\n} from \"./services\";\nimport type { CopyLogsOptions, CopyProgress } from \"./types\";\n\nexport const MODEL_TYPE = \"copy-logs-model\";\n\nexport type CopyLogsModel = PublicModelInterface<CopyLogsModelImpl> &\n ExternalFutureInterface<CopyProgress>;\n\nexport interface Volume {\n id: string;\n name: string;\n freeBytes: number;\n totalBytes: number;\n}\n\n// Interface merging to add Future Container properties\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface CopyLogsModelImpl\n extends KosFutureAwareFull<CopyProgress>,\n KosLoggerAware {}\n\n/**\n * @kosService ddk.copy-logs\n * @kosApiLevel 1\n */\n@kosModel({ modelTypeId: MODEL_TYPE, singleton: true })\n@kosFutureAware()\n@kosLoggerAware()\nexport class CopyLogsModelImpl implements IKosDataModel, IKosIdentifiable {\n static Registration: KosModelRegistrationType<CopyLogsModel, CopyLogsOptions>;\n\n id: string;\n\n private _volumes: IKosDataContainer<Volume>;\n\n // Future properties are available via interface merging - no need to declare\n @kosDependency({ modelType: StorageDeviceContainer.type })\n private storageDeviceContainer!: StorageDeviceContainerModel;\n private _activeVolume?: Volume;\n private _logFileSize = 0;\n private _actionState: \"idle\" | \"erasing\" | \"copying\" = \"idle\";\n copyProgress: CopyProgress;\n constructor(modelId: string) {\n this.id = modelId;\n\n this._volumes = new KosDataContainer<Volume>();\n this._activeVolume = undefined;\n this.copyProgress = {\n bytesCopied: 0,\n bytesToCopy: 0,\n filesCopied: 0,\n filesSkipped: 0,\n };\n }\n\n // -------------------LIFECYCLE----------------------------\n\n get volumes() {\n return this._volumes.data;\n }\n get activeVolume() {\n return this._activeVolume;\n }\n\n get logFileSize() {\n return this._logFileSize;\n }\n\n reset() {\n this.clearActiveVolume();\n this.futureHandler.removeFuture();\n }\n clearActiveVolume() {\n this._activeVolume = undefined;\n }\n updateActiveVolume(volume: Volume) {\n this._activeVolume = volume;\n }\n get inserted() {\n return this.storageDeviceContainer.isStorageInserted;\n }\n\n updateLogFileSize(size: number) {\n this._logFileSize = size;\n }\n\n get canCopyLogs() {\n return this.inserted && this._activeVolume;\n }\n\n get actionState() {\n return this._actionState;\n }\n\n get diskFull() {\n return (\n this.future?.status === FutureEndState.Success &&\n this.copyProgress.filesSkipped > 0\n );\n }\n\n onFutureUpdate(update: IFutureModel<CopyProgress>) {\n this.logger.info(`Future update: ${update.status}`);\n if (update.status === FutureEndState.Success) {\n this.logger.info(`Future success: ${update.status}`);\n if (this.diskFull) {\n kosAction(() => {\n update.endState = FutureEndState.Fail;\n update.reason = \"errDiskFull\";\n });\n }\n }\n if (update.status === FutureEndState.Fail) {\n this.logger.error(`Future failed: ${update.status}`);\n }\n\n if (update.note === \"copy\") {\n kosAction(() => {\n this._actionState = \"copying\";\n this.copyProgress = update.clientData || {\n bytesCopied: 0,\n bytesToCopy: 0,\n filesCopied: 0,\n filesSkipped: 0,\n };\n });\n } else {\n this._actionState = \"erasing\";\n kosAction(() => {\n this.copyProgress = {\n bytesCopied: 0,\n bytesToCopy: 0,\n filesCopied: 0,\n filesSkipped: 0,\n };\n });\n }\n }\n\n @kosFuture()\n async eraseAndCopyVolume(tracker?: string) {\n // should be handed in by the `kosFuture` decorator\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n\n kosAction(() => {\n this._actionState = \"erasing\";\n });\n if (!this._activeVolume) {\n this.logger.error(\"No active volume selected\");\n throw new Error(\"No active volume selected\");\n }\n this.logger.info(`Erasing volume ${this._activeVolume?.name}`);\n\n return eraseAndCopyLogsToVolume(this._activeVolume.id, tracker);\n }\n @kosFuture()\n async eraseVolume(tracker?: string) {\n // should be handed in by the `kosFuture` decorator\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n\n kosAction(() => {\n this._actionState = \"erasing\";\n });\n if (!this._activeVolume) {\n this.logger.error(\"No active volume selected\");\n throw new Error(\"No active volume selected\");\n }\n this.logger.info(`Erasing volume ${this._activeVolume?.name}`);\n\n return eraseVolume(this._activeVolume.id, tracker);\n }\n\n @kosFuture()\n async copyLogs(tracker?: string) {\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n kosAction(() => {\n this._actionState = \"copying\";\n });\n\n if (!this._activeVolume) {\n this.logger.error(\"No active volume selected\");\n throw new Error(\"No active volume selected\");\n }\n this.logger.info(`Copying logs to ${this._activeVolume?.name}`);\n\n return copyLogFromVolume(this._activeVolume.id, tracker);\n }\n\n @kosModelEffect({\n dependencies: (model) => [model.inserted],\n })\n protected handleInsertion() {\n if (this.inserted) {\n this.syncVolumes();\n } else {\n this._volumes.clear();\n this.clearActiveVolume();\n }\n }\n\n async init(): Promise<void> {\n this.logger.debug(`initializing copy-logs ${this.id}`);\n }\n\n async syncVolumes() {\n const [volumeError, volumes] = await getVolumes();\n const [error, logSize] = await getLogFileSize();\n if (error) {\n this.logger.error(`Error fetching log file size: ${error}`);\n return;\n }\n\n if (volumeError) {\n this.logger.error(`Error fetching volumes: ${volumeError}`);\n return;\n }\n\n if (volumes) {\n volumes.forEach((volume) => {\n const storageVolume = this.storageDeviceContainer.getModel(volume.id);\n if (storageVolume) {\n const _volume: Volume = {\n id: volume.id,\n name: storageVolume.label,\n freeBytes: volume.info.freeBytes,\n totalBytes: volume.info.totalBytes,\n };\n\n this._volumes.addModel(_volume);\n }\n });\n if (volumes.length === 1) {\n this.updateActiveVolume(this._volumes.data[0]);\n } else {\n this.clearActiveVolume();\n }\n }\n\n if (logSize) {\n this.logger.info(`Log file size: ${logSize}`);\n this.updateLogFileSize(parseInt(logSize, 10));\n }\n }\n\n async activate(): Promise<void> {\n this.logger.debug(`activating copy-logs ${this.id}`);\n await this.syncVolumes();\n }\n async load(): Promise<void> {\n this.logger.debug(`loading copy-logs ${this.id}`);\n }\n}\n","export type { CopyLogsModel, Volume } from \"./copy-logs-model\";\nexport * as CopyLogsServices from \"./services\";\nexport type * from \"./types\";\nimport { CopyLogsModelImpl } from \"./copy-logs-model\";\nexport const CopyLogs = CopyLogsModelImpl.Registration;\n","import { KosLog, TroubleServices } from \"@kosdev-code/kos-ui-sdk\";\n// const { URL } = resolveServiceUrl('DASHBOARD-OPERATIONS_SERVICE');\n// const { getAll } = ServiceFactory.build({\n// basePath: `${URL}/api/dashboard-operations`,\n// });\n\nconst log = KosLog.createLogger({\n name: \"dashboard-operations-service\",\n group: \"Services\",\n});\n\n/**\n * @category Service\n * Retrieves the initial dashboard-operations data.\n */\n\nexport const resolveAll = async (troubleIds: string[], tracker?: string) => {\n log.debug(\"resolveAll\");\n // call the bulkResolveTroubles method from the Trouble Service and return the response\n const response = await TroubleServices.bulkResolveTroubles(\n troubleIds,\n undefined,\n tracker\n );\n return response;\n};\n\nexport const resolveTrouble = async (troubleId: string, tracker?: string) => {\n log.debug(\"resolveTrouble\");\n // call the resolveTrouble method from the Trouble Service and return the response\n const response = await TroubleServices.resolveTrouble(\n troubleId,\n undefined,\n tracker\n );\n return response;\n};\n","import type {\n IKosDataModel,\n KosContextLogger,\n KosCreationContext,\n TroubleContainerModel,\n TroubleModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n FutureHandler,\n TroubleContainer,\n kosDependency,\n kosFuture,\n kosModel,\n troubleByTypeReducer,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { TROUBLE_TYPE_PRIME, TROUBLE_TYPE_PURGE } from \"../../constants\";\nimport { resolveAll, resolveTrouble } from \"./services\";\nimport type {\n DashboardOperationsModel,\n DashboardOperationsOptions,\n} from \"./types\";\n\nexport const MODEL_TYPE = \"dashboard-operations-model\";\n\nfunction resolvableTroubleFilter(trouble: TroubleModel) {\n return !trouble.deferred;\n}\n\nfunction deferredTroubleFilter(trouble: TroubleModel) {\n return trouble.deferred;\n}\n/**\n * @kosService ddk.dashboard\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class DashboardOperationsModelImpl\n implements DashboardOperationsModel, IKosDataModel\n{\n id: string;\n\n @kosDependency({\n modelType: TroubleContainer.type,\n })\n private troubles!: TroubleContainerModel;\n\n futureHandler: FutureHandler;\n private logger: KosContextLogger;\n constructor(\n modelId: string,\n options: DashboardOperationsOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.futureHandler = new FutureHandler(this);\n this.logger = context.logger;\n if (options) {\n // Assign options properties here.\n }\n }\n\n get troublesByType() {\n return this.troubles.troubles.data.reduce(\n troubleByTypeReducer,\n {} as Record<string, TroubleModel[]>\n );\n }\n\n get queuedPurgeTroubles() {\n return this.purgeTroubles.filter(deferredTroubleFilter);\n }\n\n get queuedPrimeTroubles() {\n return this.primeTroubles.filter(deferredTroubleFilter);\n }\n\n get resolvablePrimeTroubles() {\n return this.primeTroubles.filter(resolvableTroubleFilter);\n }\n\n get resolvablePurgeTroubles() {\n return this.purgeTroubles.filter(resolvableTroubleFilter);\n }\n\n get hasResolvablePurgeTroubles() {\n return this.resolvablePurgeTroubles.length > 0;\n }\n\n get hasResolvablePrimeTroubles() {\n return this.resolvablePrimeTroubles.length > 0;\n }\n get hasPurgeTroubles() {\n return this.purgeTroubles.length > 0;\n }\n\n get hasPrimeTroubles() {\n return this.primeTroubles.length > 0;\n }\n\n get purgeTroubles() {\n return this.troublesByType[TROUBLE_TYPE_PURGE] || [];\n }\n\n get primeTroubles() {\n return this.troublesByType[TROUBLE_TYPE_PRIME] || [];\n }\n\n get future() {\n return this.futureHandler.getFuture();\n }\n @kosFuture()\n async resolveAllTroubles(type: string, tracker?: string) {\n // should be handed in by the `kosFuture` decorator\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n\n const container =\n type === TROUBLE_TYPE_PURGE ? this.purgeTroubles : this.primeTroubles;\n\n const shouldDefer = container.filter((trouble) => trouble.shouldDefer);\n shouldDefer.forEach((trouble) => {\n this.logger.info(`Deferring trouble ${trouble.rawId}`);\n trouble.defer();\n });\n // gather up all of the purge trouble ids for the macro holders\n const allTroubles = container\n .filter((trouble) => !trouble.shouldDefer)\n .map((trouble) => trouble.rawId);\n\n if (allTroubles.length === 0) {\n return undefined;\n }\n // submit the purge troubles to the trouble service bulk resolve endpoint\n const response = await resolveAll(allTroubles, tracker);\n\n return response;\n }\n\n @kosFuture()\n async resolveTrouble(troubleId: string, tracker?: string) {\n // should be handed in by the `kosFuture` decorator\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n\n // submit the purge troubles to the trouble service single resolve endpoint\n const response = await resolveTrouble(troubleId, tracker);\n\n return response;\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing dashboard-operations ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading dashboard-operations ${this.id}`);\n }\n}\n","import type { SingletonKosModelRegistrationBean } from \"@kosdev-code/kos-ui-sdk\";\nimport { Kos, isKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport {\n DashboardOperationsModelImpl,\n MODEL_TYPE,\n} from \"./dashboard-operations-model\";\nimport type {\n DashboardOperationsModel,\n DashboardOperationsOptions,\n} from \"./types\";\n\n/**\n * # DashboardOperations\n *\n * The registration bean includes convenience methods for creating and working with DashboardOperationsModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: DashboardOperations.type, id: \"dashboardOperationsId\"})\n * private dashboardOperationsModel: DashboardOperationsModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new DashboardOperationsModel instances.\n *\n \n * As this is a singleton model, the factory function accepts the model options as its argument.\n *\n * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = DashboardOperations.factory({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a DashboardOperationsModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (DashboardOperations.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to DashboardOperationsModel\n * // and the compiler will know that the model has the DashboardOperationsModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { DashboardOperations } from \"@kosdev-code/kos-dispense-sdk\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...DashboardOperations.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The dashboardOperations model is a singleton model. This means that each time the factory function is called , the same instance will be returned.\n * If the model does not yet exist, it will be created passing in the provided options to initialize it.\n *\n * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.\n \n * */\nexport const DashboardOperations: Readonly<\n SingletonKosModelRegistrationBean<\n DashboardOperationsModel,\n DashboardOperationsOptions\n >\n> = {\n registration: {\n [MODEL_TYPE]: {\n class: DashboardOperationsModelImpl,\n singleton: true,\n },\n },\n type: MODEL_TYPE,\n predicate: isKosModel(MODEL_TYPE),\n factory: Kos.Singleton.create<\n DashboardOperationsModel,\n DashboardOperationsOptions\n >(MODEL_TYPE),\n};\n","import type {\n IKosModelLogger,\n KosContextLogger,\n KosCreationContext,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { kosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { DispenserModel, DispenserOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"dispenser-model\";\n\n/**\n * @kosService ddk.dispenser\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class DispenserModelImpl implements DispenserModel, IKosModelLogger {\n id: string;\n logger: KosContextLogger;\n constructor(\n modelId: string,\n options: DispenserOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n if (options) {\n // Assign options properties here.\n }\n }\n\n updateModel(): void {\n // Update model properties here.\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing dispenser ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading dispenser ${this.id}`);\n }\n}\n","import type { SingletonKosModelRegistrationBean } from \"@kosdev-code/kos-ui-sdk\";\nimport { Kos, isKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport { DispenserModelImpl, MODEL_TYPE } from \"./dispenser-model\";\nimport type { DispenserModel, DispenserOptions } from \"./types\";\n\n/**\n * # Dispenser\n *\n * The registration bean includes convenience methods for creating and working with DispenserModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: Dispenser.type, id: \"dispenserId\"})\n * private dispenserModel: DispenserModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new DispenserModel instances.\n *\n \n * As this is a singleton model, the factory function accepts the model options as its argument.\n *\n * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = Dispenser.factory({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a DispenserModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (Dispenser.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to DispenserModel\n * // and the compiler will know that the model has the DispenserModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { Dispenser } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...Dispenser.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The dispenser model is a singleton model. This means that each time the factory function is called , the same instance will be returned.\n * If the model does not yet exist, it will be created passing in the provided options to initialize it.\n *\n * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.\n \n * */\nexport const Dispenser: Readonly<\n SingletonKosModelRegistrationBean<DispenserModel, DispenserOptions>\n> = {\n registration: {\n [MODEL_TYPE]: {\n class: DispenserModelImpl,\n singleton: true,\n },\n },\n type: MODEL_TYPE,\n predicate: isKosModel(MODEL_TYPE),\n factory: Kos.Singleton.create<DispenserModel, DispenserOptions>(MODEL_TYPE),\n};\n","import {\n ServiceFactory,\n resolveServiceUrl,\n KosLog,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"DISPENSER_SERVICE\");\nconst { getAll } = ServiceFactory.build({\n basePath: `${URL}/api/dispenser`,\n});\n\nconst log = KosLog.createLogger({\n name: \"dispenser-service\",\n group: \"Services\",\n});\ninterface DispenserResponse {\n id: string;\n}\n/**\n * @category Service\n * Retrieves the initial dispenser data.\n */\nexport const getDispensers = async () => {\n log.debug(\"sending GET for dispenser\");\n const response = await getAll<DispenserResponse>({});\n return response;\n};\n","import type {\n IKosDataModel,\n KosConfigProperty,\n KosContextLogger,\n KosCreationContext,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { kosConfigProperty, kosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { DispenserInfoModel, DispenserInfoOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"dispenser-info-model\";\n\n/**\n * @kosService ddk.dispenser-info\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class DispenserInfoModelImpl\n implements DispenserInfoModel, IKosDataModel\n{\n private logger: KosContextLogger;\n\n id: string;\n\n @kosConfigProperty({\n path: \"kos:device\",\n attribute: \"name\",\n })\n name!: KosConfigProperty<string>;\n\n constructor(\n modelId: string,\n _options: DispenserInfoOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing dispenser-info ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading dispenser-info ${this.id}`);\n }\n}\n","import { Kos, isKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { KosModelRegistrationBean } from \"@kosdev-code/kos-ui-sdk\";\nimport type { DispenserInfoModel, DispenserInfoOptions } from \"./types\";\nimport { DispenserInfoModelImpl, MODEL_TYPE } from \"./dispenser-info-model\";\n\n/**\n * # DispenserInfo\n *\n * The registration bean includes convenience methods for creating and working with DispenserInfoModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: DispenserInfo.type, id: \"dispenserInfoId\"})\n * private dispenserInfoModel: DispenserInfoModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new DispenserInfoModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = DispenserInfo.factory(\"dispenserInfoId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a DispenserInfoModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (DispenserInfo.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to DispenserInfoModel\n * // and the compiler will know that the model has the DispenserInfoModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { DispenserInfo } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...DispenserInfo.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The dispenserInfo model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const DispenserInfo: Readonly<\n KosModelRegistrationBean<DispenserInfoModel, DispenserInfoOptions>\n> = {\n registration: {\n [MODEL_TYPE]: {\n class: DispenserInfoModelImpl,\n singleton: false,\n },\n },\n type: MODEL_TYPE,\n predicate: isKosModel(MODEL_TYPE),\n factory: Kos.Factory.create<DispenserInfoModel, DispenserInfoOptions>(\n MODEL_TYPE\n ),\n};\n","import {\n ServiceFactory,\n resolveServiceUrl,\n KosLog,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"DISPENSER-INFO_SERVICE\");\nconst { getAll } = ServiceFactory.build({\n basePath: `${URL}/api/dispenser-info`,\n});\n\nconst log = KosLog.createLogger({\n name: \"dispenser-info-service\",\n group: \"Services\",\n});\ninterface DispenserInfoResponse {\n id: string;\n}\n/**\n * @category Service\n * Retrieves the initial dispenser-info data.\n */\nexport const getDispenserInfos = async () => {\n log.debug(\"sending GET for dispenser-info\");\n const response = await getAll<DispenserInfoResponse>({});\n return response;\n};\n","import type {\n IKosModelLogger,\n KosContextLogger,\n KosCreationContext,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { kosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { EnrollmentModel, EnrollmentOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"enrollment-model\";\n\n/**\n * @kosService ddk.enrollment\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class EnrollmentModelImpl implements EnrollmentModel, IKosModelLogger {\n id: string;\n logger: KosContextLogger;\n enrolled: boolean;\n\n constructor(\n modelId: string,\n _options: EnrollmentOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this.enrolled = false;\n }\n\n updateModel(options: EnrollmentOptions): void {\n console.log(\"updateModel:\", options);\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing enrollment ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading enrollment ${this.id}`);\n }\n}\n","import type { SingletonKosModelRegistrationBean } from \"@kosdev-code/kos-ui-sdk\";\nimport { Kos, isKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport { EnrollmentModelImpl, MODEL_TYPE } from \"./enrollment-model\";\nimport type { EnrollmentModel, EnrollmentOptions } from \"./types\";\n\n/**\n * # Enrollment\n *\n * The registration bean includes convenience methods for creating and working with EnrollmentModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: Enrollment.type, id: \"enrollmentId\"})\n * private enrollmentModel: EnrollmentModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new EnrollmentModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = Enrollment.factory(\"enrollmentId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a EnrollmentModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (Enrollment.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to EnrollmentModel\n * // and the compiler will know that the model has the EnrollmentModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { Enrollment } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...Enrollment.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The enrollment model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const Enrollment: Readonly<\n SingletonKosModelRegistrationBean<EnrollmentModel, EnrollmentOptions>\n> = {\n registration: {\n [MODEL_TYPE]: {\n class: EnrollmentModelImpl,\n singleton: true,\n },\n },\n type: MODEL_TYPE,\n predicate: isKosModel(MODEL_TYPE),\n factory: Kos.Singleton.create<EnrollmentModel, EnrollmentOptions>(MODEL_TYPE),\n};\n","import {\n ServiceFactory,\n resolveServiceUrl,\n KosLog,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"ENROLLMENT_SERVICE\");\nconst { getAll } = ServiceFactory.build({\n basePath: `${URL}/api/enrollment`,\n});\n\nconst log = KosLog.createLogger({\n name: \"enrollment-service\",\n group: \"Services\",\n});\ninterface EnrollmentResponse {\n id: string;\n}\n/**\n * @category Service\n * Retrieves the initial enrollment data.\n */\nexport const getEnrollments = async () => {\n log.debug(\"sending GET for enrollment\");\n const response = await getAll<EnrollmentResponse>({});\n return response;\n};\n","import { AssemblyModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport type { FreestyleModelAssemblyExt } from \"@kosdev-code/kos-freestyle-sdk\";\n\nexport const isMicroGroup = (group: string) =>\n group.toLowerCase().includes(\"micros\");\n\nexport const isMacroGroup = (group: string) =>\n !group.toLowerCase().includes(\"micros\");\n\nexport interface HolderProps {\n name: string;\n id: string;\n path: string;\n}\n\nexport const macroHolderMap =\n (assembly: AssemblyModel<FreestyleModelAssemblyExt>) =>\n (holderName: string) => {\n const holderGroup = assembly?.getHoldersByGroup(holderName);\n if (!holderGroup) {\n return null;\n }\n\n return holderGroup.map((holder) => {\n return { id: holder.id, name: holder.ingredientName, path: holder.path };\n });\n };\n\nexport const MACRO_KEYS = [\"water\", \"carb\", \"ns\", \"nss\"] as const;\n","import type { HolderModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport {\n ExtensionManager,\n registerExtensionPoint,\n} from \"@kosdev-code/kos-ui-sdk\";\n\n// Declare the module augmentation\ndeclare module \"@kosdev-code/kos-ui-sdk\" {\n interface IExtensionManager {\n registerDashboardKeyFactory: (factory: HolderDetailFactory) => void;\n executeDashboardKeyFactory: (holder: HolderModel) => string | undefined;\n }\n}\n\nexport const EXTENSION_POINT_DASHBOARD_KEY_FACTORY = \"dashboardKeyFactory\";\nexport type HolderDetailFactory = {\n factory: (holder: HolderModel) => string | undefined | void;\n rank: number;\n};\nconst dashboardKeyFactories: HolderDetailFactory[] = [];\nregisterExtensionPoint(EXTENSION_POINT_DASHBOARD_KEY_FACTORY, {\n register: (_id: string, factory: HolderDetailFactory) => {\n if (dashboardKeyFactories.includes(factory)) {\n return;\n }\n dashboardKeyFactories.push(factory);\n },\n execute: (_id: string, holder: HolderModel) => {\n const factories = dashboardKeyFactories.sort((a, b) => a.rank - b.rank);\n\n for (const factory of factories) {\n const key = factory.factory(holder);\n if (key) {\n return key;\n }\n }\n return undefined;\n },\n});\n\nexport const registerDashboardKeyFactory = (factory: HolderDetailFactory) => {\n ExtensionManager[EXTENSION_POINT_DASHBOARD_KEY_FACTORY].register(\n EXTENSION_POINT_DASHBOARD_KEY_FACTORY,\n factory\n );\n};\n\nexport const executeDashboardKeyFactory = (holder: HolderModel) =>\n ExtensionManager[EXTENSION_POINT_DASHBOARD_KEY_FACTORY].execute(\n EXTENSION_POINT_DASHBOARD_KEY_FACTORY,\n holder\n );\n\nExtensionManager.registerDashboardKeyFactory = registerDashboardKeyFactory;\nExtensionManager.executeDashboardKeyFactory = executeDashboardKeyFactory;\n","//prettier-ignore\nexport type Hours = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23;\n//prettier-ignore\nexport type Minutes = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59;\n\nconst HOUR = 3600; // Seconds in an hour...\nconst MINUTE = 60; // Seconds in a minute...\n\n// Convert number of seconds into hours and minutes...\nexport const toTimeComponents = (seconds: number) => {\n const hours = Math.floor(seconds / HOUR) as Hours;\n const minutes = Math.floor((seconds % HOUR) / MINUTE) as Minutes;\n\n return { hours, minutes };\n};\n\nexport const toSeconds = (hours: Hours, minutes: Minutes) => {\n const time = hours * HOUR + minutes * MINUTE;\n\n return time;\n};\n\nexport const calculateTimeDifference = (date: Date) => {\n const currentDate = new Date();\n const timeDifference: number = currentDate.valueOf() - date.valueOf();\n const minutes = Math.floor(timeDifference / (1000 * 60));\n const hours = Math.floor(minutes / 60);\n const days = Math.floor(hours / 24);\n\n const remainingMinutes = minutes % 60;\n const remainingHours = hours % 24;\n\n let result = \"\";\n if (days > 0) {\n result += `${days} day${days > 1 ? \"s\" : \"\"} `;\n }\n if (remainingHours > 0) {\n result += `${remainingHours} hour${remainingHours > 1 ? \"s\" : \"\"} `;\n }\n if (remainingMinutes > 0 || (days === 0 && remainingHours === 0)) {\n result += `${remainingMinutes} minute${remainingMinutes > 1 ? \"s\" : \"\"} `;\n }\n return result;\n};\n","import { Assembly, type AssemblyModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport type {\n IKosDataModel,\n KosContextLogger,\n KosCreationContext,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n getKosCompanionModel,\n kosDependency,\n kosModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { Application, type ApplicationModel } from \"../application\";\nimport {\n DashboardOperations,\n type DashboardOperationsModel,\n} from \"../dashboard-operations\";\nimport { troubleVisibilityFilter } from \"../utils\";\nimport type { IngredientSummaryModel, IngredientSummaryOptions } from \"./types\";\nimport {\n FreestyleHolder,\n type FreestyleHolderModel,\n} from \"@kosdev-code/kos-freestyle-sdk\";\n\nexport const MODEL_TYPE = \"ingredient-summary-model\";\n\n/**\n * @kosService ddk.ingredient-summary\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class IngredientSummaryModelImpl\n implements IngredientSummaryModel, IKosDataModel\n{\n id: string;\n @kosDependency({ modelType: Assembly.type })\n private assemblyModel!: AssemblyModel;\n @kosDependency({ modelType: DashboardOperations.type })\n private dashboardOperationModel: DashboardOperationsModel;\n\n @kosDependency({ modelType: Application.type })\n private appModel!: ApplicationModel;\n private logger: KosContextLogger;\n constructor(\n modelId: string,\n options: IngredientSummaryOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n\n this.dashboardOperationModel = DashboardOperations.factory({});\n if (options) {\n // Assign options properties here.\n }\n }\n\n get highPriorityHolders() {\n return this.assemblyModel.allHolders.filter(\n (holder) =>\n holder.troubles.length > 0 &&\n holder.troubles.find((trouble) => trouble.rank >= 400)\n );\n }\n\n get actionRequiredHolders() {\n const currentRole = this.appModel.currentRole;\n const filter = troubleVisibilityFilter(currentRole);\n return this.assemblyModel.allHolders.filter((holder) => {\n const companionModel = getKosCompanionModel<FreestyleHolderModel>(\n holder,\n FreestyleHolder.type\n );\n\n if (companionModel?.isRemote) {\n return false;\n }\n\n const visibleTroubles = holder.troubles.filter(filter);\n return (\n visibleTroubles.length > 0 &&\n visibleTroubles.find((trouble) => trouble.resolvable)\n );\n });\n }\n\n get lowLevelHolders() {\n return this.assemblyModel.allHolders.filter((holder) => {\n const fillPercent = holder.fillPercent;\n const hasFuelGuage = holder.hasFuelGuage;\n return hasFuelGuage && fillPercent < 20;\n });\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing ingredient-summary ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading ingredient-summary ${this.id}`);\n }\n}\n","import type { KosModelRegistrationBean } from \"@kosdev-code/kos-ui-sdk\";\nimport { Kos, isKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport {\n IngredientSummaryModelImpl,\n MODEL_TYPE,\n} from \"./ingredient-summary-model\";\nimport type { IngredientSummaryModel, IngredientSummaryOptions } from \"./types\";\n\n/**\n * # IngredientSummary\n *\n * The registration bean includes convenience methods for creating and working with IngredientSummaryModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: IngredientSummary.type, id: \"ingredientSummaryId\"})\n * private ingredientSummaryModel: IngredientSummaryModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new IngredientSummaryModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = IngredientSummary.factory(\"ingredientSummaryId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a IngredientSummaryModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (IngredientSummary.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to IngredientSummaryModel\n * // and the compiler will know that the model has the IngredientSummaryModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { IngredientSummary } from \"@kosdev-code/kos-dispense-sdk\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...IngredientSummary.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The ingredientSummary model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const IngredientSummary: Readonly<\n KosModelRegistrationBean<IngredientSummaryModel, IngredientSummaryOptions>\n> = {\n registration: {\n [MODEL_TYPE]: {\n class: IngredientSummaryModelImpl,\n singleton: false,\n },\n },\n type: MODEL_TYPE,\n predicate: isKosModel(MODEL_TYPE),\n factory: Kos.Factory.create<IngredientSummaryModel, IngredientSummaryOptions>(\n MODEL_TYPE\n ),\n};\n","import {\n ServiceFactory,\n resolveServiceUrl,\n KosLog,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"LOCKOUT_SERVICE\");\nconst { postModel } = ServiceFactory.build({\n basePath: `${URL}/api/app/kosdev.ddk/lockout`,\n});\n\nconst log = KosLog.createLogger({ name: \"lockout-service\", group: \"Services\" });\n\nexport const lock = async () => {\n log.info(\"lock\");\n\n const response = await postModel({\n model: {},\n urlOverride: `${URL}/api/app/kosdev.ddk/lockout/lockNow`,\n });\n\n return response;\n};\n\nexport const unlock = async (pin: string) => {\n log.info(\"unlock\");\n\n const response = await postModel({\n model: {},\n urlOverride: `${URL}/api/app/kosdev.ddk/lockout/unlock/${pin}`,\n });\n\n return response?.data;\n};\n","import type {\n ConfigPropertyTypes,\n IConfigBeanModel,\n IKosDataModel,\n IKosIdentifiable,\n KosConfigProperty,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n kosConfigBean,\n kosConfigProperty,\n kosModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { unlock } from \"./services\";\nimport type { LockoutOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"lockout-model\";\n\n// prettier-ignore\nconst scheduleData: ScheduleData = [\n { day: \"monday\", lock: \"dayWiseLockConfigMap.Mon.enabled\", open: \"dayWiseLockConfigMap.Mon.unlockTime\", close: \"dayWiseLockConfigMap.Mon.lockTime\" },\n { day: \"tuesday\", lock: \"dayWiseLockConfigMap.Tue.enabled\", open: \"dayWiseLockConfigMap.Tue.unlockTime\", close: \"dayWiseLockConfigMap.Tue.lockTime\" },\n { day: \"wednesday\", lock: \"dayWiseLockConfigMap.Wed.enabled\", open: \"dayWiseLockConfigMap.Wed.unlockTime\", close: \"dayWiseLockConfigMap.Wed.lockTime\" },\n { day: \"thursday\", lock: \"dayWiseLockConfigMap.Thu.enabled\", open:\"dayWiseLockConfigMap.Thu.unlockTime\", close: \"dayWiseLockConfigMap.Thu.lockTime\" },\n { day: \"friday\", lock: \"dayWiseLockConfigMap.Fri.enabled\", open: \"dayWiseLockConfigMap.Fri.unlockTime\", close: \"dayWiseLockConfigMap.Fri.lockTime\" },\n { day: \"saturday\", lock: \"dayWiseLockConfigMap.Sat.enabled\", open: \"dayWiseLockConfigMap.Sat.unlockTime\", close:\"dayWiseLockConfigMap.Sat.lockTime\" },\n { day: \"sunday\", lock: \"dayWiseLockConfigMap.Sun.enabled\", open: \"dayWiseLockConfigMap.Sun.unlockTime\", close: \"dayWiseLockConfigMap.Sun.lockTime\" },\n];\n\nexport type LockoutModel = PublicModelInterface<LockoutModelImpl>;\n\nexport interface CUILockout {\n // pin...\n pin: string;\n\n // next lock/unlock...\n nextLockTime: number;\n nextUnLockTime: number;\n nextLockSkipped: number;\n\n // oneTimeLock...\n \"oneTimeLockConfig.unLockManually\": boolean;\n \"oneTimeLockConfig.lockTime\": number;\n \"oneTimeLockConfig.unlockTime\": number;\n\n // schedule...\n lockScheduleEnabled: boolean;\n customizedLockScheduleEnabled: boolean;\n \"defaultLockConfig.unlockTime\": number;\n \"defaultLockConfig.lockTime\": number;\n\n // monday...\n \"dayWiseLockConfigMap.Mon.enabled\": boolean;\n \"dayWiseLockConfigMap.Mon.unlockTime\": number;\n \"dayWiseLockConfigMap.Mon.lockTime\": number;\n\n // tuesday...\n \"dayWiseLockConfigMap.Tue.enabled\": boolean;\n \"dayWiseLockConfigMap.Tue.unlockTime\": number;\n \"dayWiseLockConfigMap.Tue.lockTime\": number;\n\n // wednesday...\n \"dayWiseLockConfigMap.Wed.enabled\": boolean;\n \"dayWiseLockConfigMap.Wed.unlockTime\": number;\n \"dayWiseLockConfigMap.Wed.lockTime\": number;\n\n // thursday...\n \"dayWiseLockConfigMap.Thu.enabled\": boolean;\n \"dayWiseLockConfigMap.Thu.lockTime\": number;\n \"dayWiseLockConfigMap.Thu.unlockTime\": number;\n\n // friday...\n \"dayWiseLockConfigMap.Fri.enabled\": boolean;\n \"dayWiseLockConfigMap.Fri.unlockTime\": number;\n \"dayWiseLockConfigMap.Fri.lockTime\": number;\n\n // saturday...\n \"dayWiseLockConfigMap.Sat.enabled\": boolean;\n \"dayWiseLockConfigMap.Sat.unlockTime\": number;\n \"dayWiseLockConfigMap.Sat.lockTime\": number;\n\n // sunday...\n \"dayWiseLockConfigMap.Sun.enabled\": boolean;\n \"dayWiseLockConfigMap.Sun.unlockTime\": number;\n \"dayWiseLockConfigMap.Sun.lockTime\": number;\n}\n\ntype CUILockoutKey = keyof CUILockout;\n\ntype ExtractKeysByPattern<T, P extends string> = {\n [K in keyof T]: K extends P ? K : never;\n}[keyof T];\n\ntype DayEnabledKeys = ExtractKeysByPattern<\n CUILockout,\n `dayWiseLockConfigMap.${string}.enabled`\n>;\ntype DayOpenAtKeys = ExtractKeysByPattern<\n CUILockout,\n `dayWiseLockConfigMap.${string}.unlockTime`\n>;\ntype DayCloseAtKeys = ExtractKeysByPattern<\n CUILockout,\n `dayWiseLockConfigMap.${string}.lockTime`\n>;\n\ntype ScheduleData = ScheduleDay[];\n\ninterface ScheduleDay {\n day: string;\n lock: DayEnabledKeys;\n open: DayOpenAtKeys;\n close: DayCloseAtKeys;\n}\n\n/**\n * @kosService ddk.lockout\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class LockoutModelImpl implements IKosDataModel, IKosIdentifiable {\n id: string;\n\n private logger: KosContextLogger;\n private dayEnabledList?: DayEnabledKeys[] = [\n \"dayWiseLockConfigMap.Sun.enabled\",\n \"dayWiseLockConfigMap.Mon.enabled\",\n \"dayWiseLockConfigMap.Tue.enabled\",\n \"dayWiseLockConfigMap.Wed.enabled\",\n \"dayWiseLockConfigMap.Thu.enabled\",\n \"dayWiseLockConfigMap.Fri.enabled\",\n \"dayWiseLockConfigMap.Sat.enabled\",\n ];\n private dayOpenAtList?: DayOpenAtKeys[] = [\n \"dayWiseLockConfigMap.Sun.unlockTime\",\n \"dayWiseLockConfigMap.Mon.unlockTime\",\n \"dayWiseLockConfigMap.Tue.unlockTime\",\n \"dayWiseLockConfigMap.Wed.unlockTime\",\n \"dayWiseLockConfigMap.Thu.unlockTime\",\n \"dayWiseLockConfigMap.Fri.unlockTime\",\n \"dayWiseLockConfigMap.Sat.unlockTime\",\n ];\n private dayCloseAtList?: DayCloseAtKeys[] = [\n \"dayWiseLockConfigMap.Sun.lockTime\",\n \"dayWiseLockConfigMap.Mon.lockTime\",\n \"dayWiseLockConfigMap.Tue.lockTime\",\n \"dayWiseLockConfigMap.Wed.lockTime\",\n \"dayWiseLockConfigMap.Thu.lockTime\",\n \"dayWiseLockConfigMap.Fri.lockTime\",\n \"dayWiseLockConfigMap.Sat.lockTime\",\n ];\n\n private saveMap: Map<CUILockoutKey, any>;\n\n @kosConfigProperty({\n path: \"app:kosdev.ddk:service:cuiLockout\",\n attribute: \"pin\",\n })\n pin!: KosConfigProperty<string>;\n\n @kosConfigProperty({\n path: \"app:kosdev.ddk:service:cuiLockout\",\n attribute: \"nextLockSkipped\",\n })\n nextLockSkipped!: KosConfigProperty<string>;\n\n @kosConfigProperty({\n path: \"app:kosdev.ddk:service:cuiLockout\",\n attribute: \"nextLockTime\",\n })\n nextLockTime!: KosConfigProperty<string>;\n\n @kosConfigProperty({\n path: \"app:kosdev.ddk:service:cuiLockout\",\n attribute: \"nextUnLockTime\",\n })\n nextUnLockTime!: KosConfigProperty<string>;\n\n @kosConfigBean({ path: \"app:kosdev.ddk:service:cuiLockout\" })\n private cuiLockout!: IConfigBeanModel<CUILockout>;\n\n get enabled() {\n const oneTimeLockConfigLockTime = this.getProp(\n \"oneTimeLockConfig.lockTime\"\n );\n\n const oneTimeLockEnabled =\n oneTimeLockConfigLockTime !== undefined &&\n oneTimeLockConfigLockTime !== \"\";\n\n const lockScheduleEnabled = this.getProp(\"lockScheduleEnabled\") as boolean;\n\n const enabled = oneTimeLockEnabled || lockScheduleEnabled;\n\n return enabled;\n }\n\n get schedule(): ScheduleData {\n return scheduleData;\n }\n\n constructor(\n modelId: string,\n _options: LockoutOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this.saveMap = new Map();\n }\n\n getProp(key: CUILockoutKey) {\n return this.saveMap.get(key);\n }\n\n setProp(key: CUILockoutKey, value: ConfigPropertyTypes) {\n this.saveMap.set(key, value);\n }\n\n // Skip or resume the next lock...\n toggleSkip() {\n const nextLockSkipped = this.nextLockSkipped.value;\n if (nextLockSkipped === \"0\") {\n const nextLockTime = this.nextLockTime.value;\n if (nextLockTime !== undefined)\n this.nextLockSkipped.updateProperty(nextLockTime);\n } else {\n this.nextLockSkipped.updateProperty(\"0\");\n }\n }\n\n async unlock(pin: string) {\n return await unlock(pin);\n }\n\n async save() {\n this.saveMap.forEach((value, key) => {\n if (value !== this.cuiLockout.props[key])\n this.cuiLockout.props[key] = value;\n });\n\n return this.cuiLockout.updateConfigBean();\n }\n\n reset() {\n this.cuiLockout.props.entries.forEach(([key, value]) =>\n this.saveMap.set(key, value)\n );\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing lockout ${this.id}`);\n\n // Mirror the cuiLockout to the saveMap... We'll use the saveMap as our\n // source of truth and save its values to the cuiLockout on save...\n this.cuiLockout.props.entries.forEach(([key, value]) =>\n this.saveMap.set(key, value)\n );\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading lockout ${this.id}`);\n }\n}\n","import { SingletonKosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { LockoutOptions } from \"./types\";\nimport { LockoutModelImpl, MODEL_TYPE } from \"./lockout-model\";\nimport type { LockoutModel } from \"./lockout-model\";\n\n/**\n * # Lockout\n *\n * The registration bean includes convenience methods for creating and working with LockoutModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: Lockout.type, id: \"lockoutId\"})\n * private lockoutModel: LockoutModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new LockoutModel instances.\n *\n \n * As this is a singleton model, the factory function accepts the model options as its argument.\n *\n * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = Lockout.factory({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a LockoutModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (Lockout.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to LockoutModel\n * // and the compiler will know that the model has the LockoutModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { Lockout } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(Lockout);\n * ```\n *\n * ## registration.singleton\n \n * The lockout model is a singleton model. This means that each time the factory function is called , the same instance will be returned.\n * If the model does not yet exist, it will be created passing in the provided options to initialize it.\n *\n * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.\n \n * */\nexport const Lockout = new SingletonKosModelRegistrationFactory<\n LockoutModel,\n LockoutOptions\n>({\n class: LockoutModelImpl,\n type: MODEL_TYPE,\n});\n","import { TroubleServices } from \"@kosdev-code/kos-ui-sdk\";\n\nexport const purgeMacroPumps = async (\n troubleIds: string[],\n tracker?: string\n) => {\n // call the bulkResolveTroubles method from the Trouble Service and return the response\n const response = await TroubleServices.bulkResolveTroubles(\n troubleIds,\n undefined,\n tracker\n );\n return response;\n};\n","import {\n HolderContainer,\n IngredientContainer,\n type HolderContainerModel,\n type IngredientContainerModel,\n} from \"@kosdev-code/kos-dispense-sdk\";\nimport type {\n FutureAwareContainer,\n IKosDataModel,\n KosContextLogger,\n KosCreationContext,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n FutureHandler,\n TroubleModel,\n kosDependency,\n kosFuture,\n kosModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { purgeMacroPumps } from \"./services\";\nimport type { MacroAssignmentModel, MacroAssignmentOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"macro-assignment-model\";\n\nexport const TROUBLE_TYPE_PURGE = \"PurgeTrouble\";\nexport const TROUBLE_TYPE_PRIME = \"PrimeTrouble\";\n/**\n * @kosService ddk.macro-assignment\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class MacroAssignmentModelImpl\n implements MacroAssignmentModel, IKosDataModel\n{\n id: string;\n private logger: KosContextLogger;\n\n /**\n * futureHandler is used to handle async operations\n */\n futureHandler: FutureAwareContainer;\n\n /**\n * Model containing all of the holders in the current dispenser assembly\n */\n @kosDependency({ modelType: HolderContainer.type })\n private holders!: HolderContainerModel;\n\n /**\n * Model containing all of the ingredients in the current dispenser brandset\n */\n @kosDependency({ modelType: IngredientContainer.type })\n private ingredients!: IngredientContainerModel;\n\n constructor(\n modelId: string,\n _options: MacroAssignmentOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.futureHandler = new FutureHandler();\n this.logger = context.logger;\n }\n\n /**\n * shortcut to the current running future\n */\n get future() {\n return this.futureHandler.future;\n }\n\n /**\n * Represents the subset of holder that are identified as holding macros.\n *\n * This is determined by the group property of the holder which is determined\n * by the holders position in the dispenser assembly.\n */\n get macroHolders() {\n return this.holders.holders\n .getIndexByKey(\"group\", \"macros\")\n .sort((a, b) => {\n if (a.name < b.name) return -1;\n if (a.name > b.name) return 1;\n return 0;\n });\n }\n\n /**\n * Returns true if there are any macro holders in the dispenser assembly\n */\n get hasMacroHolders() {\n return this.macroHolders.length > 0;\n }\n\n /**\n * Returns all of the purge troubles for the macro holders.\n *\n * Relying on the indexing of troubles by type to find the purge troubles.\n */\n get holderPurgeTroubles() {\n const troubles = this.macroHolders.reduce<TroubleModel[]>((acc, curr) => {\n const purgeTroubles = curr.troublesByType[TROUBLE_TYPE_PURGE] || [];\n\n acc = [...acc, ...purgeTroubles];\n return acc;\n }, [] as TroubleModel[]);\n return troubles;\n }\n\n get holderPrimeTroubles() {\n const troubles = this.macroHolders.reduce<TroubleModel[]>((acc, curr) => {\n const primeTroubles = curr.troublesByType[TROUBLE_TYPE_PRIME] || [];\n\n acc = [...acc, ...primeTroubles];\n return acc;\n }, [] as TroubleModel[]);\n return troubles;\n }\n\n /**\n * Returns true if there are any purge troubles for the macro holders.\n */\n get hasHolderPurgeTroubles() {\n return this.holderPurgeTroubles.length > 0;\n }\n\n get hasHolderPrimeTroubles() {\n return this.holderPrimeTroubles.length > 0;\n }\n\n /**\n * Represents the subset of ingredients that are identified as macros\n *\n * This is determined by the `ingredientMacro` property of the ingredient\n * which is derived from the `bib` and `sweetener` properties of the ingredient.\n *\n * The `ingredientMacro` property is set by the `ingredientDataMapper` extension point.\n *\n * The macro ingredients are indexed by the `ingredientIndexExtension` extension point using\n * the `ingredientMacro` property.\n */\n get macroIngredients() {\n return this.ingredients.ingredients.getIndexByKey(\"macro\", \"macro\");\n }\n\n /**\n * Returns true if there are any macro ingredients in the dispenser brandset\n */\n get hasMacroIngredients() {\n return this.macroIngredients.length > 0;\n }\n\n /**\n *\n * Purges all of the macro holders in the dispenser assembly.\n *\n * Gathers up all of the purge troubles that are associated with the macro holders and submits them to the\n * trouble service bulk resolve endpoint.\n *\n * @param tracker - the tracker to use for the purge future. This is passed in by the framework automatically.\n * @returns the future response\n */\n @kosFuture()\n async resolveAll(type: string, tracker?: string) {\n // should be handed in by the `kosFuture` decorator\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n\n const container =\n type === TROUBLE_TYPE_PURGE\n ? this.holderPurgeTroubles\n : this.holderPrimeTroubles;\n // gather up all of the purge trouble ids for the macro holders\n const allTroubles = container.map((trouble) => trouble.rawId);\n\n // submit the purge troubles to the trouble service bulk resolve endpoint\n const response = await purgeMacroPumps(allTroubles, tracker);\n\n return response;\n }\n}\n","import { Kos, isKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { SingletonKosModelRegistrationBean } from \"@kosdev-code/kos-ui-sdk\";\nimport type { MacroAssignmentModel, MacroAssignmentOptions } from \"./types\";\nimport { MacroAssignmentModelImpl, MODEL_TYPE } from \"./macro-assignment-model\";\n\n/**\n * # MacroAssignment\n *\n * The registration bean includes convenience methods for creating and working with MacroAssignmentModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: MacroAssignment.type, id: \"macroAssignmentId\"})\n * private macroAssignmentModel: MacroAssignmentModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new MacroAssignmentModel instances.\n *\n \n * As this is a singleton model, the factory function accepts the model options as its argument.\n *\n * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = MacroAssignment.factory({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a MacroAssignmentModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (MacroAssignment.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to MacroAssignmentModel\n * // and the compiler will know that the model has the MacroAssignmentModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { MacroAssignment } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...MacroAssignment.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The macroAssignment model is a singleton model. This means that each time the factory function is called , the same instance will be returned.\n * If the model does not yet exist, it will be created passing in the provided options to initialize it.\n *\n * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.\n \n * */\nexport const MacroAssignment: Readonly<\n SingletonKosModelRegistrationBean<\n MacroAssignmentModel,\n MacroAssignmentOptions\n >\n> = {\n registration: {\n [MODEL_TYPE]: {\n class: MacroAssignmentModelImpl,\n singleton: true,\n },\n },\n type: MODEL_TYPE,\n predicate: isKosModel(MODEL_TYPE),\n factory: Kos.Singleton.create<MacroAssignmentModel, MacroAssignmentOptions>(\n MODEL_TYPE\n ),\n};\n","import type {\n IKosDataModel,\n KosContextLogger,\n KosCreationContext,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { kosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { ReportResult } from \"./services\";\nimport type {\n NetworkTestModel,\n NetworkTestOptions,\n NetworkTestUpdateOptions,\n} from \"./types\";\n\nexport const MODEL_TYPE = \"network-test-model\";\n\n/**\n * @kosService ddk.network-test\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class NetworkTestModelImpl implements NetworkTestModel, IKosDataModel {\n id: string;\n group: string;\n passed: boolean;\n inProgress: boolean;\n failureTime?: Date;\n timestamp?: Date;\n name: string;\n results: ReportResult[];\n\n private logger: KosContextLogger;\n constructor(\n modelId: string,\n options: NetworkTestOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this.group = options.group;\n this.passed = false;\n this.inProgress = false;\n this.name = options.name;\n this.results = [];\n }\n\n updateModel(options: NetworkTestUpdateOptions): void {\n this.group = options.group;\n this.name = options.name;\n this.passed = options.passed;\n this.failureTime = options.failureTime;\n this.inProgress = options.inProgress;\n this.timestamp = options.timestamp;\n this.results = options.results;\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing network-test ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading network-test ${this.id}`);\n }\n}\n","import { Kos, isKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { KosModelRegistrationBean } from \"@kosdev-code/kos-ui-sdk\";\nimport type { NetworkTestModel, NetworkTestOptions } from \"./types\";\nimport { NetworkTestModelImpl, MODEL_TYPE } from \"./network-test-model\";\n\n/**\n * # NetworkTest\n *\n * The registration bean includes convenience methods for creating and working with NetworkTestModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: NetworkTest.type, id: \"networkTestId\"})\n * private networkTestModel: NetworkTestModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new NetworkTestModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = NetworkTest.factory(\"networkTestId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a NetworkTestModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (NetworkTest.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to NetworkTestModel\n * // and the compiler will know that the model has the NetworkTestModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { NetworkTest } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...NetworkTest.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The networkTest model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const NetworkTest: Readonly<\n KosModelRegistrationBean<NetworkTestModel, NetworkTestOptions>\n> = {\n registration: {\n [MODEL_TYPE]: {\n class: NetworkTestModelImpl,\n singleton: false,\n },\n },\n type: MODEL_TYPE,\n predicate: isKosModel(MODEL_TYPE),\n factory: Kos.Factory.create<NetworkTestModel, NetworkTestOptions>(MODEL_TYPE),\n};\n","import {\n FutureResponse,\n KosLog,\n ServiceFactory,\n resolveServiceUrl,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"NETWORK-TEST_SERVICE\");\nconst { getAll, getOne } = ServiceFactory.build({\n basePath: `${URL}/api/app/ncui/network/tests`,\n});\n\nconst log = KosLog.createLogger({\n name: \"network-test-service\",\n group: \"Services\",\n});\ninterface NetworkTestResponse {\n id: string;\n name: string;\n group: string;\n}\n\nexport interface ReportResult {\n name: string;\n val: string;\n passed: boolean;\n}\nexport interface ReportItem {\n passed: boolean;\n timestamp: number;\n failureTime?: number;\n inProgress: boolean;\n results: ReportResult[];\n name: string;\n id: string;\n group: string;\n}\n\ninterface ReportGroup {\n [k: string]: ReportItem;\n}\ninterface NetworkTestReportResponse {\n [k: string]: ReportGroup;\n}\n/**\n * @category Service\n * Retrieves the initial network-test data.\n */\nexport const getNetworkTests = async () => {\n log.debug(\"sending GET for network-test\");\n const response = await getAll<NetworkTestResponse>({\n urlOverride: `${URL}/api/app/kosdev.ddk/network/tests`,\n });\n return response?.data;\n};\n\nexport const getTestsReports = async () => {\n const response = await getOne<NetworkTestReportResponse>({\n urlOverride: `${URL}/api/app/kosdev.ddk/network/reports`,\n });\n return response?.data;\n};\n\nexport const performGroupTest = async (group: string, tracker: string) => {\n const response = await getOne<FutureResponse>({\n urlOverride: `${URL}/api/app/kosdev.ddk/network/tests/run/group/${group}`,\n tracker,\n });\n return response;\n};\n","import type {\n FutureAwareContainer,\n IFutureModel,\n IKosModelContainer,\n KosContextLogger,\n KosCreationContext,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n FutureHandler,\n KosModelContainer,\n kosAction,\n kosChild,\n kosFuture,\n kosModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { calculateTimeDifference } from \"../utils/time-utils\";\nimport { NetworkTest } from \"./network-test-registration\";\nimport {\n ReportItem,\n getNetworkTests,\n getTestsReports,\n performGroupTest,\n} from \"./services\";\nimport type {\n NetworkTestContainerModel,\n NetworkTestContainerOptions,\n NetworkTestModel,\n NetworkTestUpdateOptions,\n} from \"./types\";\n\nexport const MODEL_TYPE = \"network-test-container-model\";\n\n/**\n * @kosService ddk.network-test\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class NetworkTestContainerModelImpl\n implements NetworkTestContainerModel\n{\n id: string;\n private logger: KosContextLogger;\n lastTested: Date;\n futureHandler: FutureAwareContainer<ReportItem[]>;\n @kosChild models: IKosModelContainer<NetworkTestModel>;\n constructor(\n modelId: string,\n options: NetworkTestContainerOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this.futureHandler = new FutureHandler<ReportItem[]>(this);\n this.models = new KosModelContainer<NetworkTestModel>({\n parentId: modelId,\n indexMap: {\n group: \"group\",\n },\n });\n this.lastTested = new Date(\"default\");\n if (options) {\n // Assign options properties here.\n }\n }\n\n get data() {\n return this.models.data;\n }\n\n addModel(model: NetworkTestModel) {\n this.models.addModel(model);\n }\n\n removeModel(id: string) {\n this.models.removeModel(id);\n }\n\n getModel(id: string) {\n return this.models.getModel(id);\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(\n `initializing network-test-container container ${this.id}`\n );\n }\n getLastTested(groupName: string) {\n const dateArray = this.models\n .getIndexByKey(\"group\", groupName)\n .map((obj) => obj.timestamp && new Date(obj.timestamp));\n const latestDate = Math.max(\n ...dateArray.map((date) => (date ? date.getTime() : 0))\n );\n return latestDate ? calculateTimeDifference(new Date(latestDate)) : \"\";\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading network-test-container container ${this.id}`);\n const testResponse = await getNetworkTests();\n const testReportResponse = await getTestsReports();\n if (testResponse) {\n testResponse.forEach((item) => {\n const testModel = NetworkTest.factory(item.id)(item);\n this.addModel(testModel);\n });\n }\n\n if (testResponse && testReportResponse) {\n testResponse.forEach((item) => {\n const groupReport = testReportResponse?.[item.group];\n const testReport = groupReport?.[item.id];\n const testModel = this.getModel(item.id);\n\n if (testModel && testReport) {\n const update: NetworkTestUpdateOptions = {\n group: testReport.group,\n name: testReport.name,\n passed: testReport.passed,\n failureTime: testReport.failureTime\n ? new Date(testReport.failureTime)\n : undefined,\n inProgress: testReport.inProgress,\n timestamp: new Date(testReport.timestamp),\n results: testReport.results,\n };\n testModel.updateModel(update);\n }\n });\n }\n }\n\n @kosFuture()\n async performTest(group: string, tracker?: string) {\n if (!tracker) {\n throw new Error(\"No tracker provided\");\n }\n const result = await performGroupTest(group, tracker);\n return result?.data;\n }\n\n onFutureUpdate(future: IFutureModel<ReportItem[]>) {\n const { clientData } = future;\n if (clientData) {\n clientData.forEach((item) => {\n const testModel = this.getModel(item.id);\n kosAction(() => {\n this.lastTested =\n this.lastTested > new Date(item.timestamp)\n ? this.lastTested\n : new Date(item.timestamp);\n });\n\n if (testModel) {\n const update: NetworkTestUpdateOptions = {\n group: item.group,\n name: item.name,\n passed: item.passed,\n failureTime: item.failureTime\n ? new Date(item.failureTime)\n : undefined,\n inProgress: item.inProgress,\n timestamp: new Date(item.timestamp),\n results: item.results,\n };\n kosAction(() => {\n testModel.updateModel(update);\n });\n }\n });\n }\n }\n}\n","import { Kos, isKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { SingletonKosModelRegistrationBean } from \"@kosdev-code/kos-ui-sdk\";\nimport { NetworkTest } from \"./network-test-registration\";\nimport type {\n NetworkTestContainerModel,\n NetworkTestContainerOptions,\n} from \"./types\";\nimport {\n NetworkTestContainerModelImpl,\n MODEL_TYPE,\n} from \"./network-test-container-model\";\n\n/**\n * # NetworkTestContainer\n *\n * The registration bean includes convenience methods for creating and working with NetworkTestContainerModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: NetworkTestContainer.type, id: \"networkTestContainerId\"})\n * private networkTestContainerModel: NetworkTestContainerModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new NetworkTestContainerModel instances.\n *\n \n * As this is a singleton model, the factory function accepts the model options as its argument.\n *\n * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = NetworkTestContainer.factory({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a NetworkTestContainerModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (NetworkTestContainer.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to NetworkTestContainerModel\n * // and the compiler will know that the model has the NetworkTestContainerModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { NetworkTestContainer } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...NetworkTestContainer.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The networkTestContainer model is a singleton model. This means that each time the factory function is called , the same instance will be returned.\n * If the model does not yet exist, it will be created passing in the provided options to initialize it.\n *\n * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.\n \n * */\nexport const NetworkTestContainer: Readonly<\n SingletonKosModelRegistrationBean<\n NetworkTestContainerModel,\n NetworkTestContainerOptions\n >\n> = {\n registration: {\n [MODEL_TYPE]: {\n class: NetworkTestContainerModelImpl,\n singleton: true,\n },\n ...NetworkTest.registration,\n },\n type: MODEL_TYPE,\n predicate: isKosModel(MODEL_TYPE),\n factory: Kos.Singleton.create<\n NetworkTestContainerModel,\n NetworkTestContainerOptions\n >(MODEL_TYPE),\n};\n","/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\nimport { Assembly, type AssemblyModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport type { PumpAware } from \"@kosdev-code/kos-freestyle-sdk\";\nimport type {\n IKosDataModel,\n KosLoggerAware,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n createPropKey,\n kosDependency,\n kosLoggerAware,\n kosModel,\n kosStateBean,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { NutritiveSweetenerOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"nutritive-sweetener-model\";\n\nexport type NutritiveSweetenerModel =\n PublicModelInterface<NutritiveSweetenerModelImpl>;\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface NutritiveSweetenerModelImpl extends KosLoggerAware {}\n\nconst PATH_PUMP_STATE = createPropKey<NutritiveSweetenerModel>(\"statePath\");\n/**\n * @kosService ddk.nutritive-sweetener\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\n@kosLoggerAware()\nexport class NutritiveSweetenerModelImpl\n implements NutritiveSweetenerModel, IKosDataModel, PumpAware\n{\n id: string;\n\n @kosDependency({ modelType: Assembly.type })\n assemblyModel!: AssemblyModel;\n\n @kosStateBean({\n path: PATH_PUMP_STATE,\n })\n pumpState: any;\n constructor(modelId: string, _options: NutritiveSweetenerOptions) {\n this.id = modelId;\n }\n\n get holder() {\n const nsHolder = this.assemblyModel.getHoldersByGroup(\"ns\")[0];\n return nsHolder;\n }\n getHolder() {\n return this.holder;\n }\n\n get statePath() {\n return `${this.pump.path}:airVent:state`;\n }\n get pump() {\n return this.holder.pumps.data[0];\n }\n getPump() {\n return this.pump;\n }\n}\n","import { Kos, isKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { KosModelRegistrationBean } from \"@kosdev-code/kos-ui-sdk\";\nimport {\n MODEL_TYPE,\n NutritiveSweetenerModel,\n NutritiveSweetenerModelImpl,\n} from \"./nutritive-sweetener-model\";\nimport type { NutritiveSweetenerOptions } from \"./types\";\n\n/**\n * # NutritiveSweetener\n *\n * The registration bean includes convenience methods for creating and working with NutritiveSweetenerModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: NutritiveSweetener.type, id: \"nutritiveSweetenerId\"})\n * private nutritiveSweetenerModel: NutritiveSweetenerModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new NutritiveSweetenerModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = NutritiveSweetener.factory(\"nutritiveSweetenerId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a NutritiveSweetenerModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (NutritiveSweetener.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to NutritiveSweetenerModel\n * // and the compiler will know that the model has the NutritiveSweetenerModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { NutritiveSweetener } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...NutritiveSweetener.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The nutritiveSweetener model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const NutritiveSweetener: Readonly<\n KosModelRegistrationBean<NutritiveSweetenerModel, NutritiveSweetenerOptions>\n> = {\n registration: {\n [MODEL_TYPE]: {\n class: NutritiveSweetenerModelImpl,\n singleton: false,\n },\n },\n type: MODEL_TYPE,\n predicate: isKosModel(MODEL_TYPE),\n factory: Kos.Factory.create<\n NutritiveSweetenerModel,\n NutritiveSweetenerOptions\n >(MODEL_TYPE),\n};\n","import { Assembly, type AssemblyModel } from \"@kosdev-code/kos-dispense-sdk\";\nimport type { PumpAware } from \"@kosdev-code/kos-freestyle-sdk\";\nimport { FcmPump, type FcmPumpModel } from \"@kosdev-code/kos-freestyle-sdk\";\nimport type {\n IKosDataModel,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n getKosCompanionModel,\n kosDependency,\n kosModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { PlainWaterOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"plain-water-model\";\n\nexport type PlainWaterModel = PublicModelInterface<PlainWaterModelImpl>;\n\n/**\n * @kosService ddk.plain-water\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class PlainWaterModelImpl\n implements PlainWaterModel, IKosDataModel, PumpAware\n{\n id: string;\n\n @kosDependency({ modelType: Assembly.type })\n assemblyModel!: AssemblyModel;\n\n private logger: KosContextLogger;\n\n constructor(\n modelId: string,\n _options: PlainWaterOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n }\n\n getHolder() {\n const waterHolder = this.assemblyModel.getHoldersByGroup(\"water\")[0];\n\n return waterHolder;\n }\n\n getPump(): FcmPumpModel {\n const waterHolder = this.getHolder();\n\n const pump = waterHolder?.pumps?.data?.[0];\n\n const model = getKosCompanionModel<FcmPumpModel>(pump, FcmPump.type);\n\n return model;\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing plain-water ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading plain-water ${this.id}`);\n }\n}\n","import { Kos, isKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { KosModelRegistrationBean } from \"@kosdev-code/kos-ui-sdk\";\nimport {\n MODEL_TYPE,\n PlainWaterModel,\n PlainWaterModelImpl,\n} from \"./plain-water-model\";\nimport type { PlainWaterOptions } from \"./types\";\n\n/**\n * # PlainWater\n *\n * The registration bean includes convenience methods for creating and working with PlainWaterModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: PlainWater.type, id: \"plainWaterId\"})\n * private plainWaterModel: PlainWaterModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new PlainWaterModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = PlainWater.factory(\"plainWaterId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a PlainWaterModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (PlainWater.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to PlainWaterModel\n * // and the compiler will know that the model has the PlainWaterModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { PlainWater } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...PlainWater.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The plainWater model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const PlainWater: Readonly<\n KosModelRegistrationBean<PlainWaterModel, PlainWaterOptions>\n> = {\n registration: {\n [MODEL_TYPE]: {\n class: PlainWaterModelImpl,\n singleton: false,\n },\n },\n type: MODEL_TYPE,\n predicate: isKosModel(MODEL_TYPE),\n factory: Kos.Factory.create<PlainWaterModel, PlainWaterOptions>(MODEL_TYPE),\n};\n","import {\n ServiceFactory,\n resolveServiceUrl,\n KosLog,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"REBOOT_SERVICE\");\nconst { postModel } = ServiceFactory.build({\n basePath: `${URL}/api/reboot`,\n});\n\nconst log = KosLog.createLogger({ name: \"reboot-service\", group: \"Services\" });\n\nexport const rebootDispenser = async () => {\n log.debug(\"sending POST call for Reboot Dispenser\");\n const response = await postModel({\n urlOverride: `${URL}/api/app/kosdev.ddk/ncui/reboot`,\n model: {},\n });\n return response;\n};\n","import type {\n IKosDataModel,\n KosContextLogger,\n KosCreationContext,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { kosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport { rebootDispenser } from \"./services\";\nimport type { RebootModel, RebootOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"reboot-model\";\n\n/**\n * @kosService ddk.reboot\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class RebootModelImpl implements RebootModel, IKosDataModel {\n id: string;\n private logger: KosContextLogger;\n constructor(\n modelId: string,\n options: RebootOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n if (options) {\n // Assign options properties here.\n }\n }\n\n async completeReboot() {\n await rebootDispenser();\n }\n\n updateModel(): void {\n // Update model properties here.\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing reboot ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading reboot ${this.id}`);\n }\n}\n","import { Kos, isKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { KosModelRegistrationBean } from \"@kosdev-code/kos-ui-sdk\";\nimport type { RebootModel, RebootOptions } from \"./types\";\nimport { RebootModelImpl, MODEL_TYPE } from \"./reboot-model\";\n\n/**\n * # Reboot\n *\n * The registration bean includes convenience methods for creating and working with RebootModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: Reboot.type, id: \"rebootId\"})\n * private rebootModel: RebootModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new RebootModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = Reboot.factory(\"rebootId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a RebootModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (Reboot.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to RebootModel\n * // and the compiler will know that the model has the RebootModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { Reboot } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...Reboot.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The reboot model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const Reboot: Readonly<\n KosModelRegistrationBean<RebootModel, RebootOptions>\n> = {\n registration: {\n [MODEL_TYPE]: {\n class: RebootModelImpl,\n singleton: false,\n },\n },\n type: MODEL_TYPE,\n predicate: isKosModel(MODEL_TYPE),\n factory: Kos.Factory.create<RebootModel, RebootOptions>(MODEL_TYPE),\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type {\n IKosModelLogger,\n KosConfigProperty,\n KosContextLogger,\n KosCreationContext,\n KosServiceResponse,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n kosConfigProperty,\n kosModel,\n kosModelEffect,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type {\n SettingsModel,\n SettingsOptions,\n ncuiLanguageDataProps,\n} from \"./types\";\n\nexport const MODEL_TYPE = \"settings-model\";\n\n/**\n * @kosService ddk.settings\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class SettingsModelImpl implements SettingsModel, IKosModelLogger {\n id: string;\n logger: KosContextLogger;\n ncuiLanguageData: KosServiceResponse<ncuiLanguageDataProps> | undefined;\n\n @kosConfigProperty({\n path: \"system:app\",\n attribute: \"resolveDelaysMs\",\n // optionsExpander: () => [],\n })\n resolveDelaysMs!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: \"system:app\",\n attribute: \"dateFormat\",\n // optionsExpander: () => [],\n })\n dateFormat!: KosConfigProperty<number>;\n @kosConfigProperty({\n path: \"system:app\",\n attribute: \"timeFormat\",\n // optionsExpander: () => [],\n })\n timeFormat!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: \"app:kosdev.ddk:app\",\n attribute: \"ncui.hidePlainWaterBev\",\n })\n hidePlainWaterBev!: KosConfigProperty<boolean>;\n\n @kosConfigProperty({\n path: \"app:kosdev.ddk:app\",\n attribute: \"ncui.hideCarbWaterBev\",\n })\n hideCarbWaterBev!: KosConfigProperty<boolean>;\n\n @kosConfigProperty({\n path: \"app:kosdev.ddk:app\",\n attribute: \"ncui.ncuiLanguage\",\n })\n ncuiLanguage!: KosConfigProperty<string>;\n\n @kosConfigProperty({\n path: \"kos:device\",\n attribute: \"name\",\n })\n name!: KosConfigProperty<string>;\n\n @kosConfigProperty({\n path: \"kos:service:OTA\",\n attribute: \"activateAndRebootTime\",\n })\n activateAndRebootTime!: KosConfigProperty<number>;\n\n @kosConfigProperty({\n path: \"app:kosdev.ddk:app\",\n attribute: \"ncui.uiConfig.display.horizontalMode\",\n })\n horizontalMode!: KosConfigProperty<boolean>;\n constructor(\n modelId: string,\n _options: SettingsOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async ready(): Promise<void> {\n this.updateDisplayMode();\n }\n\n async getNcuiLanguageList(): Promise<void> {\n // const response: any = await getNcuiLanguage();\n\n this.ncuiLanguageData = {\n status: 200,\n data: {\n languages: [\n {\n name: \"English\",\n locale: \"en\",\n },\n ],\n },\n };\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading settings ${this.id}`);\n //const ncuiLanguageResponse: any = await getNcuiLanguage();\n this.ncuiLanguageData = {\n status: 200,\n data: {\n languages: [\n {\n name: \"English\",\n locale: \"en\",\n },\n ],\n },\n };\n // kosAction(() => {\n // this.ncuiLanguageData = ncuiLanguageResponse as any;\n // });\n }\n\n @kosModelEffect({\n dependencies: (model) => [model.horizontalMode.value],\n })\n handleUpdateDisplayMode() {\n this.updateDisplayMode();\n }\n\n updateDisplayMode() {\n if (this.horizontalMode.value) {\n document.body.setAttribute(\"data-dashboard-layout\", \"horizontal\");\n } else {\n document.body.setAttribute(\"data-dashboard-layout\", \"vertical\");\n }\n }\n}\n","import type { SingletonKosModelRegistrationBean } from \"@kosdev-code/kos-ui-sdk\";\nimport { Kos, isKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport { MODEL_TYPE, SettingsModelImpl } from \"./settings-model\";\nimport type { SettingsModel, SettingsOptions } from \"./types\";\n\n/**\n * # Settings\n *\n * The registration bean includes convenience methods for creating and working with SettingsModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: Settings.type, id: \"settingsId\"})\n * private settingsModel: SettingsModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new SettingsModel instances.\n *\n \n * As this is a singleton model, the factory function accepts the model options as its argument.\n *\n * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = Settings.factory({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a SettingsModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (Settings.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to SettingsModel\n * // and the compiler will know that the model has the SettingsModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { Settings } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...Settings.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The settings model is a singleton model. This means that each time the factory function is called , the same instance will be returned.\n * If the model does not yet exist, it will be created passing in the provided options to initialize it.\n *\n * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.\n \n * */\nexport const Settings: Readonly<\n SingletonKosModelRegistrationBean<SettingsModel, SettingsOptions>\n> = {\n registration: {\n [MODEL_TYPE]: {\n class: SettingsModelImpl,\n singleton: true,\n },\n },\n type: MODEL_TYPE,\n predicate: isKosModel(MODEL_TYPE),\n factory: Kos.Singleton.create<SettingsModel, SettingsOptions>(MODEL_TYPE),\n};\n","import {\n ServiceFactory,\n resolveServiceUrl,\n KosLog,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { ncuiLanguageDataProps } from \"../types\";\n\nconst { URL } = resolveServiceUrl(\"SETTINGS_SERVICE\");\nconst { getAll } = ServiceFactory.build({\n basePath: `${URL}/api/settings`,\n});\n\nconst log = KosLog.createLogger({\n name: \"settings-service\",\n group: \"Services\",\n});\n\ninterface SettingsResponse {\n id: string;\n}\n\n/**\n * @category Service\n * Retrieves the initial settings data.\n */\nexport const getSettings = async () => {\n log.debug(\"sending GET for settings\");\n const response = await getAll<SettingsResponse>({});\n return response;\n};\n\nexport const getNcuiLanguage = async () => {\n const response = await getAll<ncuiLanguageDataProps[]>({\n urlOverride: `${URL}api/app/kosdev.ddk/ncui/languages`,\n });\n return response;\n};\n","import type {\n IKosDataModel,\n KosContextLogger,\n KosCreationContext,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { kosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { UtilitiesModel, UtilitiesOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"utilities-model\";\n\n/**\n * @kosService ddk.utilities\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class UtilitiesModelImpl implements UtilitiesModel, IKosDataModel {\n id: string;\n name: string;\n options: Map<string, object>;\n roles?: string[];\n columnId: string;\n\n private logger: KosContextLogger;\n\n constructor(\n modelId: string,\n options: UtilitiesOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n this.name = options.name;\n this.options = options.options;\n this.roles = options?.roles;\n this.columnId = options.columnId;\n }\n\n updateModel(options: UtilitiesOptions): void {\n this.name = options.name;\n this.options = options.options;\n this.roles = options?.roles;\n }\n\n get titleKey() {\n return `utility.${this.id}.title`;\n }\n\n get bodyKey() {\n return `utility.${this.id}.body`;\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing utilities ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading utilities ${this.id}`);\n }\n}\n","import { Kos, isKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { KosModelRegistrationBean } from \"@kosdev-code/kos-ui-sdk\";\nimport type { UtilitiesModel, UtilitiesOptions } from \"./types\";\nimport { UtilitiesModelImpl, MODEL_TYPE } from \"./utilities-model\";\n\n/**\n * # Utilities\n *\n * The registration bean includes convenience methods for creating and working with UtilitiesModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: Utilities.type, id: \"utilitiesId\"})\n * private utilitiesModel: UtilitiesModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new UtilitiesModel instances.\n *\n \n * The factory function is a curried function that takes the model id as the first argument and the options as the second argument.\n *\n * If a model with the specified id already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = Utilities.factory(\"utilitiesId\")({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a UtilitiesModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (Utilities.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to UtilitiesModel\n * // and the compiler will know that the model has the UtilitiesModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { Utilities } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...Utilities.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The utilities model is NOT a singleton model. This means that each time the factory function is called with a unique ID, a new model instance will be created.\n * If the factory function is called with an ID that already exists, the existing model will be returned.\n \n * */\nexport const Utilities: Readonly<\n KosModelRegistrationBean<UtilitiesModel, UtilitiesOptions>\n> = {\n registration: {\n [MODEL_TYPE]: {\n class: UtilitiesModelImpl,\n singleton: false,\n },\n },\n type: MODEL_TYPE,\n predicate: isKosModel(MODEL_TYPE),\n factory: Kos.Factory.create<UtilitiesModel, UtilitiesOptions>(MODEL_TYPE),\n};\n","import {\n KosLog,\n ServiceFactory,\n resolveServiceUrl,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"UTILITIES_SERVICE\");\nconst { getAll } = ServiceFactory.build({\n basePath: `${URL}/api/utilities`,\n});\n\nconst log = KosLog.createLogger({\n name: \"utilities-service\",\n group: \"Services\",\n});\n\nexport interface UtilityResponse {\n name: string;\n options: Map<string, object>;\n roles?: string[];\n}\n\ntype UtilityColumnsResponse = UtilityResponse[];\n\n/**\n * @category Service\n * Retrieves the initial utilities data.\n */\nexport const getUtilities = async () => {\n log.debug(\"sending GET for utilities\");\n try {\n const extensionResponse = await getAll<UtilityColumnsResponse>({\n urlOverride: `${URL}/api/kos/descriptor/app:kosdev.ddk:ncuiDescriptor/kondra.ncui.utilities`,\n });\n\n if (extensionResponse?.status !== 200) {\n log.info(`no extensions found, using base data`);\n const response = await getAll<UtilityColumnsResponse>({\n urlOverride: `${URL}/api/kos/descriptor/system:app/kondra.ncui.utilities`,\n });\n\n return response?.data ?? [];\n }\n return extensionResponse?.data ?? [];\n } catch (error) {\n log.info(`error fetching utilities: ${error}. Using base data`);\n const response = await getAll<UtilityColumnsResponse>({\n urlOverride: `${URL}/api/kos/descriptor/system:app/kondra.ncui.utilities`,\n });\n\n return response?.data ?? [];\n }\n};\n","import type {\n KosContextLogger,\n KosCreationContext,\n IKosModelContainer,\n IKosDataModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { kosModel, kosChild, KosModelContainer } from \"@kosdev-code/kos-ui-sdk\";\nimport type {\n UtilitiesModel,\n UtilitiesContainerModel,\n UtilitiesContainerOptions,\n UtilitiesOptions,\n} from \"./types\";\nimport { getUtilities } from \"./services\";\nimport { Utilities } from \"./utilities-registration\";\n\nexport const MODEL_TYPE = \"utilities-container-model\";\n\n/**\n * @kosService ddk.utilities\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class UtilitiesContainerModelImpl\n implements UtilitiesContainerModel, IKosDataModel\n{\n id: string;\n\n private logger: KosContextLogger;\n\n @kosChild private _models: IKosModelContainer<UtilitiesModel>;\n constructor(\n modelId: string,\n _options: UtilitiesContainerOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n\n this._models = new KosModelContainer<UtilitiesModel>({\n parentId: modelId,\n sortKey: \"id\",\n indexMap: {\n byColumn: \"columnId\",\n },\n });\n }\n\n get data() {\n return this._models.data;\n }\n\n get models() {\n return this._models;\n }\n\n get columns(): string[] {\n return this._models\n .getIndexKeys(\"byColumn\")\n .sort((a, b) => a.localeCompare(b));\n }\n\n addModel(model: UtilitiesModel) {\n this._models.addModel(model);\n }\n\n removeModel(id: string) {\n this._models.removeModel(id);\n }\n\n getModel(id: string) {\n return this._models.getModel(id);\n }\n\n getUtilitiesByColumn(id: string) {\n return this._models.getIndexByKey(\"byColumn\", id);\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async load(): Promise<void> {\n this.logger.debug(`loading utilities-container container ${this.id}`);\n\n const utilitiesResponse = await getUtilities();\n\n utilitiesResponse?.forEach((utilityColumnsResponse, columnId) => {\n utilityColumnsResponse.forEach((utilityResponse) => {\n const utilityOptions: UtilitiesOptions = {\n ...utilityResponse,\n columnId: String(columnId),\n };\n\n const utilityModel = Utilities.factory(utilityResponse.name)(\n utilityOptions\n );\n\n this.addModel(utilityModel);\n });\n });\n }\n}\n","import { Kos, isKosModel } from \"@kosdev-code/kos-ui-sdk\";\nimport type { SingletonKosModelRegistrationBean } from \"@kosdev-code/kos-ui-sdk\";\nimport { Utilities } from \"./utilities-registration\";\nimport type {\n UtilitiesContainerModel,\n UtilitiesContainerOptions,\n} from \"./types\";\nimport {\n UtilitiesContainerModelImpl,\n MODEL_TYPE,\n} from \"./utilities-container-model\";\n\n/**\n * # UtilitiesContainer\n *\n * The registration bean includes convenience methods for creating and working with UtilitiesContainerModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: UtilitiesContainer.type, id: \"utilitiesContainerId\"})\n * private utilitiesContainerModel: UtilitiesContainerModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new UtilitiesContainerModel instances.\n *\n \n * As this is a singleton model, the factory function accepts the model options as its argument.\n *\n * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = UtilitiesContainer.factory({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a UtilitiesContainerModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (UtilitiesContainer.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to UtilitiesContainerModel\n * // and the compiler will know that the model has the UtilitiesContainerModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { UtilitiesContainer } from \"@kos-ui/kos-dispenser-model\";\n * ...\n * import { ExtensionManager, IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n * export const kosModels: IKosRegistry[\"models\"] = {\n * ...UtilitiesContainer.registration,\n * };\n * ```\n *\n * ## registration.singleton\n \n * The utilitiesContainer model is a singleton model. This means that each time the factory function is called , the same instance will be returned.\n * If the model does not yet exist, it will be created passing in the provided options to initialize it.\n *\n * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.\n \n * */\nexport const UtilitiesContainer: Readonly<\n SingletonKosModelRegistrationBean<\n UtilitiesContainerModel,\n UtilitiesContainerOptions\n >\n> = {\n registration: {\n [MODEL_TYPE]: {\n class: UtilitiesContainerModelImpl,\n singleton: true,\n },\n ...Utilities.registration,\n },\n type: MODEL_TYPE,\n predicate: isKosModel(MODEL_TYPE),\n factory: Kos.Singleton.create<\n UtilitiesContainerModel,\n UtilitiesContainerOptions\n >(MODEL_TYPE),\n};\n","import { Animation } from \"./animation\";\nimport { Application } from \"./application\";\nimport { Auth } from \"./auth\";\n\nimport { CarbWater } from \"./carb-water\";\nimport { DashboardOperations } from \"./dashboard-operations\";\nimport { Dispenser } from \"./dispenser\";\nimport { DispenserInfo } from \"./dispenser-info\";\nimport { Enrollment } from \"./enrollment\";\n\nimport { IKosRegistry } from \"@kosdev-code/kos-ui-sdk\";\n\nimport { IngredientSummary } from \"./ingredient-summary\";\nimport { MacroAssignment } from \"./macro-assignment\";\nimport { NetworkTestContainer } from \"./network-test\";\nimport { NutritiveSweetener } from \"./nutritive-sweetener\";\nimport { PlainWater } from \"./plain-water\";\nimport { Reboot } from \"./reboot\";\nimport { Settings } from \"./settings\";\nimport { SetupStepContainer } from \"./setup-step\";\nimport { UtilitiesContainer } from \"./utilities\";\n\nexport const DDKModels: IKosRegistry[\"models\"] = {\n ...Animation.registration,\n ...Application.registration,\n ...Auth.registration,\n ...CarbWater.registration,\n ...DashboardOperations.registration,\n ...Dispenser.registration,\n ...DispenserInfo.registration,\n ...Enrollment.registration,\n ...IngredientSummary.registration,\n ...MacroAssignment.registration,\n ...NetworkTestContainer.registration,\n ...NutritiveSweetener.registration,\n ...PlainWater.registration,\n ...Reboot.registration,\n ...Settings.registration,\n ...SetupStepContainer.registration,\n ...UtilitiesContainer.registration,\n} as IKosRegistry[\"models\"];\n","/**\n * (C) Copyright 2024, TCCC, All rights reserved.\n */\n\n/* eslint-disable @typescript-eslint/no-unsafe-declaration-merging */\nimport type {\n IKosDataModel,\n IKosIdentifiable,\n KosData,\n KosLoggerAware,\n PublicModelInterface,\n SingletonKosModelRegistrationFactory,\n TroubleContainerModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n kosDependency,\n kosLoggerAware,\n kosModel,\n kosModelEffect,\n ObservableData,\n TroubleContainer,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport type { TroubleActionData, TroubleActionOptions } from \"./types\";\n\n/**\n * Model type identifier for the TroubleAction singleton model.\n *\n * This constant is used for model registration and identification within\n * the KOS framework. As a singleton model, only one instance exists per\n * application lifecycle.\n *\n * @category Model Configuration\n */\nexport const MODEL_TYPE = \"trouble-action-model\";\n\n/**\n * Public interface type for the TroubleActionModel.\n *\n * This type represents the publicly accessible interface of the TroubleActionModel,\n * exposing only the methods and properties intended for external consumption.\n * Use this type when declaring dependencies on the TroubleActionModel.\n *\n * @category Model Types\n * @see {@link TroubleActionModelImpl} for the implementation details\n */\nexport type TroubleActionModel = PublicModelInterface<TroubleActionModelImpl>;\n\n/**\n * Interface definition for TroubleActionModel implementation.\n *\n * Manages trouble action state by monitoring active troubles and mapping them\n * to configurable state key-value pairs. This singleton model acts as a centralized\n * coordinator between the trouble system and UI state management.\n *\n * @author Mark Pomerant (mark@matrica.ca)\n * @version 2.1.1\n * @category Model Interface\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface TroubleActionModelImpl extends KosLoggerAware {}\n\n/**\n * Singleton model that manages trouble action state for beverage dispensing systems.\n *\n * The TroubleActionModel monitors active troubles in the system and maintains a\n * reactive state object that maps trouble types to configured state values. This\n * enables UI components to respond to trouble conditions without directly coupling\n * to the trouble system.\n *\n * **Key Features:**\n * - Singleton model ensuring single source of truth for trouble action state\n * - Automatic synchronization with TroubleContainer changes\n * - Configurable mapping between trouble types and state representations\n * - Reactive state updates via KosData observables\n * - Support for custom state keys and values per trouble type\n *\n * **Architecture:**\n * - Depends on TroubleContainerModel for trouble data\n * - Uses @kosModelEffect for reactive trouble monitoring\n * - Maintains internal mapping of trouble definitions to state values\n *\n * @example\n * ```typescript\n * // Register and create the singleton TroubleActionModel\n * import { TroubleAction } from '@kosdev-code/kos-ddk-models';\n *\n * const troubleActionModel = TroubleAction.instance().options({\n * definitions: [\n * {\n * troubleType: 'InsufficientAgitationTrouble',\n * stateKey: 'agitationRequired',\n * stateValue: 'true'\n * },\n * {\n * troubleType: 'CartridgeEmptyTrouble',\n * stateKey: 'cartridgeStatus',\n * stateValue: 'empty'\n * }\n * ]\n * }).build();\n *\n * // Access state in React components\n * const agitationRequired = troubleActionModel.state.agitationRequired;\n * ```\n *\n * @example\n * ```typescript\n * // Monitor active trouble in a React component\n * import { useKosModel } from '@kosdev-code/kos-ui-sdk';\n * import { TroubleAction } from '@kosdev-code/kos-ddk-models';\n *\n * function TroubleIndicator() {\n * const troubleAction = useKosModel(TroubleAction);\n * const activeTroubleType = troubleAction.activeTroubleType;\n *\n * if (!activeTroubleType) {\n * return <div>No active troubles</div>;\n * }\n *\n * return <div>Active: {activeTroubleType}</div>;\n * }\n * ```\n *\n * @category DDK Models\n * @see {@link TroubleContainerModel} for the underlying trouble data source\n * @see {@link TroubleActionOptions} for configuration options\n * @see {@link TroubleActionData} for trouble definition structure\n *\n * @kosService ddk.trouble-action\n * @kosApiLevel 1\n */\n@kosModel({ modelTypeId: MODEL_TYPE, singleton: true })\n@kosLoggerAware()\nexport class TroubleActionModelImpl implements IKosDataModel, IKosIdentifiable {\n /**\n * Registration factory for creating TroubleActionModel instances.\n *\n * This static property is automatically populated by the @kosModel decorator\n * and provides the registration interface for creating and configuring the\n * singleton TroubleActionModel instance.\n *\n * @example\n * ```typescript\n * const troubleAction = TroubleActionModelImpl.Registration\n * .instance()\n * .options({ definitions: [...] })\n * .build();\n * ```\n *\n * @category Model Registration\n */\n static Registration: SingletonKosModelRegistrationFactory<\n TroubleActionModel,\n TroubleActionOptions\n >;\n\n /**\n * Unique identifier for this model instance.\n *\n * Set during construction and used for model lifecycle management\n * and debugging purposes.\n *\n * @category Model Properties\n */\n id: string;\n\n /**\n * Dependency on the TroubleContainer singleton model.\n *\n * Provides access to the system's active troubles collection. Changes to\n * the trouble container automatically trigger state updates via the\n * handleTroubleActions effect.\n *\n * @category Dependencies\n * @see {@link TroubleContainerModel}\n */\n @kosDependency({ modelType: TroubleContainer.type })\n private troubleContainer!: TroubleContainerModel;\n\n /**\n * Observable state object mapping trouble state keys to values.\n *\n * This reactive state object is automatically updated when troubles are\n * added or removed from the system. Keys and values are determined by\n * the trouble action definitions provided during model initialization.\n *\n * State keys that no longer have associated active troubles are set to\n * undefined.\n *\n * @example\n * ```typescript\n * // Access state values\n * const isAgitationRequired = troubleActionModel.state.agitationRequired;\n *\n * // State is reactive - updates automatically propagate to React components\n * ```\n *\n * @category Model State\n */\n state: KosData<Record<string, string | undefined>>;\n\n /**\n * Internal mapping of trouble types to their action definitions.\n *\n * Built from the definitions array provided in TroubleActionOptions during\n * construction. Used for efficient lookup when processing trouble changes.\n *\n * @category Internal State\n */\n private troubleActionData: Record<string, TroubleActionData>;\n\n /**\n * Creates a new TroubleActionModel instance.\n *\n * Initializes the model with trouble action definitions that map trouble\n * types to state key-value pairs. The model begins monitoring the trouble\n * container immediately upon creation.\n *\n * @param modelId - Unique identifier for this model instance\n * @param options - Configuration options containing trouble action definitions\n * @param context - KOS creation context providing logger and framework services\n *\n * @category Lifecycle\n */\n constructor(modelId: string, options: TroubleActionOptions) {\n this.id = modelId;\n this.state = ObservableData();\n this.troubleActionData = options.definitions.reduce((acc, curr) => {\n acc[curr.troubleType] = curr;\n return acc;\n }, {});\n }\n\n // -------------------LIFECYCLE----------------------------\n\n /**\n * Gets the first active trouble that has an associated action definition.\n *\n * Returns the first trouble found that matches any of the configured trouble\n * action definitions. If multiple troubles are active, priority is determined\n * by the order of trouble type keys in the troubleActionData object.\n *\n * @returns The active trouble model, or undefined if no matching troubles exist\n *\n * @example\n * ```typescript\n * const trouble = troubleActionModel.activeTrouble;\n * if (trouble) {\n * console.log(`Active trouble: ${trouble.type}`);\n * console.log(`Resolvable: ${trouble.resolvable}`);\n * }\n * ```\n *\n * @category Trouble Access\n * @see {@link TroubleContainerModel} for trouble data structure\n */\n get activeTrouble() {\n const actions = Object.keys(this.troubleActionData);\n if (actions.length > 0) {\n const firstAction = actions[0];\n const troubles = this.troubleContainer.troubles.getIndexByKey(\n \"byType\",\n firstAction\n );\n\n if (troubles.length > 0) {\n return troubles[0];\n } else {\n return undefined;\n }\n }\n return undefined;\n }\n\n /**\n * Gets the type of the first active trouble with an associated action definition.\n *\n * Convenience getter that extracts the trouble type from the active trouble.\n * Commonly used for conditional UI rendering based on trouble type.\n *\n * @returns The active trouble type string, or undefined if no troubles are active\n *\n * @example\n * ```typescript\n * const troubleType = troubleActionModel.activeTroubleType;\n * if (troubleType === 'InsufficientAgitationTrouble') {\n * // Show agitation required UI\n * }\n * ```\n *\n * @category Trouble Access\n */\n get activeTroubleType() {\n return this.activeTrouble?.type;\n }\n\n /**\n * Reactive effect that synchronizes trouble action state with active troubles.\n *\n * Automatically called when the trouble container's data changes. Updates the\n * model's state object to reflect current trouble conditions:\n * - Adds state entries for newly active troubles\n * - Removes state entries (sets to undefined) for resolved troubles\n * - Uses configured stateKey and stateValue from trouble definitions\n *\n * The effect dependencies ensure this method runs whenever troubles are added\n * or removed from the system.\n *\n * @remarks\n * This method is decorated with @kosModelEffect to establish reactive dependencies\n * on the trouble container's data. It should not be called directly.\n *\n * @category Effects\n * @see {@link kosModelEffect} for reactive effect pattern documentation\n */\n @kosModelEffect({\n dependencies: (model) => [model.troubleContainer.troubles.data],\n })\n handleTroubleActions() {\n const _state = this.troubleContainer.troubles.data.reduce((acc, curr) => {\n const _troubleType = curr.type;\n if (this.troubleActionData[_troubleType]) {\n const _stateKey =\n this.troubleActionData[_troubleType].stateKey ?? _troubleType;\n const _stateValue =\n this.troubleActionData[_troubleType].stateValue ?? _troubleType;\n acc[_stateKey] = _stateValue;\n }\n return acc;\n }, {});\n this.state.setValues(_state);\n Object.keys(this.troubleActionData).forEach((key) => {\n if (\n this.troubleContainer.troubles.getIndexByKey(\"byType\", key).length === 0\n ) {\n const _stateKey = this.troubleActionData[key].stateKey ?? key;\n this.state[_stateKey] = undefined;\n }\n });\n }\n}\n\n/**\n * Singleton registration factory for the TroubleActionModel.\n *\n * Use this export to create and configure the TroubleAction singleton model\n * in your application. The factory provides a fluent interface for instance\n * creation and configuration.\n *\n * @example\n * ```typescript\n * import { TroubleAction } from '@kosdev-code/kos-ddk-models';\n *\n * const troubleAction = TroubleAction.instance().options({\n * definitions: [\n * {\n * troubleType: 'InsufficientAgitationTrouble',\n * stateKey: 'agitationRequired',\n * stateValue: 'true'\n * }\n * ]\n * }).build();\n * ```\n *\n * @category Model Registration\n * @see {@link TroubleActionModel} for the model interface\n * @see {@link TroubleActionOptions} for configuration options\n */\nexport const TroubleAction = TroubleActionModelImpl.Registration;\n","import {\n KosLog,\n ServiceFactory,\n resolveServiceUrl,\n} from \"@kosdev-code/kos-ui-sdk\";\nconst { URL } = resolveServiceUrl(\"START_SERVICE\");\nconst { getOne } = ServiceFactory.build({\n basePath: `${URL}/api/start`,\n});\n\nconst log = KosLog.createLogger({ name: \"start-service\", group: \"Services\" });\n\n/**\n * @category Service\n * Retrieves the initial start data.\n */\nexport const navigateToNCui = async () => {\n log.debug(\"navigating to NCUI\");\n const response = await getOne({\n urlOverride: `${URL}/api/app/kosdev.ddk/ncui/open`,\n });\n return response;\n};\n","import type {\n IKosDataModel,\n IKosIdentifiable,\n KosContextLogger,\n KosCreationContext,\n PublicModelInterface,\n TroubleContainerModel,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport {\n kosDependency,\n kosModel,\n TroubleContainer,\n} from \"@kosdev-code/kos-ui-sdk\";\nimport { navigateToNCui } from \"./services\";\nimport type { StartOptions } from \"./types\";\n\nexport const MODEL_TYPE = \"start-model\";\n\nexport type StartModel = PublicModelInterface<StartModelImpl>;\n\n/**\n * @kosService ddk.start\n * @kosApiLevel 1\n */\n@kosModel(MODEL_TYPE)\nexport class StartModelImpl implements IKosDataModel, IKosIdentifiable {\n id: string;\n private logger: KosContextLogger;\n\n @kosDependency({ modelType: TroubleContainer.type })\n private troubles!: TroubleContainerModel;\n\n constructor(\n modelId: string,\n options: StartOptions,\n context: KosCreationContext\n ) {\n this.id = modelId;\n this.logger = context.logger;\n\n if (options) {\n // Assign options properties here.\n }\n }\n\n get firmwareFailed() {\n return (\n this.troubles.troubles.getIndexByKey(\n \"byType\",\n \"FirmwareUpdateFailedTrouble\"\n ).length > 0\n );\n }\n\n get firmwareInProgress() {\n return (\n this.troubles.troubles.getIndexByKey(\n \"byType\",\n \"FirmwareUpdateInProgressTrouble\"\n ).length > 0\n );\n }\n\n async navigate() {\n await navigateToNCui();\n }\n\n // -------------------LIFECYCLE----------------------------\n\n async init(): Promise<void> {\n this.logger.debug(`initializing start ${this.id}`);\n }\n\n async load(): Promise<void> {\n this.logger.debug(`loading start ${this.id}`);\n }\n}\n","import { SingletonKosModelRegistrationFactory } from \"@kosdev-code/kos-ui-sdk\";\nimport type { StartOptions } from \"./types\";\nimport { StartModelImpl, MODEL_TYPE } from \"./start-model\";\nimport type { StartModel } from \"./start-model\";\n\n/**\n * # Start\n *\n * The registration bean includes convenience methods for creating and working with StartModel instances.\n *\n * ## type\n * The type property is a string that identifies the model type.\n * The type is used to identify the model type in the model registry and to narrow down the model type in type predicates. It's most frequently\n * used when declaring dependencies on models.\n *\n * @example\n * ```typescript\n *\n * @kosDependency({modelType: Start.type, id: \"startId\"})\n * private startModel: StartModel;\n * ```\n *\n *\n * ## factory\n *\n * The factory method creates a factory function that can be used to create new StartModel instances.\n *\n \n * As this is a singleton model, the factory function accepts the model options as its argument.\n *\n * If a model with the same model type already exists, the factory function will return the existing model. The options will be ignored\n * in this case and the existing model will be returned in its current state.\n *\n * @example\n * ```typescript\n * const model = Start.factory({\n * // Add option data\n * });\n * ```\n \n\n *\n * ## predicate\n *\n * [Typescript type predicate](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates) function that will identify and narrow down a model to a StartModel.\n *\n * @example\n * ```typescript\n *\n * const model: IKosDataModel = ...; // some model\n *\n * if (Start.predicate(model)) {\n * // if the function evaluates to true, the model is narrowed down to StartModel\n * // and the compiler will know that the model has the StartModel interface\n * model.updateAvailability(false);\n * }\n * ```\n *\n * ## registration\n *\n * The registration property is an object that can be used to simplify registration of the model with the model registry. The registration object\n * can be spread into the model registration and provides all of the required information to register the model implementation class against the model type.\n *\n *\n * @example\n *\n * In an application registration file you can declare the model registration as follows:\n *\n * **registration.ts**\n * ```typescript\n * import { Start } from \"@kos-ui/project-models\";\n * import { KosModelRegistry } from \"@kosdev-code/kos-dispense-sdk\";\n *\n * import { initKosProvider } from \"@kosdev-code/kos-ui-sdk\";\n *\n * KosModelRegistry.dispense\n * .models()\n * .model(Start);\n * ```\n *\n * ## registration.singleton\n \n * The start model is a singleton model. This means that each time the factory function is called , the same instance will be returned.\n * If the model does not yet exist, it will be created passing in the provided options to initialize it.\n *\n * Singleton models don't require an ID as they will use the model type as their ID to guarantee uniqueness throughout the system.\n \n * */\nexport const Start = new SingletonKosModelRegistrationFactory<\n StartModel,\n StartOptions\n>({\n class: StartModelImpl,\n type: MODEL_TYPE,\n});\n"],"names":["TROUBLE_TYPE_PURGE","TROUBLE_TYPE_PRIME","URL","getOne","postModel","log","MODEL_TYPE","__decorateClass","getAll","index","navigateToNCui","__publicField"],"mappings":";;;AAAO,MAAMA,uBAAqB;AAC3B,MAAMC,uBAAqB;ACKlC,MAAM,OAAEC,MAAA,IAAQ,kBAAkB,cAAc;AAChD,MAAM,EAAA,QAAEC,UAAA,WAAQC,gBAAc,eAAe,MAAM;AAAA,EACjD,UAAU,GAAGF,KAAG;AAClB,CAAC;AAED,MAAMG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