document-model 1.1.0-debug.1 → 1.1.0-debug.2

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 (407) hide show
  1. package/dist/browser/cjs/document-model.js +15 -35
  2. package/dist/browser/cjs/document-model.js.map +1 -1
  3. package/dist/browser/cjs/document.js +10 -10
  4. package/dist/browser/cjs/index.js +11 -7
  5. package/dist/browser/cjs/index.js.map +1 -1
  6. package/dist/browser/cjs/internal/index-CaJbS06G.js +2339 -0
  7. package/dist/browser/cjs/internal/index-CaJbS06G.js.map +1 -0
  8. package/dist/browser/cjs/internal/index-kKIg6qNB.js +44 -0
  9. package/dist/browser/cjs/internal/index-kKIg6qNB.js.map +1 -0
  10. package/dist/browser/cjs/internal/object-B6dSDhtS.js +4109 -0
  11. package/dist/browser/cjs/internal/object-B6dSDhtS.js.map +1 -0
  12. package/dist/browser/es/document-model.js +16 -37
  13. package/dist/browser/es/document-model.js.map +1 -1
  14. package/dist/browser/es/document.js +12 -12
  15. package/dist/browser/es/index.js +11 -7
  16. package/dist/browser/es/index.js.map +1 -1
  17. package/dist/browser/es/internal/index-B1lQN59e.js +2340 -0
  18. package/dist/browser/es/internal/index-B1lQN59e.js.map +1 -0
  19. package/dist/browser/es/internal/index-Bu0CkmrW.js +45 -0
  20. package/dist/browser/es/internal/index-Bu0CkmrW.js.map +1 -0
  21. package/dist/browser/es/internal/object-9mR1JlXD.js +4110 -0
  22. package/dist/browser/es/internal/object-9mR1JlXD.js.map +1 -0
  23. package/dist/node/cjs/document-model.js +15 -33
  24. package/dist/node/cjs/document-model.js.map +1 -1
  25. package/dist/node/cjs/document.js +14 -10
  26. package/dist/node/cjs/document.js.map +1 -1
  27. package/dist/node/cjs/index.js +15 -7
  28. package/dist/node/cjs/index.js.map +1 -1
  29. package/dist/node/cjs/internal/index-AqiVmL0w.js +44 -0
  30. package/dist/node/cjs/internal/index-AqiVmL0w.js.map +1 -0
  31. package/dist/node/cjs/internal/index-ajqhOWQ1.js +2343 -0
  32. package/dist/node/cjs/internal/index-ajqhOWQ1.js.map +1 -0
  33. package/dist/node/cjs/internal/object-D_9h7jBN.js +2111 -0
  34. package/dist/node/cjs/internal/object-D_9h7jBN.js.map +1 -0
  35. package/dist/node/es/document-model.js +16 -35
  36. package/dist/node/es/document-model.js.map +1 -1
  37. package/dist/node/es/document.js +16 -12
  38. package/dist/node/es/document.js.map +1 -1
  39. package/dist/node/es/index.js +15 -7
  40. package/dist/node/es/index.js.map +1 -1
  41. package/dist/node/es/internal/index-Bh_09edy.js +2344 -0
  42. package/dist/node/es/internal/index-Bh_09edy.js.map +1 -0
  43. package/dist/node/es/internal/index-s6NFw7Kq.js +45 -0
  44. package/dist/node/es/internal/index-s6NFw7Kq.js.map +1 -0
  45. package/dist/node/es/internal/object-CbITi4iq.js +2112 -0
  46. package/dist/node/es/internal/object-CbITi4iq.js.map +1 -0
  47. package/dist/src/document/reducer.d.ts +13 -2
  48. package/dist/src/document/utils/base.d.ts +1 -1
  49. package/dist/src/document/utils/document-helpers.d.ts +53 -0
  50. package/dist/src/document/utils/index.d.ts +1 -0
  51. package/package.json +1 -1
  52. package/dist/browser/cjs/_virtual/_commonjsHelpers.js +0 -7
  53. package/dist/browser/cjs/_virtual/_commonjsHelpers.js.map +0 -1
  54. package/dist/browser/cjs/_virtual/browser.js +0 -35
  55. package/dist/browser/cjs/_virtual/browser.js.map +0 -1
  56. package/dist/browser/cjs/_virtual/index.js +0 -5
  57. package/dist/browser/cjs/_virtual/index.js.map +0 -1
  58. package/dist/browser/cjs/_virtual/index2.js +0 -5
  59. package/dist/browser/cjs/_virtual/index2.js.map +0 -1
  60. package/dist/browser/cjs/_virtual/index3.js +0 -5
  61. package/dist/browser/cjs/_virtual/index3.js.map +0 -1
  62. package/dist/browser/cjs/_virtual/index4.js +0 -5
  63. package/dist/browser/cjs/_virtual/index4.js.map +0 -1
  64. package/dist/browser/cjs/_virtual/index5.js +0 -5
  65. package/dist/browser/cjs/_virtual/index5.js.map +0 -1
  66. package/dist/browser/cjs/_virtual/inherits_browser.js +0 -5
  67. package/dist/browser/cjs/_virtual/inherits_browser.js.map +0 -1
  68. package/dist/browser/cjs/src/document/actions/creators.js +0 -46
  69. package/dist/browser/cjs/src/document/actions/creators.js.map +0 -1
  70. package/dist/browser/cjs/src/document/actions/index.js +0 -173
  71. package/dist/browser/cjs/src/document/actions/index.js.map +0 -1
  72. package/dist/browser/cjs/src/document/actions/types.js +0 -15
  73. package/dist/browser/cjs/src/document/actions/types.js.map +0 -1
  74. package/dist/browser/cjs/src/document/object.js +0 -190
  75. package/dist/browser/cjs/src/document/object.js.map +0 -1
  76. package/dist/browser/cjs/src/document/reducer.js +0 -192
  77. package/dist/browser/cjs/src/document/reducer.js.map +0 -1
  78. package/dist/browser/cjs/src/document/schema/zod.js +0 -137
  79. package/dist/browser/cjs/src/document/schema/zod.js.map +0 -1
  80. package/dist/browser/cjs/src/document/utils/base.js +0 -220
  81. package/dist/browser/cjs/src/document/utils/base.js.map +0 -1
  82. package/dist/browser/cjs/src/document/utils/document-helpers.js +0 -324
  83. package/dist/browser/cjs/src/document/utils/document-helpers.js.map +0 -1
  84. package/dist/browser/cjs/src/document/utils/file.js +0 -135
  85. package/dist/browser/cjs/src/document/utils/file.js.map +0 -1
  86. package/dist/browser/cjs/src/document/utils/index.js +0 -33
  87. package/dist/browser/cjs/src/document/utils/index.js.map +0 -1
  88. package/dist/browser/cjs/src/document/utils/validation.js +0 -24
  89. package/dist/browser/cjs/src/document/utils/validation.js.map +0 -1
  90. package/dist/browser/cjs/src/document-model/custom/reducers/header.js +0 -26
  91. package/dist/browser/cjs/src/document-model/custom/reducers/header.js.map +0 -1
  92. package/dist/browser/cjs/src/document-model/custom/reducers/module.js +0 -46
  93. package/dist/browser/cjs/src/document-model/custom/reducers/module.js.map +0 -1
  94. package/dist/browser/cjs/src/document-model/custom/reducers/operation-error.js +0 -95
  95. package/dist/browser/cjs/src/document-model/custom/reducers/operation-error.js.map +0 -1
  96. package/dist/browser/cjs/src/document-model/custom/reducers/operation-example.js +0 -58
  97. package/dist/browser/cjs/src/document-model/custom/reducers/operation-example.js.map +0 -1
  98. package/dist/browser/cjs/src/document-model/custom/reducers/operation.js +0 -123
  99. package/dist/browser/cjs/src/document-model/custom/reducers/operation.js.map +0 -1
  100. package/dist/browser/cjs/src/document-model/custom/reducers/state.js +0 -66
  101. package/dist/browser/cjs/src/document-model/custom/reducers/state.js.map +0 -1
  102. package/dist/browser/cjs/src/document-model/custom/reducers/versioning.js +0 -31
  103. package/dist/browser/cjs/src/document-model/custom/reducers/versioning.js.map +0 -1
  104. package/dist/browser/cjs/src/document-model/custom/utils.js +0 -117
  105. package/dist/browser/cjs/src/document-model/custom/utils.js.map +0 -1
  106. package/dist/browser/cjs/src/document-model/gen/creators.js +0 -53
  107. package/dist/browser/cjs/src/document-model/gen/creators.js.map +0 -1
  108. package/dist/browser/cjs/src/document-model/gen/document-model.js +0 -545
  109. package/dist/browser/cjs/src/document-model/gen/document-model.js.map +0 -1
  110. package/dist/browser/cjs/src/document-model/gen/header/creators.js +0 -39
  111. package/dist/browser/cjs/src/document-model/gen/header/creators.js.map +0 -1
  112. package/dist/browser/cjs/src/document-model/gen/header/object.js +0 -26
  113. package/dist/browser/cjs/src/document-model/gen/header/object.js.map +0 -1
  114. package/dist/browser/cjs/src/document-model/gen/module/creators.js +0 -34
  115. package/dist/browser/cjs/src/document-model/gen/module/creators.js.map +0 -1
  116. package/dist/browser/cjs/src/document-model/gen/module/object.js +0 -23
  117. package/dist/browser/cjs/src/document-model/gen/module/object.js.map +0 -1
  118. package/dist/browser/cjs/src/document-model/gen/object.js +0 -47
  119. package/dist/browser/cjs/src/document-model/gen/object.js.map +0 -1
  120. package/dist/browser/cjs/src/document-model/gen/operation/creators.js +0 -59
  121. package/dist/browser/cjs/src/document-model/gen/operation/creators.js.map +0 -1
  122. package/dist/browser/cjs/src/document-model/gen/operation/object.js +0 -38
  123. package/dist/browser/cjs/src/document-model/gen/operation/object.js.map +0 -1
  124. package/dist/browser/cjs/src/document-model/gen/operation-error/creators.js +0 -44
  125. package/dist/browser/cjs/src/document-model/gen/operation-error/creators.js.map +0 -1
  126. package/dist/browser/cjs/src/document-model/gen/operation-error/object.js +0 -29
  127. package/dist/browser/cjs/src/document-model/gen/operation-error/object.js.map +0 -1
  128. package/dist/browser/cjs/src/document-model/gen/operation-example/creators.js +0 -29
  129. package/dist/browser/cjs/src/document-model/gen/operation-example/creators.js.map +0 -1
  130. package/dist/browser/cjs/src/document-model/gen/operation-example/object.js +0 -20
  131. package/dist/browser/cjs/src/document-model/gen/operation-example/object.js.map +0 -1
  132. package/dist/browser/cjs/src/document-model/gen/reducer.js +0 -255
  133. package/dist/browser/cjs/src/document-model/gen/reducer.js.map +0 -1
  134. package/dist/browser/cjs/src/document-model/gen/schema/zod.js +0 -449
  135. package/dist/browser/cjs/src/document-model/gen/schema/zod.js.map +0 -1
  136. package/dist/browser/cjs/src/document-model/gen/state/creators.js +0 -39
  137. package/dist/browser/cjs/src/document-model/gen/state/creators.js.map +0 -1
  138. package/dist/browser/cjs/src/document-model/gen/state/object.js +0 -26
  139. package/dist/browser/cjs/src/document-model/gen/state/object.js.map +0 -1
  140. package/dist/browser/cjs/src/document-model/gen/utils.js +0 -75
  141. package/dist/browser/cjs/src/document-model/gen/utils.js.map +0 -1
  142. package/dist/browser/cjs/src/document-model/gen/versioning/creators.js +0 -33
  143. package/dist/browser/cjs/src/document-model/gen/versioning/creators.js.map +0 -1
  144. package/dist/browser/cjs/src/document-model/gen/versioning/object.js +0 -23
  145. package/dist/browser/cjs/src/document-model/gen/versioning/object.js.map +0 -1
  146. package/dist/browser/es/_virtual/_commonjsHelpers.js +0 -7
  147. package/dist/browser/es/_virtual/_commonjsHelpers.js.map +0 -1
  148. package/dist/browser/es/_virtual/browser.js +0 -35
  149. package/dist/browser/es/_virtual/browser.js.map +0 -1
  150. package/dist/browser/es/_virtual/index.js +0 -5
  151. package/dist/browser/es/_virtual/index.js.map +0 -1
  152. package/dist/browser/es/_virtual/index2.js +0 -5
  153. package/dist/browser/es/_virtual/index2.js.map +0 -1
  154. package/dist/browser/es/_virtual/index3.js +0 -5
  155. package/dist/browser/es/_virtual/index3.js.map +0 -1
  156. package/dist/browser/es/_virtual/index4.js +0 -5
  157. package/dist/browser/es/_virtual/index4.js.map +0 -1
  158. package/dist/browser/es/_virtual/index5.js +0 -5
  159. package/dist/browser/es/_virtual/index5.js.map +0 -1
  160. package/dist/browser/es/_virtual/inherits_browser.js +0 -5
  161. package/dist/browser/es/_virtual/inherits_browser.js.map +0 -1
  162. package/dist/browser/es/src/document/actions/creators.js +0 -46
  163. package/dist/browser/es/src/document/actions/creators.js.map +0 -1
  164. package/dist/browser/es/src/document/actions/index.js +0 -174
  165. package/dist/browser/es/src/document/actions/index.js.map +0 -1
  166. package/dist/browser/es/src/document/actions/types.js +0 -15
  167. package/dist/browser/es/src/document/actions/types.js.map +0 -1
  168. package/dist/browser/es/src/document/object.js +0 -190
  169. package/dist/browser/es/src/document/object.js.map +0 -1
  170. package/dist/browser/es/src/document/reducer.js +0 -192
  171. package/dist/browser/es/src/document/reducer.js.map +0 -1
  172. package/dist/browser/es/src/document/schema/zod.js +0 -137
  173. package/dist/browser/es/src/document/schema/zod.js.map +0 -1
  174. package/dist/browser/es/src/document/utils/base.js +0 -220
  175. package/dist/browser/es/src/document/utils/base.js.map +0 -1
  176. package/dist/browser/es/src/document/utils/document-helpers.js +0 -324
  177. package/dist/browser/es/src/document/utils/document-helpers.js.map +0 -1
  178. package/dist/browser/es/src/document/utils/file.js +0 -135
  179. package/dist/browser/es/src/document/utils/file.js.map +0 -1
  180. package/dist/browser/es/src/document/utils/index.js +0 -33
  181. package/dist/browser/es/src/document/utils/index.js.map +0 -1
  182. package/dist/browser/es/src/document/utils/validation.js +0 -24
  183. package/dist/browser/es/src/document/utils/validation.js.map +0 -1
  184. package/dist/browser/es/src/document-model/custom/reducers/header.js +0 -26
  185. package/dist/browser/es/src/document-model/custom/reducers/header.js.map +0 -1
  186. package/dist/browser/es/src/document-model/custom/reducers/module.js +0 -46
  187. package/dist/browser/es/src/document-model/custom/reducers/module.js.map +0 -1
  188. package/dist/browser/es/src/document-model/custom/reducers/operation-error.js +0 -95
  189. package/dist/browser/es/src/document-model/custom/reducers/operation-error.js.map +0 -1
  190. package/dist/browser/es/src/document-model/custom/reducers/operation-example.js +0 -58
  191. package/dist/browser/es/src/document-model/custom/reducers/operation-example.js.map +0 -1
  192. package/dist/browser/es/src/document-model/custom/reducers/operation.js +0 -123
  193. package/dist/browser/es/src/document-model/custom/reducers/operation.js.map +0 -1
  194. package/dist/browser/es/src/document-model/custom/reducers/state.js +0 -66
  195. package/dist/browser/es/src/document-model/custom/reducers/state.js.map +0 -1
  196. package/dist/browser/es/src/document-model/custom/reducers/versioning.js +0 -31
  197. package/dist/browser/es/src/document-model/custom/reducers/versioning.js.map +0 -1
  198. package/dist/browser/es/src/document-model/custom/utils.js +0 -117
  199. package/dist/browser/es/src/document-model/custom/utils.js.map +0 -1
  200. package/dist/browser/es/src/document-model/gen/creators.js +0 -53
  201. package/dist/browser/es/src/document-model/gen/creators.js.map +0 -1
  202. package/dist/browser/es/src/document-model/gen/document-model.js +0 -545
  203. package/dist/browser/es/src/document-model/gen/document-model.js.map +0 -1
  204. package/dist/browser/es/src/document-model/gen/header/creators.js +0 -39
  205. package/dist/browser/es/src/document-model/gen/header/creators.js.map +0 -1
  206. package/dist/browser/es/src/document-model/gen/header/object.js +0 -26
  207. package/dist/browser/es/src/document-model/gen/header/object.js.map +0 -1
  208. package/dist/browser/es/src/document-model/gen/module/creators.js +0 -34
  209. package/dist/browser/es/src/document-model/gen/module/creators.js.map +0 -1
  210. package/dist/browser/es/src/document-model/gen/module/object.js +0 -23
  211. package/dist/browser/es/src/document-model/gen/module/object.js.map +0 -1
  212. package/dist/browser/es/src/document-model/gen/object.js +0 -47
  213. package/dist/browser/es/src/document-model/gen/object.js.map +0 -1
  214. package/dist/browser/es/src/document-model/gen/operation/creators.js +0 -59
  215. package/dist/browser/es/src/document-model/gen/operation/creators.js.map +0 -1
  216. package/dist/browser/es/src/document-model/gen/operation/object.js +0 -38
  217. package/dist/browser/es/src/document-model/gen/operation/object.js.map +0 -1
  218. package/dist/browser/es/src/document-model/gen/operation-error/creators.js +0 -44
  219. package/dist/browser/es/src/document-model/gen/operation-error/creators.js.map +0 -1
  220. package/dist/browser/es/src/document-model/gen/operation-error/object.js +0 -29
  221. package/dist/browser/es/src/document-model/gen/operation-error/object.js.map +0 -1
  222. package/dist/browser/es/src/document-model/gen/operation-example/creators.js +0 -29
  223. package/dist/browser/es/src/document-model/gen/operation-example/creators.js.map +0 -1
  224. package/dist/browser/es/src/document-model/gen/operation-example/object.js +0 -20
  225. package/dist/browser/es/src/document-model/gen/operation-example/object.js.map +0 -1
  226. package/dist/browser/es/src/document-model/gen/reducer.js +0 -255
  227. package/dist/browser/es/src/document-model/gen/reducer.js.map +0 -1
  228. package/dist/browser/es/src/document-model/gen/schema/zod.js +0 -449
  229. package/dist/browser/es/src/document-model/gen/schema/zod.js.map +0 -1
  230. package/dist/browser/es/src/document-model/gen/state/creators.js +0 -39
  231. package/dist/browser/es/src/document-model/gen/state/creators.js.map +0 -1
  232. package/dist/browser/es/src/document-model/gen/state/object.js +0 -26
  233. package/dist/browser/es/src/document-model/gen/state/object.js.map +0 -1
  234. package/dist/browser/es/src/document-model/gen/utils.js +0 -75
  235. package/dist/browser/es/src/document-model/gen/utils.js.map +0 -1
  236. package/dist/browser/es/src/document-model/gen/versioning/creators.js +0 -33
  237. package/dist/browser/es/src/document-model/gen/versioning/creators.js.map +0 -1
  238. package/dist/browser/es/src/document-model/gen/versioning/object.js +0 -23
  239. package/dist/browser/es/src/document-model/gen/versioning/object.js.map +0 -1
  240. package/dist/node/cjs/_virtual/_commonjsHelpers.js +0 -7
  241. package/dist/node/cjs/_virtual/_commonjsHelpers.js.map +0 -1
  242. package/dist/node/cjs/_virtual/index.js +0 -5
  243. package/dist/node/cjs/_virtual/index.js.map +0 -1
  244. package/dist/node/cjs/src/document/actions/creators.js +0 -46
  245. package/dist/node/cjs/src/document/actions/creators.js.map +0 -1
  246. package/dist/node/cjs/src/document/actions/index.js +0 -173
  247. package/dist/node/cjs/src/document/actions/index.js.map +0 -1
  248. package/dist/node/cjs/src/document/actions/types.js +0 -15
  249. package/dist/node/cjs/src/document/actions/types.js.map +0 -1
  250. package/dist/node/cjs/src/document/object.js +0 -190
  251. package/dist/node/cjs/src/document/object.js.map +0 -1
  252. package/dist/node/cjs/src/document/reducer.js +0 -194
  253. package/dist/node/cjs/src/document/reducer.js.map +0 -1
  254. package/dist/node/cjs/src/document/schema/zod.js +0 -137
  255. package/dist/node/cjs/src/document/schema/zod.js.map +0 -1
  256. package/dist/node/cjs/src/document/utils/base.js +0 -220
  257. package/dist/node/cjs/src/document/utils/base.js.map +0 -1
  258. package/dist/node/cjs/src/document/utils/document-helpers.js +0 -324
  259. package/dist/node/cjs/src/document/utils/document-helpers.js.map +0 -1
  260. package/dist/node/cjs/src/document/utils/file.js +0 -136
  261. package/dist/node/cjs/src/document/utils/file.js.map +0 -1
  262. package/dist/node/cjs/src/document/utils/index.js +0 -33
  263. package/dist/node/cjs/src/document/utils/index.js.map +0 -1
  264. package/dist/node/cjs/src/document/utils/node.js +0 -54
  265. package/dist/node/cjs/src/document/utils/node.js.map +0 -1
  266. package/dist/node/cjs/src/document/utils/validation.js +0 -24
  267. package/dist/node/cjs/src/document/utils/validation.js.map +0 -1
  268. package/dist/node/cjs/src/document-model/custom/reducers/header.js +0 -26
  269. package/dist/node/cjs/src/document-model/custom/reducers/header.js.map +0 -1
  270. package/dist/node/cjs/src/document-model/custom/reducers/module.js +0 -46
  271. package/dist/node/cjs/src/document-model/custom/reducers/module.js.map +0 -1
  272. package/dist/node/cjs/src/document-model/custom/reducers/operation-error.js +0 -95
  273. package/dist/node/cjs/src/document-model/custom/reducers/operation-error.js.map +0 -1
  274. package/dist/node/cjs/src/document-model/custom/reducers/operation-example.js +0 -58
  275. package/dist/node/cjs/src/document-model/custom/reducers/operation-example.js.map +0 -1
  276. package/dist/node/cjs/src/document-model/custom/reducers/operation.js +0 -123
  277. package/dist/node/cjs/src/document-model/custom/reducers/operation.js.map +0 -1
  278. package/dist/node/cjs/src/document-model/custom/reducers/state.js +0 -66
  279. package/dist/node/cjs/src/document-model/custom/reducers/state.js.map +0 -1
  280. package/dist/node/cjs/src/document-model/custom/reducers/versioning.js +0 -31
  281. package/dist/node/cjs/src/document-model/custom/reducers/versioning.js.map +0 -1
  282. package/dist/node/cjs/src/document-model/custom/utils.js +0 -117
  283. package/dist/node/cjs/src/document-model/custom/utils.js.map +0 -1
  284. package/dist/node/cjs/src/document-model/gen/creators.js +0 -53
  285. package/dist/node/cjs/src/document-model/gen/creators.js.map +0 -1
  286. package/dist/node/cjs/src/document-model/gen/document-model.js +0 -545
  287. package/dist/node/cjs/src/document-model/gen/document-model.js.map +0 -1
  288. package/dist/node/cjs/src/document-model/gen/header/creators.js +0 -41
  289. package/dist/node/cjs/src/document-model/gen/header/creators.js.map +0 -1
  290. package/dist/node/cjs/src/document-model/gen/header/object.js +0 -26
  291. package/dist/node/cjs/src/document-model/gen/header/object.js.map +0 -1
  292. package/dist/node/cjs/src/document-model/gen/module/creators.js +0 -36
  293. package/dist/node/cjs/src/document-model/gen/module/creators.js.map +0 -1
  294. package/dist/node/cjs/src/document-model/gen/module/object.js +0 -23
  295. package/dist/node/cjs/src/document-model/gen/module/object.js.map +0 -1
  296. package/dist/node/cjs/src/document-model/gen/object.js +0 -47
  297. package/dist/node/cjs/src/document-model/gen/object.js.map +0 -1
  298. package/dist/node/cjs/src/document-model/gen/operation/creators.js +0 -61
  299. package/dist/node/cjs/src/document-model/gen/operation/creators.js.map +0 -1
  300. package/dist/node/cjs/src/document-model/gen/operation/object.js +0 -38
  301. package/dist/node/cjs/src/document-model/gen/operation/object.js.map +0 -1
  302. package/dist/node/cjs/src/document-model/gen/operation-error/creators.js +0 -46
  303. package/dist/node/cjs/src/document-model/gen/operation-error/creators.js.map +0 -1
  304. package/dist/node/cjs/src/document-model/gen/operation-error/object.js +0 -29
  305. package/dist/node/cjs/src/document-model/gen/operation-error/object.js.map +0 -1
  306. package/dist/node/cjs/src/document-model/gen/operation-example/creators.js +0 -31
  307. package/dist/node/cjs/src/document-model/gen/operation-example/creators.js.map +0 -1
  308. package/dist/node/cjs/src/document-model/gen/operation-example/object.js +0 -20
  309. package/dist/node/cjs/src/document-model/gen/operation-example/object.js.map +0 -1
  310. package/dist/node/cjs/src/document-model/gen/reducer.js +0 -257
  311. package/dist/node/cjs/src/document-model/gen/reducer.js.map +0 -1
  312. package/dist/node/cjs/src/document-model/gen/schema/zod.js +0 -449
  313. package/dist/node/cjs/src/document-model/gen/schema/zod.js.map +0 -1
  314. package/dist/node/cjs/src/document-model/gen/state/creators.js +0 -41
  315. package/dist/node/cjs/src/document-model/gen/state/creators.js.map +0 -1
  316. package/dist/node/cjs/src/document-model/gen/state/object.js +0 -26
  317. package/dist/node/cjs/src/document-model/gen/state/object.js.map +0 -1
  318. package/dist/node/cjs/src/document-model/gen/utils.js +0 -75
  319. package/dist/node/cjs/src/document-model/gen/utils.js.map +0 -1
  320. package/dist/node/cjs/src/document-model/gen/versioning/creators.js +0 -35
  321. package/dist/node/cjs/src/document-model/gen/versioning/creators.js.map +0 -1
  322. package/dist/node/cjs/src/document-model/gen/versioning/object.js +0 -23
  323. package/dist/node/cjs/src/document-model/gen/versioning/object.js.map +0 -1
  324. package/dist/node/es/_virtual/_commonjsHelpers.js +0 -7
  325. package/dist/node/es/_virtual/_commonjsHelpers.js.map +0 -1
  326. package/dist/node/es/_virtual/index.js +0 -5
  327. package/dist/node/es/_virtual/index.js.map +0 -1
  328. package/dist/node/es/src/document/actions/creators.js +0 -46
  329. package/dist/node/es/src/document/actions/creators.js.map +0 -1
  330. package/dist/node/es/src/document/actions/index.js +0 -174
  331. package/dist/node/es/src/document/actions/index.js.map +0 -1
  332. package/dist/node/es/src/document/actions/types.js +0 -15
  333. package/dist/node/es/src/document/actions/types.js.map +0 -1
  334. package/dist/node/es/src/document/object.js +0 -190
  335. package/dist/node/es/src/document/object.js.map +0 -1
  336. package/dist/node/es/src/document/reducer.js +0 -194
  337. package/dist/node/es/src/document/reducer.js.map +0 -1
  338. package/dist/node/es/src/document/schema/zod.js +0 -137
  339. package/dist/node/es/src/document/schema/zod.js.map +0 -1
  340. package/dist/node/es/src/document/utils/base.js +0 -220
  341. package/dist/node/es/src/document/utils/base.js.map +0 -1
  342. package/dist/node/es/src/document/utils/document-helpers.js +0 -324
  343. package/dist/node/es/src/document/utils/document-helpers.js.map +0 -1
  344. package/dist/node/es/src/document/utils/file.js +0 -136
  345. package/dist/node/es/src/document/utils/file.js.map +0 -1
  346. package/dist/node/es/src/document/utils/index.js +0 -33
  347. package/dist/node/es/src/document/utils/index.js.map +0 -1
  348. package/dist/node/es/src/document/utils/node.js +0 -54
  349. package/dist/node/es/src/document/utils/node.js.map +0 -1
  350. package/dist/node/es/src/document/utils/validation.js +0 -24
  351. package/dist/node/es/src/document/utils/validation.js.map +0 -1
  352. package/dist/node/es/src/document-model/custom/reducers/header.js +0 -26
  353. package/dist/node/es/src/document-model/custom/reducers/header.js.map +0 -1
  354. package/dist/node/es/src/document-model/custom/reducers/module.js +0 -46
  355. package/dist/node/es/src/document-model/custom/reducers/module.js.map +0 -1
  356. package/dist/node/es/src/document-model/custom/reducers/operation-error.js +0 -95
  357. package/dist/node/es/src/document-model/custom/reducers/operation-error.js.map +0 -1
  358. package/dist/node/es/src/document-model/custom/reducers/operation-example.js +0 -58
  359. package/dist/node/es/src/document-model/custom/reducers/operation-example.js.map +0 -1
  360. package/dist/node/es/src/document-model/custom/reducers/operation.js +0 -123
  361. package/dist/node/es/src/document-model/custom/reducers/operation.js.map +0 -1
  362. package/dist/node/es/src/document-model/custom/reducers/state.js +0 -66
  363. package/dist/node/es/src/document-model/custom/reducers/state.js.map +0 -1
  364. package/dist/node/es/src/document-model/custom/reducers/versioning.js +0 -31
  365. package/dist/node/es/src/document-model/custom/reducers/versioning.js.map +0 -1
  366. package/dist/node/es/src/document-model/custom/utils.js +0 -117
  367. package/dist/node/es/src/document-model/custom/utils.js.map +0 -1
  368. package/dist/node/es/src/document-model/gen/creators.js +0 -53
  369. package/dist/node/es/src/document-model/gen/creators.js.map +0 -1
  370. package/dist/node/es/src/document-model/gen/document-model.js +0 -545
  371. package/dist/node/es/src/document-model/gen/document-model.js.map +0 -1
  372. package/dist/node/es/src/document-model/gen/header/creators.js +0 -41
  373. package/dist/node/es/src/document-model/gen/header/creators.js.map +0 -1
  374. package/dist/node/es/src/document-model/gen/header/object.js +0 -26
  375. package/dist/node/es/src/document-model/gen/header/object.js.map +0 -1
  376. package/dist/node/es/src/document-model/gen/module/creators.js +0 -36
  377. package/dist/node/es/src/document-model/gen/module/creators.js.map +0 -1
  378. package/dist/node/es/src/document-model/gen/module/object.js +0 -23
  379. package/dist/node/es/src/document-model/gen/module/object.js.map +0 -1
  380. package/dist/node/es/src/document-model/gen/object.js +0 -47
  381. package/dist/node/es/src/document-model/gen/object.js.map +0 -1
  382. package/dist/node/es/src/document-model/gen/operation/creators.js +0 -61
  383. package/dist/node/es/src/document-model/gen/operation/creators.js.map +0 -1
  384. package/dist/node/es/src/document-model/gen/operation/object.js +0 -38
  385. package/dist/node/es/src/document-model/gen/operation/object.js.map +0 -1
  386. package/dist/node/es/src/document-model/gen/operation-error/creators.js +0 -46
  387. package/dist/node/es/src/document-model/gen/operation-error/creators.js.map +0 -1
  388. package/dist/node/es/src/document-model/gen/operation-error/object.js +0 -29
  389. package/dist/node/es/src/document-model/gen/operation-error/object.js.map +0 -1
  390. package/dist/node/es/src/document-model/gen/operation-example/creators.js +0 -31
  391. package/dist/node/es/src/document-model/gen/operation-example/creators.js.map +0 -1
  392. package/dist/node/es/src/document-model/gen/operation-example/object.js +0 -20
  393. package/dist/node/es/src/document-model/gen/operation-example/object.js.map +0 -1
  394. package/dist/node/es/src/document-model/gen/reducer.js +0 -257
  395. package/dist/node/es/src/document-model/gen/reducer.js.map +0 -1
  396. package/dist/node/es/src/document-model/gen/schema/zod.js +0 -449
  397. package/dist/node/es/src/document-model/gen/schema/zod.js.map +0 -1
  398. package/dist/node/es/src/document-model/gen/state/creators.js +0 -41
  399. package/dist/node/es/src/document-model/gen/state/creators.js.map +0 -1
  400. package/dist/node/es/src/document-model/gen/state/object.js +0 -26
  401. package/dist/node/es/src/document-model/gen/state/object.js.map +0 -1
  402. package/dist/node/es/src/document-model/gen/utils.js +0 -75
  403. package/dist/node/es/src/document-model/gen/utils.js.map +0 -1
  404. package/dist/node/es/src/document-model/gen/versioning/creators.js +0 -35
  405. package/dist/node/es/src/document-model/gen/versioning/creators.js.map +0 -1
  406. package/dist/node/es/src/document-model/gen/versioning/object.js +0 -23
  407. package/dist/node/es/src/document-model/gen/versioning/object.js.map +0 -1
