@apollo-annotation/shared 0.3.10 → 0.3.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 (247) hide show
  1. package/dist/Changes/AddAssemblyAliasesChange.d.ts +1 -0
  2. package/dist/Changes/AddAssemblyAliasesChange.d.ts.map +1 -0
  3. package/dist/Changes/AddAssemblyAliasesChange.js +7 -9
  4. package/dist/Changes/AddAssemblyAliasesChange.js.map +1 -1
  5. package/dist/Changes/AddAssemblyAndFeaturesFromFileChange.d.ts +5 -3
  6. package/dist/Changes/AddAssemblyAndFeaturesFromFileChange.d.ts.map +1 -0
  7. package/dist/Changes/AddAssemblyAndFeaturesFromFileChange.js +31 -13
  8. package/dist/Changes/AddAssemblyAndFeaturesFromFileChange.js.map +1 -1
  9. package/dist/Changes/AddAssemblyFromExternalChange.d.ts +1 -0
  10. package/dist/Changes/AddAssemblyFromExternalChange.d.ts.map +1 -0
  11. package/dist/Changes/AddAssemblyFromExternalChange.js +13 -16
  12. package/dist/Changes/AddAssemblyFromExternalChange.js.map +1 -1
  13. package/dist/Changes/AddAssemblyFromFileChange.d.ts +3 -2
  14. package/dist/Changes/AddAssemblyFromFileChange.d.ts.map +1 -0
  15. package/dist/Changes/AddAssemblyFromFileChange.js +4 -8
  16. package/dist/Changes/AddAssemblyFromFileChange.js.map +1 -1
  17. package/dist/Changes/AddFeatureChange.d.ts +3 -2
  18. package/dist/Changes/AddFeatureChange.d.ts.map +1 -0
  19. package/dist/Changes/AddFeatureChange.js +11 -11
  20. package/dist/Changes/AddFeatureChange.js.map +1 -1
  21. package/dist/Changes/AddFeaturesFromFileChange.d.ts +5 -3
  22. package/dist/Changes/AddFeaturesFromFileChange.d.ts.map +1 -0
  23. package/dist/Changes/AddFeaturesFromFileChange.js +27 -14
  24. package/dist/Changes/AddFeaturesFromFileChange.js.map +1 -1
  25. package/dist/Changes/AddRefSeqAliasesChange.d.ts +1 -0
  26. package/dist/Changes/AddRefSeqAliasesChange.d.ts.map +1 -0
  27. package/dist/Changes/AddRefSeqAliasesChange.js +7 -8
  28. package/dist/Changes/AddRefSeqAliasesChange.js.map +1 -1
  29. package/dist/Changes/DeleteAssemblyChange.d.ts +1 -0
  30. package/dist/Changes/DeleteAssemblyChange.d.ts.map +1 -0
  31. package/dist/Changes/DeleteAssemblyChange.js +5 -8
  32. package/dist/Changes/DeleteAssemblyChange.js.map +1 -1
  33. package/dist/Changes/DeleteFeatureChange.d.ts +4 -3
  34. package/dist/Changes/DeleteFeatureChange.d.ts.map +1 -0
  35. package/dist/Changes/DeleteFeatureChange.js +25 -12
  36. package/dist/Changes/DeleteFeatureChange.js.map +1 -1
  37. package/dist/Changes/DeleteUserChange.d.ts +1 -0
  38. package/dist/Changes/DeleteUserChange.d.ts.map +1 -0
  39. package/dist/Changes/DeleteUserChange.js +2 -6
  40. package/dist/Changes/DeleteUserChange.js.map +1 -1
  41. package/dist/Changes/FeatureAttributeChange.d.ts +1 -0
  42. package/dist/Changes/FeatureAttributeChange.d.ts.map +1 -0
  43. package/dist/Changes/FeatureAttributeChange.js +14 -8
  44. package/dist/Changes/FeatureAttributeChange.js.map +1 -1
  45. package/dist/Changes/FromFileBaseChange.d.ts +4 -3
  46. package/dist/Changes/FromFileBaseChange.d.ts.map +1 -0
  47. package/dist/Changes/FromFileBaseChange.js +4 -10
  48. package/dist/Changes/FromFileBaseChange.js.map +1 -1
  49. package/dist/Changes/ImportJBrowseConfigChange.d.ts +1 -0
  50. package/dist/Changes/ImportJBrowseConfigChange.d.ts.map +1 -0
  51. package/dist/Changes/ImportJBrowseConfigChange.js +3 -8
  52. package/dist/Changes/ImportJBrowseConfigChange.js.map +1 -1
  53. package/dist/Changes/LocationEndChange.d.ts +1 -0
  54. package/dist/Changes/LocationEndChange.d.ts.map +1 -0
  55. package/dist/Changes/LocationEndChange.js +3 -8
  56. package/dist/Changes/LocationEndChange.js.map +1 -1
  57. package/dist/Changes/LocationStartChange.d.ts +1 -0
  58. package/dist/Changes/LocationStartChange.d.ts.map +1 -0
  59. package/dist/Changes/LocationStartChange.js +3 -8
  60. package/dist/Changes/LocationStartChange.js.map +1 -1
  61. package/dist/Changes/MergeExonsChange.d.ts +3 -2
  62. package/dist/Changes/MergeExonsChange.d.ts.map +1 -0
  63. package/dist/Changes/MergeExonsChange.js +9 -13
  64. package/dist/Changes/MergeExonsChange.js.map +1 -1
  65. package/dist/Changes/MergeTranscriptsChange.d.ts +4 -3
  66. package/dist/Changes/MergeTranscriptsChange.d.ts.map +1 -0
  67. package/dist/Changes/MergeTranscriptsChange.js +20 -24
  68. package/dist/Changes/MergeTranscriptsChange.js.map +1 -1
  69. package/dist/Changes/SplitExonChange.d.ts +3 -2
  70. package/dist/Changes/SplitExonChange.d.ts.map +1 -0
  71. package/dist/Changes/SplitExonChange.js +6 -10
  72. package/dist/Changes/SplitExonChange.js.map +1 -1
  73. package/dist/Changes/StrandChange.d.ts +1 -0
  74. package/dist/Changes/StrandChange.d.ts.map +1 -0
  75. package/dist/Changes/StrandChange.js +2 -6
  76. package/dist/Changes/StrandChange.js.map +1 -1
  77. package/dist/Changes/TypeChange.d.ts +1 -0
  78. package/dist/Changes/TypeChange.d.ts.map +1 -0
  79. package/dist/Changes/TypeChange.js +2 -6
  80. package/dist/Changes/TypeChange.js.map +1 -1
  81. package/dist/Changes/UndoMergeExonsChange.d.ts +3 -2
  82. package/dist/Changes/UndoMergeExonsChange.d.ts.map +1 -0
  83. package/dist/Changes/UndoMergeExonsChange.js +4 -8
  84. package/dist/Changes/UndoMergeExonsChange.js.map +1 -1
  85. package/dist/Changes/UndoMergeTranscriptsChange.d.ts +3 -2
  86. package/dist/Changes/UndoMergeTranscriptsChange.d.ts.map +1 -0
  87. package/dist/Changes/UndoMergeTranscriptsChange.js +4 -8
  88. package/dist/Changes/UndoMergeTranscriptsChange.js.map +1 -1
  89. package/dist/Changes/UndoSplitExonChange.d.ts +3 -2
  90. package/dist/Changes/UndoSplitExonChange.d.ts.map +1 -0
  91. package/dist/Changes/UndoSplitExonChange.js +6 -10
  92. package/dist/Changes/UndoSplitExonChange.js.map +1 -1
  93. package/dist/Changes/UserChange.d.ts +1 -0
  94. package/dist/Changes/UserChange.d.ts.map +1 -0
  95. package/dist/Changes/UserChange.js +2 -6
  96. package/dist/Changes/UserChange.js.map +1 -1
  97. package/dist/Changes/index.d.ts +47 -46
  98. package/dist/Changes/index.d.ts.map +1 -0
  99. package/dist/Changes/index.js +70 -74
  100. package/dist/Changes/index.js.map +1 -1
  101. package/dist/Checks/CDSCheck.d.ts +2 -1
  102. package/dist/Checks/CDSCheck.d.ts.map +1 -0
  103. package/dist/Checks/CDSCheck.js +17 -26
  104. package/dist/Checks/CDSCheck.js.map +1 -1
  105. package/dist/Checks/TranscriptCheck.d.ts +2 -1
  106. package/dist/Checks/TranscriptCheck.d.ts.map +1 -0
  107. package/dist/Checks/TranscriptCheck.js +11 -16
  108. package/dist/Checks/TranscriptCheck.js.map +1 -1
  109. package/dist/Checks/index.d.ts +3 -2
  110. package/dist/Checks/index.d.ts.map +1 -0
  111. package/dist/Checks/index.js +2 -5
  112. package/dist/Checks/index.js.map +1 -1
  113. package/dist/Checks/util.d.ts +2 -1
  114. package/dist/Checks/util.d.ts.map +1 -0
  115. package/dist/Checks/util.js +1 -4
  116. package/dist/Checks/util.js.map +1 -1
  117. package/dist/Common/index.d.ts +2 -1
  118. package/dist/Common/index.d.ts.map +1 -0
  119. package/dist/Common/index.js +1 -4
  120. package/dist/Common/index.js.map +1 -1
  121. package/dist/Common/jwtPayload.d.ts +1 -0
  122. package/dist/Common/jwtPayload.d.ts.map +1 -0
  123. package/dist/Common/jwtPayload.js +5 -10
  124. package/dist/Common/jwtPayload.js.map +1 -1
  125. package/dist/GFF3/annotationFeatureToGFF3.d.ts +3 -2
  126. package/dist/GFF3/annotationFeatureToGFF3.d.ts.map +1 -0
  127. package/dist/GFF3/annotationFeatureToGFF3.js +96 -93
  128. package/dist/GFF3/annotationFeatureToGFF3.js.map +1 -1
  129. package/dist/GFF3/annotationFeatureToGFF3.test.d.ts +1 -0
  130. package/dist/GFF3/annotationFeatureToGFF3.test.d.ts.map +1 -0
  131. package/dist/GFF3/annotationFeatureToGFF3.test.js +77 -79
  132. package/dist/GFF3/annotationFeatureToGFF3.test.js.map +1 -1
  133. package/dist/GFF3/gff3ToAnnotationFeature.d.ts +3 -2
  134. package/dist/GFF3/gff3ToAnnotationFeature.d.ts.map +1 -0
  135. package/dist/GFF3/gff3ToAnnotationFeature.js +30 -22
  136. package/dist/GFF3/gff3ToAnnotationFeature.js.map +1 -1
  137. package/dist/GFF3/gff3ToAnnotationFeature.test.d.ts +1 -0
  138. package/dist/GFF3/gff3ToAnnotationFeature.test.d.ts.map +1 -0
  139. package/dist/GFF3/gff3ToAnnotationFeature.test.js +60 -63
  140. package/dist/GFF3/gff3ToAnnotationFeature.test.js.map +1 -1
  141. package/dist/GFF3/gffReservedKeys.d.ts +1 -0
  142. package/dist/GFF3/gffReservedKeys.d.ts.map +1 -0
  143. package/dist/GFF3/gffReservedKeys.js +12 -19
  144. package/dist/GFF3/gffReservedKeys.js.map +1 -1
  145. package/dist/GFF3/index.d.ts +4 -3
  146. package/dist/GFF3/index.d.ts.map +1 -0
  147. package/dist/GFF3/index.js +3 -6
  148. package/dist/GFF3/index.js.map +1 -1
  149. package/dist/GFF3/testUtil.d.ts +2 -1
  150. package/dist/GFF3/testUtil.d.ts.map +1 -0
  151. package/dist/GFF3/testUtil.js +8 -8
  152. package/dist/GFF3/testUtil.js.map +1 -1
  153. package/dist/Messages.d.ts +3 -2
  154. package/dist/Messages.d.ts.map +1 -0
  155. package/dist/Messages.js +1 -2
  156. package/dist/Operations/GetAssembliesOperation.d.ts +2 -3
  157. package/dist/Operations/GetAssembliesOperation.d.ts.map +1 -0
  158. package/dist/Operations/GetAssembliesOperation.js +2 -6
  159. package/dist/Operations/GetAssembliesOperation.js.map +1 -1
  160. package/dist/Operations/GetFeaturesOperation.d.ts +1 -0
  161. package/dist/Operations/GetFeaturesOperation.d.ts.map +1 -0
  162. package/dist/Operations/GetFeaturesOperation.js +2 -6
  163. package/dist/Operations/GetFeaturesOperation.js.map +1 -1
  164. package/dist/Operations/index.d.ts +5 -4
  165. package/dist/Operations/index.d.ts.map +1 -0
  166. package/dist/Operations/index.js +5 -9
  167. package/dist/Operations/index.js.map +1 -1
  168. package/dist/Validations/CoreValidation.d.ts +4 -3
  169. package/dist/Validations/CoreValidation.d.ts.map +1 -0
  170. package/dist/Validations/CoreValidation.js +6 -12
  171. package/dist/Validations/CoreValidation.js.map +1 -1
  172. package/dist/Validations/ParentChildValidation.d.ts +6 -5
  173. package/dist/Validations/ParentChildValidation.d.ts.map +1 -0
  174. package/dist/Validations/ParentChildValidation.js +6 -10
  175. package/dist/Validations/ParentChildValidation.js.map +1 -1
  176. package/dist/Validations/Validation.d.ts +6 -5
  177. package/dist/Validations/Validation.d.ts.map +1 -0
  178. package/dist/Validations/Validation.js +2 -7
  179. package/dist/Validations/Validation.js.map +1 -1
  180. package/dist/Validations/ValidationSet.d.ts +5 -4
  181. package/dist/Validations/ValidationSet.d.ts.map +1 -0
  182. package/dist/Validations/ValidationSet.js +3 -8
  183. package/dist/Validations/ValidationSet.js.map +1 -1
  184. package/dist/Validations/index.d.ts +5 -4
  185. package/dist/Validations/index.d.ts.map +1 -0
  186. package/dist/Validations/index.js +4 -7
  187. package/dist/Validations/index.js.map +1 -1
  188. package/dist/Validations/soSequenceTypes.d.ts +1 -0
  189. package/dist/Validations/soSequenceTypes.d.ts.map +1 -0
  190. package/dist/Validations/soSequenceTypes.js +1 -3
  191. package/dist/Validations/soSequenceTypes.js.map +1 -1
  192. package/dist/index.d.ts +9 -8
  193. package/dist/index.d.ts.map +1 -0
  194. package/dist/index.js +8 -11
  195. package/dist/index.js.map +1 -1
  196. package/dist/tsconfig.tsbuildinfo +1 -1
  197. package/dist/util.d.ts +3 -2
  198. package/dist/util.d.ts.map +1 -0
  199. package/dist/util.js +4 -10
  200. package/dist/util.js.map +1 -1
  201. package/package.json +16 -13
  202. package/src/Changes/AddAssemblyAliasesChange.ts +3 -1
  203. package/src/Changes/AddAssemblyAndFeaturesFromFileChange.ts +38 -16
  204. package/src/Changes/AddAssemblyFromExternalChange.ts +3 -2
  205. package/src/Changes/AddAssemblyFromFileChange.ts +11 -8
  206. package/src/Changes/AddFeatureChange.ts +8 -3
  207. package/src/Changes/AddFeaturesFromFileChange.ts +35 -18
  208. package/src/Changes/AddRefSeqAliasesChange.ts +3 -0
  209. package/src/Changes/DeleteAssemblyChange.ts +1 -0
  210. package/src/Changes/DeleteFeatureChange.ts +21 -3
  211. package/src/Changes/FeatureAttributeChange.ts +14 -1
  212. package/src/Changes/FromFileBaseChange.ts +4 -9
  213. package/src/Changes/LocationEndChange.ts +1 -1
  214. package/src/Changes/LocationStartChange.ts +1 -1
  215. package/src/Changes/MergeExonsChange.ts +4 -4
  216. package/src/Changes/MergeTranscriptsChange.ts +8 -8
  217. package/src/Changes/SplitExonChange.ts +3 -3
  218. package/src/Changes/StrandChange.ts +1 -1
  219. package/src/Changes/TypeChange.ts +1 -1
  220. package/src/Changes/UndoMergeExonsChange.ts +2 -2
  221. package/src/Changes/UndoMergeTranscriptsChange.ts +2 -2
  222. package/src/Changes/UndoSplitExonChange.ts +3 -3
  223. package/src/Changes/index.ts +46 -46
  224. package/src/Checks/CDSCheck.ts +8 -10
  225. package/src/Checks/TranscriptCheck.ts +4 -4
  226. package/src/Checks/index.ts +2 -2
  227. package/src/Checks/util.ts +1 -1
  228. package/src/Common/index.ts +1 -1
  229. package/src/GFF3/annotationFeatureToGFF3.test.ts +3 -3
  230. package/src/GFF3/annotationFeatureToGFF3.ts +105 -99
  231. package/src/GFF3/gff3ToAnnotationFeature.test.ts +3 -3
  232. package/src/GFF3/gff3ToAnnotationFeature.ts +29 -13
  233. package/src/GFF3/index.ts +3 -3
  234. package/src/GFF3/testUtil.ts +5 -1
  235. package/src/Messages.ts +2 -2
  236. package/src/Operations/index.ts +4 -4
  237. package/src/Validations/CoreValidation.ts +4 -4
  238. package/src/Validations/ParentChildValidation.ts +6 -6
  239. package/src/Validations/Validation.ts +5 -5
  240. package/src/Validations/ValidationSet.ts +4 -8
  241. package/src/Validations/index.ts +4 -4
  242. package/src/declare.d.ts +58 -0
  243. package/src/index.ts +8 -8
  244. package/src/util.ts +3 -3
  245. package/test_data/single_feature_mutliple_locations.gff3 +5 -0
  246. package/test_data/single_feature_mutliple_locations.json +76 -0
  247. package/tsconfig.json +6 -4
