@apollo-annotation/jbrowse-plugin-apollo 0.3.12 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/dist/ApolloRefNameAliasAdapter/ApolloRefNameAliasAdapter.d.ts +1 -1
  2. package/dist/ApolloRefNameAliasAdapter/ApolloRefNameAliasAdapter.d.ts.map +1 -1
  3. package/dist/BackendDrivers/BackendDriver.d.ts +29 -4
  4. package/dist/BackendDrivers/BackendDriver.d.ts.map +1 -1
  5. package/dist/BackendDrivers/CollaborationServerDriver.d.ts +3 -1
  6. package/dist/BackendDrivers/CollaborationServerDriver.d.ts.map +1 -1
  7. package/dist/BackendDrivers/LocalDriver/LocalDriver.d.ts +22 -0
  8. package/dist/BackendDrivers/LocalDriver/LocalDriver.d.ts.map +1 -0
  9. package/dist/BackendDrivers/LocalDriver/db.d.ts +4 -0
  10. package/dist/BackendDrivers/LocalDriver/db.d.ts.map +1 -0
  11. package/dist/BackendDrivers/index.d.ts +1 -2
  12. package/dist/BackendDrivers/index.d.ts.map +1 -1
  13. package/dist/ChangeManager.d.ts +3 -3
  14. package/dist/ChangeManager.d.ts.map +1 -1
  15. package/dist/FeatureDetailsWidget/ApolloTranscriptDetailsWidget.d.ts +0 -6
  16. package/dist/FeatureDetailsWidget/ApolloTranscriptDetailsWidget.d.ts.map +1 -1
  17. package/dist/FeatureDetailsWidget/TranscriptWidgetEditLocation.d.ts.map +1 -1
  18. package/dist/FeatureDetailsWidget/model.d.ts +0 -2
  19. package/dist/FeatureDetailsWidget/model.d.ts.map +1 -1
  20. package/dist/LinearApolloDisplay/components/CheckResultWarnings.d.ts.map +1 -1
  21. package/dist/LinearApolloDisplay/components/LinearApolloDisplay.d.ts.map +1 -1
  22. package/dist/LinearApolloDisplay/components/OverlayCanvas.d.ts +7 -0
  23. package/dist/LinearApolloDisplay/components/OverlayCanvas.d.ts.map +1 -0
  24. package/dist/LinearApolloDisplay/components/Tooltip.d.ts +10 -0
  25. package/dist/LinearApolloDisplay/components/Tooltip.d.ts.map +1 -0
  26. package/dist/LinearApolloDisplay/glyphs/BoxGlyph.d.ts +0 -1
  27. package/dist/LinearApolloDisplay/glyphs/BoxGlyph.d.ts.map +1 -1
  28. package/dist/LinearApolloDisplay/glyphs/CDSGlyph.d.ts +3 -0
  29. package/dist/LinearApolloDisplay/glyphs/CDSGlyph.d.ts.map +1 -0
  30. package/dist/LinearApolloDisplay/glyphs/ExonGlyph.d.ts +3 -0
  31. package/dist/LinearApolloDisplay/glyphs/ExonGlyph.d.ts.map +1 -0
  32. package/dist/LinearApolloDisplay/glyphs/GeneGlyph.d.ts.map +1 -1
  33. package/dist/LinearApolloDisplay/glyphs/GenericChildGlyph.d.ts.map +1 -1
  34. package/dist/LinearApolloDisplay/glyphs/Glyph.d.ts +26 -20
  35. package/dist/LinearApolloDisplay/glyphs/Glyph.d.ts.map +1 -1
  36. package/dist/LinearApolloDisplay/glyphs/TranscriptGlyph.d.ts +3 -0
  37. package/dist/LinearApolloDisplay/glyphs/TranscriptGlyph.d.ts.map +1 -0
  38. package/dist/LinearApolloDisplay/glyphs/util.d.ts +13 -0
  39. package/dist/LinearApolloDisplay/glyphs/util.d.ts.map +1 -1
  40. package/dist/LinearApolloDisplay/stateModel/base.d.ts +17 -0
  41. package/dist/LinearApolloDisplay/stateModel/base.d.ts.map +1 -1
  42. package/dist/LinearApolloDisplay/stateModel/index.d.ts +35 -17
  43. package/dist/LinearApolloDisplay/stateModel/index.d.ts.map +1 -1
  44. package/dist/LinearApolloDisplay/stateModel/layouts.d.ts +29 -7
  45. package/dist/LinearApolloDisplay/stateModel/layouts.d.ts.map +1 -1
  46. package/dist/LinearApolloDisplay/stateModel/mouseEvents.d.ts +69 -23
  47. package/dist/LinearApolloDisplay/stateModel/mouseEvents.d.ts.map +1 -1
  48. package/dist/LinearApolloDisplay/stateModel/rendering.d.ts +26 -9
  49. package/dist/LinearApolloDisplay/stateModel/rendering.d.ts.map +1 -1
  50. package/dist/LinearApolloReferenceSequenceDisplay/stateModel/base.d.ts +6 -0
  51. package/dist/LinearApolloReferenceSequenceDisplay/stateModel/base.d.ts.map +1 -1
  52. package/dist/LinearApolloReferenceSequenceDisplay/stateModel/index.d.ts +6 -0
  53. package/dist/LinearApolloReferenceSequenceDisplay/stateModel/index.d.ts.map +1 -1
  54. package/dist/LinearApolloReferenceSequenceDisplay/stateModel/rendering.d.ts +6 -0
  55. package/dist/LinearApolloReferenceSequenceDisplay/stateModel/rendering.d.ts.map +1 -1
  56. package/dist/LinearApolloSixFrameDisplay/components/LinearApolloSixFrameDisplay.d.ts.map +1 -1
  57. package/dist/LinearApolloSixFrameDisplay/glyphs/GeneGlyph.d.ts.map +1 -1
  58. package/dist/LinearApolloSixFrameDisplay/glyphs/Glyph.d.ts +1 -1
  59. package/dist/LinearApolloSixFrameDisplay/glyphs/Glyph.d.ts.map +1 -1
  60. package/dist/LinearApolloSixFrameDisplay/stateModel/layouts.d.ts.map +1 -1
  61. package/dist/LinearApolloSixFrameDisplay/stateModel/rendering.d.ts.map +1 -1
  62. package/dist/OntologyManager/OntologyStore/fulltext.d.ts +1 -1
  63. package/dist/OntologyManager/OntologyStore/fulltext.d.ts.map +1 -1
  64. package/dist/OntologyManager/OntologyStore/index.d.ts +2 -2
  65. package/dist/OntologyManager/OntologyStore/index.d.ts.map +1 -1
  66. package/dist/OntologyManager/OntologyStore/indexeddb-storage.d.ts +1 -1
  67. package/dist/OntologyManager/OntologyStore/indexeddb-storage.d.ts.map +1 -1
  68. package/dist/OntologyManager/OntologyStore/types.d.ts +18 -0
  69. package/dist/OntologyManager/OntologyStore/types.d.ts.map +1 -0
  70. package/dist/TabularEditor/HybridGrid/featureContextMenuItems.d.ts.map +1 -1
  71. package/dist/components/AddChildFeature.d.ts.map +1 -1
  72. package/dist/components/ColorFeature.d.ts +13 -0
  73. package/dist/components/ColorFeature.d.ts.map +1 -0
  74. package/dist/components/CreateApolloAnnotation.d.ts.map +1 -1
  75. package/dist/components/DownloadGFF3.d.ts +4 -1
  76. package/dist/components/DownloadGFF3.d.ts.map +1 -1
  77. package/dist/components/DuplicateTranscript.d.ts.map +1 -1
  78. package/dist/components/ViewChangeLog.d.ts +2 -1
  79. package/dist/components/ViewChangeLog.d.ts.map +1 -1
  80. package/dist/components/ViewCheckResults.d.ts +2 -1
  81. package/dist/components/ViewCheckResults.d.ts.map +1 -1
  82. package/dist/components/index.d.ts +1 -1
  83. package/dist/components/index.d.ts.map +1 -1
  84. package/dist/config.d.ts +4 -0
  85. package/dist/config.d.ts.map +1 -0
  86. package/dist/extensions/annotationFromJBrowseFeature.d.ts.map +1 -1
  87. package/dist/extensions/annotationFromPileup.d.ts.map +1 -1
  88. package/dist/index.d.ts +11 -0
  89. package/dist/index.d.ts.map +1 -0
  90. package/dist/index.esm.js +6325 -5997
  91. package/dist/index.esm.js.map +1 -1
  92. package/dist/jbrowse-plugin-apollo.cjs.development.js +5869 -5541
  93. package/dist/jbrowse-plugin-apollo.cjs.development.js.map +1 -1
  94. package/dist/jbrowse-plugin-apollo.cjs.production.min.js +1 -1
  95. package/dist/jbrowse-plugin-apollo.cjs.production.min.js.map +1 -1
  96. package/dist/jbrowse-plugin-apollo.umd.development.js +16782 -25897
  97. package/dist/jbrowse-plugin-apollo.umd.development.js.map +1 -1
  98. package/dist/jbrowse-plugin-apollo.umd.production.min.js +1 -1
  99. package/dist/jbrowse-plugin-apollo.umd.production.min.js.map +1 -1
  100. package/dist/makeDisplayComponent.d.ts.map +1 -1
  101. package/dist/menus/Icons.d.ts +3 -0
  102. package/dist/menus/Icons.d.ts.map +1 -0
  103. package/dist/menus/topLevelMenu.d.ts.map +1 -1
  104. package/dist/session/changeHandlers.d.ts +9 -0
  105. package/dist/session/changeHandlers.d.ts.map +1 -0
  106. package/dist/util/annotationFeatureUtils.d.ts +2 -1
  107. package/dist/util/annotationFeatureUtils.d.ts.map +1 -1
  108. package/dist/util/glyphUtils.d.ts +3 -3
  109. package/dist/util/glyphUtils.d.ts.map +1 -1
  110. package/dist/util/index.d.ts +0 -1
  111. package/dist/util/index.d.ts.map +1 -1
  112. package/package.json +4 -4
  113. package/src/ApolloInternetAccount/model.ts +68 -4
  114. package/src/ApolloRefNameAliasAdapter/ApolloRefNameAliasAdapter.ts +6 -3
  115. package/src/ApolloTextSearchAdapter/ApolloTextSearchAdapter.ts +1 -1
  116. package/src/BackendDrivers/BackendDriver.ts +36 -3
  117. package/src/BackendDrivers/CollaborationServerDriver.ts +78 -23
  118. package/src/BackendDrivers/LocalDriver/LocalDriver.ts +367 -0
  119. package/src/BackendDrivers/LocalDriver/db.ts +37 -0
  120. package/src/BackendDrivers/index.ts +1 -2
  121. package/src/ChangeManager.ts +27 -25
  122. package/src/FeatureDetailsWidget/ApolloTranscriptDetailsWidget.tsx +1 -1
  123. package/src/FeatureDetailsWidget/TranscriptWidgetEditLocation.tsx +69 -53
  124. package/src/LinearApolloDisplay/components/CheckResultWarnings.tsx +1 -5
  125. package/src/LinearApolloDisplay/components/LinearApolloDisplay.tsx +95 -115
  126. package/src/LinearApolloDisplay/components/OverlayCanvas.tsx +76 -0
  127. package/src/LinearApolloDisplay/components/Tooltip.tsx +42 -0
  128. package/src/LinearApolloDisplay/glyphs/BoxGlyph.ts +60 -302
  129. package/src/LinearApolloDisplay/glyphs/CDSGlyph.ts +145 -0
  130. package/src/LinearApolloDisplay/glyphs/ExonGlyph.ts +212 -0
  131. package/src/LinearApolloDisplay/glyphs/GeneGlyph.ts +65 -999
  132. package/src/LinearApolloDisplay/glyphs/GenericChildGlyph.ts +71 -181
  133. package/src/LinearApolloDisplay/glyphs/Glyph.ts +42 -66
  134. package/src/LinearApolloDisplay/glyphs/TranscriptGlyph.ts +291 -0
  135. package/src/LinearApolloDisplay/glyphs/util.ts +87 -0
  136. package/src/LinearApolloDisplay/stateModel/base.ts +83 -0
  137. package/src/LinearApolloDisplay/stateModel/layouts.ts +198 -138
  138. package/src/LinearApolloDisplay/stateModel/mouseEvents.ts +252 -158
  139. package/src/LinearApolloDisplay/stateModel/rendering.ts +103 -21
  140. package/src/LinearApolloReferenceSequenceDisplay/drawSequenceOverlay.ts +3 -3
  141. package/src/LinearApolloReferenceSequenceDisplay/stateModel/base.ts +20 -2
  142. package/src/LinearApolloSixFrameDisplay/components/LinearApolloSixFrameDisplay.tsx +7 -2
  143. package/src/LinearApolloSixFrameDisplay/glyphs/GeneGlyph.ts +8 -13
  144. package/src/LinearApolloSixFrameDisplay/glyphs/Glyph.ts +1 -1
  145. package/src/LinearApolloSixFrameDisplay/stateModel/layouts.ts +4 -3
  146. package/src/LinearApolloSixFrameDisplay/stateModel/mouseEvents.ts +1 -1
  147. package/src/LinearApolloSixFrameDisplay/stateModel/rendering.ts +2 -1
  148. package/src/OntologyManager/OntologyStore/__snapshots__/index.test.ts.snap +18262 -8519
  149. package/src/OntologyManager/OntologyStore/fulltext.ts +1 -2
  150. package/src/OntologyManager/OntologyStore/index.test.ts +5 -2
  151. package/src/OntologyManager/OntologyStore/index.ts +7 -8
  152. package/src/OntologyManager/OntologyStore/indexeddb-storage.ts +2 -2
  153. package/src/OntologyManager/OntologyStore/types.ts +27 -0
  154. package/src/OntologyManager/index.ts +15 -26
  155. package/src/TabularEditor/HybridGrid/featureContextMenuItems.ts +4 -5
  156. package/src/components/AddChildFeature.tsx +15 -8
  157. package/src/components/ColorFeature.tsx +167 -0
  158. package/src/components/CreateApolloAnnotation.tsx +35 -9
  159. package/src/components/DownloadGFF3.tsx +92 -121
  160. package/src/components/DuplicateTranscript.tsx +10 -0
  161. package/src/components/ViewChangeLog.tsx +123 -83
  162. package/src/components/ViewCheckResults.tsx +15 -73
  163. package/src/components/index.ts +1 -1
  164. package/src/config.ts +37 -19
  165. package/src/extensions/annotationFromJBrowseFeature.test.ts +1 -1
  166. package/src/extensions/annotationFromJBrowseFeature.ts +91 -63
  167. package/src/extensions/annotationFromPileup.ts +40 -40
  168. package/src/index.ts +45 -1
  169. package/src/makeDisplayComponent.tsx +10 -3
  170. package/src/menus/Icons.tsx +49 -0
  171. package/src/menus/topLevelMenu.ts +24 -96
  172. package/src/session/ClientDataStore.ts +16 -17
  173. package/src/session/changeHandlers.ts +261 -0
  174. package/src/session/session.ts +77 -46
  175. package/src/util/annotationFeatureUtils.ts +29 -1
  176. package/src/util/glyphUtils.ts +74 -31
  177. package/src/util/index.ts +0 -1
  178. package/dist/BackendDrivers/DesktopFileDriver.d.ts +0 -160
  179. package/dist/BackendDrivers/DesktopFileDriver.d.ts.map +0 -1
  180. package/dist/BackendDrivers/InMemoryFileDriver.d.ts +0 -162
  181. package/dist/BackendDrivers/InMemoryFileDriver.d.ts.map +0 -1
  182. package/dist/LinearApolloDisplay/glyphs/index.d.ts +0 -4
  183. package/dist/LinearApolloDisplay/glyphs/index.d.ts.map +0 -1
  184. package/dist/components/OpenLocalFile.d.ts +0 -15
  185. package/dist/components/OpenLocalFile.d.ts.map +0 -1
  186. package/dist/util/loadAssemblyIntoClient.d.ts +0 -5
  187. package/dist/util/loadAssemblyIntoClient.d.ts.map +0 -1
  188. package/src/BackendDrivers/DesktopFileDriver.ts +0 -184
  189. package/src/BackendDrivers/InMemoryFileDriver.ts +0 -107
  190. package/src/LinearApolloDisplay/glyphs/index.ts +0 -3
  191. package/src/components/OpenLocalFile.tsx +0 -189
  192. package/src/util/loadAssemblyIntoClient.ts +0 -94
