document-model 1.3.0 → 1.5.0

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