package/dist/util.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { type Feature } from '@apollo-annotation/schemas';
2
- import { type IKeyValueMap } from 'mobx';
1
+ import type { Feature } from '@apollo-annotation/schemas';
2
+ import type { IKeyValueMap } from 'mobx';
3
3
  export declare function splitStringIntoChunks(input: string, chunkSize: number): string[];
4
4
  export declare function getPrintableId(feature: Feature): string;
5
5
  export declare function attributesToRecords(attributes: IKeyValueMap<readonly string[] | undefined> | undefined): Record<string, string[] | undefined>;
6
6
  export declare function stringifyAttributes(attributes: Record<string, string[] | undefined> | undefined): string;
7
+ //# sourceMappingURL=util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAExC,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAChB,MAAM,EAAE,CAOV;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAWvD;AAED,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,YAAY,CAAC,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC,GAAG,SAAS,GAClE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC,CAStC;AAED,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC,GAAG,SAAS,GAC3D,MAAM,CAmBR"}
package/dist/util.js CHANGED
@@ -1,10 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.splitStringIntoChunks = splitStringIntoChunks;
4
- exports.getPrintableId = getPrintableId;
5
- exports.attributesToRecords = attributesToRecords;
6
- exports.stringifyAttributes = stringifyAttributes;
7
- function splitStringIntoChunks(input, chunkSize) {
1
+ export function splitStringIntoChunks(input, chunkSize) {
8
2
  const chunks = [];
9
3
  for (let i = 0; i < input.length; i += chunkSize) {
10
4
  const chunk = input.slice(i, i + chunkSize);
@@ -12,7 +6,7 @@ function splitStringIntoChunks(input, chunkSize) {
12
6
  }
13
7
  return chunks;
14
8
  }
15
- function getPrintableId(feature) {
9
+ export function getPrintableId(feature) {
16
10
  const ff = feature;
17
11
  const gff_id = ff.attributes.get('gff_id')?.join(',');
18
12
  if (gff_id) {
@@ -24,7 +18,7 @@ function getPrintableId(feature) {
24
18
  }
25
19
  return `_id: ${feature._id.toString()}`;
26
20
  }
27
- function attributesToRecords(attributes) {
21
+ export function attributesToRecords(attributes) {
28
22
  const records = {};
29
23
  if (!attributes) {
30
24
  return records;
@@ -34,7 +28,7 @@ function attributesToRecords(attributes) {
34
28
  }
35
29
  return records;
36
30
  }
37
- function stringifyAttributes(attributes) {
31
+ export function stringifyAttributes(attributes) {
38
32
  if (!attributes) {
39
33
  return '';
40
34
  }
package/dist/util.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;AAIA,sDAUC;AAED,wCAWC;AAED,kDAWC;AAED,kDAqBC;AA3DD,SAAgB,qBAAqB,CACnC,KAAa,EACb,SAAiB;IAEjB,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,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,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QACtD,IAAI,aAAa,GAAG,GAAG,CAAA;QACvB,IAAI,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YACrC,aAAa,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;YACtC,aAAa;gBACX,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAClE,CAAC;QACD,IAAI,KAAK,EAAE,CAAC;YACV,GAAG,CAAC,IAAI,CAAC,GAAG,aAAa,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACjD,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;QACzB,CAAC;IACH,CAAC;IACD,OAAO,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AAC1C,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "@apollo-annotation/shared",
3
- "version": "0.3.10",
4
- "main": "./dist/index.js",
3
+ "version": "0.3.12",
4
+ "sideEffects": false,
5
+ "type": "module",
6
+ "exports": "./dist/index.js",
5
7
  "scripts": {
6
8
  "build": "yarn clean && tsc --build",
7
9
  "clean": "rimraf dist",
@@ -10,27 +12,27 @@
10
12
  "test:ci": "NODE_V8_COVERAGE=./coverage glob -c \"tsx --test --test-reporter spec --experimental-test-coverage \" \"**/*.test.ts\""
11
13
  },
12
14
  "dependencies": {
13
- "@apollo-annotation/common": "^0.3.10",
14
- "@apollo-annotation/mst": "^0.3.10",
15
- "@apollo-annotation/schemas": "^0.3.10",
16
- "@gmod/gff": "^2.0.0",
17
- "@gmod/indexedfasta": "^2.0.4",
18
- "@jbrowse/core": "^3.6.5",
15
+ "@apollo-annotation/common": "^0.3.12",
16
+ "@apollo-annotation/mst": "^0.3.12",
17
+ "@apollo-annotation/schemas": "^0.3.12",
18
+ "@gmod/gff": "^2.1.0",
19
+ "@gmod/indexedfasta": "^5.0.2",
20
+ "@jbrowse/core": "^4.1.1",
19
21
  "bson-objectid": "^2.0.4",
20
- "generic-filehandle": "^3.0.0",
22
+ "generic-filehandle2": "^2.0.18",
21
23
  "jwt-decode": "^3.1.2",
22
24
  "tslib": "^2.3.1"
23
25
  },
24
26
  "devDependencies": {
27
+ "@jbrowse/mobx-state-tree": "^5.5.0",
25
28
  "@nestjs/common": "^10.1.0",
26
29
  "@nestjs/core": "^10.1.0",
27
30
  "@types/chai": "^4.3.19",
28
- "@types/node": "^20.19.15",
31
+ "@types/node": "^24.10.9",
29
32
  "chai": "^5.1.1",
30
33
  "chai-exclude": "^3.0.0",
31
34
  "glob": "^11.0.0",
32
35
  "mobx": "^6.6.1",
33
- "mobx-state-tree": "^5.4.0",
34
36
  "mongoose": "^6.12.0",
35
37
  "react-dom": "^18.2.0",
36
38
  "rimraf": "^3.0.2",
@@ -39,14 +41,15 @@
39
41
  "typescript": "^5.5.3"
40
42
  },
41
43
  "peerDependencies": {
42
- "@mui/material": "^7.0.0",
44
+ "@jbrowse/mobx-state-tree": "^5.5.0",
45
+ "@mui/material": "^7.3.7",
43
46
  "@mui/x-data-grid": "^8.0.0",
44
47
  "mobx": "^6.6.1",
45
48
  "mobx-react": "^7.2.1",
46
- "mobx-state-tree": "^5.4.0",
47
49
  "prop-types": "^15.8.1",
48
50
  "react": "^18.2.0",
49
51
  "react-dom": "^18.2.0",
52
+ "reflect-metadata": "^0.1.13",
50
53
  "rxjs": "^7.4.0"
51
54
  },
52
55
  "publishConfig": {
@@ -1,3 +1,6 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
2
+ /* eslint-disable @typescript-eslint/no-unsafe-call */
3
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
1
4
  import {
2
5
  AssemblySpecificChange,
3
6
  type Change,
@@ -30,7 +33,6 @@ export class AddAssemblyAliasesChange extends AssemblySpecificChange {
30
33
  if (!assembly) {
31
34
  throw new Error(`assembly ${this.assembly} not found`)
32
35
  }
33
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
34
36
  assembly.configuration.aliases.set(this.aliases)
35
37
  return Promise.resolve()
36
38
  }
@@ -1,15 +1,18 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
2
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
3
+ /* eslint-disable @typescript-eslint/no-unsafe-call */
4
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
1
5
  /* eslint-disable @typescript-eslint/require-await */
2
6
 
3
- import {
4
- type ChangeOptions,
5
- type ClientDataStore,
6
- type LocalGFF3DataStore,
7
- type SerializedAssemblySpecificChange,
8
- type ServerDataStore,
7
+ import type {
8
+ ChangeOptions,
9
+ ClientDataStore,
10
+ LocalGFF3DataStore,
11
+ SerializedAssemblySpecificChange,
12
+ ServerDataStore,
9
13
  } from '@apollo-annotation/common'
10
- import { type GFF3Feature } from '@gmod/gff'
11
14
 
12
- import { FromFileBaseChange } from './FromFileBaseChange'
15
+ import { FromFileBaseChange } from './FromFileBaseChange.js'
13
16
 
14
17
  export interface SerializedAddAssemblyAndFeaturesFromFileChangeBase
15
18
  extends SerializedAssemblySpecificChange {
@@ -19,7 +22,7 @@ export interface SerializedAddAssemblyAndFeaturesFromFileChangeBase
19
22
  export interface AddAssemblyAndFeaturesFromFileChangeDetails {
20
23
  assemblyName: string
21
24
  fileIds: { fa: string }
22
- parseOptions?: { bufferSize: number }
25
+ parseOptions?: { bufferSize?: number; strict?: boolean }
23
26
  }
24
27
 
25
28
  export interface SerializedAddAssemblyAndFeaturesFromFileChangeSingle
@@ -111,18 +114,37 @@ export class AddAssemblyAndFeaturesFromFileChange extends FromFileBaseChange {
111
114
  backend,
112
115
  )
113
116
 
114
- const { bufferSize = 10_000 } = parseOptions ?? {}
117
+ const { bufferSize = 10_000, strict = true } = parseOptions ?? {}
115
118
  const featureStream = filesService.parseGFF3(
116
119
  filesService.getFileStream(fileDoc),
117
120
  { bufferSize },
118
121
  )
119
- // @ts-expect-error type is wrong here
120
- // eslint-disable-next-line @typescript-eslint/await-thenable
121
- for await (const f of featureStream) {
122
- const gff3Feature = f as GFF3Feature
123
- logger.verbose?.(`ENTRY=${JSON.stringify(gff3Feature)}`)
122
+ let featureCount = 0
123
+ let errorCount = 0
124
+ for await (const gff3Feature of featureStream) {
124
125
  // Add new feature into database
125
- await this.addFeatureIntoDb(gff3Feature, backend)
126
+ try {
127
+ await this.addFeatureIntoDb(gff3Feature, backend)
128
+ } catch (error) {
129
+ // if the first feature is an error, assume the file isn't valid and throw
130
+ if (strict || featureCount === 0) {
131
+ throw error
132
+ }
133
+ if (errorCount <= 99) {
134
+ logger.warn('Error parsing feature')
135
+ logger.warn(error)
136
+ if (errorCount === 99) {
137
+ logger.warn(
138
+ 'Reached 100 parsing errors, omitting further warnings from log',
139
+ )
140
+ }
141
+ }
142
+ errorCount++
143
+ }
144
+ featureCount++
145
+ if (featureCount % 1000 === 0) {
146
+ logger.debug?.(`Processed ${featureCount} features`)
147
+ }
126
148
  }
127
149
  }
128
150
  }
@@ -1,4 +1,5 @@
1
- /* eslint-disable @typescript-eslint/restrict-template-expressions */
1
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
2
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
2
3
  /* eslint-disable @typescript-eslint/no-unnecessary-condition */
3
4
 
4
5
  /* eslint-disable @typescript-eslint/require-await */
@@ -11,7 +12,7 @@ import {
11
12
  type ServerDataStore,
12
13
  } from '@apollo-annotation/common'
13
14
  import { BgzipIndexedFasta, IndexedFasta } from '@gmod/indexedfasta'
14
- import { RemoteFile } from 'generic-filehandle'
15
+ import { RemoteFile } from 'generic-filehandle2'
15
16
 
16
17
  export interface SerializedAddAssemblyFromExternalChangeBase
17
18
  extends SerializedAssemblySpecificChange {
@@ -1,15 +1,18 @@
1
- /* eslint-disable @typescript-eslint/restrict-template-expressions */
1
+ /* eslint-disable @typescript-eslint/no-unsafe-call */
2
+ /* eslint-disable @typescript-eslint/no-unsafe-argument */
3
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
4
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
2
5
  /* eslint-disable @typescript-eslint/require-await */
3
- import {
4
- type ChangeOptions,
5
- type ClientDataStore,
6
- type LocalGFF3DataStore,
7
- type SerializedAssemblySpecificChange,
8
- type ServerDataStore,
6
+ import type {
7
+ ChangeOptions,
8
+ ClientDataStore,
9
+ LocalGFF3DataStore,
10
+ SerializedAssemblySpecificChange,
11
+ ServerDataStore,
9
12
  } from '@apollo-annotation/common'
10
13
  import { BgzipIndexedFasta } from '@gmod/indexedfasta'
11
14
 
12
- import { FromFileBaseChange } from './FromFileBaseChange'
15
+ import { FromFileBaseChange } from './FromFileBaseChange.js'
13
16
 
14
17
  export interface SerializedAddAssemblyFromFileChangeBase
15
18
  extends SerializedAssemblySpecificChange {
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
1
2
  /* eslint-disable @typescript-eslint/restrict-template-expressions */
2
3
  /* eslint-disable @typescript-eslint/require-await */
3
4
  /* eslint-disable @typescript-eslint/no-unnecessary-condition */
@@ -9,9 +10,9 @@ import {
9
10
  type SerializedFeatureChange,
10
11
  type ServerDataStore,
11
12
  } from '@apollo-annotation/common'
12
- import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
13
+ import type { AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
13
14
 
14
- import { DeleteFeatureChange } from './DeleteFeatureChange'
15
+ import { DeleteFeatureChange } from './DeleteFeatureChange.js'
15
16
 
16
17
  interface SerializedAddFeatureChangeBase extends SerializedFeatureChange {
17
18
  typeName: 'AddFeatureChange'
@@ -123,6 +124,7 @@ export class AddFeatureChange extends FeatureChange {
123
124
  )
124
125
  featureCnt++
125
126
  } else {
127
+ const indexedIds = this.getIndexedIds(addedFeature, idsToIndex)
126
128
  // Adding new child feature
127
129
  if (parentFeatureId) {
128
130
  const topLevelFeature = await featureModel
@@ -146,11 +148,14 @@ export class AddFeatureChange extends FeatureChange {
146
148
  this.addChild(parentFeature, addedFeature)
147
149
  const childIds = this.getChildFeatureIds(addedFeature)
148
150
  topLevelFeature.allIds.push(_id, ...childIds)
151
+ if (indexedIds.length > 0 && !topLevelFeature.indexedIds) {
152
+ topLevelFeature.indexedIds = []
153
+ }
154
+ topLevelFeature.indexedIds?.push(...indexedIds)
149
155
  await topLevelFeature.save()
150
156
  } else {
151
157
  const childIds = this.getChildFeatureIds(addedFeature)
152
158
  const allIdsV2 = [_id, ...childIds]
153
- const indexedIds = this.getIndexedIds(addedFeature, idsToIndex)
154
159
  const [newFeatureDoc] = await featureModel.create(
155
160
  [{ allIds: allIdsV2, indexedIds, status: 0, ...addedFeature }],
156
161
  { session },
@@ -1,14 +1,13 @@
1
1
  /* eslint-disable @typescript-eslint/require-await */
2
- import {
3
- type ChangeOptions,
4
- type ClientDataStore,
5
- type LocalGFF3DataStore,
6
- type SerializedAssemblySpecificChange,
7
- type ServerDataStore,
2
+ import type {
3
+ ChangeOptions,
4
+ ClientDataStore,
5
+ LocalGFF3DataStore,
6
+ SerializedAssemblySpecificChange,
7
+ ServerDataStore,
8
8
  } from '@apollo-annotation/common'
9
- import { type GFF3Feature } from '@gmod/gff'
10
9
 
11
- import { FromFileBaseChange } from './FromFileBaseChange'
10
+ import { FromFileBaseChange } from './FromFileBaseChange.js'
12
11
 
13
12
  export interface SerializedAddFeaturesFromFileChangeBase
14
13
  extends SerializedAssemblySpecificChange {
@@ -18,7 +17,7 @@ export interface SerializedAddFeaturesFromFileChangeBase
18
17
 
19
18
  export interface AddFeaturesFromFileChangeDetails {
20
19
  fileId: string
21
- parseOptions?: { bufferSize: number }
20
+ parseOptions?: { bufferSize?: number; strict?: boolean }
22
21
  }
23
22
 
24
23
  export interface SerializedAddFeaturesFromFileChangeSingle
@@ -89,21 +88,39 @@ export class AddFeaturesFromFileChange extends FromFileBaseChange {
89
88
  }
90
89
  logger.debug?.(`FileId "${fileId}", checksum "${fileDoc.checksum}"`)
91
90
 
91
+ let errorCount = 0
92
+ // eslint-disable-next-line unicorn/consistent-function-scoping
93
+ const errorLogger = (error: unknown) => {
94
+ if (errorCount <= 99) {
95
+ logger.warn('Error parsing or adding feature')
96
+ logger.warn(error)
97
+ if (errorCount === 99) {
98
+ logger.warn(
99
+ 'Reached 100 feature errors, omitting further warnings from log',
100
+ )
101
+ }
102
+ }
103
+ errorCount++
104
+ }
105
+
92
106
  // Read data from compressed file and parse the content
93
- const { bufferSize = 10_000 } = parseOptions ?? {}
107
+ const { bufferSize = 10_000, strict = true } = parseOptions ?? {}
94
108
  const featureStream = filesService.parseGFF3(
95
109
  filesService.getFileStream(fileDoc),
96
- { bufferSize },
110
+ { bufferSize, errorCallback: strict ? undefined : errorLogger },
97
111
  )
98
112
  let featureCount = 0
99
- // @ts-expect-error type is wrong here
100
- // eslint-disable-next-line @typescript-eslint/await-thenable
101
- for await (const f of featureStream) {
102
- const gff3Feature = f as GFF3Feature
103
-
113
+ for await (const gff3Feature of featureStream) {
104
114
  // Add new feature into database
105
- // We cannot use Mongo 'session' / transaction here because Mongo has 16 MB limit for transaction
106
- await this.addFeatureIntoDb(gff3Feature, backend)
115
+ try {
116
+ await this.addFeatureIntoDb(gff3Feature, backend)
117
+ } catch (error) {
118
+ // if the first feature is an error, assume the file isn't valid and throw
119
+ if (strict || featureCount === 0) {
120
+ throw error
121
+ }
122
+ errorLogger(error)
123
+ }
107
124
  featureCount++
108
125
  if (featureCount % 1000 === 0) {
109
126
  logger.debug?.(`Processed ${featureCount} features`)
@@ -1,3 +1,6 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
2
+ /* eslint-disable @typescript-eslint/no-unsafe-call */
3
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
1
4
  import {
2
5
  AssemblySpecificChange,
3
6
  type Change,
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-unsafe-assignment */
1
2
  /* eslint-disable @typescript-eslint/no-unsafe-return */
2
3
  /* eslint-disable @typescript-eslint/require-await */
3
4
  /* eslint-disable @typescript-eslint/no-unnecessary-condition */
@@ -9,10 +9,10 @@ import {
9
9
  type SerializedFeatureChange,
10
10
  type ServerDataStore,
11
11
  } from '@apollo-annotation/common'
12
- import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
13
- import { type Feature } from '@apollo-annotation/schemas'
12
+ import type { AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
13
+ import type { Feature } from '@apollo-annotation/schemas'
14
14
 
15
- import { AddFeatureChange } from './AddFeatureChange'
15
+ import { AddFeatureChange } from './AddFeatureChange.js'
16
16
 
17
17
  interface SerializedDeleteFeatureChangeBase extends SerializedFeatureChange {
18
18
  typeName: 'DeleteFeatureChange'
@@ -67,6 +67,12 @@ export class DeleteFeatureChange extends FeatureChange {
67
67
  const { featureModel, session } = backend
68
68
  const { changes, logger } = this
69
69
 
70
+ const { INDEXED_IDS } = process.env
71
+ let idsToIndex: string[] | undefined
72
+ if (INDEXED_IDS) {
73
+ idsToIndex = INDEXED_IDS.split(',')
74
+ }
75
+
70
76
  // Loop the changes
71
77
  for (const change of changes) {
72
78
  const { deletedFeature, parentFeatureId } = change
@@ -105,6 +111,18 @@ export class DeleteFeatureChange extends FeatureChange {
105
111
  featureDoc.allIds = featureDoc.allIds.filter(
106
112
  (id) => !deletedIds.includes(id),
107
113
  )
114
+ const indexedIds = this.getIndexedIds(featureDoc, idsToIndex)
115
+ if (featureDoc.indexedIds) {
116
+ if (indexedIds.length > 0) {
117
+ featureDoc.indexedIds = indexedIds
118
+ } else {
119
+ delete featureDoc.indexedIds
120
+ }
121
+ } else {
122
+ if (indexedIds.length > 0) {
123
+ featureDoc.indexedIds = indexedIds
124
+ }
125
+ }
108
126
  // Save updated document in Mongo
109
127
  featureDoc.markModified('children') // Mark as modified. Without this save() -method is not updating data in database
110
128
  try {
@@ -9,7 +9,7 @@ import {
9
9
  type SerializedFeatureChange,
10
10
  type ServerDataStore,
11
11
  } from '@apollo-annotation/common'
12
- import { type Feature, type FeatureDocument } from '@apollo-annotation/schemas'
12
+ import type { Feature, FeatureDocument } from '@apollo-annotation/schemas'
13
13
 
14
14
  interface SerializedFeatureAttributeChangeBase extends SerializedFeatureChange {
15
15
  typeName: 'FeatureAttributeChange'
@@ -100,11 +100,24 @@ export class FeatureAttributeChange extends FeatureChange {
100
100
  featuresForChanges.push({ feature: foundFeature, topLevelFeature })
101
101
  }
102
102
 
103
+ const { INDEXED_IDS } = process.env
104
+ let idsToIndex: string[] | undefined
105
+ if (INDEXED_IDS) {
106
+ idsToIndex = INDEXED_IDS.split(',')
107
+ }
103
108
  // Let's update objects
104
109
  for (const [idx, change] of changes.entries()) {
105
110
  const { newAttributes } = change
106
111
  const { feature, topLevelFeature } = featuresForChanges[idx]
112
+ const indexedIdsChanged = idsToIndex?.some(
113
+ (id) => id in newAttributes || id in (feature?.attributes ?? {}),
114
+ )
107
115
  feature.attributes = newAttributes
116
+ if (indexedIdsChanged) {
117
+ const indexedIds = this.getIndexedIds(topLevelFeature, idsToIndex)
118
+ topLevelFeature.indexedIds = indexedIds
119
+ topLevelFeature.markModified('indexedIds')
120
+ }
108
121
  if (topLevelFeature._id.equals(feature._id)) {
109
122
  topLevelFeature.markModified('attributes') // Mark as modified. Without this save() -method is not updating data in database
110
123
  } else {
@@ -4,14 +4,11 @@ import {
4
4
  AssemblySpecificChange,
5
5
  type ServerDataStore,
6
6
  } from '@apollo-annotation/common'
7
- import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
8
- import {
9
- type FileDocument,
10
- type RefSeqDocument,
11
- } from '@apollo-annotation/schemas'
12
- import { type GFF3Feature } from '@gmod/gff'
7
+ import type { AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
8
+ import type { FileDocument, RefSeqDocument } from '@apollo-annotation/schemas'
9
+ import type { GFF3Feature } from '@gmod/gff'
13
10
 
14
- import { gff3ToAnnotationFeature } from '../GFF3'
11
+ import { gff3ToAnnotationFeature } from '../GFF3/index.js'
15
12
 
16
13
  export abstract class FromFileBaseChange extends AssemblySpecificChange {
17
14
  async addRefSeqIntoDb(
@@ -37,8 +34,6 @@ export abstract class FromFileBaseChange extends AssemblySpecificChange {
37
34
  logger.debug?.('starting sequence stream')
38
35
  let lineCount = 0
39
36
  const decoder = new TextDecoder()
40
- // @ts-expect-error type is wrong here
41
- // eslint-disable-next-line @typescript-eslint/await-thenable
42
37
  for await (const data of sequenceStream) {
43
38
  const chunk = decoder.decode(data)
44
39
  lastLineIsIncomplete = !chunk.endsWith('\n')
@@ -9,7 +9,7 @@ import {
9
9
  type SerializedFeatureChange,
10
10
  type ServerDataStore,
11
11
  } from '@apollo-annotation/common'
12
- import { type Feature, type FeatureDocument } from '@apollo-annotation/schemas'
12
+ import type { Feature, FeatureDocument } from '@apollo-annotation/schemas'
13
13
 
14
14
  interface SerializedLocationEndChangeBase extends SerializedFeatureChange {
15
15
  typeName: 'LocationEndChange'
@@ -9,7 +9,7 @@ import {
9
9
  type SerializedFeatureChange,
10
10
  type ServerDataStore,
11
11
  } from '@apollo-annotation/common'
12
- import { type Feature, type FeatureDocument } from '@apollo-annotation/schemas'
12
+ import type { Feature, FeatureDocument } from '@apollo-annotation/schemas'
13
13
 
14
14
  interface SerializedLocationStartChangeBase extends SerializedFeatureChange {
15
15
  typeName: 'LocationStartChange'
@@ -10,12 +10,12 @@ import {
10
10
  type SerializedFeatureChange,
11
11
  type ServerDataStore,
12
12
  } from '@apollo-annotation/common'
13
- import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
13
+ import type { AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
14
14
 
15
- import { attributesToRecords, stringifyAttributes } from '../util'
15
+ import { attributesToRecords, stringifyAttributes } from '../util.js'
16
16
 
17
- import { findAndDeleteChildFeature } from './DeleteFeatureChange'
18
- import { UndoMergeExonsChange } from './UndoMergeExonsChange'
17
+ import { findAndDeleteChildFeature } from './DeleteFeatureChange.js'
18
+ import { UndoMergeExonsChange } from './UndoMergeExonsChange.js'
19
19
 
20
20
  interface SerializedMergeExonsChangeBase extends SerializedFeatureChange {
21
21
  typeName: 'MergeExonsChange'
@@ -10,18 +10,18 @@ import {
10
10
  type SerializedFeatureChange,
11
11
  type ServerDataStore,
12
12
  } from '@apollo-annotation/common'
13
- import {
14
- type AnnotationFeature,
15
- type AnnotationFeatureSnapshot,
13
+ import type {
14
+ AnnotationFeature,
15
+ AnnotationFeatureSnapshot,
16
16
  } from '@apollo-annotation/mst'
17
- import { type Feature } from '@apollo-annotation/schemas'
17
+ import type { Feature } from '@apollo-annotation/schemas'
18
18
  import { doesIntersect2 } from '@jbrowse/core/util'
19
- import { getSnapshot } from 'mobx-state-tree'
19
+ import { getSnapshot } from '@jbrowse/mobx-state-tree'
20
20
 
21
- import { attributesToRecords, stringifyAttributes } from '../util'
21
+ import { attributesToRecords, stringifyAttributes } from '../util.js'
22
22
 
23
- import { findAndDeleteChildFeature } from './DeleteFeatureChange'
24
- import { UndoMergeTranscriptsChange } from './UndoMergeTranscriptsChange'
23
+ import { findAndDeleteChildFeature } from './DeleteFeatureChange.js'
24
+ import { UndoMergeTranscriptsChange } from './UndoMergeTranscriptsChange.js'
25
25
 
26
26
  interface SerializedMergeTranscriptsChangeBase extends SerializedFeatureChange {
27
27
  typeName: 'MergeTranscriptsChange'
@@ -9,10 +9,10 @@ import {
9
9
  type SerializedFeatureChange,
10
10
  type ServerDataStore,
11
11
  } from '@apollo-annotation/common'
12
- import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
12
+ import type { AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
13
13
 
14
- import { findAndDeleteChildFeature } from './DeleteFeatureChange'
15
- import { UndoSplitExonChange } from './UndoSplitExonChange'
14
+ import { findAndDeleteChildFeature } from './DeleteFeatureChange.js'
15
+ import { UndoSplitExonChange } from './UndoSplitExonChange.js'
16
16
 
17
17
  interface SerializedSplitExonChangeBase extends SerializedFeatureChange {
18
18
  typeName: 'SplitExonChange'
@@ -9,7 +9,7 @@ import {
9
9
  type SerializedFeatureChange,
10
10
  type ServerDataStore,
11
11
  } from '@apollo-annotation/common'
12
- import { type Feature, type FeatureDocument } from '@apollo-annotation/schemas'
12
+ import type { Feature, FeatureDocument } from '@apollo-annotation/schemas'
13
13
 
14
14
  interface SerializedStrandChangeBase extends SerializedFeatureChange {
15
15
  typeName: 'StrandChange'
@@ -9,7 +9,7 @@ import {
9
9
  type SerializedFeatureChange,
10
10
  type ServerDataStore,
11
11
  } from '@apollo-annotation/common'
12
- import { type Feature, type FeatureDocument } from '@apollo-annotation/schemas'
12
+ import type { Feature, FeatureDocument } from '@apollo-annotation/schemas'
13
13
 
14
14
  interface SerializedTypeChangeBase extends SerializedFeatureChange {
15
15
  typeName: 'TypeChange'
@@ -8,9 +8,9 @@ import {
8
8
  type SerializedFeatureChange,
9
9
  type ServerDataStore,
10
10
  } from '@apollo-annotation/common'
11
- import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
11
+ import type { AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
12
12
 
13
- import { MergeExonsChange } from './MergeExonsChange'
13
+ import { MergeExonsChange } from './MergeExonsChange.js'
14
14
 
15
15
  interface SerializedUndoMergeExonsChangeBase extends SerializedFeatureChange {
16
16
  typeName: 'UndoMergeExonsChange'
@@ -8,9 +8,9 @@ import {
8
8
  type SerializedFeatureChange,
9
9
  type ServerDataStore,
10
10
  } from '@apollo-annotation/common'
11
- import { type AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
11
+ import type { AnnotationFeatureSnapshot } from '@apollo-annotation/mst'
12
12
 
13
- import { MergeTranscriptsChange } from './MergeTranscriptsChange'
13
+ import { MergeTranscriptsChange } from './MergeTranscriptsChange.js'
14
14
 
15
15
  interface SerializedUndoMergeTranscriptsChangeBase
16
16
  extends SerializedFeatureChange {