@@ -0,0 +1,2343 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
+ var __publicField = (obj, key, value) => {
5
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
6
+ return value;
7
+ };
8
+ var _a;
9
+ const object = require("./object-D_9h7jBN.js");
10
+ require("immer");
11
+ require("jszip");
12
+ require("crypto");
13
+ require("fs");
14
+ require("https");
15
+ require("path");
16
+ const zod$1 = require("zod");
17
+ const SPLIT_LOWER_UPPER_RE = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu");
18
+ const SPLIT_UPPER_UPPER_RE = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu");
19
+ const SPLIT_SEPARATE_NUMBER_RE = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u");
20
+ const DEFAULT_STRIP_REGEXP = /[^\p{L}\d]+/giu;
21
+ const SPLIT_REPLACE_VALUE = "$1\0$2";
22
+ const DEFAULT_PREFIX_SUFFIX_CHARACTERS = "";
23
+ function split(value) {
24
+ let result = value.trim();
25
+ result = result.replace(SPLIT_LOWER_UPPER_RE, SPLIT_REPLACE_VALUE).replace(SPLIT_UPPER_UPPER_RE, SPLIT_REPLACE_VALUE);
26
+ result = result.replace(DEFAULT_STRIP_REGEXP, "\0");
27
+ let start = 0;
28
+ let end = result.length;
29
+ while (result.charAt(start) === "\0")
30
+ start++;
31
+ if (start === end)
32
+ return [];
33
+ while (result.charAt(end - 1) === "\0")
34
+ end--;
35
+ return result.slice(start, end).split(/\0/g);
36
+ }
37
+ function splitSeparateNumbers(value) {
38
+ const words = split(value);
39
+ for (let i = 0; i < words.length; i++) {
40
+ const word = words[i];
41
+ const match = SPLIT_SEPARATE_NUMBER_RE.exec(word);
42
+ if (match) {
43
+ const offset = match.index + (match[1] ?? match[2]).length;
44
+ words.splice(i, 1, word.slice(0, offset), word.slice(offset));
45
+ }
46
+ }
47
+ return words;
48
+ }
49
+ function pascalCase(input, options) {
50
+ const [prefix, words, suffix] = splitPrefixSuffix(input, options);
51
+ const lower = lowerFactory(options == null ? void 0 : options.locale);
52
+ const upper = upperFactory(options == null ? void 0 : options.locale);
53
+ const transform = (options == null ? void 0 : options.mergeAmbiguousCharacters) ? capitalCaseTransformFactory(lower, upper) : pascalCaseTransformFactory(lower, upper);
54
+ return prefix + words.map(transform).join((options == null ? void 0 : options.delimiter) ?? "") + suffix;
55
+ }
56
+ function lowerFactory(locale) {
57
+ return locale === false ? (input) => input.toLowerCase() : (input) => input.toLocaleLowerCase(locale);
58
+ }
59
+ function upperFactory(locale) {
60
+ return locale === false ? (input) => input.toUpperCase() : (input) => input.toLocaleUpperCase(locale);
61
+ }
62
+ function capitalCaseTransformFactory(lower, upper) {
63
+ return (word) => `${upper(word[0])}${lower(word.slice(1))}`;
64
+ }
65
+ function pascalCaseTransformFactory(lower, upper) {
66
+ return (word, index) => {
67
+ const char0 = word[0];
68
+ const initial = index > 0 && char0 >= "0" && char0 <= "9" ? "_" + char0 : upper(char0);
69
+ return initial + lower(word.slice(1));
70
+ };
71
+ }
72
+ function splitPrefixSuffix(input, options = {}) {
73
+ const splitFn = options.split ?? (options.separateNumbers ? splitSeparateNumbers : split);
74
+ const prefixCharacters = options.prefixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;
75
+ const suffixCharacters = options.suffixCharacters ?? DEFAULT_PREFIX_SUFFIX_CHARACTERS;
76
+ let prefixIndex = 0;
77
+ let suffixIndex = input.length;
78
+ while (prefixIndex < input.length) {
79
+ const char = input.charAt(prefixIndex);
80
+ if (!prefixCharacters.includes(char))
81
+ break;
82
+ prefixIndex++;
83
+ }
84
+ while (suffixIndex > prefixIndex) {
85
+ const index = suffixIndex - 1;
86
+ const char = input.charAt(index);
87
+ if (!suffixCharacters.includes(char))
88
+ break;
89
+ suffixIndex = index;
90
+ }
91
+ return [
92
+ input.slice(0, prefixIndex),
93
+ splitFn(input.slice(prefixIndex, suffixIndex)),
94
+ input.slice(suffixIndex)
95
+ ];
96
+ }
97
+ function validateInitialState(initialState, allowEmptyState = false) {
98
+ const errors = [];
99
+ if (allowEmptyState && initialState === "")
100
+ return errors;
101
+ try {
102
+ const state = JSON.parse(initialState);
103
+ if (!allowEmptyState && !Object.keys(state).length) {
104
+ errors.push({
105
+ message: "Initial state cannot be empty",
106
+ details: {
107
+ initialState
108
+ }
109
+ });
110
+ }
111
+ } catch {
112
+ errors.push({
113
+ message: "Invalid initial state",
114
+ details: {
115
+ initialState
116
+ }
117
+ });
118
+ }
119
+ return errors;
120
+ }
121
+ function validateStateSchemaName(schema, documentName, scope = "", allowEmptySchema = true) {
122
+ const errors = [];
123
+ if (!allowEmptySchema && !schema) {
124
+ errors.push({
125
+ message: "State schema is required",
126
+ details: {
127
+ schema
128
+ }
129
+ });
130
+ return errors;
131
+ }
132
+ if (allowEmptySchema && !schema)
133
+ return errors;
134
+ const expectedTypeName = `type ${pascalCase(documentName)}${pascalCase(scope)}State`;
135
+ if (!schema.includes(expectedTypeName)) {
136
+ errors.push({
137
+ message: `Invalid state schema name. Expected ${expectedTypeName}`,
138
+ details: {
139
+ schema
140
+ }
141
+ });
142
+ }
143
+ return errors;
144
+ }
145
+ function validateModules(modules) {
146
+ const errors = [];
147
+ if (!modules.length) {
148
+ errors.push({
149
+ message: "Modules are required",
150
+ details: {
151
+ modules
152
+ }
153
+ });
154
+ }
155
+ const modulesError = modules.reduce(
156
+ (acc, mod) => [...acc, ...validateModule(mod)],
157
+ []
158
+ );
159
+ return [...errors, ...modulesError];
160
+ }
161
+ function validateModule(mod) {
162
+ const errors = [];
163
+ if (!mod.name) {
164
+ errors.push({
165
+ message: "Module name is required",
166
+ details: {
167
+ module: mod
168
+ }
169
+ });
170
+ }
171
+ if (!mod.operations.length) {
172
+ errors.push({
173
+ message: "Module operations are required",
174
+ details: {
175
+ module: mod
176
+ }
177
+ });
178
+ }
179
+ const operationErrors = mod.operations.reduce(
180
+ (acc, operation) => [...acc, ...validateModuleOperation(operation)],
181
+ []
182
+ );
183
+ return [...errors, ...operationErrors];
184
+ }
185
+ function validateModuleOperation(operation) {
186
+ const errors = [];
187
+ if (!operation.name) {
188
+ errors.push({
189
+ message: "Operation name is required",
190
+ details: {
191
+ operation
192
+ }
193
+ });
194
+ }
195
+ if (!operation.schema) {
196
+ errors.push({
197
+ message: "Operation schema is required",
198
+ details: {
199
+ operation
200
+ }
201
+ });
202
+ }
203
+ return errors;
204
+ }
205
+ const customUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
206
+ __proto__: null,
207
+ validateInitialState,
208
+ validateModule,
209
+ validateModuleOperation,
210
+ validateModules,
211
+ validateStateSchemaName
212
+ }, Symbol.toStringTag, { value: "Module" }));
213
+ const documentModel = {
214
+ id: "powerhouse/document-model",
215
+ name: "DocumentModel",
216
+ extension: "phdm",
217
+ description: "The Powerhouse Document Model describes the state and operations of a document type.",
218
+ author: {
219
+ name: "Powerhouse",
220
+ website: "https://www.powerhouse.inc/"
221
+ },
222
+ specifications: [
223
+ {
224
+ version: 1,
225
+ changeLog: [],
226
+ modules: [
227
+ {
228
+ name: "header",
229
+ operations: [
230
+ {
231
+ name: "SetModelName",
232
+ id: "",
233
+ description: "",
234
+ schema: "",
235
+ template: "",
236
+ reducer: "",
237
+ examples: [],
238
+ errors: [],
239
+ scope: "global"
240
+ },
241
+ {
242
+ name: "SetModelId",
243
+ id: "",
244
+ description: "",
245
+ schema: "",
246
+ template: "",
247
+ reducer: "",
248
+ examples: [],
249
+ errors: [],
250
+ scope: "global"
251
+ },
252
+ {
253
+ name: "SetModelExtension",
254
+ id: "",
255
+ description: "",
256
+ schema: "",
257
+ template: "",
258
+ reducer: "",
259
+ examples: [],
260
+ errors: [],
261
+ scope: "global"
262
+ },
263
+ {
264
+ name: "SetModelDescription",
265
+ id: "",
266
+ description: "",
267
+ schema: "",
268
+ template: "",
269
+ reducer: "",
270
+ examples: [],
271
+ errors: [],
272
+ scope: "global"
273
+ },
274
+ {
275
+ name: "SetAuthorName",
276
+ id: "",
277
+ description: "",
278
+ schema: "",
279
+ template: "",
280
+ reducer: "",
281
+ examples: [],
282
+ errors: [],
283
+ scope: "global"
284
+ },
285
+ {
286
+ name: "SetAuthorWebsite",
287
+ id: "",
288
+ description: "",
289
+ schema: "",
290
+ template: "",
291
+ reducer: "",
292
+ examples: [],
293
+ errors: [],
294
+ scope: "global"
295
+ }
296
+ ],
297
+ id: "",
298
+ description: ""
299
+ },
300
+ {
301
+ name: "versioning",
302
+ operations: [
303
+ {
304
+ name: "AddChangeLogItem",
305
+ id: "",
306
+ description: "",
307
+ schema: "",
308
+ template: "",
309
+ reducer: "",
310
+ examples: [],
311
+ errors: [],
312
+ scope: "global"
313
+ },
314
+ {
315
+ name: "UpdateChangeLogItem",
316
+ id: "",
317
+ description: "",
318
+ schema: "",
319
+ template: "",
320
+ reducer: "",
321
+ examples: [],
322
+ errors: [],
323
+ scope: "global"
324
+ },
325
+ {
326
+ name: "DeleteChangeLogItem",
327
+ id: "",
328
+ description: "",
329
+ schema: "",
330
+ template: "",
331
+ reducer: "",
332
+ examples: [],
333
+ errors: [],
334
+ scope: "global"
335
+ },
336
+ {
337
+ name: "ReorderChangeLogItems",
338
+ id: "",
339
+ description: "",
340
+ schema: "",
341
+ template: "",
342
+ reducer: "",
343
+ examples: [],
344
+ errors: [],
345
+ scope: "global"
346
+ },
347
+ {
348
+ name: "ReleaseNewVersion",
349
+ schema: null,
350
+ id: "",
351
+ description: "",
352
+ template: "",
353
+ reducer: "",
354
+ examples: [],
355
+ errors: [],
356
+ scope: "global"
357
+ }
358
+ ],
359
+ id: "",
360
+ description: ""
361
+ },
362
+ {
363
+ name: "module",
364
+ operations: [
365
+ {
366
+ name: "AddModule",
367
+ id: "",
368
+ description: "",
369
+ schema: "",
370
+ template: "",
371
+ reducer: "",
372
+ examples: [],
373
+ errors: [],
374
+ scope: "global"
375
+ },
376
+ {
377
+ name: "SetModuleName",
378
+ id: "",
379
+ description: "",
380
+ schema: "",
381
+ template: "",
382
+ reducer: "",
383
+ examples: [],
384
+ errors: [],
385
+ scope: "global"
386
+ },
387
+ {
388
+ name: "SetModuleDescription",
389
+ id: "",
390
+ description: "",
391
+ schema: "",
392
+ template: "",
393
+ reducer: "",
394
+ examples: [],
395
+ errors: [],
396
+ scope: "global"
397
+ },
398
+ {
399
+ name: "DeleteModule",
400
+ id: "",
401
+ description: "",
402
+ schema: "",
403
+ template: "",
404
+ reducer: "",
405
+ examples: [],
406
+ errors: [],
407
+ scope: "global"
408
+ },
409
+ {
410
+ name: "ReorderModules",
411
+ id: "",
412
+ description: "",
413
+ schema: "",
414
+ template: "",
415
+ reducer: "",
416
+ examples: [],
417
+ errors: [],
418
+ scope: "global"
419
+ }
420
+ ],
421
+ id: "",
422
+ description: ""
423
+ },
424
+ {
425
+ name: "operation-error",
426
+ operations: [
427
+ {
428
+ name: "AddOperationError",
429
+ id: "",
430
+ description: "",
431
+ schema: "",
432
+ template: "",
433
+ reducer: "",
434
+ examples: [],
435
+ errors: [],
436
+ scope: "global"
437
+ },
438
+ {
439
+ name: "SetOperationErrorCode",
440
+ id: "",
441
+ description: "",
442
+ schema: "",
443
+ template: "",
444
+ reducer: "",
445
+ examples: [],
446
+ errors: [],
447
+ scope: "global"
448
+ },
449
+ {
450
+ name: "SetOperationErrorName",
451
+ id: "",
452
+ description: "",
453
+ schema: "",
454
+ template: "",
455
+ reducer: "",
456
+ examples: [],
457
+ errors: [],
458
+ scope: "global"
459
+ },
460
+ {
461
+ name: "SetOperationErrorDescription",
462
+ id: "",
463
+ description: "",
464
+ schema: "",
465
+ template: "",
466
+ reducer: "",
467
+ examples: [],
468
+ errors: [],
469
+ scope: "global"
470
+ },
471
+ {
472
+ name: "SetOperationErrorTemplate",
473
+ id: "",
474
+ description: "",
475
+ schema: "",
476
+ template: "",
477
+ reducer: "",
478
+ examples: [],
479
+ errors: [],
480
+ scope: "global"
481
+ },
482
+ {
483
+ name: "DeleteOperationError",
484
+ id: "",
485
+ description: "",
486
+ schema: "",
487
+ template: "",
488
+ reducer: "",
489
+ examples: [],
490
+ errors: [],
491
+ scope: "global"
492
+ },
493
+ {
494
+ name: "ReorderOperationErrors",
495
+ id: "",
496
+ description: "",
497
+ schema: "",
498
+ template: "",
499
+ reducer: "",
500
+ examples: [],
501
+ errors: [],
502
+ scope: "global"
503
+ }
504
+ ],
505
+ id: "",
506
+ description: ""
507
+ },
508
+ {
509
+ name: "operation-example",
510
+ operations: [
511
+ {
512
+ name: "AddOperationExample",
513
+ id: "",
514
+ description: "",
515
+ schema: "",
516
+ template: "",
517
+ reducer: "",
518
+ examples: [],
519
+ errors: [],
520
+ scope: "global"
521
+ },
522
+ {
523
+ name: "UpdateOperationExample",
524
+ id: "",
525
+ description: "",
526
+ schema: "",
527
+ template: "",
528
+ reducer: "",
529
+ examples: [],
530
+ errors: [],
531
+ scope: "global"
532
+ },
533
+ {
534
+ name: "DeleteOperationExample",
535
+ id: "",
536
+ description: "",
537
+ schema: "",
538
+ template: "",
539
+ reducer: "",
540
+ examples: [],
541
+ errors: [],
542
+ scope: "global"
543
+ },
544
+ {
545
+ name: "ReorderOperationExamples",
546
+ id: "",
547
+ description: "",
548
+ schema: "",
549
+ template: "",
550
+ reducer: "",
551
+ examples: [],
552
+ errors: [],
553
+ scope: "global"
554
+ }
555
+ ],
556
+ id: "",
557
+ description: ""
558
+ },
559
+ {
560
+ name: "operation",
561
+ operations: [
562
+ {
563
+ name: "AddOperation",
564
+ id: "",
565
+ description: "",
566
+ schema: "",
567
+ template: "",
568
+ reducer: "",
569
+ examples: [],
570
+ errors: [],
571
+ scope: "global"
572
+ },
573
+ {
574
+ name: "SetOperationName",
575
+ id: "",
576
+ description: "",
577
+ schema: "",
578
+ template: "",
579
+ reducer: "",
580
+ examples: [],
581
+ errors: [],
582
+ scope: "global"
583
+ },
584
+ {
585
+ name: "SetOperationSchema",
586
+ id: "",
587
+ description: "",
588
+ schema: "",
589
+ template: "",
590
+ reducer: "",
591
+ examples: [],
592
+ errors: [],
593
+ scope: "global"
594
+ },
595
+ {
596
+ name: "SetOperationDescription",
597
+ id: "",
598
+ description: "",
599
+ schema: "",
600
+ template: "",
601
+ reducer: "",
602
+ examples: [],
603
+ errors: [],
604
+ scope: "global"
605
+ },
606
+ {
607
+ name: "SetOperationTemplate",
608
+ id: "",
609
+ description: "",
610
+ schema: "",
611
+ template: "",
612
+ reducer: "",
613
+ examples: [],
614
+ errors: [],
615
+ scope: "global"
616
+ },
617
+ {
618
+ name: "SetOperationReducer",
619
+ id: "",
620
+ description: "",
621
+ schema: "",
622
+ template: "",
623
+ reducer: "",
624
+ examples: [],
625
+ errors: [],
626
+ scope: "global"
627
+ },
628
+ {
629
+ name: "MoveOperation",
630
+ id: "",
631
+ description: "",
632
+ schema: "",
633
+ template: "",
634
+ reducer: "",
635
+ examples: [],
636
+ errors: [],
637
+ scope: "global"
638
+ },
639
+ {
640
+ name: "DeleteOperation",
641
+ id: "",
642
+ description: "",
643
+ schema: "",
644
+ template: "",
645
+ reducer: "",
646
+ examples: [],
647
+ errors: [],
648
+ scope: "global"
649
+ },
650
+ {
651
+ name: "ReorderModuleOperations",
652
+ id: "",
653
+ description: "",
654
+ schema: "",
655
+ template: "",
656
+ reducer: "",
657
+ examples: [],
658
+ errors: [],
659
+ scope: "global"
660
+ }
661
+ ],
662
+ id: "",
663
+ description: ""
664
+ },
665
+ {
666
+ name: "state",
667
+ operations: [
668
+ {
669
+ name: "SetStateSchema",
670
+ id: "",
671
+ description: "",
672
+ schema: "",
673
+ template: "",
674
+ reducer: "",
675
+ examples: [],
676
+ errors: [],
677
+ scope: "global"
678
+ },
679
+ {
680
+ name: "SetInitialState",
681
+ id: "",
682
+ description: "",
683
+ schema: "",
684
+ template: "",
685
+ reducer: "",
686
+ examples: [],
687
+ errors: [],
688
+ scope: "global"
689
+ },
690
+ {
691
+ name: "AddStateExample",
692
+ id: "",
693
+ description: "",
694
+ schema: "",
695
+ template: "",
696
+ reducer: "",
697
+ examples: [],
698
+ errors: [],
699
+ scope: "global"
700
+ },
701
+ {
702
+ name: "UpdateStateExample",
703
+ id: "",
704
+ description: "",
705
+ schema: "",
706
+ template: "",
707
+ reducer: "",
708
+ examples: [],
709
+ errors: [],
710
+ scope: "global"
711
+ },
712
+ {
713
+ name: "DeleteStateExample",
714
+ id: "",
715
+ description: "",
716
+ schema: "",
717
+ template: "",
718
+ reducer: "",
719
+ examples: [],
720
+ errors: [],
721
+ scope: "global"
722
+ },
723
+ {
724
+ name: "ReorderStateExamples",
725
+ id: "",
726
+ description: "",
727
+ schema: "",
728
+ template: "",
729
+ reducer: "",
730
+ examples: [],
731
+ errors: [],
732
+ scope: "global"
733
+ }
734
+ ],
735
+ id: "",
736
+ description: ""
737
+ }
738
+ ],
739
+ state: {
740
+ global: {
741
+ schema: "",
742
+ initialValue: '{\n "id": "",\n "name": "",\n "extension": "",\n "description": "",\n "author": {\n "name": "",\n "website": ""\n },\n "specifications": [\n {\n "version": 1,\n "changeLog": [],\n "state": {\n "schema": "",\n "initialValue": "",\n "examples": []\n },\n "modules": []\n }\n ]\n}',
743
+ examples: []
744
+ },
745
+ local: {
746
+ schema: "",
747
+ initialValue: `{}`,
748
+ examples: []
749
+ }
750
+ }
751
+ }
752
+ ]
753
+ };
754
+ const isDefinedNonNullAny = (v) => v !== void 0 && v !== null;
755
+ const definedNonNullAnySchema = zod$1.z.any().refine((v) => isDefinedNonNullAny(v));
756
+ function AddChangeLogItemInputSchema() {
757
+ return zod$1.z.object({
758
+ __typename: zod$1.z.literal("AddChangeLogItemInput").optional(),
759
+ content: zod$1.z.string(),
760
+ id: zod$1.z.string(),
761
+ insertBefore: zod$1.z.string().nullable()
762
+ });
763
+ }
764
+ function AddModuleInputSchema() {
765
+ return zod$1.z.object({
766
+ description: zod$1.z.string().nullish(),
767
+ id: zod$1.z.string(),
768
+ name: zod$1.z.string()
769
+ });
770
+ }
771
+ function AddOperationErrorInputSchema() {
772
+ return zod$1.z.object({
773
+ errorCode: zod$1.z.string().nullish(),
774
+ errorDescription: zod$1.z.string().nullish(),
775
+ errorName: zod$1.z.string().nullish(),
776
+ errorTemplate: zod$1.z.string().nullish(),
777
+ id: zod$1.z.string(),
778
+ operationId: zod$1.z.string()
779
+ });
780
+ }
781
+ function AddOperationExampleInputSchema() {
782
+ return zod$1.z.object({
783
+ example: zod$1.z.string(),
784
+ id: zod$1.z.string(),
785
+ operationId: zod$1.z.string()
786
+ });
787
+ }
788
+ function AddOperationInputSchema() {
789
+ return zod$1.z.object({
790
+ description: zod$1.z.string().nullish(),
791
+ id: zod$1.z.string(),
792
+ moduleId: zod$1.z.string(),
793
+ name: zod$1.z.string(),
794
+ reducer: zod$1.z.string().nullish(),
795
+ schema: zod$1.z.string().nullish(),
796
+ template: zod$1.z.string().nullish(),
797
+ scope: OperationScopeSchema().nullish()
798
+ });
799
+ }
800
+ function AddStateExampleInputSchema() {
801
+ return zod$1.z.object({
802
+ scope: zod$1.z.string(),
803
+ example: zod$1.z.string(),
804
+ id: zod$1.z.string(),
805
+ insertBefore: zod$1.z.string().nullish()
806
+ });
807
+ }
808
+ function AuthorSchema() {
809
+ return zod$1.z.object({
810
+ __typename: zod$1.z.literal("Author").optional(),
811
+ name: zod$1.z.string(),
812
+ website: zod$1.z.string().nullable()
813
+ });
814
+ }
815
+ function CodeExampleSchema() {
816
+ return zod$1.z.object({
817
+ __typename: zod$1.z.literal("CodeExample").optional(),
818
+ id: zod$1.z.string(),
819
+ value: zod$1.z.string()
820
+ });
821
+ }
822
+ function DeleteChangeLogItemInputSchema() {
823
+ return zod$1.z.object({
824
+ __typename: zod$1.z.literal("DeleteChangeLogItemInput").optional(),
825
+ id: zod$1.z.string()
826
+ });
827
+ }
828
+ function DeleteModuleInputSchema() {
829
+ return zod$1.z.object({
830
+ id: zod$1.z.string()
831
+ });
832
+ }
833
+ function DeleteOperationErrorInputSchema() {
834
+ return zod$1.z.object({
835
+ id: zod$1.z.string()
836
+ });
837
+ }
838
+ function DeleteOperationExampleInputSchema() {
839
+ return zod$1.z.object({
840
+ id: zod$1.z.string()
841
+ });
842
+ }
843
+ function DeleteOperationInputSchema() {
844
+ return zod$1.z.object({
845
+ id: zod$1.z.string()
846
+ });
847
+ }
848
+ function DeleteStateExampleInputSchema() {
849
+ return zod$1.z.object({
850
+ scope: zod$1.z.string(),
851
+ id: zod$1.z.string()
852
+ });
853
+ }
854
+ function OperationScopeSchema() {
855
+ return zod$1.z.literal("global").or(zod$1.z.literal("local"));
856
+ }
857
+ function DocumentModelInputSchema() {
858
+ return zod$1.z.union([
859
+ AddChangeLogItemInputSchema(),
860
+ AddModuleInputSchema(),
861
+ AddOperationErrorInputSchema(),
862
+ AddOperationExampleInputSchema(),
863
+ AddOperationInputSchema(),
864
+ AddStateExampleInputSchema(),
865
+ DeleteChangeLogItemInputSchema(),
866
+ DeleteModuleInputSchema(),
867
+ DeleteOperationErrorInputSchema(),
868
+ DeleteOperationExampleInputSchema(),
869
+ DeleteOperationInputSchema(),
870
+ DeleteStateExampleInputSchema(),
871
+ MoveOperationInputSchema(),
872
+ ReorderChangeLogItemsInputSchema(),
873
+ ReorderModuleOperationsInputSchema(),
874
+ ReorderModulesInputSchema(),
875
+ ReorderOperationErrorsInputSchema(),
876
+ ReorderOperationExamplesInputSchema(),
877
+ ReorderStateExamplesInputSchema(),
878
+ SetAuthorNameInputSchema(),
879
+ SetAuthorWebsiteInputSchema(),
880
+ SetInitialStateInputSchema(),
881
+ SetModelDescriptionInputSchema(),
882
+ SetModelExtensionInputSchema(),
883
+ SetModelIdInputSchema(),
884
+ SetModelNameInputSchema(),
885
+ SetModuleDescriptionInputSchema(),
886
+ SetModuleNameInputSchema(),
887
+ SetOperationDescriptionInputSchema(),
888
+ SetOperationErrorCodeInputSchema(),
889
+ SetOperationErrorDescriptionInputSchema(),
890
+ SetOperationErrorNameInputSchema(),
891
+ SetOperationErrorTemplateInputSchema(),
892
+ SetOperationNameInputSchema(),
893
+ SetOperationReducerInputSchema(),
894
+ SetOperationSchemaInputSchema(),
895
+ SetOperationTemplateInputSchema(),
896
+ SetStateSchemaInputSchema(),
897
+ UpdateChangeLogItemInputSchema(),
898
+ UpdateOperationExampleInputSchema(),
899
+ UpdateStateExampleInputSchema()
900
+ ]);
901
+ }
902
+ function DocumentModelStateSchema() {
903
+ return zod$1.z.object({
904
+ __typename: zod$1.z.literal("DocumentModelState").optional(),
905
+ author: AuthorSchema(),
906
+ description: zod$1.z.string(),
907
+ extension: zod$1.z.string(),
908
+ id: zod$1.z.string(),
909
+ name: zod$1.z.string(),
910
+ specifications: zod$1.z.array(DocumentSpecificationSchema())
911
+ });
912
+ }
913
+ function DocumentSpecificationSchema() {
914
+ return zod$1.z.object({
915
+ __typename: zod$1.z.literal("DocumentSpecification").optional(),
916
+ changeLog: zod$1.z.array(zod$1.z.string()),
917
+ modules: zod$1.z.array(ModuleSchema()),
918
+ state: ScopeStateSchema(),
919
+ version: zod$1.z.number()
920
+ });
921
+ }
922
+ function ModuleSchema() {
923
+ return zod$1.z.object({
924
+ __typename: zod$1.z.literal("Module").optional(),
925
+ description: zod$1.z.string().nullable(),
926
+ id: zod$1.z.string(),
927
+ name: zod$1.z.string(),
928
+ operations: zod$1.z.array(OperationSchema())
929
+ });
930
+ }
931
+ function MoveOperationInputSchema() {
932
+ return zod$1.z.object({
933
+ newModuleId: zod$1.z.string(),
934
+ operationId: zod$1.z.string()
935
+ });
936
+ }
937
+ function OperationSchema() {
938
+ return zod$1.z.object({
939
+ __typename: zod$1.z.literal("Operation").optional(),
940
+ description: zod$1.z.string().nullable(),
941
+ errors: zod$1.z.array(OperationErrorSchema()),
942
+ examples: zod$1.z.array(CodeExampleSchema()),
943
+ id: zod$1.z.string(),
944
+ name: zod$1.z.string().nullable(),
945
+ reducer: zod$1.z.string().nullable(),
946
+ schema: zod$1.z.string().nullable(),
947
+ template: zod$1.z.string().nullable(),
948
+ scope: OperationScopeSchema()
949
+ });
950
+ }
951
+ function OperationErrorSchema() {
952
+ return zod$1.z.object({
953
+ __typename: zod$1.z.literal("OperationError").optional(),
954
+ code: zod$1.z.string().nullable(),
955
+ description: zod$1.z.string().nullable(),
956
+ id: zod$1.z.string(),
957
+ name: zod$1.z.string().nullable(),
958
+ template: zod$1.z.string().nullable()
959
+ });
960
+ }
961
+ function ReorderChangeLogItemsInputSchema() {
962
+ return zod$1.z.object({
963
+ __typename: zod$1.z.literal("ReorderChangeLogItemsInput").optional(),
964
+ order: zod$1.z.array(zod$1.z.string())
965
+ });
966
+ }
967
+ function ReorderModuleOperationsInputSchema() {
968
+ return zod$1.z.object({
969
+ moduleId: zod$1.z.string(),
970
+ order: zod$1.z.array(zod$1.z.string())
971
+ });
972
+ }
973
+ function ReorderModulesInputSchema() {
974
+ return zod$1.z.object({
975
+ order: zod$1.z.array(zod$1.z.string())
976
+ });
977
+ }
978
+ function ReorderOperationErrorsInputSchema() {
979
+ return zod$1.z.object({
980
+ operationId: zod$1.z.string(),
981
+ order: zod$1.z.array(zod$1.z.string())
982
+ });
983
+ }
984
+ function ReorderOperationExamplesInputSchema() {
985
+ return zod$1.z.object({
986
+ operationId: zod$1.z.string(),
987
+ order: zod$1.z.array(zod$1.z.string())
988
+ });
989
+ }
990
+ function ReorderStateExamplesInputSchema() {
991
+ return zod$1.z.object({
992
+ scope: zod$1.z.string(),
993
+ order: zod$1.z.array(zod$1.z.string())
994
+ });
995
+ }
996
+ function SetAuthorNameInputSchema() {
997
+ return zod$1.z.object({
998
+ authorName: zod$1.z.string()
999
+ });
1000
+ }
1001
+ function SetAuthorWebsiteInputSchema() {
1002
+ return zod$1.z.object({
1003
+ authorWebsite: zod$1.z.string()
1004
+ });
1005
+ }
1006
+ function SetInitialStateInputSchema() {
1007
+ return zod$1.z.object({
1008
+ scope: zod$1.z.string(),
1009
+ initialValue: zod$1.z.string()
1010
+ });
1011
+ }
1012
+ function SetModelDescriptionInputSchema() {
1013
+ return zod$1.z.object({
1014
+ description: zod$1.z.string()
1015
+ });
1016
+ }
1017
+ function SetModelExtensionInputSchema() {
1018
+ return zod$1.z.object({
1019
+ extension: zod$1.z.string()
1020
+ });
1021
+ }
1022
+ function SetModelIdInputSchema() {
1023
+ return zod$1.z.object({
1024
+ id: zod$1.z.string()
1025
+ });
1026
+ }
1027
+ function SetModelNameInputSchema() {
1028
+ return zod$1.z.object({
1029
+ name: zod$1.z.string()
1030
+ });
1031
+ }
1032
+ function SetModuleDescriptionInputSchema() {
1033
+ return zod$1.z.object({
1034
+ description: zod$1.z.string().nullish(),
1035
+ id: zod$1.z.string()
1036
+ });
1037
+ }
1038
+ function SetModuleNameInputSchema() {
1039
+ return zod$1.z.object({
1040
+ id: zod$1.z.string(),
1041
+ name: zod$1.z.string().nullish()
1042
+ });
1043
+ }
1044
+ function SetOperationDescriptionInputSchema() {
1045
+ return zod$1.z.object({
1046
+ description: zod$1.z.string().nullish(),
1047
+ id: zod$1.z.string()
1048
+ });
1049
+ }
1050
+ function SetOperationErrorCodeInputSchema() {
1051
+ return zod$1.z.object({
1052
+ errorCode: zod$1.z.string().nullish(),
1053
+ id: zod$1.z.string()
1054
+ });
1055
+ }
1056
+ function SetOperationErrorDescriptionInputSchema() {
1057
+ return zod$1.z.object({
1058
+ errorDescription: zod$1.z.string().nullish(),
1059
+ id: zod$1.z.string()
1060
+ });
1061
+ }
1062
+ function SetOperationErrorNameInputSchema() {
1063
+ return zod$1.z.object({
1064
+ errorName: zod$1.z.string().nullish(),
1065
+ id: zod$1.z.string()
1066
+ });
1067
+ }
1068
+ function SetOperationErrorTemplateInputSchema() {
1069
+ return zod$1.z.object({
1070
+ errorTemplate: zod$1.z.string().nullish(),
1071
+ id: zod$1.z.string()
1072
+ });
1073
+ }
1074
+ function SetOperationNameInputSchema() {
1075
+ return zod$1.z.object({
1076
+ id: zod$1.z.string(),
1077
+ name: zod$1.z.string().nullish()
1078
+ });
1079
+ }
1080
+ function SetOperationScopeInputSchema() {
1081
+ return zod$1.z.object({
1082
+ id: zod$1.z.string(),
1083
+ scope: OperationScopeSchema()
1084
+ });
1085
+ }
1086
+ function SetOperationReducerInputSchema() {
1087
+ return zod$1.z.object({
1088
+ id: zod$1.z.string(),
1089
+ reducer: zod$1.z.string().nullish()
1090
+ });
1091
+ }
1092
+ function SetOperationSchemaInputSchema() {
1093
+ return zod$1.z.object({
1094
+ id: zod$1.z.string(),
1095
+ schema: zod$1.z.string().nullish()
1096
+ });
1097
+ }
1098
+ function SetOperationTemplateInputSchema() {
1099
+ return zod$1.z.object({
1100
+ id: zod$1.z.string(),
1101
+ template: zod$1.z.string().nullish()
1102
+ });
1103
+ }
1104
+ function SetStateSchemaInputSchema() {
1105
+ return zod$1.z.object({
1106
+ scope: zod$1.z.string(),
1107
+ schema: zod$1.z.string()
1108
+ });
1109
+ }
1110
+ function StateSchema() {
1111
+ return zod$1.z.object({
1112
+ __typename: zod$1.z.literal("State").optional(),
1113
+ examples: zod$1.z.array(CodeExampleSchema()),
1114
+ initialValue: zod$1.z.string(),
1115
+ schema: zod$1.z.string()
1116
+ });
1117
+ }
1118
+ function ScopeStateSchema() {
1119
+ return zod$1.z.object({
1120
+ global: StateSchema(),
1121
+ local: StateSchema()
1122
+ });
1123
+ }
1124
+ function UpdateChangeLogItemInputSchema() {
1125
+ return zod$1.z.object({
1126
+ __typename: zod$1.z.literal("UpdateChangeLogItemInput").optional(),
1127
+ id: zod$1.z.string(),
1128
+ newContent: zod$1.z.string()
1129
+ });
1130
+ }
1131
+ function UpdateOperationExampleInputSchema() {
1132
+ return zod$1.z.object({
1133
+ example: zod$1.z.string(),
1134
+ id: zod$1.z.string()
1135
+ });
1136
+ }
1137
+ function UpdateStateExampleInputSchema() {
1138
+ return zod$1.z.object({
1139
+ scope: zod$1.z.string(),
1140
+ id: zod$1.z.string(),
1141
+ newExample: zod$1.z.string()
1142
+ });
1143
+ }
1144
+ const zod = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1145
+ __proto__: null,
1146
+ AddChangeLogItemInputSchema,
1147
+ AddModuleInputSchema,
1148
+ AddOperationErrorInputSchema,
1149
+ AddOperationExampleInputSchema,
1150
+ AddOperationInputSchema,
1151
+ AddStateExampleInputSchema,
1152
+ AuthorSchema,
1153
+ CodeExampleSchema,
1154
+ DeleteChangeLogItemInputSchema,
1155
+ DeleteModuleInputSchema,
1156
+ DeleteOperationErrorInputSchema,
1157
+ DeleteOperationExampleInputSchema,
1158
+ DeleteOperationInputSchema,
1159
+ DeleteStateExampleInputSchema,
1160
+ DocumentModelInputSchema,
1161
+ DocumentModelStateSchema,
1162
+ DocumentSpecificationSchema,
1163
+ ModuleSchema,
1164
+ MoveOperationInputSchema,
1165
+ OperationErrorSchema,
1166
+ OperationSchema,
1167
+ OperationScopeSchema,
1168
+ ReorderChangeLogItemsInputSchema,
1169
+ ReorderModuleOperationsInputSchema,
1170
+ ReorderModulesInputSchema,
1171
+ ReorderOperationErrorsInputSchema,
1172
+ ReorderOperationExamplesInputSchema,
1173
+ ReorderStateExamplesInputSchema,
1174
+ ScopeStateSchema,
1175
+ SetAuthorNameInputSchema,
1176
+ SetAuthorWebsiteInputSchema,
1177
+ SetInitialStateInputSchema,
1178
+ SetModelDescriptionInputSchema,
1179
+ SetModelExtensionInputSchema,
1180
+ SetModelIdInputSchema,
1181
+ SetModelNameInputSchema,
1182
+ SetModuleDescriptionInputSchema,
1183
+ SetModuleNameInputSchema,
1184
+ SetOperationDescriptionInputSchema,
1185
+ SetOperationErrorCodeInputSchema,
1186
+ SetOperationErrorDescriptionInputSchema,
1187
+ SetOperationErrorNameInputSchema,
1188
+ SetOperationErrorTemplateInputSchema,
1189
+ SetOperationNameInputSchema,
1190
+ SetOperationReducerInputSchema,
1191
+ SetOperationSchemaInputSchema,
1192
+ SetOperationScopeInputSchema,
1193
+ SetOperationTemplateInputSchema,
1194
+ SetStateSchemaInputSchema,
1195
+ StateSchema,
1196
+ UpdateChangeLogItemInputSchema,
1197
+ UpdateOperationExampleInputSchema,
1198
+ UpdateStateExampleInputSchema,
1199
+ definedNonNullAnySchema,
1200
+ isDefinedNonNullAny
1201
+ }, Symbol.toStringTag, { value: "Module" }));
1202
+ const reducer$7 = {
1203
+ setModelNameOperation(state, action) {
1204
+ state.name = action.input.name;
1205
+ },
1206
+ setModelIdOperation(state, action) {
1207
+ state.id = action.input.id;
1208
+ },
1209
+ setModelExtensionOperation(state, action) {
1210
+ state.extension = action.input.extension;
1211
+ },
1212
+ setModelDescriptionOperation(state, action) {
1213
+ state.description = action.input.description;
1214
+ },
1215
+ setAuthorNameOperation(state, action) {
1216
+ state.author = state.author || { name: "", website: null };
1217
+ state.author.name = action.input.authorName;
1218
+ },
1219
+ setAuthorWebsiteOperation(state, action) {
1220
+ state.author = state.author || { name: "", website: null };
1221
+ state.author.website = action.input.authorWebsite;
1222
+ }
1223
+ };
1224
+ const reducer$6 = {
1225
+ addChangeLogItemOperation(state, action) {
1226
+ throw new Error(
1227
+ 'Reducer "addChangeLogItemOperation" not yet implemented'
1228
+ );
1229
+ },
1230
+ updateChangeLogItemOperation(state, action) {
1231
+ throw new Error(
1232
+ 'Reducer "updateChangeLogItemOperation" not yet implemented'
1233
+ );
1234
+ },
1235
+ deleteChangeLogItemOperation(state, action) {
1236
+ throw new Error(
1237
+ 'Reducer "deleteChangeLogItemOperation" not yet implemented'
1238
+ );
1239
+ },
1240
+ reorderChangeLogItemsOperation(state, action) {
1241
+ throw new Error(
1242
+ 'Reducer "reorderChangeLogItemsOperation" not yet implemented'
1243
+ );
1244
+ },
1245
+ releaseNewVersionOperation(state, action) {
1246
+ throw new Error(
1247
+ 'Reducer "releaseNewVersionOperation" not yet implemented'
1248
+ );
1249
+ }
1250
+ };
1251
+ const moduleSorter = (order) => {
1252
+ const mapping = {};
1253
+ order.forEach((key, index) => mapping[key] = index);
1254
+ return (a, b) => (mapping[b.id] || 999999) - (mapping[a.id] || 999999);
1255
+ };
1256
+ const reducer$5 = {
1257
+ addModuleOperation(state, action) {
1258
+ const latestSpec = state.specifications[state.specifications.length - 1];
1259
+ latestSpec.modules.push({
1260
+ id: action.input.id,
1261
+ name: action.input.name,
1262
+ description: action.input.description || "",
1263
+ operations: []
1264
+ });
1265
+ },
1266
+ setModuleNameOperation(state, action) {
1267
+ const latestSpec = state.specifications[state.specifications.length - 1];
1268
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1269
+ if (latestSpec.modules[i].id === action.input.id) {
1270
+ latestSpec.modules[i].name = action.input.name || "";
1271
+ }
1272
+ }
1273
+ },
1274
+ setModuleDescriptionOperation(state, action) {
1275
+ const latestSpec = state.specifications[state.specifications.length - 1];
1276
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1277
+ if (latestSpec.modules[i].id === action.input.id) {
1278
+ latestSpec.modules[i].description = action.input.description || "";
1279
+ }
1280
+ }
1281
+ },
1282
+ deleteModuleOperation(state, action) {
1283
+ const latestSpec = state.specifications[state.specifications.length - 1];
1284
+ latestSpec.modules = latestSpec.modules.filter(
1285
+ (m) => m.id != action.input.id
1286
+ );
1287
+ },
1288
+ reorderModulesOperation(state, action) {
1289
+ const latestSpec = state.specifications[state.specifications.length - 1];
1290
+ latestSpec.modules.sort(moduleSorter(action.input.order));
1291
+ }
1292
+ };
1293
+ const errorSorter = (order) => {
1294
+ const mapping = {};
1295
+ order.forEach((key, index) => mapping[key] = index);
1296
+ return (a, b) => (mapping[b.id] || 999999) - (mapping[a.id] || 999999);
1297
+ };
1298
+ const reducer$4 = {
1299
+ addOperationErrorOperation(state, action) {
1300
+ const latestSpec = state.specifications[state.specifications.length - 1];
1301
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1302
+ for (let j = 0; j < latestSpec.modules[i].operations.length; j++) {
1303
+ if (latestSpec.modules[i].operations[j].id == action.input.operationId) {
1304
+ latestSpec.modules[i].operations[j].errors.push({
1305
+ id: action.input.id,
1306
+ name: action.input.errorName || "",
1307
+ code: action.input.errorCode || "",
1308
+ description: action.input.errorDescription || "",
1309
+ template: action.input.errorTemplate || ""
1310
+ });
1311
+ }
1312
+ }
1313
+ }
1314
+ },
1315
+ setOperationErrorCodeOperation(state, action) {
1316
+ const latestSpec = state.specifications[state.specifications.length - 1];
1317
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1318
+ for (let j = 0; j < latestSpec.modules[i].operations.length; j++) {
1319
+ for (let k = 0; k < latestSpec.modules[i].operations[j].errors.length; k++) {
1320
+ if (latestSpec.modules[i].operations[j].errors[k].id == action.input.id) {
1321
+ latestSpec.modules[i].operations[j].errors[k].code = action.input.errorCode || "";
1322
+ }
1323
+ }
1324
+ }
1325
+ }
1326
+ },
1327
+ setOperationErrorNameOperation(state, action) {
1328
+ const latestSpec = state.specifications[state.specifications.length - 1];
1329
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1330
+ for (let j = 0; j < latestSpec.modules[i].operations.length; j++) {
1331
+ for (let k = 0; k < latestSpec.modules[i].operations[j].errors.length; k++) {
1332
+ if (latestSpec.modules[i].operations[j].errors[k].id == action.input.id) {
1333
+ latestSpec.modules[i].operations[j].errors[k].name = action.input.errorName || "";
1334
+ }
1335
+ }
1336
+ }
1337
+ }
1338
+ },
1339
+ setOperationErrorDescriptionOperation(state, action) {
1340
+ const latestSpec = state.specifications[state.specifications.length - 1];
1341
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1342
+ for (let j = 0; j < latestSpec.modules[i].operations.length; j++) {
1343
+ for (let k = 0; k < latestSpec.modules[i].operations[j].errors.length; k++) {
1344
+ if (latestSpec.modules[i].operations[j].errors[k].id == action.input.id) {
1345
+ latestSpec.modules[i].operations[j].errors[k].description = action.input.errorDescription || "";
1346
+ }
1347
+ }
1348
+ }
1349
+ }
1350
+ },
1351
+ setOperationErrorTemplateOperation(state, action) {
1352
+ const latestSpec = state.specifications[state.specifications.length - 1];
1353
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1354
+ for (let j = 0; j < latestSpec.modules[i].operations.length; j++) {
1355
+ for (let k = 0; k < latestSpec.modules[i].operations[j].errors.length; k++) {
1356
+ if (latestSpec.modules[i].operations[j].errors[k].id == action.input.id) {
1357
+ latestSpec.modules[i].operations[j].errors[k].template = action.input.errorTemplate || "";
1358
+ }
1359
+ }
1360
+ }
1361
+ }
1362
+ },
1363
+ deleteOperationErrorOperation(state, action) {
1364
+ const latestSpec = state.specifications[state.specifications.length - 1];
1365
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1366
+ for (let j = 0; j < latestSpec.modules[i].operations.length; j++) {
1367
+ latestSpec.modules[i].operations[j].errors = latestSpec.modules[i].operations[j].errors.filter((e) => e.id != action.input.id);
1368
+ }
1369
+ }
1370
+ },
1371
+ reorderOperationErrorsOperation(state, action) {
1372
+ const latestSpec = state.specifications[state.specifications.length - 1];
1373
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1374
+ for (let j = 0; j < latestSpec.modules[i].operations.length; j++) {
1375
+ if (latestSpec.modules[i].operations[j].id == action.input.operationId) {
1376
+ latestSpec.modules[i].operations[j].errors.sort(
1377
+ errorSorter(action.input.order)
1378
+ );
1379
+ }
1380
+ }
1381
+ }
1382
+ }
1383
+ };
1384
+ const exampleSorter$1 = (order) => {
1385
+ const mapping = {};
1386
+ order.forEach((key, index) => mapping[key] = index);
1387
+ return (a, b) => (mapping[b.id] || 999999) - (mapping[a.id] || 999999);
1388
+ };
1389
+ const reducer$3 = {
1390
+ addOperationExampleOperation(state, action) {
1391
+ const latestSpec = state.specifications[state.specifications.length - 1];
1392
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1393
+ for (let j = 0; j < latestSpec.modules[i].operations.length; j++) {
1394
+ if (latestSpec.modules[i].operations[j].id == action.input.operationId) {
1395
+ latestSpec.modules[i].operations[j].examples.push({
1396
+ id: action.input.id,
1397
+ value: action.input.example
1398
+ });
1399
+ }
1400
+ }
1401
+ }
1402
+ },
1403
+ updateOperationExampleOperation(state, action) {
1404
+ const latestSpec = state.specifications[state.specifications.length - 1];
1405
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1406
+ for (let j = 0; j < latestSpec.modules[i].operations.length; j++) {
1407
+ for (let k = 0; k < latestSpec.modules[i].operations[j].examples.length; k++) {
1408
+ if (latestSpec.modules[i].operations[j].examples[k].id == action.input.id) {
1409
+ latestSpec.modules[i].operations[j].examples[k].value = action.input.example;
1410
+ }
1411
+ }
1412
+ }
1413
+ }
1414
+ },
1415
+ deleteOperationExampleOperation(state, action) {
1416
+ const latestSpec = state.specifications[state.specifications.length - 1];
1417
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1418
+ for (let j = 0; j < latestSpec.modules[i].operations.length; j++) {
1419
+ latestSpec.modules[i].operations[j].examples = latestSpec.modules[i].operations[j].examples.filter(
1420
+ (e) => e.id != action.input.id
1421
+ );
1422
+ }
1423
+ }
1424
+ },
1425
+ reorderOperationExamplesOperation(state, action) {
1426
+ const latestSpec = state.specifications[state.specifications.length - 1];
1427
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1428
+ for (let j = 0; j < latestSpec.modules[i].operations.length; j++) {
1429
+ if (latestSpec.modules[i].operations[j].id == action.input.operationId) {
1430
+ latestSpec.modules[i].operations[j].examples.sort(
1431
+ exampleSorter$1(action.input.order)
1432
+ );
1433
+ }
1434
+ }
1435
+ }
1436
+ }
1437
+ };
1438
+ const operationSorter = (order) => {
1439
+ const mapping = {};
1440
+ order.forEach((key, index) => mapping[key] = index);
1441
+ return (a, b) => (mapping[b.id] || 999999) - (mapping[a.id] || 999999);
1442
+ };
1443
+ const reducer$2 = {
1444
+ addOperationOperation(state, action) {
1445
+ const latestSpec = state.specifications[state.specifications.length - 1];
1446
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1447
+ if (latestSpec.modules[i].id == action.input.moduleId) {
1448
+ latestSpec.modules[i].operations.push({
1449
+ id: action.input.id,
1450
+ name: action.input.name,
1451
+ description: action.input.description || "",
1452
+ schema: action.input.schema || "",
1453
+ template: action.input.template || action.input.description || "",
1454
+ reducer: action.input.reducer || "",
1455
+ errors: [],
1456
+ examples: [],
1457
+ scope: action.input.scope || "global"
1458
+ });
1459
+ }
1460
+ }
1461
+ },
1462
+ setOperationNameOperation(state, action) {
1463
+ const latestSpec = state.specifications[state.specifications.length - 1];
1464
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1465
+ for (let j = 0; j < latestSpec.modules[i].operations.length; j++) {
1466
+ if (latestSpec.modules[i].operations[j].id == action.input.id) {
1467
+ latestSpec.modules[i].operations[j].name = action.input.name || "";
1468
+ }
1469
+ }
1470
+ }
1471
+ },
1472
+ setOperationScopeOperation(state, action) {
1473
+ const latestSpec = state.specifications[state.specifications.length - 1];
1474
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1475
+ for (let j = 0; j < latestSpec.modules[i].operations.length; j++) {
1476
+ if (latestSpec.modules[i].operations[j].id == action.input.id) {
1477
+ latestSpec.modules[i].operations[j].scope = action.input.scope || "global";
1478
+ }
1479
+ }
1480
+ }
1481
+ },
1482
+ setOperationSchemaOperation(state, action) {
1483
+ const latestSpec = state.specifications[state.specifications.length - 1];
1484
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1485
+ for (let j = 0; j < latestSpec.modules[i].operations.length; j++) {
1486
+ if (latestSpec.modules[i].operations[j].id == action.input.id) {
1487
+ latestSpec.modules[i].operations[j].schema = action.input.schema || "";
1488
+ }
1489
+ }
1490
+ }
1491
+ },
1492
+ setOperationDescriptionOperation(state, action) {
1493
+ const latestSpec = state.specifications[state.specifications.length - 1];
1494
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1495
+ for (let j = 0; j < latestSpec.modules[i].operations.length; j++) {
1496
+ if (latestSpec.modules[i].operations[j].id == action.input.id) {
1497
+ latestSpec.modules[i].operations[j].description = action.input.description || "";
1498
+ }
1499
+ }
1500
+ }
1501
+ },
1502
+ setOperationTemplateOperation(state, action) {
1503
+ const latestSpec = state.specifications[state.specifications.length - 1];
1504
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1505
+ for (let j = 0; j < latestSpec.modules[i].operations.length; j++) {
1506
+ if (latestSpec.modules[i].operations[j].id == action.input.id) {
1507
+ latestSpec.modules[i].operations[j].template = action.input.template || "";
1508
+ }
1509
+ }
1510
+ }
1511
+ },
1512
+ setOperationReducerOperation(state, action) {
1513
+ const latestSpec = state.specifications[state.specifications.length - 1];
1514
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1515
+ for (let j = 0; j < latestSpec.modules[i].operations.length; j++) {
1516
+ if (latestSpec.modules[i].operations[j].id == action.input.id) {
1517
+ latestSpec.modules[i].operations[j].reducer = action.input.reducer || "";
1518
+ }
1519
+ }
1520
+ }
1521
+ },
1522
+ moveOperationOperation(state, action) {
1523
+ const moveOperations = [];
1524
+ const latestSpec = state.specifications[state.specifications.length - 1];
1525
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1526
+ latestSpec.modules[i].operations = latestSpec.modules[i].operations.filter((operation) => {
1527
+ if (operation.id == action.input.operationId) {
1528
+ moveOperations.push(operation);
1529
+ return false;
1530
+ }
1531
+ return true;
1532
+ });
1533
+ }
1534
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1535
+ if (latestSpec.modules[i].id == action.input.newModuleId) {
1536
+ latestSpec.modules[i].operations.push(...moveOperations);
1537
+ }
1538
+ }
1539
+ },
1540
+ deleteOperationOperation(state, action) {
1541
+ const latestSpec = state.specifications[state.specifications.length - 1];
1542
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1543
+ latestSpec.modules[i].operations = latestSpec.modules[i].operations.filter((operation) => operation.id != action.input.id);
1544
+ }
1545
+ },
1546
+ reorderModuleOperationsOperation(state, action) {
1547
+ const latestSpec = state.specifications[state.specifications.length - 1];
1548
+ for (let i = 0; i < latestSpec.modules.length; i++) {
1549
+ if (latestSpec.modules[i].id == action.input.moduleId) {
1550
+ latestSpec.modules[i].operations.sort(
1551
+ operationSorter(action.input.order)
1552
+ );
1553
+ }
1554
+ }
1555
+ }
1556
+ };
1557
+ const exampleSorter = (order) => {
1558
+ const mapping = {};
1559
+ order.forEach((key, index) => mapping[key] = index);
1560
+ return (a, b) => (mapping[b.id] || 999999) - (mapping[a.id] || 999999);
1561
+ };
1562
+ const reducer$1 = {
1563
+ setStateSchemaOperation(state, action) {
1564
+ const latestSpec = state.specifications[state.specifications.length - 1];
1565
+ if (Object.keys(latestSpec.state).includes(action.input.scope)) {
1566
+ latestSpec.state[action.input.scope].schema = action.input.schema;
1567
+ } else {
1568
+ throw new Error(`Invalid scope: ${action.input.scope}`);
1569
+ }
1570
+ },
1571
+ setInitialStateOperation(state, action) {
1572
+ const latestSpec = state.specifications[state.specifications.length - 1];
1573
+ if (Object.keys(latestSpec.state).includes(action.input.scope)) {
1574
+ latestSpec.state[action.input.scope].initialValue = action.input.initialValue;
1575
+ } else {
1576
+ throw new Error(`Invalid scope: ${action.input.scope}`);
1577
+ }
1578
+ },
1579
+ addStateExampleOperation(state, action) {
1580
+ const latestSpec = state.specifications[state.specifications.length - 1];
1581
+ if (Object.keys(latestSpec.state).includes(action.input.scope)) {
1582
+ latestSpec.state[action.input.scope].examples.push({
1583
+ id: action.input.id,
1584
+ value: action.input.example
1585
+ });
1586
+ } else {
1587
+ throw new Error(`Invalid scope: ${action.input.scope}`);
1588
+ }
1589
+ },
1590
+ updateStateExampleOperation(state, action) {
1591
+ const latestSpec = state.specifications[state.specifications.length - 1];
1592
+ if (!Object.keys(latestSpec.state).includes(action.input.scope)) {
1593
+ throw new Error(`Invalid scope: ${action.input.scope}`);
1594
+ }
1595
+ const examples = latestSpec.state[action.input.scope].examples;
1596
+ for (let i = 0; i < examples.length; i++) {
1597
+ if (examples[i].id == action.input.id) {
1598
+ examples[i].value = action.input.newExample;
1599
+ }
1600
+ }
1601
+ },
1602
+ deleteStateExampleOperation(state, action) {
1603
+ const latestSpec = state.specifications[state.specifications.length - 1];
1604
+ if (Object.keys(latestSpec.state).includes(action.input.scope)) {
1605
+ latestSpec.state[action.input.scope].examples = latestSpec.state[action.input.scope].examples.filter((e) => e.id != action.input.id);
1606
+ } else {
1607
+ throw new Error(`Invalid scope: ${action.input.scope}`);
1608
+ }
1609
+ },
1610
+ reorderStateExamplesOperation(state, action) {
1611
+ const latestSpec = state.specifications[state.specifications.length - 1];
1612
+ if (Object.keys(latestSpec.state).includes(action.input.scope)) {
1613
+ latestSpec.state[action.input.scope].examples.sort(exampleSorter(action.input.order));
1614
+ } else {
1615
+ throw new Error(`Invalid scope: ${action.input.scope}`);
1616
+ }
1617
+ }
1618
+ };
1619
+ const stateReducer = (state, action) => {
1620
+ if (object.isBaseAction(action)) {
1621
+ return state;
1622
+ }
1623
+ switch (action.type) {
1624
+ case "SET_MODEL_NAME":
1625
+ SetModelNameInputSchema().parse(action.input);
1626
+ reducer$7.setModelNameOperation(state.global, action);
1627
+ break;
1628
+ case "SET_MODEL_ID":
1629
+ SetModelIdInputSchema().parse(action.input);
1630
+ reducer$7.setModelIdOperation(state.global, action);
1631
+ break;
1632
+ case "SET_MODEL_EXTENSION":
1633
+ SetModelExtensionInputSchema().parse(action.input);
1634
+ reducer$7.setModelExtensionOperation(state.global, action);
1635
+ break;
1636
+ case "SET_MODEL_DESCRIPTION":
1637
+ SetModelDescriptionInputSchema().parse(action.input);
1638
+ reducer$7.setModelDescriptionOperation(state.global, action);
1639
+ break;
1640
+ case "SET_AUTHOR_NAME":
1641
+ SetAuthorNameInputSchema().parse(action.input);
1642
+ reducer$7.setAuthorNameOperation(state.global, action);
1643
+ break;
1644
+ case "SET_AUTHOR_WEBSITE":
1645
+ SetAuthorWebsiteInputSchema().parse(action.input);
1646
+ reducer$7.setAuthorWebsiteOperation(state.global, action);
1647
+ break;
1648
+ case "ADD_CHANGE_LOG_ITEM":
1649
+ AddChangeLogItemInputSchema().parse(action.input);
1650
+ reducer$6.addChangeLogItemOperation(state.global, action);
1651
+ break;
1652
+ case "UPDATE_CHANGE_LOG_ITEM":
1653
+ UpdateChangeLogItemInputSchema().parse(action.input);
1654
+ reducer$6.updateChangeLogItemOperation(
1655
+ state.global,
1656
+ action
1657
+ );
1658
+ break;
1659
+ case "DELETE_CHANGE_LOG_ITEM":
1660
+ DeleteChangeLogItemInputSchema().parse(action.input);
1661
+ reducer$6.deleteChangeLogItemOperation(
1662
+ state.global,
1663
+ action
1664
+ );
1665
+ break;
1666
+ case "REORDER_CHANGE_LOG_ITEMS":
1667
+ ReorderChangeLogItemsInputSchema().parse(action.input);
1668
+ reducer$6.reorderChangeLogItemsOperation(
1669
+ state.global,
1670
+ action
1671
+ );
1672
+ break;
1673
+ case "RELEASE_NEW_VERSION":
1674
+ if (Object.keys(action.input).length > 0)
1675
+ throw new Error(
1676
+ "Expected empty input for action RELEASE_NEW_VERSION"
1677
+ );
1678
+ reducer$6.releaseNewVersionOperation(state.global, action);
1679
+ break;
1680
+ case "ADD_MODULE":
1681
+ AddModuleInputSchema().parse(action.input);
1682
+ reducer$5.addModuleOperation(state.global, action);
1683
+ break;
1684
+ case "SET_MODULE_NAME":
1685
+ SetModuleNameInputSchema().parse(action.input);
1686
+ reducer$5.setModuleNameOperation(state.global, action);
1687
+ break;
1688
+ case "SET_MODULE_DESCRIPTION":
1689
+ SetModuleDescriptionInputSchema().parse(action.input);
1690
+ reducer$5.setModuleDescriptionOperation(state.global, action);
1691
+ break;
1692
+ case "DELETE_MODULE":
1693
+ DeleteModuleInputSchema().parse(action.input);
1694
+ reducer$5.deleteModuleOperation(state.global, action);
1695
+ break;
1696
+ case "REORDER_MODULES":
1697
+ ReorderModulesInputSchema().parse(action.input);
1698
+ reducer$5.reorderModulesOperation(state.global, action);
1699
+ break;
1700
+ case "ADD_OPERATION_ERROR":
1701
+ AddOperationErrorInputSchema().parse(action.input);
1702
+ reducer$4.addOperationErrorOperation(
1703
+ state.global,
1704
+ action
1705
+ );
1706
+ break;
1707
+ case "SET_OPERATION_ERROR_CODE":
1708
+ SetOperationErrorCodeInputSchema().parse(action.input);
1709
+ reducer$4.setOperationErrorCodeOperation(
1710
+ state.global,
1711
+ action
1712
+ );
1713
+ break;
1714
+ case "SET_OPERATION_ERROR_NAME":
1715
+ SetOperationErrorNameInputSchema().parse(action.input);
1716
+ reducer$4.setOperationErrorNameOperation(
1717
+ state.global,
1718
+ action
1719
+ );
1720
+ break;
1721
+ case "SET_OPERATION_ERROR_DESCRIPTION":
1722
+ SetOperationErrorDescriptionInputSchema().parse(action.input);
1723
+ reducer$4.setOperationErrorDescriptionOperation(
1724
+ state.global,
1725
+ action
1726
+ );
1727
+ break;
1728
+ case "SET_OPERATION_ERROR_TEMPLATE":
1729
+ SetOperationErrorTemplateInputSchema().parse(action.input);
1730
+ reducer$4.setOperationErrorTemplateOperation(
1731
+ state.global,
1732
+ action
1733
+ );
1734
+ break;
1735
+ case "DELETE_OPERATION_ERROR":
1736
+ DeleteOperationErrorInputSchema().parse(action.input);
1737
+ reducer$4.deleteOperationErrorOperation(
1738
+ state.global,
1739
+ action
1740
+ );
1741
+ break;
1742
+ case "REORDER_OPERATION_ERRORS":
1743
+ ReorderOperationErrorsInputSchema().parse(action.input);
1744
+ reducer$4.reorderOperationErrorsOperation(
1745
+ state.global,
1746
+ action
1747
+ );
1748
+ break;
1749
+ case "ADD_OPERATION_EXAMPLE":
1750
+ AddOperationExampleInputSchema().parse(action.input);
1751
+ reducer$3.addOperationExampleOperation(
1752
+ state.global,
1753
+ action
1754
+ );
1755
+ break;
1756
+ case "UPDATE_OPERATION_EXAMPLE":
1757
+ UpdateOperationExampleInputSchema().parse(action.input);
1758
+ reducer$3.updateOperationExampleOperation(
1759
+ state.global,
1760
+ action
1761
+ );
1762
+ break;
1763
+ case "DELETE_OPERATION_EXAMPLE":
1764
+ DeleteOperationExampleInputSchema().parse(action.input);
1765
+ reducer$3.deleteOperationExampleOperation(
1766
+ state.global,
1767
+ action
1768
+ );
1769
+ break;
1770
+ case "REORDER_OPERATION_EXAMPLES":
1771
+ ReorderOperationExamplesInputSchema().parse(action.input);
1772
+ reducer$3.reorderOperationExamplesOperation(
1773
+ state.global,
1774
+ action
1775
+ );
1776
+ break;
1777
+ case "ADD_OPERATION":
1778
+ AddOperationInputSchema().parse(action.input);
1779
+ reducer$2.addOperationOperation(state.global, action);
1780
+ break;
1781
+ case "SET_OPERATION_NAME":
1782
+ SetOperationNameInputSchema().parse(action.input);
1783
+ reducer$2.setOperationNameOperation(state.global, action);
1784
+ break;
1785
+ case "SET_OPERATION_SCOPE":
1786
+ SetOperationScopeInputSchema().parse(action.input);
1787
+ reducer$2.setOperationScopeOperation(state.global, action);
1788
+ break;
1789
+ case "SET_OPERATION_SCHEMA":
1790
+ SetOperationSchemaInputSchema().parse(action.input);
1791
+ reducer$2.setOperationSchemaOperation(state.global, action);
1792
+ break;
1793
+ case "SET_OPERATION_DESCRIPTION":
1794
+ SetOperationDescriptionInputSchema().parse(action.input);
1795
+ reducer$2.setOperationDescriptionOperation(
1796
+ state.global,
1797
+ action
1798
+ );
1799
+ break;
1800
+ case "SET_OPERATION_TEMPLATE":
1801
+ SetOperationTemplateInputSchema().parse(action.input);
1802
+ reducer$2.setOperationTemplateOperation(
1803
+ state.global,
1804
+ action
1805
+ );
1806
+ break;
1807
+ case "SET_OPERATION_REDUCER":
1808
+ SetOperationReducerInputSchema().parse(action.input);
1809
+ reducer$2.setOperationReducerOperation(state.global, action);
1810
+ break;
1811
+ case "MOVE_OPERATION":
1812
+ MoveOperationInputSchema().parse(action.input);
1813
+ reducer$2.moveOperationOperation(state.global, action);
1814
+ break;
1815
+ case "DELETE_OPERATION":
1816
+ DeleteOperationInputSchema().parse(action.input);
1817
+ reducer$2.deleteOperationOperation(state.global, action);
1818
+ break;
1819
+ case "REORDER_MODULE_OPERATIONS":
1820
+ ReorderModuleOperationsInputSchema().parse(action.input);
1821
+ reducer$2.reorderModuleOperationsOperation(
1822
+ state.global,
1823
+ action
1824
+ );
1825
+ break;
1826
+ case "SET_STATE_SCHEMA":
1827
+ SetStateSchemaInputSchema().parse(action.input);
1828
+ reducer$1.setStateSchemaOperation(state.global, action);
1829
+ break;
1830
+ case "SET_INITIAL_STATE":
1831
+ SetInitialStateInputSchema().parse(action.input);
1832
+ reducer$1.setInitialStateOperation(state.global, action);
1833
+ break;
1834
+ case "ADD_STATE_EXAMPLE":
1835
+ AddStateExampleInputSchema().parse(action.input);
1836
+ reducer$1.addStateExampleOperation(state.global, action);
1837
+ break;
1838
+ case "UPDATE_STATE_EXAMPLE":
1839
+ UpdateStateExampleInputSchema().parse(action.input);
1840
+ reducer$1.updateStateExampleOperation(state.global, action);
1841
+ break;
1842
+ case "DELETE_STATE_EXAMPLE":
1843
+ DeleteStateExampleInputSchema().parse(action.input);
1844
+ reducer$1.deleteStateExampleOperation(state.global, action);
1845
+ break;
1846
+ case "REORDER_STATE_EXAMPLES":
1847
+ ReorderStateExamplesInputSchema().parse(action.input);
1848
+ reducer$1.reorderStateExamplesOperation(state.global, action);
1849
+ break;
1850
+ default:
1851
+ return state;
1852
+ }
1853
+ };
1854
+ const reducer = object.createReducer(stateReducer);
1855
+ const initialGlobalState = {
1856
+ id: "",
1857
+ name: "",
1858
+ extension: "",
1859
+ description: "",
1860
+ author: {
1861
+ name: "",
1862
+ website: ""
1863
+ },
1864
+ specifications: [
1865
+ {
1866
+ version: 1,
1867
+ changeLog: [],
1868
+ state: {
1869
+ global: {
1870
+ schema: "",
1871
+ initialValue: "",
1872
+ examples: []
1873
+ },
1874
+ local: {
1875
+ schema: "",
1876
+ initialValue: "",
1877
+ examples: []
1878
+ }
1879
+ },
1880
+ modules: []
1881
+ }
1882
+ ]
1883
+ };
1884
+ const initialLocalState = {};
1885
+ const utils$1 = {
1886
+ fileExtension: "phdm",
1887
+ createState(state) {
1888
+ return {
1889
+ global: { ...initialGlobalState, ...state == null ? void 0 : state.global },
1890
+ local: { ...initialLocalState, ...state == null ? void 0 : state.local }
1891
+ };
1892
+ },
1893
+ createExtendedState(extendedState) {
1894
+ return object.createExtendedState(
1895
+ { ...extendedState, documentType: "powerhouse/document-model" },
1896
+ utils$1.createState
1897
+ );
1898
+ },
1899
+ createDocument(state) {
1900
+ return object.createDocument(
1901
+ utils$1.createExtendedState(state),
1902
+ utils$1.createState
1903
+ );
1904
+ },
1905
+ saveToFile(document, path, name) {
1906
+ return object.saveToFile(document, path, "phdm", name);
1907
+ },
1908
+ saveToFileHandle(document, input) {
1909
+ return object.saveToFileHandle(document, input);
1910
+ },
1911
+ loadFromFile(path) {
1912
+ return object.loadFromFile(path, reducer);
1913
+ },
1914
+ loadFromInput(input) {
1915
+ return object.loadFromInput(input, reducer);
1916
+ }
1917
+ };
1918
+ const setModelName = (input) => object.createAction(
1919
+ "SET_MODEL_NAME",
1920
+ { ...input }
1921
+ );
1922
+ const setModelId = (input) => object.createAction(
1923
+ "SET_MODEL_ID",
1924
+ { ...input }
1925
+ );
1926
+ const setModelExtension = (input) => object.createAction(
1927
+ "SET_MODEL_EXTENSION",
1928
+ { ...input }
1929
+ );
1930
+ const setModelDescription = (input) => object.createAction(
1931
+ "SET_MODEL_DESCRIPTION",
1932
+ { ...input }
1933
+ );
1934
+ const setAuthorName = (input) => object.createAction(
1935
+ "SET_AUTHOR_NAME",
1936
+ { ...input }
1937
+ );
1938
+ const setAuthorWebsite = (input) => object.createAction(
1939
+ "SET_AUTHOR_WEBSITE",
1940
+ { ...input }
1941
+ );
1942
+ class DocumentModel_Header extends object.BaseDocument {
1943
+ setModelName(input, options) {
1944
+ return this.dispatch(setModelName(input), options);
1945
+ }
1946
+ setModelId(input, options) {
1947
+ return this.dispatch(setModelId(input), options);
1948
+ }
1949
+ setModelExtension(input, options) {
1950
+ return this.dispatch(setModelExtension(input), options);
1951
+ }
1952
+ setModelDescription(input, options) {
1953
+ return this.dispatch(setModelDescription(input), options);
1954
+ }
1955
+ setAuthorName(input, options) {
1956
+ return this.dispatch(setAuthorName(input), options);
1957
+ }
1958
+ setAuthorWebsite(input, options) {
1959
+ return this.dispatch(setAuthorWebsite(input), options);
1960
+ }
1961
+ }
1962
+ const addChangeLogItem = (input) => object.createAction(
1963
+ "ADD_CHANGE_LOG_ITEM",
1964
+ { ...input }
1965
+ );
1966
+ const updateChangeLogItem = (input) => object.createAction(
1967
+ "UPDATE_CHANGE_LOG_ITEM",
1968
+ { ...input }
1969
+ );
1970
+ const deleteChangeLogItem = (input) => object.createAction(
1971
+ "DELETE_CHANGE_LOG_ITEM",
1972
+ { ...input }
1973
+ );
1974
+ const reorderChangeLogItems = (input) => object.createAction(
1975
+ "REORDER_CHANGE_LOG_ITEMS",
1976
+ { ...input }
1977
+ );
1978
+ const releaseNewVersion = () => object.createAction(
1979
+ "RELEASE_NEW_VERSION"
1980
+ );
1981
+ class DocumentModel_Versioning extends object.BaseDocument {
1982
+ addChangeLogItem(input, options) {
1983
+ return this.dispatch(addChangeLogItem(input), options);
1984
+ }
1985
+ updateChangeLogItem(input, options) {
1986
+ return this.dispatch(updateChangeLogItem(input), options);
1987
+ }
1988
+ deleteChangeLogItem(input, options) {
1989
+ return this.dispatch(deleteChangeLogItem(input), options);
1990
+ }
1991
+ reorderChangeLogItems(input, options) {
1992
+ return this.dispatch(reorderChangeLogItems(input), options);
1993
+ }
1994
+ releaseNewVersion(options) {
1995
+ return this.dispatch(releaseNewVersion(), options);
1996
+ }
1997
+ }
1998
+ const addModule = (input) => object.createAction(
1999
+ "ADD_MODULE",
2000
+ { ...input }
2001
+ );
2002
+ const setModuleName = (input) => object.createAction(
2003
+ "SET_MODULE_NAME",
2004
+ { ...input }
2005
+ );
2006
+ const setModuleDescription = (input) => object.createAction(
2007
+ "SET_MODULE_DESCRIPTION",
2008
+ { ...input }
2009
+ );
2010
+ const deleteModule = (input) => object.createAction(
2011
+ "DELETE_MODULE",
2012
+ { ...input }
2013
+ );
2014
+ const reorderModules = (input) => object.createAction(
2015
+ "REORDER_MODULES",
2016
+ { ...input }
2017
+ );
2018
+ class DocumentModel_Module extends object.BaseDocument {
2019
+ addModule(input, options) {
2020
+ return this.dispatch(addModule(input), options);
2021
+ }
2022
+ setModuleName(input, options) {
2023
+ return this.dispatch(setModuleName(input), options);
2024
+ }
2025
+ setModuleDescription(input, options) {
2026
+ return this.dispatch(setModuleDescription(input), options);
2027
+ }
2028
+ deleteModule(input, options) {
2029
+ return this.dispatch(deleteModule(input), options);
2030
+ }
2031
+ reorderModules(input, options) {
2032
+ return this.dispatch(reorderModules(input), options);
2033
+ }
2034
+ }
2035
+ const addOperationError = (input) => object.createAction(
2036
+ "ADD_OPERATION_ERROR",
2037
+ { ...input }
2038
+ );
2039
+ const setOperationErrorCode = (input) => object.createAction(
2040
+ "SET_OPERATION_ERROR_CODE",
2041
+ { ...input }
2042
+ );
2043
+ const setOperationErrorName = (input) => object.createAction(
2044
+ "SET_OPERATION_ERROR_NAME",
2045
+ { ...input }
2046
+ );
2047
+ const setOperationErrorDescription = (input) => object.createAction(
2048
+ "SET_OPERATION_ERROR_DESCRIPTION",
2049
+ { ...input }
2050
+ );
2051
+ const setOperationErrorTemplate = (input) => object.createAction(
2052
+ "SET_OPERATION_ERROR_TEMPLATE",
2053
+ { ...input }
2054
+ );
2055
+ const deleteOperationError = (input) => object.createAction(
2056
+ "DELETE_OPERATION_ERROR",
2057
+ { ...input }
2058
+ );
2059
+ const reorderOperationErrors = (input) => object.createAction(
2060
+ "REORDER_OPERATION_ERRORS",
2061
+ { ...input }
2062
+ );
2063
+ class DocumentModel_OperationError extends object.BaseDocument {
2064
+ addOperationError(input, options) {
2065
+ return this.dispatch(addOperationError(input), options);
2066
+ }
2067
+ setOperationErrorCode(input, options) {
2068
+ return this.dispatch(setOperationErrorCode(input), options);
2069
+ }
2070
+ setOperationErrorName(input, options) {
2071
+ return this.dispatch(setOperationErrorName(input), options);
2072
+ }
2073
+ setOperationErrorDescription(input, options) {
2074
+ return this.dispatch(setOperationErrorDescription(input), options);
2075
+ }
2076
+ setOperationErrorTemplate(input, options) {
2077
+ return this.dispatch(setOperationErrorTemplate(input), options);
2078
+ }
2079
+ deleteOperationError(input, options) {
2080
+ return this.dispatch(deleteOperationError(input), options);
2081
+ }
2082
+ reorderOperationErrors(input, options) {
2083
+ return this.dispatch(reorderOperationErrors(input), options);
2084
+ }
2085
+ }
2086
+ const addOperationExample = (input) => object.createAction(
2087
+ "ADD_OPERATION_EXAMPLE",
2088
+ { ...input }
2089
+ );
2090
+ const updateOperationExample = (input) => object.createAction(
2091
+ "UPDATE_OPERATION_EXAMPLE",
2092
+ { ...input }
2093
+ );
2094
+ const deleteOperationExample = (input) => object.createAction(
2095
+ "DELETE_OPERATION_EXAMPLE",
2096
+ { ...input }
2097
+ );
2098
+ const reorderOperationExamples = (input) => object.createAction(
2099
+ "REORDER_OPERATION_EXAMPLES",
2100
+ { ...input }
2101
+ );
2102
+ class DocumentModel_OperationExample extends object.BaseDocument {
2103
+ addOperationExample(input, options) {
2104
+ return this.dispatch(addOperationExample(input), options);
2105
+ }
2106
+ updateOperationExample(input, options) {
2107
+ return this.dispatch(updateOperationExample(input), options);
2108
+ }
2109
+ deleteOperationExample(input, options) {
2110
+ return this.dispatch(deleteOperationExample(input), options);
2111
+ }
2112
+ reorderOperationExamples(input, options) {
2113
+ return this.dispatch(reorderOperationExamples(input), options);
2114
+ }
2115
+ }
2116
+ const addOperation = (input) => object.createAction(
2117
+ "ADD_OPERATION",
2118
+ { ...input }
2119
+ );
2120
+ const setOperationName = (input) => object.createAction(
2121
+ "SET_OPERATION_NAME",
2122
+ { ...input }
2123
+ );
2124
+ const setOperationScope = (input) => object.createAction(
2125
+ "SET_OPERATION_SCOPE",
2126
+ { ...input }
2127
+ );
2128
+ const setOperationSchema = (input) => object.createAction(
2129
+ "SET_OPERATION_SCHEMA",
2130
+ { ...input }
2131
+ );
2132
+ const setOperationDescription = (input) => object.createAction(
2133
+ "SET_OPERATION_DESCRIPTION",
2134
+ { ...input }
2135
+ );
2136
+ const setOperationTemplate = (input) => object.createAction(
2137
+ "SET_OPERATION_TEMPLATE",
2138
+ { ...input }
2139
+ );
2140
+ const setOperationReducer = (input) => object.createAction(
2141
+ "SET_OPERATION_REDUCER",
2142
+ { ...input }
2143
+ );
2144
+ const moveOperation = (input) => object.createAction(
2145
+ "MOVE_OPERATION",
2146
+ { ...input }
2147
+ );
2148
+ const deleteOperation = (input) => object.createAction(
2149
+ "DELETE_OPERATION",
2150
+ { ...input }
2151
+ );
2152
+ const reorderModuleOperations = (input) => object.createAction(
2153
+ "REORDER_MODULE_OPERATIONS",
2154
+ { ...input }
2155
+ );
2156
+ class DocumentModel_Operation extends object.BaseDocument {
2157
+ addOperation(input, options) {
2158
+ return this.dispatch(addOperation(input), options);
2159
+ }
2160
+ setOperationName(input, options) {
2161
+ return this.dispatch(setOperationName(input), options);
2162
+ }
2163
+ setOperationScope(input, options) {
2164
+ return this.dispatch(setOperationScope(input), options);
2165
+ }
2166
+ setOperationSchema(input, options) {
2167
+ return this.dispatch(setOperationSchema(input), options);
2168
+ }
2169
+ setOperationDescription(input, options) {
2170
+ return this.dispatch(setOperationDescription(input), options);
2171
+ }
2172
+ setOperationTemplate(input, options) {
2173
+ return this.dispatch(setOperationTemplate(input), options);
2174
+ }
2175
+ setOperationReducer(input, options) {
2176
+ return this.dispatch(setOperationReducer(input), options);
2177
+ }
2178
+ moveOperation(input, options) {
2179
+ return this.dispatch(moveOperation(input), options);
2180
+ }
2181
+ deleteOperation(input, options) {
2182
+ return this.dispatch(deleteOperation(input), options);
2183
+ }
2184
+ reorderModuleOperations(input, options) {
2185
+ return this.dispatch(reorderModuleOperations(input), options);
2186
+ }
2187
+ }
2188
+ const setStateSchema = (input) => object.createAction(
2189
+ "SET_STATE_SCHEMA",
2190
+ { ...input }
2191
+ );
2192
+ const setInitialState = (input) => object.createAction(
2193
+ "SET_INITIAL_STATE",
2194
+ { ...input }
2195
+ );
2196
+ const addStateExample = (input) => object.createAction(
2197
+ "ADD_STATE_EXAMPLE",
2198
+ { ...input }
2199
+ );
2200
+ const updateStateExample = (input) => object.createAction(
2201
+ "UPDATE_STATE_EXAMPLE",
2202
+ { ...input }
2203
+ );
2204
+ const deleteStateExample = (input) => object.createAction(
2205
+ "DELETE_STATE_EXAMPLE",
2206
+ { ...input }
2207
+ );
2208
+ const reorderStateExamples = (input) => object.createAction(
2209
+ "REORDER_STATE_EXAMPLES",
2210
+ { ...input }
2211
+ );
2212
+ class DocumentModel_State extends object.BaseDocument {
2213
+ setStateSchema(input, options) {
2214
+ return this.dispatch(setStateSchema(input), options);
2215
+ }
2216
+ setInitialState(input, options) {
2217
+ return this.dispatch(setInitialState(input), options);
2218
+ }
2219
+ addStateExample(input, options) {
2220
+ return this.dispatch(addStateExample(input), options);
2221
+ }
2222
+ updateStateExample(input, options) {
2223
+ return this.dispatch(updateStateExample(input), options);
2224
+ }
2225
+ deleteStateExample(input, options) {
2226
+ return this.dispatch(deleteStateExample(input), options);
2227
+ }
2228
+ reorderStateExamples(input, options) {
2229
+ return this.dispatch(reorderStateExamples(input), options);
2230
+ }
2231
+ }
2232
+ let DocumentModel$1 = (_a = class extends object.BaseDocument {
2233
+ constructor(initialState, dispatch) {
2234
+ super(reducer, utils$1.createDocument(initialState), dispatch);
2235
+ }
2236
+ saveToFile(path, name) {
2237
+ return super.saveToFile(path, _a.fileExtension, name);
2238
+ }
2239
+ loadFromFile(path) {
2240
+ return super.loadFromFile(path);
2241
+ }
2242
+ static async fromFile(path) {
2243
+ const document = new this();
2244
+ await document.loadFromFile(path);
2245
+ return document;
2246
+ }
2247
+ }, __publicField(_a, "fileExtension", "phdm"), _a);
2248
+ object.applyMixins(DocumentModel$1, [
2249
+ DocumentModel_Header,
2250
+ DocumentModel_Versioning,
2251
+ DocumentModel_Module,
2252
+ DocumentModel_OperationError,
2253
+ DocumentModel_OperationExample,
2254
+ DocumentModel_Operation,
2255
+ DocumentModel_State
2256
+ ]);
2257
+ const DocumentModelActions = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2258
+ __proto__: null,
2259
+ addChangeLogItem,
2260
+ addModule,
2261
+ addOperation,
2262
+ addOperationError,
2263
+ addOperationExample,
2264
+ addStateExample,
2265
+ deleteChangeLogItem,
2266
+ deleteModule,
2267
+ deleteOperation,
2268
+ deleteOperationError,
2269
+ deleteOperationExample,
2270
+ deleteStateExample,
2271
+ moveOperation,
2272
+ releaseNewVersion,
2273
+ reorderChangeLogItems,
2274
+ reorderModuleOperations,
2275
+ reorderModules,
2276
+ reorderOperationErrors,
2277
+ reorderOperationExamples,
2278
+ reorderStateExamples,
2279
+ setAuthorName,
2280
+ setAuthorWebsite,
2281
+ setInitialState,
2282
+ setModelDescription,
2283
+ setModelExtension,
2284
+ setModelId,
2285
+ setModelName,
2286
+ setModuleDescription,
2287
+ setModuleName,
2288
+ setOperationDescription,
2289
+ setOperationErrorCode,
2290
+ setOperationErrorDescription,
2291
+ setOperationErrorName,
2292
+ setOperationErrorTemplate,
2293
+ setOperationName,
2294
+ setOperationReducer,
2295
+ setOperationSchema,
2296
+ setOperationScope,
2297
+ setOperationTemplate,
2298
+ setStateSchema,
2299
+ updateChangeLogItem,
2300
+ updateOperationExample,
2301
+ updateStateExample
2302
+ }, Symbol.toStringTag, { value: "Module" }));
2303
+ const Document = DocumentModel$1;
2304
+ const utils = { ...utils$1, ...customUtils };
2305
+ const actions = { ...object.BaseActions, ...DocumentModelActions };
2306
+ const module$1 = {
2307
+ Document,
2308
+ reducer,
2309
+ actions,
2310
+ utils,
2311
+ documentModel
2312
+ };
2313
+ const DocumentModel = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2314
+ __proto__: null,
2315
+ Document,
2316
+ DocumentModel: DocumentModel$1,
2317
+ actions,
2318
+ documentModel,
2319
+ module: module$1,
2320
+ reducer,
2321
+ utils,
2322
+ validateInitialState,
2323
+ validateModule,
2324
+ validateModuleOperation,
2325
+ validateModules,
2326
+ validateStateSchemaName,
2327
+ z: zod
2328
+ }, Symbol.toStringTag, { value: "Module" }));
2329
+ exports.Document = Document;
2330
+ exports.DocumentModel = DocumentModel;
2331
+ exports.DocumentModel$1 = DocumentModel$1;
2332
+ exports.actions = actions;
2333
+ exports.documentModel = documentModel;
2334
+ exports.module = module$1;
2335
+ exports.reducer = reducer;
2336
+ exports.utils = utils;
2337
+ exports.validateInitialState = validateInitialState;
2338
+ exports.validateModule = validateModule;
2339
+ exports.validateModuleOperation = validateModuleOperation;
2340
+ exports.validateModules = validateModules;
2341
+ exports.validateStateSchemaName = validateStateSchemaName;
2342
+ exports.zod = zod;
2343
+ //# sourceMappingURL=index-ajqhOWQ1.js.map