Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

refactor: cleanup sync logic and imports (#5428)

Prit Rojivadiyac31f74829dbb
diff --git a/packages/hoppscotch-backend/src/pubsub/pubsub.service.ts b/packages/hoppscotch-backend/src/pubsub/pubsub.service.ts
index b80d27965..5cdf57b0b 100644
--- a/packages/hoppscotch-backend/src/pubsub/pubsub.service.ts
+++ b/packages/hoppscotch-backend/src/pubsub/pubsub.service.ts
@@ -1,5 +1,4 @@
-import { OnModuleInit } from '@nestjs/common';
-import { Injectable } from '@nestjs/common';
+import { OnModuleInit, Injectable } from '@nestjs/common';
import { PubSub as LocalPubSub } from 'graphql-subscriptions';
import { TopicDef } from './topicsDefs';
diff --git a/packages/hoppscotch-backend/src/team-collection/team-collection.service.ts b/packages/hoppscotch-backend/src/team-collection/team-collection.service.ts
index ac6f9147a..e5bd38f18 100644
--- a/packages/hoppscotch-backend/src/team-collection/team-collection.service.ts
+++ b/packages/hoppscotch-backend/src/team-collection/team-collection.service.ts
@@ -27,6 +27,7 @@ import {
escapeSqlLikeString,
isValidLength,
transformCollectionData,
+ stringToJson
} from 'src/utils';
import * as E from 'fp-ts/Either';
import * as O from 'fp-ts/Option';
@@ -36,7 +37,6 @@ import {
TeamRequest,
} from '@prisma/client';
import { CollectionFolder } from 'src/types/CollectionFolder';
-import { stringToJson } from 'src/utils';
import { CollectionSearchNode } from 'src/types/CollectionSearchNode';
import {
GetCollectionResponse,
diff --git a/packages/hoppscotch-backend/src/user/user.service.ts b/packages/hoppscotch-backend/src/user/user.service.ts
index cb271e22f..5b880cfde 100644
--- a/packages/hoppscotch-backend/src/user/user.service.ts
+++ b/packages/hoppscotch-backend/src/user/user.service.ts
@@ -12,9 +12,9 @@ import {
USERS_NOT_FOUND,
USER_NOT_FOUND,
USER_SHORT_DISPLAY_NAME,
+ USER_UPDATE_FAILED
} from 'src/errors';
import { SessionType, User } from './user.model';
-import { USER_UPDATE_FAILED } from 'src/errors';
import { PubSubService } from 'src/pubsub/pubsub.service';
import { encrypt, stringToJson, taskEitherValidateArraySeq } from 'src/utils';
import { UserDataHandler } from './user.data.handler';
diff --git a/packages/hoppscotch-cli/src/utils/pre-request.ts b/packages/hoppscotch-cli/src/utils/pre-request.ts
index 40cbeb541..9dbdd3e52 100644
--- a/packages/hoppscotch-cli/src/utils/pre-request.ts
+++ b/packages/hoppscotch-cli/src/utils/pre-request.ts
@@ -8,6 +8,7 @@ import {
parseTemplateStringE,
generateJWTToken,
HoppCollectionVariable,
+ calculateHawkHeader
} from "@hoppscotch/data";
import { runPreRequestScript } from "@hoppscotch/js-sandbox/node";
import * as A from "fp-ts/Array";
@@ -34,8 +35,6 @@ import {
generateDigestAuthHeader,
} from "./auth/digest";
-import { calculateHawkHeader } from "@hoppscotch/data";
-
/**
* Runs pre-request-script runner over given request which extracts set ENVs and
* applies them on current request to generate updated request.
diff --git a/packages/hoppscotch-common/src/helpers/actions.ts b/packages/hoppscotch-common/src/helpers/actions.ts
index 25d0f388c..ceeba7517 100644
--- a/packages/hoppscotch-common/src/helpers/actions.ts
+++ b/packages/hoppscotch-common/src/helpers/actions.ts
@@ -2,14 +2,13 @@
* For example, sending a request.
*/
-import { Ref, onBeforeUnmount, onMounted, reactive, watch } from "vue"
+import { Ref, onBeforeUnmount, onMounted, reactive, watch, computed } from "vue"
import { BehaviorSubject } from "rxjs"
import { HoppRequestDocument } from "./rest/document"
import { Environment, HoppGQLRequest, HoppRESTRequest } from "@hoppscotch/data"
import { RESTOptionTabs } from "~/components/http/RequestOptions.vue"
import { HoppGQLSaveContext } from "./graphql/document"
import { GQLOptionTabs } from "~/components/graphql/RequestOptions.vue"
-import { computed } from "vue"
import { getKernelMode } from "@hoppscotch/kernel"
import { invoke } from "@tauri-apps/api/core"
diff --git a/packages/hoppscotch-common/src/helpers/import-export/import/hopp.ts b/packages/hoppscotch-common/src/helpers/import-export/import/hopp.ts
index 82f2f26f6..f949fbf8a 100644
--- a/packages/hoppscotch-common/src/helpers/import-export/import/hopp.ts
+++ b/packages/hoppscotch-common/src/helpers/import-export/import/hopp.ts
@@ -4,14 +4,14 @@ import {
getDefaultGQLRequest,
getDefaultRESTRequest,
translateToNewRESTCollection,
+ HoppGQLRequest,
+ translateToNewGQLCollection
} from "@hoppscotch/data"
import * as A from "fp-ts/Array"
import * as O from "fp-ts/Option"
import * as RA from "fp-ts/ReadonlyArray"
import * as TE from "fp-ts/TaskEither"
import { flow, pipe } from "fp-ts/function"
-
-import { HoppGQLRequest, translateToNewGQLCollection } from "@hoppscotch/data"
import { safeParseJSON } from "~/helpers/functional/json"
import { IMPORTER_INVALID_FILE_FORMAT } from "."
diff --git a/packages/hoppscotch-common/src/newstore/collections.ts b/packages/hoppscotch-common/src/newstore/collections.ts
index bd1e81197..088ee4fbc 100644
--- a/packages/hoppscotch-common/src/newstore/collections.ts
+++ b/packages/hoppscotch-common/src/newstore/collections.ts
@@ -8,11 +8,11 @@ import {
HoppRESTHeaders,
HoppRESTRequest,
makeCollection,
+ GQLHeader
} from "@hoppscotch/data"
import { cloneDeep } from "lodash-es"
import { pluck } from "rxjs/operators"
import { resolveSaveContextOnRequestReorder } from "~/helpers/collection/request"
-import { GQLHeader } from "@hoppscotch/data"
import { HoppInheritedProperty } from "~/helpers/types/HoppInheritedProperties"
import { getService } from "~/modules/dioc"
import { getI18n } from "~/modules/i18n"
diff --git a/packages/hoppscotch-common/src/platform/std/inspections/extension.inspector.ts b/packages/hoppscotch-common/src/platform/std/inspections/extension.inspector.ts
index 933cff47c..ea9b9a615 100644
--- a/packages/hoppscotch-common/src/platform/std/inspections/extension.inspector.ts
+++ b/packages/hoppscotch-common/src/platform/std/inspections/extension.inspector.ts
@@ -6,9 +6,8 @@ import {
} from "~/services/inspection"
import { getI18n } from "~/modules/i18n"
import { HoppRESTRequest } from "@hoppscotch/data"
-import { computed, markRaw } from "vue"
+import { computed, markRaw, Ref } from "vue"
import IconAlertTriangle from "~icons/lucide/alert-triangle"
-import { Ref } from "vue"
import { InterceptorService } from "~/services/interceptor.service"
import { ExtensionInterceptorService } from "~/platform/std/interceptors/extension"
diff --git a/packages/hoppscotch-common/src/platform/std/interceptors/proxy.ts b/packages/hoppscotch-common/src/platform/std/interceptors/proxy.ts
index ed8f52187..75ec4ee3d 100644
--- a/packages/hoppscotch-common/src/platform/std/interceptors/proxy.ts
+++ b/packages/hoppscotch-common/src/platform/std/interceptors/proxy.ts
@@ -1,9 +1,8 @@
import { Interceptor, RequestRunResult } from "~/services/interceptor.service"
-import { AxiosRequestConfig, CancelToken } from "axios"
+import axios, { AxiosRequestConfig, CancelToken } from "axios"
import * as E from "fp-ts/Either"
import { preProcessRequest } from "./helpers"
import { v4 } from "uuid"
-import axios from "axios"
import { settingsStore } from "~/newstore/settings"
import { decodeB64StringToArrayBuffer } from "~/helpers/utils/b64"
import SettingsProxy from "~/components/settings/Proxy.vue"
diff --git a/packages/hoppscotch-common/src/platform/std/kernel-interceptors/agent/index.ts b/packages/hoppscotch-common/src/platform/std/kernel-interceptors/agent/index.ts
index 5a3771f36..8d807bb73 100644
--- a/packages/hoppscotch-common/src/platform/std/kernel-interceptors/agent/index.ts
+++ b/packages/hoppscotch-common/src/platform/std/kernel-interceptors/agent/index.ts
@@ -1,6 +1,12 @@
import { Service } from "dioc"
import { markRaw } from "vue"
-import { body, relayRequestToNativeAdapter } from "@hoppscotch/kernel"
+import {
+ body,
+ relayRequestToNativeAdapter,
+ RelayRequest,
+ RelayResponse,
+ RelayCapabilities
+} from "@hoppscotch/kernel"
import * as E from "fp-ts/Either"
import { pipe } from "fp-ts/function"
import axios, { CancelTokenSource } from "axios"
@@ -8,11 +14,6 @@ import {
postProcessRelayRequest,
preProcessRelayRequest,
} from "~/helpers/functional/process-request"
-import {
- RelayRequest,
- RelayResponse,
- RelayCapabilities,
-} from "@hoppscotch/kernel"
import type { getI18n } from "~/modules/i18n"
import {
KernelInterceptor,
diff --git a/packages/hoppscotch-common/src/services/current-environment-value.service.ts b/packages/hoppscotch-common/src/services/current-environment-value.service.ts
index 67947f5fb..566802689 100644
--- a/packages/hoppscotch-common/src/services/current-environment-value.service.ts
+++ b/packages/hoppscotch-common/src/services/current-environment-value.service.ts
@@ -1,8 +1,6 @@
import { Container, Service } from "dioc"
import { cloneDeep } from "lodash-es"
-import { nextTick } from "vue"
-import { watch } from "vue"
-import { reactive, computed } from "vue"
+import { reactive, computed, watch, nextTick } from "vue"
/**
* Defines a environment variable.
diff --git a/packages/hoppscotch-common/src/services/inspection/index.ts b/packages/hoppscotch-common/src/services/inspection/index.ts
index aa206306f..53d3908f3 100644
--- a/packages/hoppscotch-common/src/services/inspection/index.ts
+++ b/packages/hoppscotch-common/src/services/inspection/index.ts
@@ -4,8 +4,7 @@ import {
} from "@hoppscotch/data"
import { refDebounced } from "@vueuse/core"
import { Service } from "dioc"
-import { computed, markRaw, reactive } from "vue"
-import { Component, Ref, ref, watch } from "vue"
+import { Component, Ref, ref, watch, computed, markRaw, reactive } from "vue"
import { HoppRESTResponse } from "~/helpers/types/HoppRESTResponse"
import { RESTTabService } from "../tab/rest"
/**
diff --git a/packages/hoppscotch-common/src/services/inspection/inspectors/environment.inspector.ts b/packages/hoppscotch-common/src/services/inspection/inspectors/environment.inspector.ts
index 323eb2c3a..37f8ff425 100644
--- a/packages/hoppscotch-common/src/services/inspection/inspectors/environment.inspector.ts
+++ b/packages/hoppscotch-common/src/services/inspection/inspectors/environment.inspector.ts
@@ -6,7 +6,7 @@ import {
InspectorResult,
} from ".."
import { Service } from "dioc"
-import { Ref, markRaw } from "vue"
+import { Ref, markRaw, computed } from "vue"
import IconPlusCircle from "~icons/lucide/plus-circle"
import {
HoppRESTRequest,
@@ -19,7 +19,6 @@ import {
getSelectedEnvironmentType,
} from "~/newstore/environments"
import { invokeAction } from "~/helpers/actions"
-import { computed } from "vue"
import { useStreamStatic } from "~/composables/stream"
import { SecretEnvironmentService } from "~/services/secret-environment.service"
import { RESTTabService } from "~/services/tab/rest"
diff --git a/packages/hoppscotch-common/src/services/inspection/inspectors/response.inspector.ts b/packages/hoppscotch-common/src/services/inspection/inspectors/response.inspector.ts
index dd9c30d1d..d35ddb2fb 100644
--- a/packages/hoppscotch-common/src/services/inspection/inspectors/response.inspector.ts
+++ b/packages/hoppscotch-common/src/services/inspection/inspectors/response.inspector.ts
@@ -5,11 +5,9 @@ import {
HoppRESTRequest,
HoppRESTResponseOriginalRequest,
} from "@hoppscotch/data"
-import { markRaw } from "vue"
import IconAlertTriangle from "~icons/lucide/alert-triangle"
import { HoppRESTResponse } from "~/helpers/types/HoppRESTResponse"
-import { Ref } from "vue"
-import { computed } from "vue"
+import { computed, Ref, markRaw } from "vue"
/**
* This inspector is responsible for inspecting the response of a request.
diff --git a/packages/hoppscotch-common/src/services/persistence/index.ts b/packages/hoppscotch-common/src/services/persistence/index.ts
index 55246ce5f..da00b0293 100644
--- a/packages/hoppscotch-common/src/services/persistence/index.ts
+++ b/packages/hoppscotch-common/src/services/persistence/index.ts
@@ -5,7 +5,7 @@ import { z } from "zod"
import { Service } from "dioc"
import { StorageLike, watchDebounced } from "@vueuse/core"
-import { assign, clone, isEmpty } from "lodash-es"
+import { assign, clone, isEmpty, cloneDeep } from "lodash-es"
import {
GlobalEnvironmentVariable,
@@ -98,7 +98,6 @@ import {
CurrentValueService,
Variable,
} from "../current-environment-value.service"
-import { cloneDeep } from "lodash-es"
import { fixBrokenRequestVersion } from "~/helpers/fixBrokenRequestVersion"
import { fixBrokenEnvironmentVersion } from "~/helpers/fixBrokenEnvironmentVersion"
import {
diff --git a/packages/hoppscotch-common/src/services/secret-environment.service.ts b/packages/hoppscotch-common/src/services/secret-environment.service.ts
index f42841bee..e4f2313e1 100644
--- a/packages/hoppscotch-common/src/services/secret-environment.service.ts
+++ b/packages/hoppscotch-common/src/services/secret-environment.service.ts
@@ -1,6 +1,5 @@
import { Container, Service } from "dioc"
-import { nextTick } from "vue"
-import { reactive, computed, watch } from "vue"
+import { reactive, computed, watch, nextTick } from "vue"
/**
* Defines a secret environment variable.
diff --git a/packages/hoppscotch-data/src/rest/v/15/auth.ts b/packages/hoppscotch-data/src/rest/v/15/auth.ts
index b76a4c608..e3df82b69 100644
--- a/packages/hoppscotch-data/src/rest/v/15/auth.ts
+++ b/packages/hoppscotch-data/src/rest/v/15/auth.ts
@@ -6,8 +6,10 @@ import {
HoppRESTAuthNone,
} from "../1"
import { HoppRESTAuthAPIKey } from "../4"
-import { AuthCodeGrantTypeParams as AuthCodeGrantTypeParamsOld } from "../7"
-import { HoppRESTAuthAWSSignature } from "../7"
+import {
+ AuthCodeGrantTypeParams as AuthCodeGrantTypeParamsOld,
+ HoppRESTAuthAWSSignature,
+} from "../7"
import {
HoppRESTAuthDigest,
PasswordGrantTypeParams as PasswordGrantTypeParamsOld,
diff --git a/packages/hoppscotch-selfhost-desktop/src/platform/collections/collections.sync.ts b/packages/hoppscotch-selfhost-desktop/src/platform/collections/collections.sync.ts
index cd633ca9b..8a0e88ea6 100644
--- a/packages/hoppscotch-selfhost-desktop/src/platform/collections/collections.sync.ts
+++ b/packages/hoppscotch-selfhost-desktop/src/platform/collections/collections.sync.ts
@@ -15,9 +15,8 @@ import {
HoppRESTRequest,
} from "@hoppscotch/data"
-import { getSyncInitFunction } from "../../lib/sync"
+import { getSyncInitFunction, type StoreSyncDefinitionOf } from "../../lib/sync"
-import { StoreSyncDefinitionOf } from "../../lib/sync"
import { createMapper } from "../../lib/sync/mapper"
import {
createRESTChildUserCollection,
@@ -144,13 +143,11 @@ const recursivelySyncCollections = async (
// create the requests
if (parentCollectionID) {
collection.requests.forEach(async (request) => {
- const res =
- parentCollectionID &&
- (await createRESTUserRequest(
- request.name,
- JSON.stringify(request),
- parentCollectionID
- ))
+ const res = await createRESTUserRequest(
+ request.name,
+ JSON.stringify(request),
+ parentCollectionID
+ )
if (res && E.isRight(res)) {
const requestId = res.right.createRESTUserRequest.id
diff --git a/packages/hoppscotch-selfhost-desktop/src/platform/collections/gqlCollections.sync.ts b/packages/hoppscotch-selfhost-desktop/src/platform/collections/gqlCollections.sync.ts
index 775eb01a1..cf2194609 100644
--- a/packages/hoppscotch-selfhost-desktop/src/platform/collections/gqlCollections.sync.ts
+++ b/packages/hoppscotch-selfhost-desktop/src/platform/collections/gqlCollections.sync.ts
@@ -14,9 +14,8 @@ import {
HoppRESTRequest,
} from "@hoppscotch/data"
-import { getSyncInitFunction } from "../../lib/sync"
+import { getSyncInitFunction, type StoreSyncDefinitionOf } from "../../lib/sync"
-import { StoreSyncDefinitionOf } from "../../lib/sync"
import { createMapper } from "../../lib/sync/mapper"
import {
createGQLChildUserCollection,
@@ -165,13 +164,11 @@ const recursivelySyncCollections = async (
// create the requests
if (parentCollectionID) {
collection.requests.forEach(async (request) => {
- const res =
- parentCollectionID &&
- (await createGQLUserRequest(
- request.name,
- JSON.stringify(request),
- parentCollectionID
- ))
+ const res = await createGQLUserRequest(
+ request.name,
+ JSON.stringify(request),
+ parentCollectionID
+ )
if (res && E.isRight(res)) {
const requestId = res.right.createGQLUserRequest.id
diff --git a/packages/hoppscotch-selfhost-desktop/src/platform/environments/environments.sync.ts b/packages/hoppscotch-selfhost-desktop/src/platform/environments/environments.sync.ts
index 98e7a1031..842f3de5f 100644
--- a/packages/hoppscotch-selfhost-desktop/src/platform/environments/environments.sync.ts
+++ b/packages/hoppscotch-selfhost-desktop/src/platform/environments/environments.sync.ts
@@ -8,11 +8,10 @@ import {
settingsStore,
} from "@hoppscotch/common/newstore/settings"
-import { getSyncInitFunction } from "../../lib/sync"
+import { getSyncInitFunction, type StoreSyncDefinitionOf } from "../../lib/sync"
import * as E from "fp-ts/Either"
-import { StoreSyncDefinitionOf } from "../../lib/sync"
import { createMapper } from "../../lib/sync/mapper"
import {
clearGlobalEnvironmentVariables,
diff --git a/packages/hoppscotch-selfhost-desktop/src/platform/history/history.sync.ts b/packages/hoppscotch-selfhost-desktop/src/platform/history/history.sync.ts
index 340c185a5..f018edb9b 100644
--- a/packages/hoppscotch-selfhost-desktop/src/platform/history/history.sync.ts
+++ b/packages/hoppscotch-selfhost-desktop/src/platform/history/history.sync.ts
@@ -9,11 +9,10 @@ import {
settingsStore,
} from "@hoppscotch/common/newstore/settings"
-import { getSyncInitFunction } from "../../lib/sync"
+import { getSyncInitFunction, type StoreSyncDefinitionOf } from "../../lib/sync"
import * as E from "fp-ts/Either"
-import { StoreSyncDefinitionOf } from "../../lib/sync"
import {
createUserHistory,
deleteAllUserHistory,
diff --git a/packages/hoppscotch-selfhost-desktop/src/platform/settings/settings.sync.ts b/packages/hoppscotch-selfhost-desktop/src/platform/settings/settings.sync.ts
index bc42556c5..ae5543bf9 100644
--- a/packages/hoppscotch-selfhost-desktop/src/platform/settings/settings.sync.ts
+++ b/packages/hoppscotch-selfhost-desktop/src/platform/settings/settings.sync.ts
@@ -1,8 +1,5 @@
import { settingsStore } from "@hoppscotch/common/newstore/settings"
-
-import { getSyncInitFunction } from "../../lib/sync"
-
-import { StoreSyncDefinitionOf } from "../../lib/sync"
+import { getSyncInitFunction, type StoreSyncDefinitionOf } from "../../lib/sync"
import { updateUserSettings } from "./settings.api"
diff --git a/packages/hoppscotch-selfhost-web/src/platform/collections/desktop/gqlCollections.sync.ts b/packages/hoppscotch-selfhost-web/src/platform/collections/desktop/gqlCollections.sync.ts
index dde51c3d1..18ef157c2 100644
--- a/packages/hoppscotch-selfhost-web/src/platform/collections/desktop/gqlCollections.sync.ts
+++ b/packages/hoppscotch-selfhost-web/src/platform/collections/desktop/gqlCollections.sync.ts
@@ -14,9 +14,8 @@ import {
HoppRESTRequest,
} from "@hoppscotch/data"
-import { getSyncInitFunction } from "@lib/sync"
+import { getSyncInitFunction, type StoreSyncDefinitionOf } from "@lib/sync"
-import { StoreSyncDefinitionOf } from "@lib/sync"
import { createMapper } from "@lib/sync/mapper"
import {
createGQLChildUserCollection,
@@ -164,13 +163,11 @@ const recursivelySyncCollections = async (
// create the requests
if (parentCollectionID) {
collection.requests.forEach(async (request) => {
- const res =
- parentCollectionID &&
- (await createGQLUserRequest(
- request.name,
- JSON.stringify(request),
- parentCollectionID
- ))
+ const res = await createGQLUserRequest(
+ request.name,
+ JSON.stringify(request),
+ parentCollectionID
+ )
if (res && E.isRight(res)) {
const requestId = res.right.createGQLUserRequest.id
diff --git a/packages/hoppscotch-selfhost-web/src/platform/collections/desktop/sync.ts b/packages/hoppscotch-selfhost-web/src/platform/collections/desktop/sync.ts
index 83249bc67..11a7c156e 100644
--- a/packages/hoppscotch-selfhost-web/src/platform/collections/desktop/sync.ts
+++ b/packages/hoppscotch-selfhost-web/src/platform/collections/desktop/sync.ts
@@ -160,13 +160,11 @@ const recursivelySyncCollections = async (
// create the requests
if (parentCollectionID) {
collection.requests.forEach(async (request) => {
- const res =
- parentCollectionID &&
- (await createRESTUserRequest(
- request.name,
- JSON.stringify(request),
- parentCollectionID
- ))
+ const res = await createRESTUserRequest(
+ request.name,
+ JSON.stringify(request),
+ parentCollectionID
+ )
if (res && E.isRight(res)) {
const requestId = res.right.createRESTUserRequest.id
diff --git a/packages/hoppscotch-selfhost-web/src/platform/collections/web/gqlCollections.sync.ts b/packages/hoppscotch-selfhost-web/src/platform/collections/web/gqlCollections.sync.ts
index 94520b02c..6b34d0daa 100644
--- a/packages/hoppscotch-selfhost-web/src/platform/collections/web/gqlCollections.sync.ts
+++ b/packages/hoppscotch-selfhost-web/src/platform/collections/web/gqlCollections.sync.ts
@@ -14,9 +14,8 @@ import {
HoppRESTRequest,
} from "@hoppscotch/data"
-import { getSyncInitFunction } from "@lib/sync"
+import { getSyncInitFunction, type StoreSyncDefinitionOf } from "@lib/sync"
-import { StoreSyncDefinitionOf } from "@lib/sync"
import { createMapper } from "@lib/sync/mapper"
import {
createGQLChildUserCollection,
@@ -164,13 +163,11 @@ const recursivelySyncCollections = async (
// create the requests
if (parentCollectionID) {
collection.requests.forEach(async (request) => {
- const res =
- parentCollectionID &&
- (await createGQLUserRequest(
- request.name,
- JSON.stringify(request),
- parentCollectionID
- ))
+ const res = await createGQLUserRequest(
+ request.name,
+ JSON.stringify(request),
+ parentCollectionID
+ )
if (res && E.isRight(res)) {
const requestId = res.right.createGQLUserRequest.id
diff --git a/packages/hoppscotch-selfhost-web/src/platform/collections/web/sync.ts b/packages/hoppscotch-selfhost-web/src/platform/collections/web/sync.ts
index 49669ab8b..3db492bbf 100644
--- a/packages/hoppscotch-selfhost-web/src/platform/collections/web/sync.ts
+++ b/packages/hoppscotch-selfhost-web/src/platform/collections/web/sync.ts
@@ -163,13 +163,11 @@ const recursivelySyncCollections = async (
// create the requests
if (parentCollectionID) {
collection.requests.forEach(async (request) => {
- const res =
- parentCollectionID &&
- (await createRESTUserRequest(
- request.name,
- JSON.stringify(request),
- parentCollectionID
- ))
+ const res = await createRESTUserRequest(
+ request.name,
+ JSON.stringify(request),
+ parentCollectionID
+ )
if (res && E.isRight(res)) {
const requestId = res.right.createRESTUserRequest.id
diff --git a/packages/hoppscotch-selfhost-web/src/platform/environments/desktop/sync.ts b/packages/hoppscotch-selfhost-web/src/platform/environments/desktop/sync.ts
index 4ec26761d..8d30d59df 100644
--- a/packages/hoppscotch-selfhost-web/src/platform/environments/desktop/sync.ts
+++ b/packages/hoppscotch-selfhost-web/src/platform/environments/desktop/sync.ts
@@ -8,11 +8,10 @@ import {
settingsStore,
} from "@hoppscotch/common/newstore/settings"
-import { getSyncInitFunction } from "@lib/sync"
+import { getSyncInitFunction, type StoreSyncDefinitionOf } from "@lib/sync"
import * as E from "fp-ts/Either"
-import { StoreSyncDefinitionOf } from "@lib/sync"
import { createMapper } from "@lib/sync/mapper"
import {
clearGlobalEnvironmentVariables,
diff --git a/packages/hoppscotch-selfhost-web/src/platform/environments/web/sync.ts b/packages/hoppscotch-selfhost-web/src/platform/environments/web/sync.ts
index 4ec26761d..8d30d59df 100644
--- a/packages/hoppscotch-selfhost-web/src/platform/environments/web/sync.ts
+++ b/packages/hoppscotch-selfhost-web/src/platform/environments/web/sync.ts
@@ -8,11 +8,10 @@ import {
settingsStore,
} from "@hoppscotch/common/newstore/settings"
-import { getSyncInitFunction } from "@lib/sync"
+import { getSyncInitFunction, type StoreSyncDefinitionOf } from "@lib/sync"
import * as E from "fp-ts/Either"
-import { StoreSyncDefinitionOf } from "@lib/sync"
import { createMapper } from "@lib/sync/mapper"
import {
clearGlobalEnvironmentVariables,
diff --git a/packages/hoppscotch-selfhost-web/src/platform/history/desktop/sync.ts b/packages/hoppscotch-selfhost-web/src/platform/history/desktop/sync.ts
index 5864a36f9..35c4b25d5 100644
--- a/packages/hoppscotch-selfhost-web/src/platform/history/desktop/sync.ts
+++ b/packages/hoppscotch-selfhost-web/src/platform/history/desktop/sync.ts
@@ -9,11 +9,10 @@ import {
settingsStore,
} from "@hoppscotch/common/newstore/settings"
-import { getSyncInitFunction } from "@lib/sync"
+import { getSyncInitFunction, type StoreSyncDefinitionOf } from "@lib/sync"
import * as E from "fp-ts/Either"
-import { StoreSyncDefinitionOf } from "@lib/sync"
import {
createUserHistory,
deleteAllUserHistory,
diff --git a/packages/hoppscotch-selfhost-web/src/platform/history/web/sync.ts b/packages/hoppscotch-selfhost-web/src/platform/history/web/sync.ts
index 04785dbe8..08dfa73ec 100644
--- a/packages/hoppscotch-selfhost-web/src/platform/history/web/sync.ts
+++ b/packages/hoppscotch-selfhost-web/src/platform/history/web/sync.ts
@@ -9,11 +9,10 @@ import {
settingsStore,
} from "@hoppscotch/common/newstore/settings"
-import { getSyncInitFunction } from "@lib/sync"
+import { getSyncInitFunction, type StoreSyncDefinitionOf } from "@lib/sync"
import * as E from "fp-ts/Either"
-import { StoreSyncDefinitionOf } from "@lib/sync"
import {
createUserHistory,
deleteAllUserHistory,
diff --git a/packages/hoppscotch-selfhost-web/src/platform/settings/desktop/sync.ts b/packages/hoppscotch-selfhost-web/src/platform/settings/desktop/sync.ts
index 8dfa1fe16..7103ba0b5 100644
--- a/packages/hoppscotch-selfhost-web/src/platform/settings/desktop/sync.ts
+++ b/packages/hoppscotch-selfhost-web/src/platform/settings/desktop/sync.ts
@@ -1,8 +1,6 @@
import { settingsStore } from "@hoppscotch/common/newstore/settings"
-import { getSyncInitFunction } from "@lib/sync"
-
-import { StoreSyncDefinitionOf } from "@lib/sync"
+import { getSyncInitFunction, type StoreSyncDefinitionOf } from "@lib/sync"
import { updateUserSettings } from "./api"
diff --git a/packages/hoppscotch-selfhost-web/src/platform/settings/web/sync.ts b/packages/hoppscotch-selfhost-web/src/platform/settings/web/sync.ts
index 8dfa1fe16..7103ba0b5 100644
--- a/packages/hoppscotch-selfhost-web/src/platform/settings/web/sync.ts
+++ b/packages/hoppscotch-selfhost-web/src/platform/settings/web/sync.ts
@@ -1,8 +1,6 @@
import { settingsStore } from "@hoppscotch/common/newstore/settings"
-import { getSyncInitFunction } from "@lib/sync"
-
-import { StoreSyncDefinitionOf } from "@lib/sync"
+import { getSyncInitFunction, type StoreSyncDefinitionOf } from "@lib/sync"
import { updateUserSettings } from "./api"
diff --git a/packages/hoppscotch-sh-admin/src/helpers/userManagement.ts b/packages/hoppscotch-sh-admin/src/helpers/userManagement.ts
index c03da5f16..0866172ad 100644
--- a/packages/hoppscotch-sh-admin/src/helpers/userManagement.ts
+++ b/packages/hoppscotch-sh-admin/src/helpers/userManagement.ts
@@ -67,7 +67,7 @@ export const handleUserDeletion = (deletedUsersList: UserDeletionResult[]) => {
// Indicates the actual count of users deleted (filtered via the `isDeleted` field)
const deletedUsersCount = deletedUserIDs.length;
- if (isBulkAction && deletedUsersCount > 0) {
+ if (deletedUsersCount > 0) {
toastMessages.push({
message: t('state.delete_some_users_success', {
count: deletedUsersCount,