@defra/forms-model 3.0.10 → 3.0.12

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 (239) hide show
  1. package/dist/module/components/component-types.js +1 -5
  2. package/dist/module/components/component-types.js.map +1 -1
  3. package/dist/module/components/conditional-component-types.js +1 -5
  4. package/dist/module/components/conditional-component-types.js.map +1 -1
  5. package/dist/module/components/enums.js +1 -5
  6. package/dist/module/components/enums.js.map +1 -1
  7. package/dist/module/components/index.js +3 -24
  8. package/dist/module/components/index.js.map +1 -1
  9. package/dist/module/components/types.js +1 -1
  10. package/dist/module/conditions/condition-abstract.js +3 -8
  11. package/dist/module/conditions/condition-abstract.js.map +1 -1
  12. package/dist/module/conditions/condition-field.js +3 -8
  13. package/dist/module/conditions/condition-field.js.map +1 -1
  14. package/dist/module/conditions/condition-group-def.js +1 -6
  15. package/dist/module/conditions/condition-group-def.js.map +1 -1
  16. package/dist/module/conditions/condition-group.js +4 -9
  17. package/dist/module/conditions/condition-group.js.map +1 -1
  18. package/dist/module/conditions/condition-model.js +20 -25
  19. package/dist/module/conditions/condition-model.js.map +1 -1
  20. package/dist/module/conditions/condition-operators.js +15 -23
  21. package/dist/module/conditions/condition-operators.js.map +1 -1
  22. package/dist/module/conditions/condition-ref.js +2 -7
  23. package/dist/module/conditions/condition-ref.js.map +1 -1
  24. package/dist/module/conditions/condition-value-abstract.js +3 -8
  25. package/dist/module/conditions/condition-value-abstract.js.map +1 -1
  26. package/dist/module/conditions/condition-value-registration.js +1 -6
  27. package/dist/module/conditions/condition-value-registration.js.map +1 -1
  28. package/dist/module/conditions/condition-values.js +12 -20
  29. package/dist/module/conditions/condition-values.js.map +1 -1
  30. package/dist/module/conditions/condition.js +9 -14
  31. package/dist/module/conditions/condition.js.map +1 -1
  32. package/dist/module/conditions/enums.js +1 -5
  33. package/dist/module/conditions/enums.js.map +1 -1
  34. package/dist/module/conditions/helpers.js +2 -7
  35. package/dist/module/conditions/helpers.js.map +1 -1
  36. package/dist/module/conditions/index.js +10 -139
  37. package/dist/module/conditions/index.js.map +1 -1
  38. package/dist/module/conditions/inline-condition-model.js +15 -26
  39. package/dist/module/conditions/inline-condition-model.js.map +1 -1
  40. package/dist/module/conditions/inline-condition-operators.js +15 -23
  41. package/dist/module/conditions/inline-condition-operators.js.map +1 -1
  42. package/dist/module/conditions/inline-condition-values.js +9 -17
  43. package/dist/module/conditions/inline-condition-values.js.map +1 -1
  44. package/dist/module/conditions/types.js +1 -1
  45. package/dist/module/conditions/types.js.map +1 -1
  46. package/dist/module/data-model/conditions-wrapper.js +3 -8
  47. package/dist/module/data-model/conditions-wrapper.js.map +1 -1
  48. package/dist/module/data-model/enums.js +1 -5
  49. package/dist/module/data-model/enums.js.map +1 -1
  50. package/dist/module/data-model/index.js +3 -24
  51. package/dist/module/data-model/index.js.map +1 -1
  52. package/dist/module/data-model/input-wrapper.js +3 -8
  53. package/dist/module/data-model/input-wrapper.js.map +1 -1
  54. package/dist/module/data-model/types.js +1 -5
  55. package/dist/module/data-model/types.js.map +1 -1
  56. package/dist/module/form/form-configuration.js +1 -6
  57. package/dist/module/form/form-configuration.js.map +1 -1
  58. package/dist/module/form/index.js +1 -10
  59. package/dist/module/form/index.js.map +1 -1
  60. package/dist/module/index.js +8 -91
  61. package/dist/module/index.js.map +1 -1
  62. package/dist/module/migration/index.js +1 -10
  63. package/dist/module/migration/index.js.map +1 -1
  64. package/dist/module/migration/migration.0-2.js +1 -5
  65. package/dist/module/migration/migration.0-2.js.map +1 -1
  66. package/dist/module/migration/migration.1-2.js +3 -6
  67. package/dist/module/migration/migration.1-2.js.map +1 -1
  68. package/dist/module/migration/types.js +1 -1
  69. package/dist/module/migration/whichMigrations.js +5 -9
  70. package/dist/module/migration/whichMigrations.js.map +1 -1
  71. package/dist/module/schema/index.js +1 -16
  72. package/dist/module/schema/index.js.map +1 -1
  73. package/dist/module/schema/schema.js +163 -167
  74. package/dist/module/schema/schema.js.map +1 -1
  75. package/dist/module/utils/helpers.js +5 -13
  76. package/dist/module/utils/helpers.js.map +1 -1
  77. package/dist/module/utils/logger.js +1 -6
  78. package/dist/module/utils/logger.js.map +1 -1
  79. package/dist/types/components/component-types.d.ts +1 -1
  80. package/dist/types/components/component-types.d.ts.map +1 -1
  81. package/dist/types/components/conditional-component-types.d.ts +1 -1
  82. package/dist/types/components/conditional-component-types.d.ts.map +1 -1
  83. package/dist/types/components/index.d.ts +3 -3
  84. package/dist/types/components/index.d.ts.map +1 -1
  85. package/dist/types/conditions/condition-abstract.d.ts +1 -1
  86. package/dist/types/conditions/condition-abstract.d.ts.map +1 -1
  87. package/dist/types/conditions/condition-field.d.ts +1 -1
  88. package/dist/types/conditions/condition-field.d.ts.map +1 -1
  89. package/dist/types/conditions/condition-group-def.d.ts +2 -2
  90. package/dist/types/conditions/condition-group-def.d.ts.map +1 -1
  91. package/dist/types/conditions/condition-group.d.ts +2 -2
  92. package/dist/types/conditions/condition-group.d.ts.map +1 -1
  93. package/dist/types/conditions/condition-model.d.ts +5 -5
  94. package/dist/types/conditions/condition-model.d.ts.map +1 -1
  95. package/dist/types/conditions/condition-operators.d.ts +2 -2
  96. package/dist/types/conditions/condition-operators.d.ts.map +1 -1
  97. package/dist/types/conditions/condition-ref.d.ts +2 -2
  98. package/dist/types/conditions/condition-ref.d.ts.map +1 -1
  99. package/dist/types/conditions/condition-value-abstract.d.ts +1 -1
  100. package/dist/types/conditions/condition-value-abstract.d.ts.map +1 -1
  101. package/dist/types/conditions/condition-values.d.ts +3 -3
  102. package/dist/types/conditions/condition-values.d.ts.map +1 -1
  103. package/dist/types/conditions/condition.d.ts +4 -4
  104. package/dist/types/conditions/condition.d.ts.map +1 -1
  105. package/dist/types/conditions/index.d.ts +10 -10
  106. package/dist/types/conditions/index.d.ts.map +1 -1
  107. package/dist/types/conditions/types.d.ts +3 -3
  108. package/dist/types/conditions/types.d.ts.map +1 -1
  109. package/dist/types/data-model/conditions-wrapper.d.ts +1 -1
  110. package/dist/types/data-model/conditions-wrapper.d.ts.map +1 -1
  111. package/dist/types/data-model/index.d.ts +3 -3
  112. package/dist/types/data-model/index.d.ts.map +1 -1
  113. package/dist/types/data-model/input-wrapper.d.ts +2 -2
  114. package/dist/types/data-model/input-wrapper.d.ts.map +1 -1
  115. package/dist/types/data-model/types.d.ts +3 -3
  116. package/dist/types/data-model/types.d.ts.map +1 -1
  117. package/dist/types/form/index.d.ts +1 -1
  118. package/dist/types/form/index.d.ts.map +1 -1
  119. package/dist/types/index.d.ts +11 -11
  120. package/dist/types/index.d.ts.map +1 -1
  121. package/dist/types/migration/index.d.ts +1 -1
  122. package/dist/types/migration/index.d.ts.map +1 -1
  123. package/dist/types/migration/migration.0-2.d.ts +1 -1
  124. package/dist/types/migration/migration.0-2.d.ts.map +1 -1
  125. package/dist/types/migration/migration.1-2.d.ts +1 -1
  126. package/dist/types/migration/migration.1-2.d.ts.map +1 -1
  127. package/dist/types/migration/whichMigrations.d.ts +1 -1
  128. package/dist/types/migration/whichMigrations.d.ts.map +1 -1
  129. package/dist/types/schema/index.d.ts +1 -1
  130. package/dist/types/schema/index.d.ts.map +1 -1
  131. package/package.json +3 -4
  132. package/src/components/component-types.ts +1 -1
  133. package/src/components/conditional-component-types.ts +1 -1
  134. package/src/components/index.ts +3 -3
  135. package/src/conditions/condition-abstract.ts +1 -1
  136. package/src/conditions/condition-field.ts +2 -2
  137. package/src/conditions/condition-group-def.ts +1 -1
  138. package/src/conditions/condition-group.ts +3 -3
  139. package/src/conditions/condition-model.ts +9 -9
  140. package/src/conditions/condition-operators.ts +6 -3
  141. package/src/conditions/condition-ref.ts +2 -2
  142. package/src/conditions/condition-value-abstract.ts +1 -1
  143. package/src/conditions/condition-values.ts +3 -3
  144. package/src/conditions/condition.ts +6 -6
  145. package/src/conditions/index.ts +10 -10
  146. package/src/conditions/inline-condition-model.ts +3 -3
  147. package/src/conditions/inline-condition-operators.ts +1 -1
  148. package/src/conditions/types.ts +3 -3
  149. package/src/data-model/conditions-wrapper.ts +2 -2
  150. package/src/data-model/index.ts +3 -3
  151. package/src/data-model/input-wrapper.ts +3 -3
  152. package/src/data-model/types.ts +3 -3
  153. package/src/form/index.ts +1 -1
  154. package/src/index.ts +11 -11
  155. package/src/migration/index.ts +1 -1
  156. package/src/migration/migration.0-2.ts +1 -1
  157. package/src/migration/migration.1-2.ts +2 -2
  158. package/src/migration/whichMigrations.ts +3 -3
  159. package/src/schema/index.ts +1 -1
  160. package/dist/browser/components/component-types.js +0 -220
  161. package/dist/browser/components/component-types.js.map +0 -1
  162. package/dist/browser/components/conditional-component-types.js +0 -28
  163. package/dist/browser/components/conditional-component-types.js.map +0 -1
  164. package/dist/browser/components/enums.js +0 -46
  165. package/dist/browser/components/enums.js.map +0 -1
  166. package/dist/browser/components/index.js +0 -36
  167. package/dist/browser/components/index.js.map +0 -1
  168. package/dist/browser/components/types.js +0 -16
  169. package/dist/browser/components/types.js.map +0 -1
  170. package/dist/browser/conditions/condition-abstract.js +0 -62
  171. package/dist/browser/conditions/condition-abstract.js.map +0 -1
  172. package/dist/browser/conditions/condition-field.js +0 -45
  173. package/dist/browser/conditions/condition-field.js.map +0 -1
  174. package/dist/browser/conditions/condition-group-def.js +0 -45
  175. package/dist/browser/conditions/condition-group-def.js.map +0 -1
  176. package/dist/browser/conditions/condition-group.js +0 -64
  177. package/dist/browser/conditions/condition-group.js.map +0 -1
  178. package/dist/browser/conditions/condition-model.js +0 -214
  179. package/dist/browser/conditions/condition-model.js.map +0 -1
  180. package/dist/browser/conditions/condition-operators.js +0 -132
  181. package/dist/browser/conditions/condition-operators.js.map +0 -1
  182. package/dist/browser/conditions/condition-ref.js +0 -51
  183. package/dist/browser/conditions/condition-ref.js.map +0 -1
  184. package/dist/browser/conditions/condition-value-abstract.js +0 -41
  185. package/dist/browser/conditions/condition-value-abstract.js.map +0 -1
  186. package/dist/browser/conditions/condition-value-registration.js +0 -37
  187. package/dist/browser/conditions/condition-value-registration.js.map +0 -1
  188. package/dist/browser/conditions/condition-values.js +0 -127
  189. package/dist/browser/conditions/condition-values.js.map +0 -1
  190. package/dist/browser/conditions/condition.js +0 -56
  191. package/dist/browser/conditions/condition.js.map +0 -1
  192. package/dist/browser/conditions/enums.js +0 -24
  193. package/dist/browser/conditions/enums.js.map +0 -1
  194. package/dist/browser/conditions/helpers.js +0 -26
  195. package/dist/browser/conditions/helpers.js.map +0 -1
  196. package/dist/browser/conditions/index.js +0 -144
  197. package/dist/browser/conditions/index.js.map +0 -1
  198. package/dist/browser/conditions/inline-condition-model.js +0 -418
  199. package/dist/browser/conditions/inline-condition-model.js.map +0 -1
  200. package/dist/browser/conditions/inline-condition-operators.js +0 -132
  201. package/dist/browser/conditions/inline-condition-operators.js.map +0 -1
  202. package/dist/browser/conditions/inline-condition-values.js +0 -159
  203. package/dist/browser/conditions/inline-condition-values.js.map +0 -1
  204. package/dist/browser/conditions/types.js +0 -16
  205. package/dist/browser/conditions/types.js.map +0 -1
  206. package/dist/browser/data-model/conditions-wrapper.js +0 -49
  207. package/dist/browser/data-model/conditions-wrapper.js.map +0 -1
  208. package/dist/browser/data-model/enums.js +0 -25
  209. package/dist/browser/data-model/enums.js.map +0 -1
  210. package/dist/browser/data-model/index.js +0 -36
  211. package/dist/browser/data-model/index.js.map +0 -1
  212. package/dist/browser/data-model/input-wrapper.js +0 -49
  213. package/dist/browser/data-model/input-wrapper.js.map +0 -1
  214. package/dist/browser/data-model/types.js +0 -27
  215. package/dist/browser/data-model/types.js.map +0 -1
  216. package/dist/browser/form/form-configuration.js +0 -38
  217. package/dist/browser/form/form-configuration.js.map +0 -1
  218. package/dist/browser/form/index.js +0 -24
  219. package/dist/browser/form/index.js.map +0 -1
  220. package/dist/browser/index.js +0 -98
  221. package/dist/browser/index.js.map +0 -1
  222. package/dist/browser/migration/index.js +0 -24
  223. package/dist/browser/migration/index.js.map +0 -1
  224. package/dist/browser/migration/migration.0-2.js +0 -65
  225. package/dist/browser/migration/migration.0-2.js.map +0 -1
  226. package/dist/browser/migration/migration.1-2.js +0 -108
  227. package/dist/browser/migration/migration.1-2.js.map +0 -1
  228. package/dist/browser/migration/types.js +0 -16
  229. package/dist/browser/migration/types.js.map +0 -1
  230. package/dist/browser/migration/whichMigrations.js +0 -38
  231. package/dist/browser/migration/whichMigrations.js.map +0 -1
  232. package/dist/browser/schema/index.js +0 -30
  233. package/dist/browser/schema/index.js.map +0 -1
  234. package/dist/browser/schema/schema.js +0 -255
  235. package/dist/browser/schema/schema.js.map +0 -1
  236. package/dist/browser/utils/helpers.js +0 -48
  237. package/dist/browser/utils/helpers.js.map +0 -1
  238. package/dist/browser/utils/logger.js +0 -46
  239. package/dist/browser/utils/logger.js.map +0 -1
