diff --git a/lib/actions/link-actions.js b/lib/actions/link-actions.js --- a/lib/actions/link-actions.js +++ b/lib/actions/link-actions.js @@ -1,6 +1,7 @@ // @flow import * as React from 'react'; +import type { CallSingleKeyserverEndpoint } from '../keyserver-conn/call-single-keyserver-endpoint.js'; import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js'; import type { CallKeyserverEndpoint } from '../keyserver-conn/keyserver-conn-types.js'; import type { @@ -13,7 +14,6 @@ DisableInviteLinkPayload, } from '../types/link-types.js'; import { authoritativeKeyserverID } from '../utils/authoritative-keyserver.js'; -import type { CallSingleKeyserverEndpoint } from '../utils/call-single-keyserver-endpoint.js'; import { useKeyserverCall } from '../utils/keyserver-call.js'; import { useSelector } from '../utils/redux-utils.js'; diff --git a/lib/actions/message-actions.js b/lib/actions/message-actions.js --- a/lib/actions/message-actions.js +++ b/lib/actions/message-actions.js @@ -2,6 +2,7 @@ import invariant from 'invariant'; +import type { CallSingleKeyserverEndpointResultInfo } from '../keyserver-conn/call-single-keyserver-endpoint.js'; import { extractKeyserverIDFromID, sortThreadIDsPerKeyserver, @@ -27,7 +28,6 @@ ToggleMessagePinRequest, ToggleMessagePinResult, } from '../types/thread-types.js'; -import type { CallSingleKeyserverEndpointResultInfo } from '../utils/call-single-keyserver-endpoint.js'; import { useKeyserverCall } from '../utils/keyserver-call.js'; const fetchMessagesBeforeCursorActionTypes = Object.freeze({ diff --git a/lib/actions/relationship-actions.js b/lib/actions/relationship-actions.js --- a/lib/actions/relationship-actions.js +++ b/lib/actions/relationship-actions.js @@ -1,10 +1,10 @@ // @flow +import type { CallSingleKeyserverEndpoint } from '../keyserver-conn/call-single-keyserver-endpoint.js'; import type { RelationshipErrors, RelationshipRequest, } from '../types/relationship-types.js'; -import type { CallSingleKeyserverEndpoint } from '../utils/call-single-keyserver-endpoint.js'; import { ServerError } from '../utils/errors.js'; const updateRelationshipsActionTypes = Object.freeze({ diff --git a/lib/actions/siwe-actions.js b/lib/actions/siwe-actions.js --- a/lib/actions/siwe-actions.js +++ b/lib/actions/siwe-actions.js @@ -1,6 +1,10 @@ // @flow import { mergeUserInfos } from './user-actions.js'; +import type { + CallSingleKeyserverEndpoint, + CallSingleKeyserverEndpointOptions, +} from '../keyserver-conn/call-single-keyserver-endpoint.js'; import threadWatcher from '../shared/thread-watcher.js'; import { type LogInResult, @@ -8,10 +12,6 @@ } from '../types/account-types.js'; import type { SIWEAuthServerCall } from '../types/siwe-types.js'; import { authoritativeKeyserverID } from '../utils/authoritative-keyserver.js'; -import type { - CallSingleKeyserverEndpoint, - CallSingleKeyserverEndpointOptions, -} from '../utils/call-single-keyserver-endpoint.js'; import { getConfig } from '../utils/config.js'; const getSIWENonceActionTypes = Object.freeze({ diff --git a/lib/actions/upload-actions.js b/lib/actions/upload-actions.js --- a/lib/actions/upload-actions.js +++ b/lib/actions/upload-actions.js @@ -5,6 +5,7 @@ import uuid from 'uuid'; import blobService from '../facts/blob-service.js'; +import type { CallSingleKeyserverEndpoint } from '../keyserver-conn/call-single-keyserver-endpoint.js'; import { extractKeyserverIDFromID } from '../keyserver-conn/keyserver-call-utils.js'; import type { CallKeyserverEndpoint } from '../keyserver-conn/keyserver-conn-types.js'; import { IdentityClientContext } from '../shared/identity-client-context.js'; @@ -16,7 +17,6 @@ type BlobServiceUploadHandler, } from '../utils/blob-service-upload.js'; import { makeBlobServiceEndpointURL } from '../utils/blob-service.js'; -import type { CallSingleKeyserverEndpoint } from '../utils/call-single-keyserver-endpoint.js'; import { getMessageForException } from '../utils/errors.js'; import { useKeyserverCall } from '../utils/keyserver-call.js'; import { diff --git a/lib/actions/user-actions.js b/lib/actions/user-actions.js --- a/lib/actions/user-actions.js +++ b/lib/actions/user-actions.js @@ -3,6 +3,10 @@ import invariant from 'invariant'; import * as React from 'react'; +import type { + CallSingleKeyserverEndpoint, + CallSingleKeyserverEndpointOptions, +} from '../keyserver-conn/call-single-keyserver-endpoint.js'; import { extractKeyserverIDFromID, sortThreadIDsPerKeyserver, @@ -60,10 +64,6 @@ LoggedOutUserInfo, } from '../types/user-types.js'; import { authoritativeKeyserverID } from '../utils/authoritative-keyserver.js'; -import type { - CallSingleKeyserverEndpoint, - CallSingleKeyserverEndpointOptions, -} from '../utils/call-single-keyserver-endpoint.js'; import { getConfig } from '../utils/config.js'; import { useKeyserverCall } from '../utils/keyserver-call.js'; import { useSelector } from '../utils/redux-utils.js'; diff --git a/lib/keyserver-conn/call-keyserver-endpoint-provider.react.js b/lib/keyserver-conn/call-keyserver-endpoint-provider.react.js --- a/lib/keyserver-conn/call-keyserver-endpoint-provider.react.js +++ b/lib/keyserver-conn/call-keyserver-endpoint-provider.react.js @@ -5,6 +5,11 @@ import * as React from 'react'; import { createSelector } from 'reselect'; +import type { + CallSingleKeyserverEndpoint, + CallSingleKeyserverEndpointOptions, +} from './call-single-keyserver-endpoint.js'; +import callSingleKeyserverEndpoint from './call-single-keyserver-endpoint.js'; import { useKeyserverCallInfos, type KeyserverCallInfo, @@ -26,11 +31,6 @@ import type { Dispatch } from '../types/redux-types.js'; import type { ClientSessionChange } from '../types/session-types.js'; import type { CurrentUserInfo } from '../types/user-types.js'; -import type { - CallSingleKeyserverEndpoint, - CallSingleKeyserverEndpointOptions, -} from '../utils/call-single-keyserver-endpoint.js'; -import callSingleKeyserverEndpoint from '../utils/call-single-keyserver-endpoint.js'; import { promiseAll } from '../utils/promises.js'; import { useSelector, useDispatch } from '../utils/redux-utils.js'; diff --git a/lib/utils/call-single-keyserver-endpoint.js b/lib/keyserver-conn/call-single-keyserver-endpoint.js rename from lib/utils/call-single-keyserver-endpoint.js rename to lib/keyserver-conn/call-single-keyserver-endpoint.js --- a/lib/utils/call-single-keyserver-endpoint.js +++ b/lib/keyserver-conn/call-single-keyserver-endpoint.js @@ -2,15 +2,6 @@ import _isEqual from 'lodash/fp/isEqual.js'; -import { getConfig } from './config.js'; -import { - ServerError, - FetchTimeout, - SocketOffline, - SocketTimeout, -} from './errors.js'; -import sleep from './sleep.js'; -import { uploadBlob, type UploadBlob } from './upload-blob.js'; import { updateLastCommunicatedPlatformDetailsActionType } from '../actions/device-actions.js'; import { callSingleKeyserverEndpointTimeout } from '../shared/timeouts.js'; import type { PlatformDetails } from '../types/device-types.js'; @@ -27,6 +18,15 @@ ClientSessionChange, } from '../types/session-types.js'; import type { CurrentUserInfo } from '../types/user-types.js'; +import { getConfig } from '../utils/config.js'; +import { + ServerError, + FetchTimeout, + SocketOffline, + SocketTimeout, +} from '../utils/errors.js'; +import sleep from '../utils/sleep.js'; +import { uploadBlob, type UploadBlob } from '../utils/upload-blob.js'; export type CallSingleKeyserverEndpointOptions = Partial<{ // null timeout means no timeout, which is the default for uploadBlob diff --git a/lib/keyserver-conn/keyserver-conn-types.js b/lib/keyserver-conn/keyserver-conn-types.js --- a/lib/keyserver-conn/keyserver-conn-types.js +++ b/lib/keyserver-conn/keyserver-conn-types.js @@ -1,5 +1,9 @@ // @flow +import type { + CallSingleKeyserverEndpoint, + CallSingleKeyserverEndpointOptions, +} from './call-single-keyserver-endpoint.js'; import type { AuthActionSource } from '../types/account-types.js'; import type { Endpoint } from '../types/endpoints.js'; import type { Dispatch } from '../types/redux-types.js'; @@ -8,10 +12,6 @@ PreRequestUserState, } from '../types/session-types.js'; import type { ConnectionStatus } from '../types/socket-types.js'; -import type { - CallSingleKeyserverEndpoint, - CallSingleKeyserverEndpointOptions, -} from '../utils/call-single-keyserver-endpoint.js'; export type ActionTypes< STARTED_ACTION_TYPE: string, diff --git a/lib/keyserver-conn/keyserver-connection-handler.js b/lib/keyserver-conn/keyserver-connection-handler.js --- a/lib/keyserver-conn/keyserver-connection-handler.js +++ b/lib/keyserver-conn/keyserver-connection-handler.js @@ -4,6 +4,7 @@ import * as React from 'react'; import { useCallKeyserverEndpointContext } from './call-keyserver-endpoint-provider.react.js'; +import type { CallSingleKeyserverEndpoint } from './call-single-keyserver-endpoint.js'; import { extractKeyserverIDFromID } from './keyserver-call-utils.js'; import { CANCELLED_ERROR, @@ -32,7 +33,6 @@ type AuthActionSource, } from '../types/account-types.js'; import { authoritativeKeyserverID } from '../utils/authoritative-keyserver.js'; -import type { CallSingleKeyserverEndpoint } from '../utils/call-single-keyserver-endpoint.js'; import { getConfig } from '../utils/config.js'; import { getMessageForException } from '../utils/errors.js'; import { useDispatchActionPromise } from '../utils/redux-promise-utils.js'; diff --git a/lib/keyserver-conn/recovery-utils.js b/lib/keyserver-conn/recovery-utils.js --- a/lib/keyserver-conn/recovery-utils.js +++ b/lib/keyserver-conn/recovery-utils.js @@ -3,6 +3,11 @@ import invariant from 'invariant'; import * as React from 'react'; +import callSingleKeyServerEndpoint from './call-single-keyserver-endpoint.js'; +import type { + CallSingleKeyserverEndpoint, + CallSingleKeyserverEndpointOptions, +} from './call-single-keyserver-endpoint.js'; import { setNewSession, type CallKeyserverEndpoint, @@ -22,11 +27,6 @@ type PreRequestUserState, } from '../types/session-types.js'; import { authoritativeKeyserverID } from '../utils/authoritative-keyserver.js'; -import callSingleKeyServerEndpoint from '../utils/call-single-keyserver-endpoint.js'; -import type { - CallSingleKeyserverEndpoint, - CallSingleKeyserverEndpointOptions, -} from '../utils/call-single-keyserver-endpoint.js'; import { getConfig } from '../utils/config.js'; import { promiseAll } from '../utils/promises.js'; import { useDispatchActionPromise } from '../utils/redux-promise-utils.js'; diff --git a/lib/shared/crypto-utils.js b/lib/shared/crypto-utils.js --- a/lib/shared/crypto-utils.js +++ b/lib/shared/crypto-utils.js @@ -6,13 +6,13 @@ getOlmSessionInitializationData, getOlmSessionInitializationDataActionTypes, } from '../actions/user-actions.js'; -import { cookieSelector } from '../selectors/keyserver-selectors.js'; -import type { OLMOneTimeKeys, OLMPrekey } from '../types/crypto-types.js'; -import { useLegacyAshoatKeyserverCall } from '../utils/action-utils.js'; import type { CallSingleKeyserverEndpointOptions, CallSingleKeyserverEndpoint, -} from '../utils/call-single-keyserver-endpoint.js'; +} from '../keyserver-conn/call-single-keyserver-endpoint.js'; +import { cookieSelector } from '../selectors/keyserver-selectors.js'; +import type { OLMOneTimeKeys, OLMPrekey } from '../types/crypto-types.js'; +import { useLegacyAshoatKeyserverCall } from '../utils/action-utils.js'; import { getConfig } from '../utils/config.js'; import { values } from '../utils/objects.js'; import { useDispatchActionPromise } from '../utils/redux-promise-utils.js'; diff --git a/lib/types/message-types.js b/lib/types/message-types.js --- a/lib/types/message-types.js +++ b/lib/types/message-types.js @@ -143,7 +143,7 @@ } from './messages/update-relationship.js'; import { rawUpdateRelationshipMessageInfoValidator } from './messages/update-relationship.js'; import { type RelativeUserInfo, type UserInfos } from './user-types.js'; -import type { CallSingleKeyserverEndpointResultInfoInterface } from '../utils/call-single-keyserver-endpoint.js'; +import type { CallSingleKeyserverEndpointResultInfoInterface } from '../keyserver-conn/call-single-keyserver-endpoint.js'; import { values } from '../utils/objects.js'; import { tID, tNumber, tShape } from '../utils/validation-utils.js'; diff --git a/lib/utils/config.js b/lib/utils/config.js --- a/lib/utils/config.js +++ b/lib/utils/config.js @@ -2,7 +2,7 @@ import invariant from 'invariant'; -import type { CallSingleKeyserverEndpoint } from './call-single-keyserver-endpoint.js'; +import type { CallSingleKeyserverEndpoint } from '../keyserver-conn/call-single-keyserver-endpoint.js'; import type { CallKeyserverEndpoint } from '../keyserver-conn/keyserver-conn-types.js'; import type { InitialNotifMessageOptions } from '../shared/crypto-utils.js'; import type { RecoveryActionSource } from '../types/account-types.js'; diff --git a/lib/utils/keyserver-call.js b/lib/utils/keyserver-call.js --- a/lib/utils/keyserver-call.js +++ b/lib/utils/keyserver-call.js @@ -3,10 +3,10 @@ import _memoize from 'lodash/memoize.js'; import * as React from 'react'; -import type { CallSingleKeyserverEndpointOptions } from './call-single-keyserver-endpoint.js'; import { promiseAll } from './promises.js'; import { useSelector, useDispatch } from './redux-utils.js'; import { useCallKeyserverEndpointContext } from '../keyserver-conn/call-keyserver-endpoint-provider.react.js'; +import type { CallSingleKeyserverEndpointOptions } from '../keyserver-conn/call-single-keyserver-endpoint.js'; import { useKeyserverCallInfos, type KeyserverInfoPartial, diff --git a/lib/utils/upload-blob.js b/lib/utils/upload-blob.js --- a/lib/utils/upload-blob.js +++ b/lib/utils/upload-blob.js @@ -3,11 +3,11 @@ import invariant from 'invariant'; import _throttle from 'lodash/throttle.js'; +import { getConfig } from './config.js'; import type { CallSingleKeyserverEndpointOptions, CallSingleKeyserverEndpointResponse, -} from './call-single-keyserver-endpoint.js'; -import { getConfig } from './config.js'; +} from '../keyserver-conn/call-single-keyserver-endpoint.js'; function uploadBlob( url: string, diff --git a/native/account/legacy-recover-keyserver-session.js b/native/account/legacy-recover-keyserver-session.js --- a/native/account/legacy-recover-keyserver-session.js +++ b/native/account/legacy-recover-keyserver-session.js @@ -1,13 +1,13 @@ // @flow import { logInActionTypes, logInRawAction } from 'lib/actions/user-actions.js'; +import type { CallSingleKeyserverEndpoint } from 'lib/keyserver-conn/call-single-keyserver-endpoint.js'; import { type CallKeyserverEndpoint, CANCELLED_ERROR, } from 'lib/keyserver-conn/keyserver-conn-types.js'; import type { InitialNotifMessageOptions } from 'lib/shared/crypto-utils.js'; import type { RecoveryActionSource } from 'lib/types/account-types.js'; -import type { CallSingleKeyserverEndpoint } from 'lib/utils/call-single-keyserver-endpoint.js'; import type { DispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; import { fetchNativeKeychainCredentials } from './native-credentials.js'; diff --git a/native/account/siwe-hooks.js b/native/account/siwe-hooks.js --- a/native/account/siwe-hooks.js +++ b/native/account/siwe-hooks.js @@ -9,6 +9,7 @@ identityRegisterActionTypes, useIdentityWalletRegister, } from 'lib/actions/user-actions.js'; +import type { CallSingleKeyserverEndpointOptions } from 'lib/keyserver-conn/call-single-keyserver-endpoint.js'; import { useInitialNotificationsEncryptedMessage } from 'lib/shared/crypto-utils.js'; import type { LogInStartingPayload, @@ -19,7 +20,6 @@ IdentityWalletRegisterInput, } from 'lib/types/siwe-types.js'; import { useLegacyAshoatKeyserverCall } from 'lib/utils/action-utils.js'; -import type { CallSingleKeyserverEndpointOptions } from 'lib/utils/call-single-keyserver-endpoint.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; import { authoritativeKeyserverID } from '../authoritative-keyserver.js'; diff --git a/native/data/sqlite-data-handler.js b/native/data/sqlite-data-handler.js --- a/native/data/sqlite-data-handler.js +++ b/native/data/sqlite-data-handler.js @@ -5,6 +5,7 @@ import { setClientDBStoreActionType } from 'lib/actions/client-db-store-actions.js'; import { MediaCacheContext } from 'lib/components/media-cache-provider.react.js'; +import type { CallSingleKeyserverEndpoint } from 'lib/keyserver-conn/call-single-keyserver-endpoint.js'; import type { CallKeyserverEndpoint } from 'lib/keyserver-conn/keyserver-conn-types.js'; import { useKeyserverRecoveryLogIn } from 'lib/keyserver-conn/recovery-utils.js'; import { auxUserStoreOpsHandlers } from 'lib/ops/aux-user-store-ops.js'; @@ -22,7 +23,6 @@ recoveryFromDataHandlerActionSources, type RecoveryFromDataHandlerActionSource, } from 'lib/types/account-types.js'; -import type { CallSingleKeyserverEndpoint } from 'lib/utils/call-single-keyserver-endpoint.js'; import { getMessageForException } from 'lib/utils/errors.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; import { useDispatch } from 'lib/utils/redux-utils.js'; diff --git a/native/input/input-state-container.react.js b/native/input/input-state-container.react.js --- a/native/input/input-state-container.react.js +++ b/native/input/input-state-container.react.js @@ -29,6 +29,10 @@ useBlobServiceUpload, } from 'lib/actions/upload-actions.js'; import commStaffCommunity from 'lib/facts/comm-staff-community.js'; +import type { + CallSingleKeyserverEndpointOptions, + CallSingleKeyserverEndpointResponse, +} from 'lib/keyserver-conn/call-single-keyserver-endpoint.js'; import { pathFromURI, replaceExtension } from 'lib/media/file-utils.js'; import { getNextLocalUploadID, @@ -84,10 +88,6 @@ type NewThreadResult, } from 'lib/types/thread-types.js'; import { useLegacyAshoatKeyserverCall } from 'lib/utils/action-utils.js'; -import type { - CallSingleKeyserverEndpointOptions, - CallSingleKeyserverEndpointResponse, -} from 'lib/utils/call-single-keyserver-endpoint.js'; import { getConfig } from 'lib/utils/config.js'; import { cloneError, getMessageForException } from 'lib/utils/errors.js'; import { values } from 'lib/utils/objects.js'; diff --git a/web/chat/reaction-message-utils.js b/web/chat/reaction-message-utils.js --- a/web/chat/reaction-message-utils.js +++ b/web/chat/reaction-message-utils.js @@ -8,11 +8,11 @@ sendReactionMessageActionTypes, } from 'lib/actions/message-actions.js'; import { useModalContext } from 'lib/components/modal-provider.react.js'; +import type { CallSingleKeyserverEndpointResultInfoInterface } from 'lib/keyserver-conn/call-single-keyserver-endpoint.js'; import type { ReactionInfo } from 'lib/selectors/chat-selectors'; import { getNextLocalID } from 'lib/shared/message-utils.js'; import { messageTypes } from 'lib/types/message-types-enum.js'; import type { RawReactionMessageInfo } from 'lib/types/messages/reaction.js'; -import type { CallSingleKeyserverEndpointResultInfoInterface } from 'lib/utils/call-single-keyserver-endpoint.js'; import { cloneError } from 'lib/utils/errors.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js';