@apollo-annotation/jbrowse-plugin-apollo 0.1.16 → 0.1.17

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apollo-annotation/jbrowse-plugin-apollo",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "Apollo plugin for JBrowse 2",
5
5
  "repository": {
6
6
  "type": "git",
@@ -51,9 +51,9 @@
51
51
  "name": "Apollo"
52
52
  },
53
53
  "dependencies": {
54
- "@apollo-annotation/common": "^0.1.16",
55
- "@apollo-annotation/mst": "^0.1.16",
56
- "@apollo-annotation/shared": "^0.1.16",
54
+ "@apollo-annotation/common": "^0.1.17",
55
+ "@apollo-annotation/mst": "^0.1.17",
56
+ "@apollo-annotation/shared": "^0.1.17",
57
57
  "@emotion/react": "^11.10.6",
58
58
  "@emotion/styled": "^11.10.6",
59
59
  "@gmod/gff": "1.2.0",
@@ -36,7 +36,7 @@ export const AuthTypeSelector = ({
36
36
  const controller = new AbortController()
37
37
  const { signal } = controller
38
38
  async function getAuthTypes() {
39
- const uri = new URL('/auth/types', baseURL).href
39
+ const uri = new URL('auth/types', baseURL).href
40
40
  const response = await fetch(uri, { method: 'GET', signal })
41
41
  if (!response.ok) {
42
42
  const newErrorMessage = await createFetchErrorMessage(
@@ -288,9 +288,10 @@ const stateModelFactory = (configSchema: ApolloInternetAccountConfigModel) => {
288
288
  }
289
289
  }),
290
290
  }))
291
- .volatile((self) => ({
292
- socket: io(self.baseURL),
293
- }))
291
+ .volatile((self) => {
292
+ const { origin, pathname: path } = new URL('socket.io/', self.baseURL)
293
+ return { socket: io(origin, { path }) }
294
+ })
294
295
  .actions((self) => ({
295
296
  addSocketListeners() {
296
297
  const { session } = getRoot<ApolloRootModel>(self)
@@ -305,7 +306,8 @@ const stateModelFactory = (configSchema: ApolloInternetAccountConfigModel) => {
305
306
  socket.on('connect', async () => {
306
307
  await self.getMissingChanges()
307
308
  })
308
- socket.on('connect_error', () => {
309
+ socket.on('connect_error', (error) => {
310
+ console.error(error)
309
311
  notify('Could not connect to the Apollo server.', 'error')
310
312
  })
311
313
  socket.on('COMMON', (message: ChangeMessage | CheckResultUpdate) => {
@@ -407,7 +409,7 @@ const stateModelFactory = (configSchema: ApolloInternetAccountConfigModel) => {
407
409
  self.addSocketListeners()
408
410
  // request user locations
409
411
  const { baseURL } = self
410
- const uri = new URL('/users/locations', baseURL).href
412
+ const uri = new URL('users/locations', baseURL).href
411
413
  const apolloFetch = self.getFetcher({
412
414
  locationType: 'UriLocation',
413
415
  uri,
@@ -168,7 +168,7 @@ export function AddAssembly({
168
168
  const { baseURL, getFetcher, internetAccountId } = selectedInternetAccount
169
169
  if (fileType !== FileType.EXTERNAL && file) {
170
170
  // First upload file
171
- const url = new URL('/files', baseURL).href
171
+ const url = new URL('files', baseURL).href
172
172
  const formData = new FormData()
173
173
  formData.append('file', file)
174
174
  formData.append('fileName', file.name)
@@ -91,7 +91,7 @@ export function ImportFeatures({
91
91
  }
92
92
 
93
93
  const { baseURL } = apolloInternetAccount
94
- const uri = new URL('/features/count', baseURL)
94
+ const uri = new URL('features/count', baseURL)
95
95
  const searchParams = new URLSearchParams({
96
96
  assemblyId: selectedAssembly.name,
97
97
  })
@@ -158,7 +158,7 @@ export function ImportFeatures({
158
158
  const { baseURL } = apolloInternetAccount
159
159
 
160
160
  // First upload file
161
- const url = new URL('/files', baseURL).href
161
+ const url = new URL('files', baseURL).href
162
162
  const formData = new FormData()
163
163
  formData.append('file', file)
164
164
  formData.append('fileName', file.name)
@@ -78,7 +78,7 @@ export function ManageChecks({ handleClose, session }: ManageChecksProps) {
78
78
  useEffect(() => {
79
79
  async function getChecks() {
80
80
  const { baseURL, getFetcher } = selectedInternetAccount
81
- const uri = new URL('/checks/types', baseURL).href
81
+ const uri = new URL('checks/types', baseURL).href
82
82
  const apolloFetch = getFetcher({ locationType: 'UriLocation', uri })
83
83
  const response = await apolloFetch(uri, { method: 'GET' })
84
84
  if (!response.ok) {
@@ -141,7 +141,7 @@ export function ManageChecks({ handleClose, session }: ManageChecksProps) {
141
141
  }
142
142
  const { notify } = session as unknown as AbstractSessionModel
143
143
  const { baseURL, getFetcher } = selectedInternetAccount
144
- const uri = new URL('/assemblies/checks', baseURL).href
144
+ const uri = new URL('assemblies/checks', baseURL).href
145
145
  const apolloFetch = getFetcher({
146
146
  locationType: 'UriLocation',
147
147
  uri,
@@ -71,7 +71,7 @@ export function ManageUsers({
71
71
 
72
72
  const getUsers = useCallback(async () => {
73
73
  const { baseURL } = selectedInternetAccount
74
- const uri = new URL('/users', baseURL).href
74
+ const uri = new URL('users', baseURL).href
75
75
  const apolloFetch = selectedInternetAccount.getFetcher({
76
76
  locationType: 'UriLocation',
77
77
  uri,
@@ -101,7 +101,7 @@ export function ViewChangeLog({ handleClose, session }: ViewChangeLogProps) {
101
101
 
102
102
  useEffect(() => {
103
103
  async function getAssemblies() {
104
- const uri = new URL('/assemblies', baseURL).href
104
+ const uri = new URL('assemblies', baseURL).href
105
105
  const apolloFetch = apolloInternetAccount?.getFetcher({
106
106
  locationType: 'UriLocation',
107
107
  uri,