@@ -1,25 +1,4 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- Object.defineProperty(exports, "ConditionsWrapper", {
5
- enumerable: true,
6
- get: function () {
7
- return _conditionsWrapper.ConditionsWrapper;
8
- }
9
- });
10
- Object.defineProperty(exports, "InputWrapper", {
11
- enumerable: true,
12
- get: function () {
13
- return _inputWrapper.InputWrapper;
14
- }
15
- });
16
- Object.defineProperty(exports, "OutputType", {
17
- enumerable: true,
18
- get: function () {
19
- return _enums.OutputType;
20
- }
21
- });
22
- var _inputWrapper = require("./input-wrapper");
23
- var _conditionsWrapper = require("./conditions-wrapper");
24
- var _enums = require("./enums");
1
+ export { InputWrapper } from "./input-wrapper.js";
2
+ export { ConditionsWrapper } from "./conditions-wrapper.js";
3
+ export { OutputType } from "./enums.js";
25
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_inputWrapper","require","_conditionsWrapper","_enums"],"sources":["../../../src/data-model/index.ts"],"sourcesContent":["export { InputWrapper } from '~/src/data-model/input-wrapper'\nexport { ConditionsWrapper } from '~/src/data-model/conditions-wrapper'\nexport { OutputType } from '~/src/data-model/enums'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA"}
1
+ {"version":3,"file":"index.js","names":["InputWrapper","ConditionsWrapper","OutputType"],"sources":["../../../src/data-model/index.ts"],"sourcesContent":["export { InputWrapper } from '~/src/data-model/input-wrapper.js'\nexport { ConditionsWrapper } from '~/src/data-model/conditions-wrapper.js'\nexport { OutputType } from '~/src/data-model/enums.js'\n"],"mappings":"AAAA,SAASA,YAAY;AACrB,SAASC,iBAAiB;AAC1B,SAASC,UAAU"}
@@ -1,16 +1,12 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.InputWrapper = void 0;
5
- var _helpers = require("../utils/helpers");
6
- class InputWrapper {
1
+ import { clone } from "../utils/helpers.js";
2
+ export class InputWrapper {
7
3
  name = undefined;
8
4
  title = undefined;
9
5
  type = undefined;
10
6
  #parentItemName;
11
7
  constructor(rawData, page, options) {
12
8
  Object.assign(this, rawData);
13
- const myPage = (0, _helpers.clone)(page);
9
+ const myPage = clone(page);
14
10
  delete myPage.components;
15
11
  this.page = myPage;
16
12
  this.propertyPath = !options.ignoreSection && page.section ? `${page.section}.${this.name}` : this.name;
@@ -21,5 +17,4 @@ class InputWrapper {
21
17
  return this.page.section ? `${titleWithContext} in ${this.page.section}` : titleWithContext;
22
18
  }
23
19
  }
24
- exports.InputWrapper = InputWrapper;
25
20
  //# sourceMappingURL=input-wrapper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-wrapper.js","names":["_helpers","require","InputWrapper","name","undefined","title","type","parentItemName","constructor","rawData","page","options","Object","assign","myPage","clone","components","propertyPath","ignoreSection","section","displayName","titleWithContext","exports"],"sources":["../../../src/data-model/input-wrapper.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types'\nimport { type Page } from '~/src/data-model/types'\nimport { clone } from '~/src/utils/helpers'\n\nexport class InputWrapper {\n name: string | undefined = undefined\n title: string | undefined = undefined\n type: string | undefined = undefined\n propertyPath: string | undefined\n #parentItemName: string | undefined\n page: Page\n\n constructor(\n rawData: ComponentDef,\n page: Page,\n options: { ignoreSection?: boolean; parentItemName?: string }\n ) {\n Object.assign(this, rawData)\n const myPage = clone(page)\n\n delete myPage.components\n\n this.page = myPage\n this.propertyPath =\n !options.ignoreSection && page.section\n ? `${page.section}.${this.name}`\n : this.name\n this.#parentItemName = options.parentItemName\n }\n\n get displayName(): string | undefined {\n const titleWithContext = this.#parentItemName\n ? `${this.title} under ${this.#parentItemName}`\n : this.title\n\n return this.page.section\n ? `${titleWithContext} in ${this.page.section}`\n : titleWithContext\n }\n}\n"],"mappings":";;;;AAEA,IAAAA,QAAA,GAAAC,OAAA;AAEO,MAAMC,YAAY,CAAC;EACxBC,IAAI,GAAuBC,SAAS;EACpCC,KAAK,GAAuBD,SAAS;EACrCE,IAAI,GAAuBF,SAAS;EAEpC,CAACG,cAAc;EAGfC,WAAWA,CACTC,OAAqB,EACrBC,IAAU,EACVC,OAA6D,EAC7D;IACAC,MAAM,CAACC,MAAM,CAAC,IAAI,EAAEJ,OAAO,CAAC;IAC5B,MAAMK,MAAM,GAAG,IAAAC,cAAK,EAACL,IAAI,CAAC;IAE1B,OAAOI,MAAM,CAACE,UAAU;IAExB,IAAI,CAACN,IAAI,GAAGI,MAAM;IAClB,IAAI,CAACG,YAAY,GACf,CAACN,OAAO,CAACO,aAAa,IAAIR,IAAI,CAACS,OAAO,GACjC,GAAET,IAAI,CAACS,OAAQ,IAAG,IAAI,CAAChB,IAAK,EAAC,GAC9B,IAAI,CAACA,IAAI;IACf,IAAI,CAAC,CAACI,cAAc,GAAGI,OAAO,CAACJ,cAAc;EAC/C;EAEA,IAAIa,WAAWA,CAAA,EAAuB;IACpC,MAAMC,gBAAgB,GAAG,IAAI,CAAC,CAACd,cAAc,GACxC,GAAE,IAAI,CAACF,KAAM,UAAS,IAAI,CAAC,CAACE,cAAe,EAAC,GAC7C,IAAI,CAACF,KAAK;IAEd,OAAO,IAAI,CAACK,IAAI,CAACS,OAAO,GACnB,GAAEE,gBAAiB,OAAM,IAAI,CAACX,IAAI,CAACS,OAAQ,EAAC,GAC7CE,gBAAgB;EACtB;AACF;AAACC,OAAA,CAAApB,YAAA,GAAAA,YAAA"}
1
+ {"version":3,"file":"input-wrapper.js","names":["clone","InputWrapper","name","undefined","title","type","parentItemName","constructor","rawData","page","options","Object","assign","myPage","components","propertyPath","ignoreSection","section","displayName","titleWithContext"],"sources":["../../../src/data-model/input-wrapper.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.js'\nimport { type Page } from '~/src/data-model/types.js'\nimport { clone } from '~/src/utils/helpers.js'\n\nexport class InputWrapper {\n name: string | undefined = undefined\n title: string | undefined = undefined\n type: string | undefined = undefined\n propertyPath: string | undefined\n #parentItemName: string | undefined\n page: Page\n\n constructor(\n rawData: ComponentDef,\n page: Page,\n options: { ignoreSection?: boolean; parentItemName?: string }\n ) {\n Object.assign(this, rawData)\n const myPage = clone(page)\n\n delete myPage.components\n\n this.page = myPage\n this.propertyPath =\n !options.ignoreSection && page.section\n ? `${page.section}.${this.name}`\n : this.name\n this.#parentItemName = options.parentItemName\n }\n\n get displayName(): string | undefined {\n const titleWithContext = this.#parentItemName\n ? `${this.title} under ${this.#parentItemName}`\n : this.title\n\n return this.page.section\n ? `${titleWithContext} in ${this.page.section}`\n : titleWithContext\n }\n}\n"],"mappings":"AAEA,SAASA,KAAK;AAEd,OAAO,MAAMC,YAAY,CAAC;EACxBC,IAAI,GAAuBC,SAAS;EACpCC,KAAK,GAAuBD,SAAS;EACrCE,IAAI,GAAuBF,SAAS;EAEpC,CAACG,cAAc;EAGfC,WAAWA,CACTC,OAAqB,EACrBC,IAAU,EACVC,OAA6D,EAC7D;IACAC,MAAM,CAACC,MAAM,CAAC,IAAI,EAAEJ,OAAO,CAAC;IAC5B,MAAMK,MAAM,GAAGb,KAAK,CAACS,IAAI,CAAC;IAE1B,OAAOI,MAAM,CAACC,UAAU;IAExB,IAAI,CAACL,IAAI,GAAGI,MAAM;IAClB,IAAI,CAACE,YAAY,GACf,CAACL,OAAO,CAACM,aAAa,IAAIP,IAAI,CAACQ,OAAO,GACjC,GAAER,IAAI,CAACQ,OAAQ,IAAG,IAAI,CAACf,IAAK,EAAC,GAC9B,IAAI,CAACA,IAAI;IACf,IAAI,CAAC,CAACI,cAAc,GAAGI,OAAO,CAACJ,cAAc;EAC/C;EAEA,IAAIY,WAAWA,CAAA,EAAuB;IACpC,MAAMC,gBAAgB,GAAG,IAAI,CAAC,CAACb,cAAc,GACxC,GAAE,IAAI,CAACF,KAAM,UAAS,IAAI,CAAC,CAACE,cAAe,EAAC,GAC7C,IAAI,CAACF,KAAK;IAEd,OAAO,IAAI,CAACK,IAAI,CAACQ,OAAO,GACnB,GAAEE,gBAAiB,OAAM,IAAI,CAACV,IAAI,CAACQ,OAAQ,EAAC,GAC7CE,gBAAgB;EACtB;AACF"}
@@ -1,8 +1,4 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.isMultipleApiKey = isMultipleApiKey;
5
- function isMultipleApiKey(payApiKey) {
1
+ export function isMultipleApiKey(payApiKey) {
6
2
  const obj = payApiKey;
7
3
  return obj.test !== undefined || obj.production !== undefined;
8
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["isMultipleApiKey","payApiKey","obj","test","undefined","production"],"sources":["../../../src/data-model/types.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types'\nimport { type Condition } from '~/src/conditions/condition'\nimport { type OutputType } from '~/src/data-model/enums'\n\ntype Toggleable<T> = boolean | T\n\nexport interface Next {\n path: string\n condition?: string\n}\nexport type Link = Next\n\nexport interface Page {\n title: string\n path: string\n controller: string\n components?: ComponentDef[]\n section: string // the section ID\n next?: { path: string; condition?: string }[]\n}\n\nexport interface RepeatingFieldPage extends Page {\n controller: 'RepeatingFieldPageController'\n options: {\n summaryDisplayMode?: {\n samePage?: boolean\n separatePage?: boolean\n hideRowTitles?: boolean\n }\n customText?: {\n separatePageTitle?: string\n }\n }\n}\n\nexport interface Section {\n name: string\n title: string\n hideTitle: boolean\n}\n\nexport interface Item {\n text: string\n value: string | number | boolean\n description?: string\n condition?: string\n}\n\nexport interface List {\n name: string\n title: string\n type: 'string' | 'number' | 'boolean'\n items: Item[]\n}\n\nexport interface Feedback {\n feedbackForm?: boolean\n url?: string\n emailAddress?: string\n}\n\nexport type PhaseBanner = {\n phase?: 'alpha' | 'beta'\n feedbackUrl?: string\n}\n\nexport type MultipleApiKeys = {\n test?: string\n production?: string\n}\n\nexport type EmailOutputConfiguration = {\n emailAddress: string\n}\n\nexport type NotifyOutputConfiguration = {\n apiKey: string\n templateId: string\n emailField: string\n personalisation: string[]\n personalisationFieldCustomisation?: {\n [personalisationName: string]: string[]\n }\n addReferencesToPersonalisation?: boolean\n emailReplyToIdConfiguration?: {\n emailReplyToId: string\n condition?: string | undefined\n }[]\n}\n\nexport type WebhookOutputConfiguration = {\n url: string\n}\n\nexport type OutputConfiguration =\n | EmailOutputConfiguration\n | NotifyOutputConfiguration\n | WebhookOutputConfiguration\n\nexport type Output = {\n name: string\n title: string\n type: OutputType\n outputConfiguration: OutputConfiguration\n}\n\nexport type ConfirmationPage = {\n customText: {\n title: string\n paymentSkipped: Toggleable<string>\n nextSteps: Toggleable<string>\n }\n components: ComponentDef[]\n}\n\nexport type PaymentSkippedWarningPage = {\n customText: {\n title: string\n caption: string\n body: string\n }\n}\n\nexport type SpecialPages = {\n confirmationPage?: ConfirmationPage\n paymentSkippedWarningPage?: PaymentSkippedWarningPage\n}\n\nexport function isMultipleApiKey(\n payApiKey: string | MultipleApiKeys | undefined\n): payApiKey is MultipleApiKeys {\n const obj = payApiKey as MultipleApiKeys\n return obj.test !== undefined || obj.production !== undefined\n}\n\nexport type Fee = {\n description: string\n amount: number\n multiplier?: string\n condition?: string\n prefix?: string\n}\n\nexport type FeeOptions = {\n paymentReferenceFormat?: string\n payReturnUrl?: string\n allowSubmissionWithoutPayment: boolean\n maxAttempts: number\n customPayErrorMessage?: string\n showPaymentSkippedWarningPage: boolean\n}\n\nexport type ConditionWrapperValue =\n | string\n | {\n name: string\n conditions: Condition[]\n }\n\nexport type ConditionRawData = {\n name: string\n displayName: string\n value: ConditionWrapperValue\n}\n\n/**\n * `FormDefinition` is a typescript representation of `Schema`\n */\nexport type FormDefinition = {\n pages: Array<Page | RepeatingFieldPage>\n conditions: ConditionRawData[]\n lists: List[]\n sections: Section[]\n startPage?: Page['path'] | undefined\n name?: string | undefined\n feedback?: Feedback\n phaseBanner?: PhaseBanner\n fees: Fee[]\n skipSummary?: boolean | undefined\n outputs: Output[]\n declaration?: string | undefined\n metadata?: Record<string, any>\n payApiKey?: string | MultipleApiKeys | undefined\n specialPages?: SpecialPages\n paymentReferenceFormat?: string\n feeOptions: FeeOptions\n}\n"],"mappings":";;;;AAgIO,SAASA,gBAAgBA,CAC9BC,SAA+C,EACjB;EAC9B,MAAMC,GAAG,GAAGD,SAA4B;EACxC,OAAOC,GAAG,CAACC,IAAI,KAAKC,SAAS,IAAIF,GAAG,CAACG,UAAU,KAAKD,SAAS;AAC/D;;AAgCA;AACA;AACA"}
1
+ {"version":3,"file":"types.js","names":["isMultipleApiKey","payApiKey","obj","test","undefined","production"],"sources":["../../../src/data-model/types.ts"],"sourcesContent":["import { type ComponentDef } from '~/src/components/types.js'\nimport { type Condition } from '~/src/conditions/condition.js'\nimport { type OutputType } from '~/src/data-model/enums.js'\n\ntype Toggleable<T> = boolean | T\n\nexport interface Next {\n path: string\n condition?: string\n}\nexport type Link = Next\n\nexport interface Page {\n title: string\n path: string\n controller: string\n components?: ComponentDef[]\n section: string // the section ID\n next?: { path: string; condition?: string }[]\n}\n\nexport interface RepeatingFieldPage extends Page {\n controller: 'RepeatingFieldPageController'\n options: {\n summaryDisplayMode?: {\n samePage?: boolean\n separatePage?: boolean\n hideRowTitles?: boolean\n }\n customText?: {\n separatePageTitle?: string\n }\n }\n}\n\nexport interface Section {\n name: string\n title: string\n hideTitle: boolean\n}\n\nexport interface Item {\n text: string\n value: string | number | boolean\n description?: string\n condition?: string\n}\n\nexport interface List {\n name: string\n title: string\n type: 'string' | 'number' | 'boolean'\n items: Item[]\n}\n\nexport interface Feedback {\n feedbackForm?: boolean\n url?: string\n emailAddress?: string\n}\n\nexport type PhaseBanner = {\n phase?: 'alpha' | 'beta'\n feedbackUrl?: string\n}\n\nexport type MultipleApiKeys = {\n test?: string\n production?: string\n}\n\nexport type EmailOutputConfiguration = {\n emailAddress: string\n}\n\nexport type NotifyOutputConfiguration = {\n apiKey: string\n templateId: string\n emailField: string\n personalisation: string[]\n personalisationFieldCustomisation?: {\n [personalisationName: string]: string[]\n }\n addReferencesToPersonalisation?: boolean\n emailReplyToIdConfiguration?: {\n emailReplyToId: string\n condition?: string | undefined\n }[]\n}\n\nexport type WebhookOutputConfiguration = {\n url: string\n}\n\nexport type OutputConfiguration =\n | EmailOutputConfiguration\n | NotifyOutputConfiguration\n | WebhookOutputConfiguration\n\nexport type Output = {\n name: string\n title: string\n type: OutputType\n outputConfiguration: OutputConfiguration\n}\n\nexport type ConfirmationPage = {\n customText: {\n title: string\n paymentSkipped: Toggleable<string>\n nextSteps: Toggleable<string>\n }\n components: ComponentDef[]\n}\n\nexport type PaymentSkippedWarningPage = {\n customText: {\n title: string\n caption: string\n body: string\n }\n}\n\nexport type SpecialPages = {\n confirmationPage?: ConfirmationPage\n paymentSkippedWarningPage?: PaymentSkippedWarningPage\n}\n\nexport function isMultipleApiKey(\n payApiKey: string | MultipleApiKeys | undefined\n): payApiKey is MultipleApiKeys {\n const obj = payApiKey as MultipleApiKeys\n return obj.test !== undefined || obj.production !== undefined\n}\n\nexport type Fee = {\n description: string\n amount: number\n multiplier?: string\n condition?: string\n prefix?: string\n}\n\nexport type FeeOptions = {\n paymentReferenceFormat?: string\n payReturnUrl?: string\n allowSubmissionWithoutPayment: boolean\n maxAttempts: number\n customPayErrorMessage?: string\n showPaymentSkippedWarningPage: boolean\n}\n\nexport type ConditionWrapperValue =\n | string\n | {\n name: string\n conditions: Condition[]\n }\n\nexport type ConditionRawData = {\n name: string\n displayName: string\n value: ConditionWrapperValue\n}\n\n/**\n * `FormDefinition` is a typescript representation of `Schema`\n */\nexport type FormDefinition = {\n pages: Array<Page | RepeatingFieldPage>\n conditions: ConditionRawData[]\n lists: List[]\n sections: Section[]\n startPage?: Page['path'] | undefined\n name?: string | undefined\n feedback?: Feedback\n phaseBanner?: PhaseBanner\n fees: Fee[]\n skipSummary?: boolean | undefined\n outputs: Output[]\n declaration?: string | undefined\n metadata?: Record<string, any>\n payApiKey?: string | MultipleApiKeys | undefined\n specialPages?: SpecialPages\n paymentReferenceFormat?: string\n feeOptions: FeeOptions\n}\n"],"mappings":"AAgIA,OAAO,SAASA,gBAAgBA,CAC9BC,SAA+C,EACjB;EAC9B,MAAMC,GAAG,GAAGD,SAA4B;EACxC,OAAOC,GAAG,CAACC,IAAI,KAAKC,SAAS,IAAIF,GAAG,CAACG,UAAU,KAAKD,SAAS;AAC/D;;AAgCA;AACA;AACA"}
@@ -1,8 +1,4 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.FormConfiguration = void 0;
5
- class FormConfiguration {
1
+ export class FormConfiguration {
6
2
  constructor(Key, DisplayName, LastModified, feedbackForm) {
7
3
  if (!Key) {
8
4
  throw Error('Form configuration must have a key');
@@ -13,5 +9,4 @@ class FormConfiguration {
13
9
  this.feedbackForm = feedbackForm || false;
14
10
  }
15
11
  }
16
- exports.FormConfiguration = FormConfiguration;
17
12
  //# sourceMappingURL=form-configuration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-configuration.js","names":["FormConfiguration","constructor","Key","DisplayName","LastModified","feedbackForm","Error","exports"],"sources":["../../../src/form/form-configuration.ts"],"sourcesContent":["export class FormConfiguration {\n Key: string\n DisplayName: string\n LastModified: string | undefined\n feedbackForm: boolean | undefined\n\n constructor(\n Key: string,\n DisplayName?: string,\n LastModified?: string,\n feedbackForm?: boolean\n ) {\n if (!Key) {\n throw Error('Form configuration must have a key')\n }\n this.Key = Key\n this.DisplayName = DisplayName || Key\n this.LastModified = LastModified\n this.feedbackForm = feedbackForm || false\n }\n}\n"],"mappings":";;;;AAAO,MAAMA,iBAAiB,CAAC;EAM7BC,WAAWA,CACTC,GAAW,EACXC,WAAoB,EACpBC,YAAqB,EACrBC,YAAsB,EACtB;IACA,IAAI,CAACH,GAAG,EAAE;MACR,MAAMI,KAAK,CAAC,oCAAoC,CAAC;IACnD;IACA,IAAI,CAACJ,GAAG,GAAGA,GAAG;IACd,IAAI,CAACC,WAAW,GAAGA,WAAW,IAAID,GAAG;IACrC,IAAI,CAACE,YAAY,GAAGA,YAAY;IAChC,IAAI,CAACC,YAAY,GAAGA,YAAY,IAAI,KAAK;EAC3C;AACF;AAACE,OAAA,CAAAP,iBAAA,GAAAA,iBAAA"}
1
+ {"version":3,"file":"form-configuration.js","names":["FormConfiguration","constructor","Key","DisplayName","LastModified","feedbackForm","Error"],"sources":["../../../src/form/form-configuration.ts"],"sourcesContent":["export class FormConfiguration {\n Key: string\n DisplayName: string\n LastModified: string | undefined\n feedbackForm: boolean | undefined\n\n constructor(\n Key: string,\n DisplayName?: string,\n LastModified?: string,\n feedbackForm?: boolean\n ) {\n if (!Key) {\n throw Error('Form configuration must have a key')\n }\n this.Key = Key\n this.DisplayName = DisplayName || Key\n this.LastModified = LastModified\n this.feedbackForm = feedbackForm || false\n }\n}\n"],"mappings":"AAAA,OAAO,MAAMA,iBAAiB,CAAC;EAM7BC,WAAWA,CACTC,GAAW,EACXC,WAAoB,EACpBC,YAAqB,EACrBC,YAAsB,EACtB;IACA,IAAI,CAACH,GAAG,EAAE;MACR,MAAMI,KAAK,CAAC,oCAAoC,CAAC;IACnD;IACA,IAAI,CAACJ,GAAG,GAAGA,GAAG;IACd,IAAI,CAACC,WAAW,GAAGA,WAAW,IAAID,GAAG;IACrC,IAAI,CAACE,YAAY,GAAGA,YAAY;IAChC,IAAI,CAACC,YAAY,GAAGA,YAAY,IAAI,KAAK;EAC3C;AACF"}
@@ -1,11 +1,2 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- Object.defineProperty(exports, "FormConfiguration", {
5
- enumerable: true,
6
- get: function () {
7
- return _formConfiguration.FormConfiguration;
8
- }
9
- });
10
- var _formConfiguration = require("./form-configuration");
1
+ export { FormConfiguration } from "./form-configuration.js";
11
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_formConfiguration","require"],"sources":["../../../src/form/index.ts"],"sourcesContent":["export { FormConfiguration } from '~/src/form/form-configuration'\n"],"mappings":";;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA"}
1
+ {"version":3,"file":"index.js","names":["FormConfiguration"],"sources":["../../../src/form/index.ts"],"sourcesContent":["export { FormConfiguration } from '~/src/form/form-configuration.js'\n"],"mappings":"AAAA,SAASA,iBAAiB"}
@@ -1,92 +1,9 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- var _schema = require("./schema");
5
- Object.keys(_schema).forEach(function (key) {
6
- if (key === "default" || key === "__esModule") return;
7
- if (key in exports && exports[key] === _schema[key]) return;
8
- Object.defineProperty(exports, key, {
9
- enumerable: true,
10
- get: function () {
11
- return _schema[key];
12
- }
13
- });
14
- });
15
- var _dataModel = require("./data-model");
16
- Object.keys(_dataModel).forEach(function (key) {
17
- if (key === "default" || key === "__esModule") return;
18
- if (key in exports && exports[key] === _dataModel[key]) return;
19
- Object.defineProperty(exports, key, {
20
- enumerable: true,
21
- get: function () {
22
- return _dataModel[key];
23
- }
24
- });
25
- });
26
- var _logger = require("./utils/logger");
27
- Object.keys(_logger).forEach(function (key) {
28
- if (key === "default" || key === "__esModule") return;
29
- if (key in exports && exports[key] === _logger[key]) return;
30
- Object.defineProperty(exports, key, {
31
- enumerable: true,
32
- get: function () {
33
- return _logger[key];
34
- }
35
- });
36
- });
37
- var _form = require("./form");
38
- Object.keys(_form).forEach(function (key) {
39
- if (key === "default" || key === "__esModule") return;
40
- if (key in exports && exports[key] === _form[key]) return;
41
- Object.defineProperty(exports, key, {
42
- enumerable: true,
43
- get: function () {
44
- return _form[key];
45
- }
46
- });
47
- });
48
- var _components = require("./components");
49
- Object.keys(_components).forEach(function (key) {
50
- if (key === "default" || key === "__esModule") return;
51
- if (key in exports && exports[key] === _components[key]) return;
52
- Object.defineProperty(exports, key, {
53
- enumerable: true,
54
- get: function () {
55
- return _components[key];
56
- }
57
- });
58
- });
59
- var _conditions = require("./conditions");
60
- Object.keys(_conditions).forEach(function (key) {
61
- if (key === "default" || key === "__esModule") return;
62
- if (key in exports && exports[key] === _conditions[key]) return;
63
- Object.defineProperty(exports, key, {
64
- enumerable: true,
65
- get: function () {
66
- return _conditions[key];
67
- }
68
- });
69
- });
70
- var _helpers = require("./utils/helpers");
71
- Object.keys(_helpers).forEach(function (key) {
72
- if (key === "default" || key === "__esModule") return;
73
- if (key in exports && exports[key] === _helpers[key]) return;
74
- Object.defineProperty(exports, key, {
75
- enumerable: true,
76
- get: function () {
77
- return _helpers[key];
78
- }
79
- });
80
- });
81
- var _migration = require("./migration");
82
- Object.keys(_migration).forEach(function (key) {
83
- if (key === "default" || key === "__esModule") return;
84
- if (key in exports && exports[key] === _migration[key]) return;
85
- Object.defineProperty(exports, key, {
86
- enumerable: true,
87
- get: function () {
88
- return _migration[key];
89
- }
90
- });
91
- });
1
+ export * from "./schema/index.js";
2
+ export * from "./data-model/index.js";
3
+ export * from "./utils/logger.js";
4
+ export * from "./form/index.js";
5
+ export * from "./components/index.js";
6
+ export * from "./conditions/index.js";
7
+ export * from "./utils/helpers.js";
8
+ export * from "./migration/index.js";
92
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_schema","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_dataModel","_logger","_form","_components","_conditions","_helpers","_migration"],"sources":["../../src/index.ts"],"sourcesContent":["export * from '~/src/schema'\nexport * from '~/src/data-model'\nexport * from '~/src/utils/logger'\nexport * from '~/src/form'\nexport * from '~/src/components'\nexport * from '~/src/conditions'\nexport * from '~/src/utils/helpers'\nexport * from '~/src/migration'\nexport type * from '~/src/components/types'\nexport type * from '~/src/conditions/types'\nexport type * from '~/src/data-model/types'\n"],"mappings":";;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,UAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,UAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,UAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,UAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,OAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,OAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,OAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,OAAA,CAAAN,GAAA;IAAA;EAAA;AAAA;AACA,IAAAO,KAAA,GAAAX,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAS,KAAA,EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,KAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,KAAA,CAAAP,GAAA;IAAA;EAAA;AAAA;AACA,IAAAQ,WAAA,GAAAZ,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAU,WAAA,EAAAT,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAQ,WAAA,CAAAR,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAI,WAAA,CAAAR,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,WAAA,GAAAb,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAW,WAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAS,WAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAK,WAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,QAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,QAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAU,QAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAM,QAAA,CAAAV,GAAA;IAAA;EAAA;AAAA;AACA,IAAAW,UAAA,GAAAf,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAa,UAAA,EAAAZ,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAW,UAAA,CAAAX,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAO,UAAA,CAAAX,GAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/index.ts"],"sourcesContent":["export * from '~/src/schema/index.js'\nexport * from '~/src/data-model/index.js'\nexport * from '~/src/utils/logger.js'\nexport * from '~/src/form/index.js'\nexport * from '~/src/components/index.js'\nexport * from '~/src/conditions/index.js'\nexport * from '~/src/utils/helpers.js'\nexport * from '~/src/migration/index.js'\nexport type * from '~/src/components/types.js'\nexport type * from '~/src/conditions/types.js'\nexport type * from '~/src/data-model/types.js'\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
@@ -1,11 +1,2 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- Object.defineProperty(exports, "whichMigrations", {
5
- enumerable: true,
6
- get: function () {
7
- return _whichMigrations.whichMigrations;
8
- }
9
- });
10
- var _whichMigrations = require("./whichMigrations");
1
+ export { whichMigrations } from "./whichMigrations.js";
11
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_whichMigrations","require"],"sources":["../../../src/migration/index.ts"],"sourcesContent":["export { whichMigrations } from '~/src/migration/whichMigrations'\n"],"mappings":";;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA"}
1
+ {"version":3,"file":"index.js","names":["whichMigrations"],"sources":["../../../src/migration/index.ts"],"sourcesContent":["export { whichMigrations } from '~/src/migration/whichMigrations.js'\n"],"mappings":"AAAA,SAASA,eAAe"}
@@ -1,11 +1,7 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.migrate = migrate;
5
1
  function needsUpgrade(data) {
6
2
  return !!(data.pages ?? []).flatMap(page => page.components).find(component => component.options?.list);
7
3
  }
8
- function migrate(data) {
4
+ export function migrate(data) {
9
5
  if (!needsUpgrade(data)) {
10
6
  return {
11
7
  ...data,
@@ -1 +1 @@
1
- {"version":3,"file":"migration.0-2.js","names":["needsUpgrade","data","pages","flatMap","page","components","find","component","options","list","migrate","version","newPages","map","rest"],"sources":["../../../src/migration/migration.0-2.ts"],"sourcesContent":["import { type MigrationScript } from '~/src/migration/types'\n\nfunction needsUpgrade(data) {\n return !!(data.pages ?? [])\n .flatMap((page) => page.components)\n .find((component) => component.options?.list)\n}\n\nexport function migrate(data): MigrationScript {\n if (!needsUpgrade(data)) {\n return { ...data, version: 2 }\n }\n const { pages } = data\n const newPages = pages.flatMap((page) => {\n return page.components.map((component) => {\n if (!component.options?.list) {\n return component\n }\n const { list, ...rest } = component.options\n return { ...component, list, options: { ...rest } }\n })\n })\n\n return {\n ...data,\n pages: newPages,\n version: 2\n }\n}\n"],"mappings":";;;;AAEA,SAASA,YAAYA,CAACC,IAAI,EAAE;EAC1B,OAAO,CAAC,CAAC,CAACA,IAAI,CAACC,KAAK,IAAI,EAAE,EACvBC,OAAO,CAAEC,IAAI,IAAKA,IAAI,CAACC,UAAU,CAAC,CAClCC,IAAI,CAAEC,SAAS,IAAKA,SAAS,CAACC,OAAO,EAAEC,IAAI,CAAC;AACjD;AAEO,SAASC,OAAOA,CAACT,IAAI,EAAmB;EAC7C,IAAI,CAACD,YAAY,CAACC,IAAI,CAAC,EAAE;IACvB,OAAO;MAAE,GAAGA,IAAI;MAAEU,OAAO,EAAE;IAAE,CAAC;EAChC;EACA,MAAM;IAAET;EAAM,CAAC,GAAGD,IAAI;EACtB,MAAMW,QAAQ,GAAGV,KAAK,CAACC,OAAO,CAAEC,IAAI,IAAK;IACvC,OAAOA,IAAI,CAACC,UAAU,CAACQ,GAAG,CAAEN,SAAS,IAAK;MACxC,IAAI,CAACA,SAAS,CAACC,OAAO,EAAEC,IAAI,EAAE;QAC5B,OAAOF,SAAS;MAClB;MACA,MAAM;QAAEE,IAAI;QAAE,GAAGK;MAAK,CAAC,GAAGP,SAAS,CAACC,OAAO;MAC3C,OAAO;QAAE,GAAGD,SAAS;QAAEE,IAAI;QAAED,OAAO,EAAE;UAAE,GAAGM;QAAK;MAAE,CAAC;IACrD,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAO;IACL,GAAGb,IAAI;IACPC,KAAK,EAAEU,QAAQ;IACfD,OAAO,EAAE;EACX,CAAC;AACH"}
1
+ {"version":3,"file":"migration.0-2.js","names":["needsUpgrade","data","pages","flatMap","page","components","find","component","options","list","migrate","version","newPages","map","rest"],"sources":["../../../src/migration/migration.0-2.ts"],"sourcesContent":["import { type MigrationScript } from '~/src/migration/types.js'\n\nfunction needsUpgrade(data) {\n return !!(data.pages ?? [])\n .flatMap((page) => page.components)\n .find((component) => component.options?.list)\n}\n\nexport function migrate(data): MigrationScript {\n if (!needsUpgrade(data)) {\n return { ...data, version: 2 }\n }\n const { pages } = data\n const newPages = pages.flatMap((page) => {\n return page.components.map((component) => {\n if (!component.options?.list) {\n return component\n }\n const { list, ...rest } = component.options\n return { ...component, list, options: { ...rest } }\n })\n })\n\n return {\n ...data,\n pages: newPages,\n version: 2\n }\n}\n"],"mappings":"AAEA,SAASA,YAAYA,CAACC,IAAI,EAAE;EAC1B,OAAO,CAAC,CAAC,CAACA,IAAI,CAACC,KAAK,IAAI,EAAE,EACvBC,OAAO,CAAEC,IAAI,IAAKA,IAAI,CAACC,UAAU,CAAC,CAClCC,IAAI,CAAEC,SAAS,IAAKA,SAAS,CAACC,OAAO,EAAEC,IAAI,CAAC;AACjD;AAEA,OAAO,SAASC,OAAOA,CAACT,IAAI,EAAmB;EAC7C,IAAI,CAACD,YAAY,CAACC,IAAI,CAAC,EAAE;IACvB,OAAO;MAAE,GAAGA,IAAI;MAAEU,OAAO,EAAE;IAAE,CAAC;EAChC;EACA,MAAM;IAAET;EAAM,CAAC,GAAGD,IAAI;EACtB,MAAMW,QAAQ,GAAGV,KAAK,CAACC,OAAO,CAAEC,IAAI,IAAK;IACvC,OAAOA,IAAI,CAACC,UAAU,CAACQ,GAAG,CAAEN,SAAS,IAAK;MACxC,IAAI,CAACA,SAAS,CAACC,OAAO,EAAEC,IAAI,EAAE;QAC5B,OAAOF,SAAS;MAClB;MACA,MAAM;QAAEE,IAAI;QAAE,GAAGK;MAAK,CAAC,GAAGP,SAAS,CAACC,OAAO;MAC3C,OAAO;QAAE,GAAGD,SAAS;QAAEE,IAAI;QAAED,OAAO,EAAE;UAAE,GAAGM;QAAK;MAAE,CAAC;IACrD,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAO;IACL,GAAGb,IAAI;IACPC,KAAK,EAAEU,QAAQ;IACfD,OAAO,EAAE;EACX,CAAC;AACH"}
@@ -1,8 +1,5 @@
1
- "use strict";
1
+ import { nanoid } from "../utils/helpers.js";
2
2
 
3
- exports.__esModule = true;
4
- exports.migrate = migrate;
5
- var _helpers = require("../utils/helpers");
6
3
  /**
7
4
  * @private
8
5
  * StaticItem is a deprecated Type.
@@ -38,7 +35,7 @@ function addListId(component) {
38
35
  } = component;
39
36
  return {
40
37
  ...component,
41
- list: values.type === 'listRef' ? values.list : (0, _helpers.nanoid)()
38
+ list: values.type === 'listRef' ? values.list : nanoid()
42
39
  };
43
40
  }
44
41
  function migratePage(page) {
@@ -64,7 +61,7 @@ function removeValues(page) {
64
61
  function needsUpgrade(data) {
65
62
  return !!data.pages.flatMap(page => page.components).find(component => component.values);
66
63
  }
67
- function migrate(data) {
64
+ export function migrate(data) {
68
65
  if (!needsUpgrade(data)) {
69
66
  return {
70
67
  ...data,
@@ -1 +1 @@
1
- {"version":3,"file":"migration.1-2.js","names":["_helpers","require","recastItem","label","value","condition","hint","item","title","conditions","addListId","component","values","list","type","nanoid","migratePage","page","components","map","removeValues","rest","needsUpgrade","data","pages","flatMap","find","migrate","version","componentsWithList","filter","c","items","valuesAsLists","name","lists"],"sources":["../../../src/migration/migration.1-2.ts"],"sourcesContent":["import { nanoid } from '~/src/utils/helpers'\nimport { type MigrationScript } from '~/src/migration/types'\n\n/**\n * @private\n * StaticItem is a deprecated Type.\n * It should only be used for aiding migration scripts.\n */\ntype StaticItem = {\n label: string\n value: string | number | boolean\n hint?: string\n condition?: string\n}\n\n/**\n * @private\n * StaticComponentValues is a deprecated Type.\n * It should only be used for aiding migration scripts.\n */\ntype StaticComponentValues = {\n list: any\n type: 'static' | 'listRef'\n valueType: string | number\n items: StaticItem[]\n}\n\ntype Item = {\n title: string\n value: any\n conditions?: any\n hint?: string\n}\n\nfunction recastItem({ label, value, condition, hint }: StaticItem) {\n const item: Item = {\n title: label,\n value\n }\n\n condition && (item.conditions = condition)\n hint && (item.hint = hint)\n return item\n}\n\nfunction addListId(component: { values: StaticComponentValues }) {\n if (!component.values) {\n return component\n }\n const { values } = component\n return {\n ...component,\n list: values.type === 'listRef' ? values.list : nanoid()\n }\n}\n\nfunction migratePage(page) {\n return {\n ...page,\n components: page.components.map(addListId)\n }\n}\n\nfunction removeValues(page) {\n return {\n ...page,\n components: page.components.map((component) => {\n const { values, ...rest } = component\n return {\n ...rest\n }\n })\n }\n}\n\nfunction needsUpgrade(data) {\n return !!data.pages\n .flatMap((page) => page.components)\n .find((component) => component.values)\n}\n\nexport function migrate(data): MigrationScript {\n if (!needsUpgrade(data)) {\n return { ...data, version: 2 }\n }\n const pages = data.pages.map(migratePage)\n const componentsWithList = pages.flatMap((page) =>\n page.components.filter((c) => c.values?.items)\n )\n\n const valuesAsLists = componentsWithList.map((component) => {\n return {\n title: component.title,\n name: component.list,\n items: component.values.items.map((item) => recastItem(item))\n }\n })\n\n return {\n ...data,\n pages: pages.map(removeValues),\n lists: [...(data.lists ?? []), ...valuesAsLists],\n version: 2\n }\n}\n"],"mappings":";;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAGA;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;;AAeA,SAASC,UAAUA,CAAC;EAAEC,KAAK;EAAEC,KAAK;EAAEC,SAAS;EAAEC;AAAiB,CAAC,EAAE;EACjE,MAAMC,IAAU,GAAG;IACjBC,KAAK,EAAEL,KAAK;IACZC;EACF,CAAC;EAEDC,SAAS,KAAKE,IAAI,CAACE,UAAU,GAAGJ,SAAS,CAAC;EAC1CC,IAAI,KAAKC,IAAI,CAACD,IAAI,GAAGA,IAAI,CAAC;EAC1B,OAAOC,IAAI;AACb;AAEA,SAASG,SAASA,CAACC,SAA4C,EAAE;EAC/D,IAAI,CAACA,SAAS,CAACC,MAAM,EAAE;IACrB,OAAOD,SAAS;EAClB;EACA,MAAM;IAAEC;EAAO,CAAC,GAAGD,SAAS;EAC5B,OAAO;IACL,GAAGA,SAAS;IACZE,IAAI,EAAED,MAAM,CAACE,IAAI,KAAK,SAAS,GAAGF,MAAM,CAACC,IAAI,GAAG,IAAAE,eAAM,EAAC;EACzD,CAAC;AACH;AAEA,SAASC,WAAWA,CAACC,IAAI,EAAE;EACzB,OAAO;IACL,GAAGA,IAAI;IACPC,UAAU,EAAED,IAAI,CAACC,UAAU,CAACC,GAAG,CAACT,SAAS;EAC3C,CAAC;AACH;AAEA,SAASU,YAAYA,CAACH,IAAI,EAAE;EAC1B,OAAO;IACL,GAAGA,IAAI;IACPC,UAAU,EAAED,IAAI,CAACC,UAAU,CAACC,GAAG,CAAER,SAAS,IAAK;MAC7C,MAAM;QAAEC,MAAM;QAAE,GAAGS;MAAK,CAAC,GAAGV,SAAS;MACrC,OAAO;QACL,GAAGU;MACL,CAAC;IACH,CAAC;EACH,CAAC;AACH;AAEA,SAASC,YAAYA,CAACC,IAAI,EAAE;EAC1B,OAAO,CAAC,CAACA,IAAI,CAACC,KAAK,CAChBC,OAAO,CAAER,IAAI,IAAKA,IAAI,CAACC,UAAU,CAAC,CAClCQ,IAAI,CAAEf,SAAS,IAAKA,SAAS,CAACC,MAAM,CAAC;AAC1C;AAEO,SAASe,OAAOA,CAACJ,IAAI,EAAmB;EAC7C,IAAI,CAACD,YAAY,CAACC,IAAI,CAAC,EAAE;IACvB,OAAO;MAAE,GAAGA,IAAI;MAAEK,OAAO,EAAE;IAAE,CAAC;EAChC;EACA,MAAMJ,KAAK,GAAGD,IAAI,CAACC,KAAK,CAACL,GAAG,CAACH,WAAW,CAAC;EACzC,MAAMa,kBAAkB,GAAGL,KAAK,CAACC,OAAO,CAAER,IAAI,IAC5CA,IAAI,CAACC,UAAU,CAACY,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACnB,MAAM,EAAEoB,KAAK,CAC/C,CAAC;EAED,MAAMC,aAAa,GAAGJ,kBAAkB,CAACV,GAAG,CAAER,SAAS,IAAK;IAC1D,OAAO;MACLH,KAAK,EAAEG,SAAS,CAACH,KAAK;MACtB0B,IAAI,EAAEvB,SAAS,CAACE,IAAI;MACpBmB,KAAK,EAAErB,SAAS,CAACC,MAAM,CAACoB,KAAK,CAACb,GAAG,CAAEZ,IAAI,IAAKL,UAAU,CAACK,IAAI,CAAC;IAC9D,CAAC;EACH,CAAC,CAAC;EAEF,OAAO;IACL,GAAGgB,IAAI;IACPC,KAAK,EAAEA,KAAK,CAACL,GAAG,CAACC,YAAY,CAAC;IAC9Be,KAAK,EAAE,CAAC,IAAIZ,IAAI,CAACY,KAAK,IAAI,EAAE,CAAC,EAAE,GAAGF,aAAa,CAAC;IAChDL,OAAO,EAAE;EACX,CAAC;AACH"}
1
+ {"version":3,"file":"migration.1-2.js","names":["nanoid","recastItem","label","value","condition","hint","item","title","conditions","addListId","component","values","list","type","migratePage","page","components","map","removeValues","rest","needsUpgrade","data","pages","flatMap","find","migrate","version","componentsWithList","filter","c","items","valuesAsLists","name","lists"],"sources":["../../../src/migration/migration.1-2.ts"],"sourcesContent":["import { nanoid } from '~/src/utils/helpers.js'\nimport { type MigrationScript } from '~/src/migration/types.js'\n\n/**\n * @private\n * StaticItem is a deprecated Type.\n * It should only be used for aiding migration scripts.\n */\ntype StaticItem = {\n label: string\n value: string | number | boolean\n hint?: string\n condition?: string\n}\n\n/**\n * @private\n * StaticComponentValues is a deprecated Type.\n * It should only be used for aiding migration scripts.\n */\ntype StaticComponentValues = {\n list: any\n type: 'static' | 'listRef'\n valueType: string | number\n items: StaticItem[]\n}\n\ntype Item = {\n title: string\n value: any\n conditions?: any\n hint?: string\n}\n\nfunction recastItem({ label, value, condition, hint }: StaticItem) {\n const item: Item = {\n title: label,\n value\n }\n\n condition && (item.conditions = condition)\n hint && (item.hint = hint)\n return item\n}\n\nfunction addListId(component: { values: StaticComponentValues }) {\n if (!component.values) {\n return component\n }\n const { values } = component\n return {\n ...component,\n list: values.type === 'listRef' ? values.list : nanoid()\n }\n}\n\nfunction migratePage(page) {\n return {\n ...page,\n components: page.components.map(addListId)\n }\n}\n\nfunction removeValues(page) {\n return {\n ...page,\n components: page.components.map((component) => {\n const { values, ...rest } = component\n return {\n ...rest\n }\n })\n }\n}\n\nfunction needsUpgrade(data) {\n return !!data.pages\n .flatMap((page) => page.components)\n .find((component) => component.values)\n}\n\nexport function migrate(data): MigrationScript {\n if (!needsUpgrade(data)) {\n return { ...data, version: 2 }\n }\n const pages = data.pages.map(migratePage)\n const componentsWithList = pages.flatMap((page) =>\n page.components.filter((c) => c.values?.items)\n )\n\n const valuesAsLists = componentsWithList.map((component) => {\n return {\n title: component.title,\n name: component.list,\n items: component.values.items.map((item) => recastItem(item))\n }\n })\n\n return {\n ...data,\n pages: pages.map(removeValues),\n lists: [...(data.lists ?? []), ...valuesAsLists],\n version: 2\n }\n}\n"],"mappings":"AAAA,SAASA,MAAM;;AAGf;AACA;AACA;AACA;AACA;;AAQA;AACA;AACA;AACA;AACA;;AAeA,SAASC,UAAUA,CAAC;EAAEC,KAAK;EAAEC,KAAK;EAAEC,SAAS;EAAEC;AAAiB,CAAC,EAAE;EACjE,MAAMC,IAAU,GAAG;IACjBC,KAAK,EAAEL,KAAK;IACZC;EACF,CAAC;EAEDC,SAAS,KAAKE,IAAI,CAACE,UAAU,GAAGJ,SAAS,CAAC;EAC1CC,IAAI,KAAKC,IAAI,CAACD,IAAI,GAAGA,IAAI,CAAC;EAC1B,OAAOC,IAAI;AACb;AAEA,SAASG,SAASA,CAACC,SAA4C,EAAE;EAC/D,IAAI,CAACA,SAAS,CAACC,MAAM,EAAE;IACrB,OAAOD,SAAS;EAClB;EACA,MAAM;IAAEC;EAAO,CAAC,GAAGD,SAAS;EAC5B,OAAO;IACL,GAAGA,SAAS;IACZE,IAAI,EAAED,MAAM,CAACE,IAAI,KAAK,SAAS,GAAGF,MAAM,CAACC,IAAI,GAAGZ,MAAM,CAAC;EACzD,CAAC;AACH;AAEA,SAASc,WAAWA,CAACC,IAAI,EAAE;EACzB,OAAO;IACL,GAAGA,IAAI;IACPC,UAAU,EAAED,IAAI,CAACC,UAAU,CAACC,GAAG,CAACR,SAAS;EAC3C,CAAC;AACH;AAEA,SAASS,YAAYA,CAACH,IAAI,EAAE;EAC1B,OAAO;IACL,GAAGA,IAAI;IACPC,UAAU,EAAED,IAAI,CAACC,UAAU,CAACC,GAAG,CAAEP,SAAS,IAAK;MAC7C,MAAM;QAAEC,MAAM;QAAE,GAAGQ;MAAK,CAAC,GAAGT,SAAS;MACrC,OAAO;QACL,GAAGS;MACL,CAAC;IACH,CAAC;EACH,CAAC;AACH;AAEA,SAASC,YAAYA,CAACC,IAAI,EAAE;EAC1B,OAAO,CAAC,CAACA,IAAI,CAACC,KAAK,CAChBC,OAAO,CAAER,IAAI,IAAKA,IAAI,CAACC,UAAU,CAAC,CAClCQ,IAAI,CAAEd,SAAS,IAAKA,SAAS,CAACC,MAAM,CAAC;AAC1C;AAEA,OAAO,SAASc,OAAOA,CAACJ,IAAI,EAAmB;EAC7C,IAAI,CAACD,YAAY,CAACC,IAAI,CAAC,EAAE;IACvB,OAAO;MAAE,GAAGA,IAAI;MAAEK,OAAO,EAAE;IAAE,CAAC;EAChC;EACA,MAAMJ,KAAK,GAAGD,IAAI,CAACC,KAAK,CAACL,GAAG,CAACH,WAAW,CAAC;EACzC,MAAMa,kBAAkB,GAAGL,KAAK,CAACC,OAAO,CAAER,IAAI,IAC5CA,IAAI,CAACC,UAAU,CAACY,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAAClB,MAAM,EAAEmB,KAAK,CAC/C,CAAC;EAED,MAAMC,aAAa,GAAGJ,kBAAkB,CAACV,GAAG,CAAEP,SAAS,IAAK;IAC1D,OAAO;MACLH,KAAK,EAAEG,SAAS,CAACH,KAAK;MACtByB,IAAI,EAAEtB,SAAS,CAACE,IAAI;MACpBkB,KAAK,EAAEpB,SAAS,CAACC,MAAM,CAACmB,KAAK,CAACb,GAAG,CAAEX,IAAI,IAAKL,UAAU,CAACK,IAAI,CAAC;IAC9D,CAAC;EACH,CAAC,CAAC;EAEF,OAAO;IACL,GAAGe,IAAI;IACPC,KAAK,EAAEA,KAAK,CAACL,GAAG,CAACC,YAAY,CAAC;IAC9Be,KAAK,EAAE,CAAC,IAAIZ,IAAI,CAACY,KAAK,IAAI,EAAE,CAAC,EAAE,GAAGF,aAAa,CAAC;IAChDL,OAAO,EAAE;EACX,CAAC;AACH"}
@@ -1,2 +1,2 @@
1
- "use strict";
1
+ export {};
2
2
  //# sourceMappingURL=types.js.map
@@ -1,24 +1,20 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.whichMigrations = whichMigrations;
5
- var _migration = require("./migration.0-2");
6
- var _migration2 = require("./migration.1-2");
1
+ import { migrate as V0_TO_V2 } from "./migration.0-2.js";
2
+ import { migrate as V1_TO_V2 } from "./migration.1-2.js";
7
3
  /**
8
4
  * Returns which migrations that should be run against your Object with the given version
9
5
  * @param version
10
6
  */
11
- function whichMigrations(version) {
7
+ export function whichMigrations(version) {
12
8
  const migrations = new Set();
13
9
  switch (version) {
14
10
  case 0:
15
- migrations.add(_migration.migrate);
11
+ migrations.add(V0_TO_V2);
16
12
  /**
17
13
  * we are skipping v1 entirely. If we weren't you would do migrations.add([V1_TO_V2, V2_TO_V3]) for example.
18
14
  */
19
15
  break;
20
16
  case 1:
21
- migrations.add(_migration2.migrate);
17
+ migrations.add(V1_TO_V2);
22
18
  break;
23
19
  }
24
20
  return migrations;
@@ -1 +1 @@
1
- {"version":3,"file":"whichMigrations.js","names":["_migration","require","_migration2","whichMigrations","version","migrations","Set","add","V0_TO_V2","V1_TO_V2"],"sources":["../../../src/migration/whichMigrations.ts"],"sourcesContent":["import { migrate as V0_TO_V2 } from '~/src/migration/migration.0-2'\nimport { migrate as V1_TO_V2 } from '~/src/migration/migration.1-2'\nimport { type MigrationScript } from '~/src/migration/types'\n\n/**\n * Returns which migrations that should be run against your Object with the given version\n * @param version\n */\nexport function whichMigrations(version: number) {\n const migrations = new Set<MigrationScript>()\n switch (version) {\n case 0:\n migrations.add(V0_TO_V2)\n /**\n * we are skipping v1 entirely. If we weren't you would do migrations.add([V1_TO_V2, V2_TO_V3]) for example.\n */\n break\n case 1:\n migrations.add(V1_TO_V2)\n break\n }\n return migrations\n}\n"],"mappings":";;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAGA;AACA;AACA;AACA;AACO,SAASE,eAAeA,CAACC,OAAe,EAAE;EAC/C,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAAkB,CAAC;EAC7C,QAAQF,OAAO;IACb,KAAK,CAAC;MACJC,UAAU,CAACE,GAAG,CAACC,kBAAQ,CAAC;MACxB;AACN;AACA;MACM;IACF,KAAK,CAAC;MACJH,UAAU,CAACE,GAAG,CAACE,mBAAQ,CAAC;MACxB;EACJ;EACA,OAAOJ,UAAU;AACnB"}
1
+ {"version":3,"file":"whichMigrations.js","names":["migrate","V0_TO_V2","V1_TO_V2","whichMigrations","version","migrations","Set","add"],"sources":["../../../src/migration/whichMigrations.ts"],"sourcesContent":["import { migrate as V0_TO_V2 } from '~/src/migration/migration.0-2.js'\nimport { migrate as V1_TO_V2 } from '~/src/migration/migration.1-2.js'\nimport { type MigrationScript } from '~/src/migration/types.js'\n\n/**\n * Returns which migrations that should be run against your Object with the given version\n * @param version\n */\nexport function whichMigrations(version: number) {\n const migrations = new Set<MigrationScript>()\n switch (version) {\n case 0:\n migrations.add(V0_TO_V2)\n /**\n * we are skipping v1 entirely. If we weren't you would do migrations.add([V1_TO_V2, V2_TO_V3]) for example.\n */\n break\n case 1:\n migrations.add(V1_TO_V2)\n break\n }\n return migrations\n}\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,QAAQ;AAC5B,SAASD,OAAO,IAAIE,QAAQ;AAG5B;AACA;AACA;AACA;AACA,OAAO,SAASC,eAAeA,CAACC,OAAe,EAAE;EAC/C,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAAkB,CAAC;EAC7C,QAAQF,OAAO;IACb,KAAK,CAAC;MACJC,UAAU,CAACE,GAAG,CAACN,QAAQ,CAAC;MACxB;AACN;AACA;MACM;IACF,KAAK,CAAC;MACJI,UAAU,CAACE,GAAG,CAACL,QAAQ,CAAC;MACxB;EACJ;EACA,OAAOG,UAAU;AACnB"}
@@ -1,17 +1,2 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- Object.defineProperty(exports, "Schema", {
5
- enumerable: true,
6
- get: function () {
7
- return _schema.Schema;
8
- }
9
- });
10
- Object.defineProperty(exports, "componentSchema", {
11
- enumerable: true,
12
- get: function () {
13
- return _schema.componentSchema;
14
- }
15
- });
16
- var _schema = require("./schema");
1
+ export { Schema, componentSchema } from "./schema.js";
17
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_schema","require"],"sources":["../../../src/schema/index.ts"],"sourcesContent":["export { Schema, componentSchema } from '~/src/schema/schema'\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA"}
1
+ {"version":3,"file":"index.js","names":["Schema","componentSchema"],"sources":["../../../src/schema/index.ts"],"sourcesContent":["export { Schema, componentSchema } from '~/src/schema/schema.js'\n"],"mappings":"AAAA,SAASA,MAAM,EAAEC,eAAe"}