@@ -1 +1 @@
1
- {"version":3,"file":"makeDisplayComponent.d.ts","sourceRoot":"","sources":["../src/makeDisplayComponent.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,mBAAmB,IAAI,oBAAoB,EAAE,MAAM,kCAAkC,CAAA;AAEnG,OAAO,KAAK,EAAE,2BAA2B,IAAI,4BAA4B,EAAE,MAAM,0CAA0C,CAAA;AA6I3H,eAAO,MAAM,4BAA4B,wBAGtC;IACD,KAAK,EAAE,oBAAoB,CAAA;CAC5B,4CAoFC,CAAA;AAEF,eAAO,MAAM,oCAAoC,wBAI5C;IACD,KAAK,EAAE,4BAA4B,CAAA;CACpC,4CAsFF,CAAA"}
1
+ {"version":3,"file":"makeDisplayComponent.d.ts","sourceRoot":"","sources":["../src/makeDisplayComponent.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,mBAAmB,IAAI,oBAAoB,EAAE,MAAM,kCAAkC,CAAA;AAEnG,OAAO,KAAK,EAAE,2BAA2B,IAAI,4BAA4B,EAAE,MAAM,0CAA0C,CAAA;AAoJ3H,eAAO,MAAM,4BAA4B,wBAGtC;IACD,KAAK,EAAE,oBAAoB,CAAA;CAC5B,4CAoFC,CAAA;AAEF,eAAO,MAAM,oCAAoC,wBAI5C;IACD,KAAK,EAAE,4BAA4B,CAAA;CACpC,4CAsFF,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { type SvgIconProps } from '@mui/material';
2
+ export declare function Apollo(props: SvgIconProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=Icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icons.d.ts","sourceRoot":"","sources":["../../src/menus/Icons.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAI1D,wBAAgB,MAAM,CAAC,KAAK,EAAE,YAAY,2CA4CzC"}
@@ -1 +1 @@
1
- {"version":3,"file":"topLevelMenu.d.ts","sourceRoot":"","sources":["../../src/menus/topLevelMenu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EAEpB,MAAM,oBAAoB,CAAA;AAkB3B,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,mBAAmB,QAsH9D"}
1
+ {"version":3,"file":"topLevelMenu.d.ts","sourceRoot":"","sources":["../../src/menus/topLevelMenu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EAEpB,MAAM,oBAAoB,CAAA;AAS3B,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,mBAAmB,QAuD9D"}
@@ -0,0 +1,9 @@
1
+ import { type localChanges } from '@apollo-annotation/shared';
2
+ import type { ClientDataStoreModel } from './ClientDataStore';
3
+ type ChangeHandlers = {
4
+ [K in keyof typeof localChanges]: (dataStore: ClientDataStoreModel, change: InstanceType<(typeof localChanges)[K]>) => Promise<void>;
5
+ };
6
+ export declare function isLocalChange(changeName: string): changeName is keyof typeof localChanges;
7
+ export declare const changeHandlers: ChangeHandlers;
8
+ export {};
9
+ //# sourceMappingURL=changeHandlers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"changeHandlers.d.ts","sourceRoot":"","sources":["../../src/session/changeHandlers.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,YAAY,EAElB,MAAM,2BAA2B,CAAA;AAElC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAE7D,KAAK,cAAc,GAAG;KACnB,CAAC,IAAI,MAAM,OAAO,YAAY,GAAG,CAChC,SAAS,EAAE,oBAAoB,EAC/B,MAAM,EAAE,YAAY,CAAC,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,KAC3C,OAAO,CAAC,IAAI,CAAC;CACnB,CAAA;AAED,wBAAgB,aAAa,CAC3B,UAAU,EAAE,MAAM,GACjB,UAAU,IAAI,MAAM,OAAO,YAAY,CAEzC;AAED,eAAO,MAAM,cAAc,EAAE,cA8O5B,CAAA"}
@@ -1,7 +1,8 @@
1
- import type { AnnotationFeature } from '@apollo-annotation/mst';
1
+ import type { AnnotationFeature, AnnotationFeatureSnapshot } from '@apollo-annotation/mst';
2
2
  export declare function getFeatureName(feature: AnnotationFeature): string;
3
3
  export declare function getFeatureId(feature: AnnotationFeature): string;
4
4
  export declare function getFeatureNameOrId(feature: AnnotationFeature): string;
5
5
  export declare function getStrand(strand: number | undefined): "" | "Forward" | "Reverse";
6
6
  export declare function getRelatedFeatures(feature: AnnotationFeature, bp: number, includeSiblings?: boolean): AnnotationFeature[];
7
+ export declare function removeSkippedAttributes(feature: AnnotationFeatureSnapshot, skippedAttributes: Set<string>): void;
7
8
  //# sourceMappingURL=annotationFeatureUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"annotationFeatureUtils.d.ts","sourceRoot":"","sources":["../../src/util/annotationFeatureUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAE/D,wBAAgB,cAAc,CAAC,OAAO,EAAE,iBAAiB,UAOxD;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,iBAAiB,UAmBtD;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,UAU5D;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,8BAQnD;AAuBD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,iBAAiB,EAC1B,EAAE,EAAE,MAAM,EACV,eAAe,UAAQ,GACtB,iBAAiB,EAAE,CAgCrB"}
1
+ {"version":3,"file":"annotationFeatureUtils.d.ts","sourceRoot":"","sources":["../../src/util/annotationFeatureUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,yBAAyB,EAC1B,MAAM,wBAAwB,CAAA;AAE/B,wBAAgB,cAAc,CAAC,OAAO,EAAE,iBAAiB,UAOxD;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,iBAAiB,UAmBtD;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,UAU5D;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,8BAQnD;AAuBD,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,iBAAiB,EAC1B,EAAE,EAAE,MAAM,EACV,eAAe,UAAQ,GACtB,iBAAiB,EAAE,CAgCrB;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,yBAAyB,EAClC,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,QAqB/B"}
@@ -4,17 +4,18 @@ import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
4
4
  import type { LinearApolloDisplayMouseEvents } from '../LinearApolloDisplay/stateModel/mouseEvents';
5
5
  import type { LinearApolloSixFrameDisplayMouseEvents } from '../LinearApolloSixFrameDisplay/stateModel/mouseEvents';
6
6
  import type { ApolloSessionModel } from '../session';
7
- import type { MousePositionWithFeature } from '.';
8
7
  type NavLocation = Parameters<LinearGenomeViewModel['navTo']>[0];
9
8
  export declare function selectFeatureAndOpenWidget(stateModel: LinearApolloDisplayMouseEvents | LinearApolloSixFrameDisplayMouseEvents, feature: AnnotationFeature): void;
9
+ export declare function isGeneFeature(feature: AnnotationFeature, session: ApolloSessionModel): boolean;
10
10
  export declare function isTranscriptFeature(feature: AnnotationFeature, session: ApolloSessionModel): boolean;
11
11
  export declare function isExonFeature(feature: AnnotationFeature, session: ApolloSessionModel): boolean;
12
12
  export declare function isCDSFeature(feature: AnnotationFeature, session: ApolloSessionModel): boolean;
13
+ export declare function looksLikeGene(feature: AnnotationFeature, session: ApolloSessionModel): boolean;
13
14
  export interface AdjacentExons {
14
15
  upstream: AnnotationFeature | undefined;
15
16
  downstream: AnnotationFeature | undefined;
16
17
  }
17
- export declare function getAdjacentExons(currentExon: AnnotationFeature, display: LinearApolloDisplayMouseEvents | LinearApolloSixFrameDisplayMouseEvents, mousePosition: MousePositionWithFeature, session: ApolloSessionModel): AdjacentExons;
18
+ export declare function getAdjacentExons(currentExon: AnnotationFeature, display: LinearApolloDisplayMouseEvents | LinearApolloSixFrameDisplayMouseEvents): AdjacentExons;
18
19
  export declare function getStreamIcon(strand: 1 | -1 | undefined, isUpstream: boolean, isFlipped: boolean | undefined): import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
19
20
  muiName: string;
20
21
  };
@@ -24,7 +25,6 @@ export declare function getOverlappingEdge(feature: AnnotationFeature, x: number
24
25
  edge: 'min' | 'max';
25
26
  } | undefined;
26
27
  export declare function isSelectedFeature(feature: AnnotationFeature, selectedFeature: AnnotationFeature | undefined): boolean;
27
- export declare function containsSelectedFeature(feature: AnnotationFeature, selectedFeature: AnnotationFeature | undefined): boolean;
28
28
  export declare function getContextMenuItemsForFeature(display: LinearApolloSixFrameDisplayMouseEvents | LinearApolloDisplayMouseEvents, sourceFeature: AnnotationFeature): MenuItem[];
29
29
  export declare function navToFeatureCenter(feature: AnnotationFeature, paddingPct: number, refSeqLength: number): NavLocation;
30
30
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"glyphUtils.d.ts","sourceRoot":"","sources":["../../src/util/glyphUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAMhD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAI/E,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,+CAA+C,CAAA;AACnG,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,uDAAuD,CAAA;AAEnH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,GAAG,CAAA;AAEjD,KAAK,WAAW,GAAG,UAAU,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAEhE,wBAAgB,0BAA0B,CACxC,UAAU,EACN,8BAA8B,GAC9B,sCAAsC,EAC1C,OAAO,EAAE,iBAAiB,QAmC3B;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAST;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAMT;AAED,wBAAgB,YAAY,CAC1B,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAMT;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,iBAAiB,GAAG,SAAS,CAAA;IACvC,UAAU,EAAE,iBAAiB,GAAG,SAAS,CAAA;CAC1C;AAED,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,iBAAiB,EAC9B,OAAO,EACH,8BAA8B,GAC9B,sCAAsC,EAC1C,aAAa,EAAE,wBAAwB,EACvC,OAAO,EAAE,kBAAkB,GAC1B,aAAa,CAkDf;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,EAC1B,UAAU,EAAE,OAAO,EACnB,SAAS,EAAE,OAAO,GAAG,SAAS;;EAsB/B;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,iBAAiB,GAAG,oBAAoB,EACjD,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,qBAAqB,GACzB,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAkB9B;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,iBAAiB,EAC1B,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GACvB;IAAE,OAAO,EAAE,iBAAiB,CAAC;IAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAAA;CAAE,GAAG,SAAS,CAajE;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,iBAAiB,EAC1B,eAAe,EAAE,iBAAiB,GAAG,SAAS,WAG/C;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,iBAAiB,EAC1B,eAAe,EAAE,iBAAiB,GAAG,SAAS,GAC7C,OAAO,CAQT;AAqBD,wBAAgB,6BAA6B,CAC3C,OAAO,EACH,sCAAsC,GACtC,8BAA8B,EAClC,aAAa,EAAE,iBAAiB,GAC/B,QAAQ,EAAE,CAwGZ;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,iBAAiB,EAC1B,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,WAAW,CAKb"}
1
+ {"version":3,"file":"glyphUtils.d.ts","sourceRoot":"","sources":["../../src/util/glyphUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EAEjB,oBAAoB,EACrB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAKhD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAI/E,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,+CAA+C,CAAA;AACnG,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,uDAAuD,CAAA;AAKnH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEpD,KAAK,WAAW,GAAG,UAAU,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAEhE,wBAAgB,0BAA0B,CACxC,UAAU,EACN,8BAA8B,GAC9B,sCAAsC,EAC1C,OAAO,EAAE,iBAAiB,QAmC3B;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAST;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAST;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAMT;AAED,wBAAgB,YAAY,CAC1B,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAMT;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,kBAAkB,WA0B5B;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,iBAAiB,GAAG,SAAS,CAAA;IACvC,UAAU,EAAE,iBAAiB,GAAG,SAAS,CAAA;CAC1C;AAED,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,iBAAiB,EAC9B,OAAO,EACH,8BAA8B,GAC9B,sCAAsC,GACzC,aAAa,CA6Cf;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS,EAC1B,UAAU,EAAE,OAAO,EACnB,SAAS,EAAE,OAAO,GAAG,SAAS;;EAsB/B;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,iBAAiB,GAAG,oBAAoB,EACjD,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,qBAAqB,GACzB,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAkB9B;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,iBAAiB,EAC1B,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GACvB;IAAE,OAAO,EAAE,iBAAiB,CAAC;IAAC,IAAI,EAAE,KAAK,GAAG,KAAK,CAAA;CAAE,GAAG,SAAS,CAajE;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,iBAAiB,EAC1B,eAAe,EAAE,iBAAiB,GAAG,SAAS,WAG/C;AAqBD,wBAAgB,6BAA6B,CAC3C,OAAO,EACH,sCAAsC,GACtC,8BAA8B,EAClC,aAAa,EAAE,iBAAiB,GAC/B,QAAQ,EAAE,CA2HZ;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,iBAAiB,EAC1B,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,WAAW,CAKb"}
@@ -3,7 +3,6 @@ import type { ApolloSessionModel } from '../session';
3
3
  export declare function createFetchErrorMessage(response: Response, additionalText?: string): Promise<string>;
4
4
  /** given a session, get our ApolloInternetAccount */
5
5
  export declare function getApolloInternetAccount(session: ApolloSessionModel): ApolloInternetAccountModel | undefined;
6
- export * from './loadAssemblyIntoClient';
7
6
  export * from './annotationFeatureUtils';
8
7
  export * from './glyphUtils';
9
8
  export * from './mouseEventsUtils';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAA;AAChF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAGpD,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,QAAQ,EAClB,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,CAAC,CAWjB;AAED,qDAAqD;AACrD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,kBAAkB,GAG9D,0BAA0B,GAC1B,SAAS,CACd;AAED,cAAc,0BAA0B,CAAA;AACxC,cAAc,0BAA0B,CAAA;AACxC,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAA;AAChF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAGpD,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,QAAQ,EAClB,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,CAAC,CAWjB;AAED,qDAAqD;AACrD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,kBAAkB,GAG9D,0BAA0B,GAC1B,SAAS,CACd;AAED,cAAc,0BAA0B,CAAA;AACxC,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apollo-annotation/jbrowse-plugin-apollo",
3
- "version": "0.3.12",
3
+ "version": "1.0.0",
4
4
  "description": "Apollo plugin for JBrowse 2",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -46,9 +46,9 @@
46
46
  }
47
47
  },
48
48
  "dependencies": {
49
- "@apollo-annotation/common": "^0.3.12",
50
- "@apollo-annotation/mst": "^0.3.12",
51
- "@apollo-annotation/shared": "^0.3.12",
49
+ "@apollo-annotation/common": "^1.0.0",
50
+ "@apollo-annotation/mst": "^1.0.0",
51
+ "@apollo-annotation/shared": "^1.0.0",
52
52
  "@emotion/react": "^11.10.6",
53
53
  "@emotion/styled": "^11.10.6",
54
54
  "@gmod/gff": "^2.1.0",
@@ -19,6 +19,7 @@ import { ConfigurationReference, getConf } from '@jbrowse/core/configuration'
19
19
  import { InternetAccount } from '@jbrowse/core/pluggableElementTypes'
20
20
  import {
21
21
  type AbstractSessionModel,
22
+ type UriLocation,
22
23
  isAbstractMenuManager,
23
24
  isElectron,
24
25
  } from '@jbrowse/core/util'
@@ -68,8 +69,8 @@ const stateModelFactory = (configSchema: ApolloInternetAccountConfigModel) => {
68
69
  .volatile(() => ({
69
70
  role: undefined as Role | undefined,
70
71
  controller: new AbortController(),
72
+ tokenPromise: undefined as Promise<string> | undefined,
71
73
  }))
72
-
73
74
  .actions((self) => ({
74
75
  setRole() {
75
76
  const token = self.retrieveToken()
@@ -78,12 +79,75 @@ const stateModelFactory = (configSchema: ApolloInternetAccountConfigModel) => {
78
79
  return
79
80
  }
80
81
  const dec = getDecodedToken(token)
81
- const { role } = dec
82
+ const { role, exp } = dec
83
+ if (exp < Date.now() / 1000) {
84
+ self.role = undefined
85
+ self.removeToken()
86
+ return
87
+ }
82
88
  if (self.role !== role) {
83
89
  self.role = role
84
90
  }
85
91
  },
86
92
  }))
93
+ .actions((self) => {
94
+ const superGetFetcher = self.getFetcher
95
+ return {
96
+ getFetcher(loc?: UriLocation) {
97
+ const fetcher = superGetFetcher(loc)
98
+ return async (input: RequestInfo, init?: RequestInit) => {
99
+ const response = await fetcher(input, init)
100
+ if (response.status === 403) {
101
+ self.removeToken()
102
+ self.setRole()
103
+ return fetcher(input, init)
104
+ }
105
+ return response
106
+ }
107
+ },
108
+ }
109
+ })
110
+ .actions((self) => ({
111
+ removeToken() {
112
+ sessionStorage.removeItem(self.tokenKey)
113
+ self.tokenPromise = undefined
114
+ },
115
+ }))
116
+ .actions((self) => ({
117
+ async getToken(location?: UriLocation): Promise<string> {
118
+ if (self.tokenPromise) {
119
+ return self.tokenPromise
120
+ }
121
+ let token = location?.internetAccountPreAuthorization?.authInfo?.token
122
+ if (token) {
123
+ self.tokenPromise = Promise.resolve(token)
124
+ return self.tokenPromise
125
+ }
126
+ if (inWebWorker) {
127
+ throw new Error(
128
+ 'Did not get internet account pre-authorization info in worker',
129
+ )
130
+ }
131
+ token = self.retrieveToken()
132
+ if (token) {
133
+ self.tokenPromise = Promise.resolve(token)
134
+ return self.tokenPromise
135
+ }
136
+ self.tokenPromise = new Promise((resolve, reject) => {
137
+ self.getTokenFromUser(
138
+ (token) => {
139
+ self.storeToken(token)
140
+ resolve(token)
141
+ },
142
+ (error) => {
143
+ self.removeToken()
144
+ reject(error)
145
+ },
146
+ )
147
+ })
148
+ return self.tokenPromise
149
+ },
150
+ }))
87
151
  .actions((self) => {
88
152
  let listener: (event: MessageEvent) => void
89
153
  return {
@@ -253,7 +317,7 @@ const stateModelFactory = (configSchema: ApolloInternetAccountConfigModel) => {
253
317
  )
254
318
  throw new Error(errorMessage)
255
319
  }
256
- const changes = yield response.json()
320
+ const { changes } = yield response.json()
257
321
  const sequence = changes.length > 0 ? changes[0].sequence : 0
258
322
  self.setLastChangeSequenceNumber(sequence)
259
323
  },
@@ -298,7 +362,7 @@ const stateModelFactory = (configSchema: ApolloInternetAccountConfigModel) => {
298
362
  )
299
363
  return
300
364
  }
301
- const serializedChanges = yield response.json()
365
+ const { changes: serializedChanges } = yield response.json()
302
366
  for (const serializedChange of serializedChanges) {
303
367
  const change = Change.fromJSON(serializedChange)
304
368
  void changeManager.submit(change, { submitToBackend: false })
@@ -38,9 +38,12 @@ export default class RefNameAliasAdapter
38
38
  extends BaseAdapter
39
39
  implements BaseRefNameAliasAdapter
40
40
  {
41
- private refNameAliases: RefNameAliases[] | undefined
41
+ private refNameAliasesP: Promise<RefNameAliases[]> | undefined
42
42
 
43
43
  async getRefNameAliases() {
44
+ if (this.refNameAliasesP) {
45
+ return this.refNameAliasesP
46
+ }
44
47
  const assemblyId = readConfObject(this.config, 'assemblyId') as string
45
48
  if (!isInWebWorker) {
46
49
  const dataStore = (
@@ -56,7 +59,7 @@ export default class RefNameAliasAdapter
56
59
  const refNameAliases = await backendDriver.getRefNameAliases(assemblyId)
57
60
  return refNameAliases
58
61
  }
59
- const refNameAliases = await new Promise(
62
+ const refNameAliases = new Promise(
60
63
  (
61
64
  resolve: (refNameAliases: RefNameAliases[]) => void,
62
65
  reject: (reason: Error) => void,
@@ -86,7 +89,7 @@ export default class RefNameAliasAdapter
86
89
  })
87
90
  },
88
91
  )
89
- this.refNameAliases = refNameAliases
92
+ this.refNameAliasesP = refNameAliases
90
93
  return refNameAliases
91
94
  }
92
95
 
@@ -16,7 +16,7 @@ function getMatchedFeature(
16
16
  feature: AnnotationFeatureSnapshot,
17
17
  ): AnnotationFeatureSnapshot | undefined {
18
18
  // @ts-expect-error this actually has a bit more info that a plain snapshot
19
- const { children, indexedIds, ...featureWithoutChildren } = feature
19
+ const { children, indexedIds, allIds, ...featureWithoutChildren } = feature
20
20
  const featureString = JSON.stringify(featureWithoutChildren)
21
21
  if (featureString.includes(query)) {
22
22
  return feature
@@ -1,4 +1,4 @@
1
- import type { Change, ClientDataStore } from '@apollo-annotation/common'
1
+ import type { Change, SerializedChange } from '@apollo-annotation/common'
2
2
  import type {
3
3
  AnnotationFeatureSnapshot,
4
4
  CheckResultSnapshot,
@@ -8,15 +8,41 @@ import type { Assembly } from '@jbrowse/core/assemblyManager/assembly'
8
8
  import type { Region } from '@jbrowse/core/util'
9
9
 
10
10
  import type { SubmitOpts } from '../ChangeManager'
11
+ import type { ClientDataStoreModel } from '../session/ClientDataStore'
11
12
 
12
13
  export interface RefNameAliases {
13
14
  refName: string
14
15
  aliases: string[]
15
- uniqueId: string
16
+ uniqueId?: string
17
+ }
18
+
19
+ export interface ChangeDocument extends SerializedChange {
20
+ sequence: IDBValidKey
21
+ user?: string
22
+ createdAt: string
23
+ changes?: SerializedChange[]
24
+ }
25
+
26
+ export interface GetChangesOpts {
27
+ page?: number
28
+ pageSize?: number
29
+ sortField?: string
30
+ sortOrder?: 'asc' | 'desc'
31
+ filters?: {
32
+ user?: string
33
+ typeName?: string
34
+ startTime?: string
35
+ endTime?: string
36
+ }
37
+ }
38
+
39
+ export interface GetChangesResult {
40
+ changes: ChangeDocument[]
41
+ totalCount: number
16
42
  }
17
43
 
18
44
  export abstract class BackendDriver {
19
- constructor(protected clientStore: ClientDataStore) {}
45
+ constructor(protected clientStore: ClientDataStoreModel) {}
20
46
 
21
47
  abstract getFeatures(
22
48
  region: Region,
@@ -39,4 +65,11 @@ export abstract class BackendDriver {
39
65
  term: string,
40
66
  assemblies: string[],
41
67
  ): Promise<AnnotationFeatureSnapshot[]>
68
+
69
+ abstract getChanges(
70
+ assemblyName: string,
71
+ opts?: GetChangesOpts,
72
+ ): Promise<GetChangesResult>
73
+
74
+ abstract getCheckResults(assemblyName: string): Promise<CheckResultSnapshot[]>
42
75
  }
@@ -28,7 +28,12 @@ import type { Socket } from 'socket.io-client'
28
28
  import { ChangeManager, type SubmitOpts } from '../ChangeManager'
29
29
  import { createFetchErrorMessage } from '../util'
30
30
 
31
- import { BackendDriver, type RefNameAliases } from './BackendDriver'
31
+ import {
32
+ BackendDriver,
33
+ type GetChangesOpts,
34
+ type GetChangesResult,
35
+ type RefNameAliases,
36
+ } from './BackendDriver'
32
37
 
33
38
  export interface ApolloRefSeqResponse {
34
39
  _id: string
@@ -72,9 +77,7 @@ export class CollaborationServerDriver extends BackendDriver {
72
77
  }
73
78
 
74
79
  async searchFeatures(term: string, assemblies: string[]) {
75
- const internetAccount = this.clientStore.getInternetAccount(
76
- assemblies[0],
77
- ) as ApolloInternetAccount
80
+ const internetAccount = this.clientStore.getInternetAccount(assemblies[0])
78
81
  const { baseURL } = internetAccount
79
82
 
80
83
  const url = new URL('features/searchFeatures', baseURL)
@@ -114,9 +117,7 @@ export class CollaborationServerDriver extends BackendDriver {
114
117
  throw new Error(`Could not find refSeq "${refName}"`)
115
118
  }
116
119
  const refSeq = refSeqEntry.id
117
- const internetAccount = this.clientStore.getInternetAccount(
118
- assemblyName,
119
- ) as ApolloInternetAccount
120
+ const internetAccount = this.clientStore.getInternetAccount(assemblyName)
120
121
  const { baseURL } = internetAccount
121
122
 
122
123
  const url = new URL('features/getFeatures', baseURL)
@@ -154,16 +155,16 @@ export class CollaborationServerDriver extends BackendDriver {
154
155
  internetAccount: ApolloInternetAccount,
155
156
  ) {
156
157
  const { socket } = internetAccount
157
- const token = internetAccount.retrieveToken()
158
- if (!token) {
159
- return
160
- }
161
- const localSessionId = makeUserSessionId(token)
162
158
  const channel = `${assembly}-${refSeq}`
163
- const changeManager = new ChangeManager(this.clientStore)
164
159
 
165
160
  if (!socket.hasListeners(channel)) {
166
161
  socket.on(channel, async (message: ChangeMessage) => {
162
+ const token = internetAccount.retrieveToken()
163
+ if (!token) {
164
+ return
165
+ }
166
+ const localSessionId = makeUserSessionId(token)
167
+ const changeManager = new ChangeManager(this.clientStore)
167
168
  // Save server last change sequence into session storage
168
169
  internetAccount.setLastChangeSequenceNumber(
169
170
  Number(message.changeSequence),
@@ -229,9 +230,7 @@ export class CollaborationServerDriver extends BackendDriver {
229
230
  if (clientStoreSequence.length === end - start) {
230
231
  return { seq: clientStoreSequence, refSeq }
231
232
  }
232
- const internetAccount = this.clientStore.getInternetAccount(
233
- assemblyName,
234
- ) as ApolloInternetAccount
233
+ const internetAccount = this.clientStore.getInternetAccount(assemblyName)
235
234
  const { baseURL } = internetAccount
236
235
 
237
236
  const url = new URL('sequence', baseURL)
@@ -293,9 +292,7 @@ export class CollaborationServerDriver extends BackendDriver {
293
292
  if (!assembly) {
294
293
  throw new Error(`Could not find assembly with name "${assemblyName}"`)
295
294
  }
296
- const internetAccount = this.clientStore.getInternetAccount(
297
- assemblyName,
298
- ) as ApolloInternetAccount
295
+ const internetAccount = this.clientStore.getInternetAccount(assemblyName)
299
296
  const { baseURL } = internetAccount
300
297
  const url = new URL('refSeqs', baseURL)
301
298
  const searchParams = new URLSearchParams({ assembly: assemblyName })
@@ -351,9 +348,7 @@ export class CollaborationServerDriver extends BackendDriver {
351
348
  if (!assembly) {
352
349
  throw new Error(`Could not find assembly with name "${assemblyName}"`)
353
350
  }
354
- const internetAccount = this.clientStore.getInternetAccount(
355
- assemblyName,
356
- ) as ApolloInternetAccount
351
+ const internetAccount = this.clientStore.getInternetAccount(assemblyName)
357
352
  const { baseURL } = internetAccount
358
353
  const url = new URL('refSeqs', baseURL)
359
354
  const searchParams = new URLSearchParams({ assembly: assemblyName })
@@ -402,6 +397,66 @@ export class CollaborationServerDriver extends BackendDriver {
402
397
  })
403
398
  }
404
399
 
400
+ async getChanges(
401
+ assemblyName: string,
402
+ opts: GetChangesOpts = {},
403
+ ): Promise<GetChangesResult> {
404
+ const internetAccount = this.clientStore.getInternetAccount(assemblyName)
405
+ const { baseURL } = internetAccount
406
+ const url = new URL('changes', baseURL)
407
+ const params: Record<string, string> = { assembly: assemblyName }
408
+ if (opts.page !== undefined) {
409
+ params.page = String(opts.page)
410
+ }
411
+ if (opts.pageSize !== undefined) {
412
+ params.pageSize = String(opts.pageSize)
413
+ }
414
+ if (opts.sortField) {
415
+ params.sortField = opts.sortField
416
+ }
417
+ if (opts.sortOrder) {
418
+ params.sortOrder = opts.sortOrder
419
+ }
420
+ if (opts.filters?.user) {
421
+ params.user = opts.filters.user
422
+ }
423
+ if (opts.filters?.typeName) {
424
+ params.typeName = opts.filters.typeName
425
+ }
426
+ if (opts.filters?.startTime) {
427
+ params.startTime = opts.filters.startTime
428
+ }
429
+ if (opts.filters?.endTime) {
430
+ params.endTime = opts.filters.endTime
431
+ }
432
+ url.search = new URLSearchParams(params).toString()
433
+ const response = await this.fetch(internetAccount, url.toString())
434
+ if (!response.ok) {
435
+ const errorMessage = await createFetchErrorMessage(
436
+ response,
437
+ 'getChanges failed',
438
+ )
439
+ throw new Error(errorMessage)
440
+ }
441
+ return response.json() as Promise<GetChangesResult>
442
+ }
443
+
444
+ async getCheckResults(assemblyName: string): Promise<CheckResultSnapshot[]> {
445
+ const internetAccount = this.clientStore.getInternetAccount(assemblyName)
446
+ const { baseURL } = internetAccount
447
+ const url = new URL('checks', baseURL)
448
+ url.search = new URLSearchParams({ assembly: assemblyName }).toString()
449
+ const response = await this.fetch(internetAccount, url.toString())
450
+ if (!response.ok) {
451
+ const errorMessage = await createFetchErrorMessage(
452
+ response,
453
+ 'getCheckResults failed',
454
+ )
455
+ throw new Error(errorMessage)
456
+ }
457
+ return response.json() as Promise<CheckResultSnapshot[]>
458
+ }
459
+
405
460
  async submitChange(
406
461
  change: Change | AssemblySpecificChange,
407
462
  opts: SubmitOpts = {},
@@ -410,7 +465,7 @@ export class CollaborationServerDriver extends BackendDriver {
410
465
  const internetAccount = this.clientStore.getInternetAccount(
411
466
  'assembly' in change ? change.assembly : undefined,
412
467
  internetAccountId,
413
- ) as ApolloInternetAccount
468
+ )
414
469
  const { baseURL } = internetAccount
415
470
  const url = new URL('changes', baseURL).href
416
471
  const response = await this.fetch(internetAccount, url, {