Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
TypeScript apiapi-clientapi-restapi-testingdeveloper-toolsgraphqlhttphttp-clientpwarestrest-apispatestingtesting-toolstoolsvuevuejswebsocket
feat: implement environments for selfhosted (#30)
Akash K80898407c3b2
diff --git a/packages/hoppscotch-selfhost-web/.gitignore b/packages/hoppscotch-selfhost-web/.gitignoreindex 5b70e816d..2203746a4 100644--- a/packages/hoppscotch-selfhost-web/.gitignore+++ b/packages/hoppscotch-selfhost-web/.gitignore@@ -25,3 +25,6 @@ dist-ssr# Sitemap Generation Artifacts (see vite.config.ts).sitemap-gen++# Backend Code generation+src/api/generated\ No newline at end of filediff --git a/packages/hoppscotch-selfhost-web/gql-codegen.yml b/packages/hoppscotch-selfhost-web/gql-codegen.ymlnew file mode 100644index 000000000..6f42fcbe0--- /dev/null+++ b/packages/hoppscotch-selfhost-web/gql-codegen.yml@@ -0,0 +1,19 @@+overwrite: true+schema:+ - ${VITE_BACKEND_GQL_URL}+generates:+ src/api/generated/graphql.ts:+ documents: "src/**/*.graphql"+ plugins:+ - add:+ content: >+ /* eslint-disable */+ // Auto-generated file (DO NOT EDIT!!!), refer gql-codegen.yml+ - typescript+ - typescript-operations+ - typed-document-node+ - typescript-urql-graphcache++ src/helpers/backend/backend-schema.json:+ plugins:+ - urql-introspectiondiff --git a/packages/hoppscotch-selfhost-web/package.json b/packages/hoppscotch-selfhost-web/package.jsonindex ad97b6716..1d02524f2 100644--- a/packages/hoppscotch-selfhost-web/package.json+++ b/packages/hoppscotch-selfhost-web/package.json@@ -16,13 +16,16 @@"do-build-prod": "pnpm run build","do-lint": "pnpm run prod-lint","do-typecheck": "pnpm run lint",- "do-lintfix": "pnpm run lintfix"+ "do-lintfix": "pnpm run lintfix",+ "gql-codegen": "graphql-codegen --require dotenv/config --config gql-codegen.yml dotenv_config_path=\"../../.env\""},"dependencies": {"@hoppscotch/common": "workspace:^","axios": "^0.21.4","buffer": "^6.0.3","firebase": "^9.8.4",+ "fp-ts": "^2.13.1",+ "graphql": "^15.8.0","process": "^0.11.10","rxjs": "^7.5.5","stream-browserify": "^3.0.0",@@ -31,6 +34,14 @@"workbox-window": "^6.5.4"},"devDependencies": {+ "@graphql-codegen/add": "^3.2.0",+ "@graphql-codegen/cli": "^2.8.0",+ "@graphql-codegen/typed-document-node": "^2.3.1",+ "@graphql-codegen/typescript": "^2.7.1",+ "@graphql-codegen/typescript-operations": "^2.5.1",+ "@graphql-codegen/typescript-urql-graphcache": "^2.3.1",+ "@graphql-codegen/urql-introspection": "^2.2.0",+ "@graphql-typed-document-node/core": "^3.1.1","@intlify/vite-plugin-vue-i18n": "^6.0.1","@rushstack/eslint-patch": "^1.1.4","@typescript-eslint/eslint-plugin": "^5.19.0",diff --git a/packages/hoppscotch-selfhost-web/src/api/mutations/ClearGlobalEnvironments.graphql b/packages/hoppscotch-selfhost-web/src/api/mutations/ClearGlobalEnvironments.graphqlnew file mode 100644index 000000000..5a184fcf8--- /dev/null+++ b/packages/hoppscotch-selfhost-web/src/api/mutations/ClearGlobalEnvironments.graphql@@ -0,0 +1,5 @@+mutation ClearGlobalEnvironments($id: ID!) {+ clearGlobalEnvironments(id: $id) {+ id+ }+}diff --git a/packages/hoppscotch-selfhost-web/src/api/mutations/CreateUserEnvironment.graphql b/packages/hoppscotch-selfhost-web/src/api/mutations/CreateUserEnvironment.graphqlnew file mode 100644index 000000000..186510644--- /dev/null+++ b/packages/hoppscotch-selfhost-web/src/api/mutations/CreateUserEnvironment.graphql@@ -0,0 +1,9 @@+mutation CreateUserEnvironment($name: String!, $variables: String!) {+ createUserEnvironment(name: $name, variables: $variables) {+ id+ userUid+ name+ variables+ isGlobal+ }+}diff --git a/packages/hoppscotch-selfhost-web/src/api/mutations/CreateUserGlobalEnvironment.graphql b/packages/hoppscotch-selfhost-web/src/api/mutations/CreateUserGlobalEnvironment.graphqlnew file mode 100644index 000000000..8e7553f32--- /dev/null+++ b/packages/hoppscotch-selfhost-web/src/api/mutations/CreateUserGlobalEnvironment.graphql@@ -0,0 +1,5 @@+mutation CreateUserGlobalEnvironment($variables: String!) {+ createUserGlobalEnvironment(variables: $variables) {+ id+ }+}diff --git a/packages/hoppscotch-selfhost-web/src/api/mutations/DeleteUserEnvironments.graphql b/packages/hoppscotch-selfhost-web/src/api/mutations/DeleteUserEnvironments.graphqlnew file mode 100644index 000000000..148971933--- /dev/null+++ b/packages/hoppscotch-selfhost-web/src/api/mutations/DeleteUserEnvironments.graphql@@ -0,0 +1,3 @@+mutation DeleteUserEnvironment($id: ID!) {+ deleteUserEnvironment(id: $id)+}diff --git a/packages/hoppscotch-selfhost-web/src/api/mutations/UpdateUserEnvironment.graphql b/packages/hoppscotch-selfhost-web/src/api/mutations/UpdateUserEnvironment.graphqlnew file mode 100644index 000000000..c849a1541--- /dev/null+++ b/packages/hoppscotch-selfhost-web/src/api/mutations/UpdateUserEnvironment.graphql@@ -0,0 +1,9 @@+mutation UpdateUserEnvironment($id: ID!, $name: String!, $variables: String!) {+ updateUserEnvironment(id: $id, name: $name, variables: $variables) {+ id+ userUid+ name+ variables+ isGlobal+ }+}diff --git a/packages/hoppscotch-selfhost-web/src/api/queries/CreateUserEnvironment.graphql b/packages/hoppscotch-selfhost-web/src/api/queries/CreateUserEnvironment.graphqlnew file mode 100644index 000000000..186510644--- /dev/null+++ b/packages/hoppscotch-selfhost-web/src/api/queries/CreateUserEnvironment.graphql@@ -0,0 +1,9 @@+mutation CreateUserEnvironment($name: String!, $variables: String!) {+ createUserEnvironment(name: $name, variables: $variables) {+ id+ userUid+ name+ variables+ isGlobal+ }+}diff --git a/packages/hoppscotch-selfhost-web/src/api/queries/GetGlobalEnvironments.graphql b/packages/hoppscotch-selfhost-web/src/api/queries/GetGlobalEnvironments.graphqlnew file mode 100644index 000000000..08d3c2143--- /dev/null+++ b/packages/hoppscotch-selfhost-web/src/api/queries/GetGlobalEnvironments.graphql@@ -0,0 +1,11 @@+query GetGlobalEnvironments {+ me {+ globalEnvironments {+ id+ isGlobal+ name+ userUid+ variables+ }+ }+}diff --git a/packages/hoppscotch-selfhost-web/src/api/queries/GetUserEnvironments.graphql b/packages/hoppscotch-selfhost-web/src/api/queries/GetUserEnvironments.graphqlnew file mode 100644index 000000000..0bbeddbb4--- /dev/null+++ b/packages/hoppscotch-selfhost-web/src/api/queries/GetUserEnvironments.graphql@@ -0,0 +1,11 @@+query GetUserEnvironments {+ me {+ environments {+ id+ isGlobal+ name+ userUid+ variables+ }+ }+}diff --git a/packages/hoppscotch-selfhost-web/src/api/subscriptions/UserEnvironmentCreated.graphql b/packages/hoppscotch-selfhost-web/src/api/subscriptions/UserEnvironmentCreated.graphqlnew file mode 100644index 000000000..49fb4b651--- /dev/null+++ b/packages/hoppscotch-selfhost-web/src/api/subscriptions/UserEnvironmentCreated.graphql@@ -0,0 +1,9 @@+subscription UserEnvironmentCreated {+ userEnvironmentCreated {+ id+ isGlobal+ name+ userUid+ variables+ }+}diff --git a/packages/hoppscotch-selfhost-web/src/api/subscriptions/UserEnvironmentDeleted.graphql b/packages/hoppscotch-selfhost-web/src/api/subscriptions/UserEnvironmentDeleted.graphqlnew file mode 100644index 000000000..1ceb27e21--- /dev/null+++ b/packages/hoppscotch-selfhost-web/src/api/subscriptions/UserEnvironmentDeleted.graphql@@ -0,0 +1,5 @@+subscription UserEnvironmentDeleted {+ userEnvironmentDeleted {+ id+ }+}diff --git a/packages/hoppscotch-selfhost-web/src/api/subscriptions/UserEnvironmentUpdated.graphql b/packages/hoppscotch-selfhost-web/src/api/subscriptions/UserEnvironmentUpdated.graphqlnew file mode 100644index 000000000..730c33e57--- /dev/null+++ b/packages/hoppscotch-selfhost-web/src/api/subscriptions/UserEnvironmentUpdated.graphql@@ -0,0 +1,9 @@+subscription UserEnvironmentUpdated {+ userEnvironmentUpdated {+ id+ userUid+ name+ variables+ isGlobal+ }+}diff --git a/packages/hoppscotch-selfhost-web/src/lib/sync/index.ts b/packages/hoppscotch-selfhost-web/src/lib/sync/index.tsnew file mode 100644index 000000000..64ad4b712--- /dev/null+++ b/packages/hoppscotch-selfhost-web/src/lib/sync/index.ts@@ -0,0 +1,101 @@+import { Observable } from "rxjs"+import DispatchingStore from "@hoppscotch/common/newstore/DispatchingStore"++export type DispatchersOf<T extends DispatchingStore<any, any>> =+ T extends DispatchingStore<any, infer U>+ ? U extends Record<infer D, any>+ ? D+ : never+ : never++export type StoreSyncDefinitionOf<T extends DispatchingStore<any, any>> = {+ [x in DispatchersOf<T>]?: T extends DispatchingStore<any, infer U>+ ? U extends Record<x, any>+ ? U[x] extends (x: any, y: infer Y) => any+ ? (payload: Y) => void+ : never+ : never+ : never+}++let _isRunningDispatchWithoutSyncing = true++export function runDispatchWithOutSyncing(func: () => void) {+ _isRunningDispatchWithoutSyncing = false+ func()+ _isRunningDispatchWithoutSyncing = true+}++export const getSyncInitFunction = <T extends DispatchingStore<any, any>>(+ store: T,+ storeSyncDefinition: StoreSyncDefinitionOf<T>,+ shouldSyncValue: () => boolean,+ shouldSyncObservable: Observable<boolean>+) => {+ let startSubscriptions: () => () => void | undefined+ let stopSubscriptions: () => void | undefined++ let oldSyncStatus = shouldSyncValue()++ // Start and stop the subscriptions according to the sync settings from profile+ shouldSyncObservable.subscribe((newSyncStatus) => {+ if (oldSyncStatus === true && newSyncStatus === false) {+ stopListeningToSubscriptions()+ } else if (oldSyncStatus === false && newSyncStatus === true) {+ startListeningToSubscriptions()+ }++ oldSyncStatus = newSyncStatus+ })++ function startStoreSync() {+ store.dispatches$.subscribe((actionParams) => {+ // typescript cannot understand that the dispatcher can be the index, so casting to any+ if ((storeSyncDefinition as any)[actionParams.dispatcher]) {+ const dispatcher = actionParams.dispatcher+ const payload = actionParams.payload++ const operationMapperFunction = (storeSyncDefinition as any)[dispatcher]++ if (+ operationMapperFunction &&+ _isRunningDispatchWithoutSyncing &&+ shouldSyncValue()+ ) {+ operationMapperFunction(payload)+ }+ }+ })+ }++ function setupSubscriptions(func: () => () => void) {+ startSubscriptions = func+ }++ function startListeningToSubscriptions() {+ if (!startSubscriptions) {+ console.warn(+ "We don't have a function to start subscriptions. Please use `setupSubscriptions` to setup the start function."+ )+ }++ startSubscriptions()+ }++ function stopListeningToSubscriptions() {+ if (!stopSubscriptions) {+ console.warn(+ "We don't have a function to unsubscribe. make sure you return the unsubscribe function when using setupSubscriptions"+ )+ }++ stopSubscriptions()+ }++ return {+ startStoreSync,+ setupSubscriptions,+ startListeningToSubscriptions,+ stopListeningToSubscriptions,+ }+}diff --git a/packages/hoppscotch-selfhost-web/src/lib/sync/mapper.ts b/packages/hoppscotch-selfhost-web/src/lib/sync/mapper.tsnew file mode 100644index 000000000..19d93cc1b--- /dev/null+++ b/packages/hoppscotch-selfhost-web/src/lib/sync/mapper.ts@@ -0,0 +1,33 @@+export const createMapper = () => {+ const indexBackendIDMap = new Map<number, string | undefined>()+ const backendIdIndexMap = new Map<string, number | undefined>()++ return {+ addEntry(localIndex: number, backendId: string) {+ indexBackendIDMap.set(localIndex, backendId)+ backendIdIndexMap.set(backendId, localIndex)+ },+ getValue() {+ return indexBackendIDMap+ },+ getBackendIdByIndex(localIndex: number) {+ return indexBackendIDMap.get(localIndex)+ },+ getIndexByBackendId(backendId: string) {+ return backendIdIndexMap.get(backendId)+ },+ removeEntry(backendId?: string, index?: number) {+ if (backendId) {+ const index = backendIdIndexMap.get(backendId)++ backendIdIndexMap.delete(backendId)+ index && indexBackendIDMap.delete(index)+ } else if (index) {+ const backendId = indexBackendIDMap.get(index)++ indexBackendIDMap.delete(index)+ backendId && backendIdIndexMap.delete(backendId)+ }+ },+ }+}diff --git a/packages/hoppscotch-selfhost-web/src/main.ts b/packages/hoppscotch-selfhost-web/src/main.tsindex 898385cc6..5ece10f56 100644--- a/packages/hoppscotch-selfhost-web/src/main.ts+++ b/packages/hoppscotch-selfhost-web/src/main.ts@@ -1,6 +1,10 @@import { createHoppApp } from "@hoppscotch/common"import { def as authDef } from "./platform/auth"+import { def as environmentsDef } from "./platform/environments/environments.platform"createHoppApp("#app", {auth: authDef,+ sync: {+ environments: environmentsDef,+ },})diff --git a/packages/hoppscotch-selfhost-web/src/platform/environments/environments.api.ts b/packages/hoppscotch-selfhost-web/src/platform/environments/environments.api.tsnew file mode 100644index 000000000..7ae561d92--- /dev/null+++ b/packages/hoppscotch-selfhost-web/src/platform/environments/environments.api.ts@@ -0,0 +1,112 @@+import {+ runMutation,+ runGQLQuery,+ runGQLSubscription,+} from "@hoppscotch/common/helpers/backend/GQLClient"++import {+ CreateUserEnvironmentDocument,+ CreateUserEnvironmentMutation,+ CreateUserEnvironmentMutationVariables,+ UpdateUserEnvironmentMutation,+ UpdateUserEnvironmentMutationVariables,+ UpdateUserEnvironmentDocument,+ DeleteUserEnvironmentMutation,+ DeleteUserEnvironmentMutationVariables,+ DeleteUserEnvironmentDocument,+ ClearGlobalEnvironmentsMutation,+ ClearGlobalEnvironmentsMutationVariables,+ ClearGlobalEnvironmentsDocument,+ CreateUserGlobalEnvironmentMutation,+ CreateUserGlobalEnvironmentMutationVariables,+ CreateUserGlobalEnvironmentDocument,+ GetGlobalEnvironmentsDocument,+ GetGlobalEnvironmentsQueryVariables,+ GetGlobalEnvironmentsQuery,+ GetUserEnvironmentsDocument,+ UserEnvironmentCreatedDocument,+ UserEnvironmentUpdatedDocument,+ UserEnvironmentDeletedDocument,+} from "./../../api/generated/graphql"++import { Environment } from "@hoppscotch/data"++export const createUserEnvironment = (name: string, variables: string) =>+ runMutation<+ CreateUserEnvironmentMutation,+ CreateUserEnvironmentMutationVariables,+ ""+ >(CreateUserEnvironmentDocument, {+ name,+ variables,+ })()++export const updateUserEnvironment = (+ id: string,+ { name, variables }: Environment+) =>+ runMutation<+ UpdateUserEnvironmentMutation,+ UpdateUserEnvironmentMutationVariables,+ ""+ >(UpdateUserEnvironmentDocument, {+ id,+ name,+ variables: JSON.stringify(variables),+ })++export const deleteUserEnvironment = (id: string) =>+ runMutation<+ DeleteUserEnvironmentMutation,+ DeleteUserEnvironmentMutationVariables,+ ""+ >(DeleteUserEnvironmentDocument, {+ id,+ })++export const clearGlobalEnvironmentVariables = (id: string) =>+ runMutation<+ ClearGlobalEnvironmentsMutation,+ ClearGlobalEnvironmentsMutationVariables,+ ""+ >(ClearGlobalEnvironmentsDocument, {+ id,+ })()++export const getUserEnvironments = () =>+ runGQLQuery({+ query: GetUserEnvironmentsDocument,+ })++export const getGlobalEnvironments = () =>+ runGQLQuery<+ GetGlobalEnvironmentsQuery,+ GetGlobalEnvironmentsQueryVariables,+ "user_environment/user_env_does_not_exists"+ >({+ query: GetGlobalEnvironmentsDocument,+ })++export const createUserGlobalEnvironment = (variables: string) =>+ runMutation<+ CreateUserGlobalEnvironmentMutation,+ CreateUserGlobalEnvironmentMutationVariables,+ ""+ >(CreateUserGlobalEnvironmentDocument, {+ variables,+ })()++export const runUserEnvironmentCreatedSubscription = () =>+ runGQLSubscription({+ query: UserEnvironmentCreatedDocument,+ })++export const runUserEnvironmentUpdatedSubscription = () =>+ runGQLSubscription({+ query: UserEnvironmentUpdatedDocument,+ })++export const runUserEnvironmentDeletedSubscription = () =>+ runGQLSubscription({+ query: UserEnvironmentDeletedDocument,+ })diff --git a/packages/hoppscotch-selfhost-web/src/platform/environments/environments.platform.ts b/packages/hoppscotch-selfhost-web/src/platform/environments/environments.platform.tsnew file mode 100644index 000000000..3258f1308--- /dev/null+++ b/packages/hoppscotch-selfhost-web/src/platform/environments/environments.platform.ts@@ -0,0 +1,219 @@+import { authEvents$, def as platformAuth } from "@platform/auth"+import {+ createEnvironment,+ deleteEnvironment,+ replaceEnvironments,+ setGlobalEnvVariables,+ updateEnvironment,+} from "@hoppscotch/common/newstore/environments"++import { EnvironmentsPlatformDef } from "@hoppscotch/common/src/platform/environments"+import { runGQLSubscription } from "@hoppscotch/common/helpers/backend/GQLClient"++import {+ environmentsMapper,+ globalEnvironmentMapper,+ environnmentsSyncer,+} from "@platform/environments/environments.sync"++import * as E from "fp-ts/Either"+import { runDispatchWithOutSyncing } from "@lib/sync"+import {+ createUserGlobalEnvironment,+ getGlobalEnvironments,+ getUserEnvironments,+ runUserEnvironmentCreatedSubscription,+ runUserEnvironmentDeletedSubscription,+ runUserEnvironmentUpdatedSubscription,+} from "@platform/environments/environments.api"++export function initEnvironmentsSync() {+ const currentUser$ = platformAuth.getCurrentUserStream()++ environnmentsSyncer.startStoreSync()+ environnmentsSyncer.setupSubscriptions(setupSubscriptions)++ currentUser$.subscribe(async (user) => {+ if (user) {+ await loadAllEnvironments()+ }+ })++ authEvents$.subscribe((event) => {+ if (event.event == "login" || event.event == "token_refresh") {+ environnmentsSyncer.startListeningToSubscriptions()+ }++ if (event.event == "logout") {+ environnmentsSyncer.stopListeningToSubscriptions()+ }+ })+}++export const def: EnvironmentsPlatformDef = {+ initEnvironmentsSync,+}++function setupSubscriptions() {+ let subs: ReturnType<typeof runGQLSubscription>[1][] = []++ const userEnvironmentCreatedSub = setupUserEnvironmentCreatedSubscription()+ const userEnvironmentUpdatedSub = setupUserEnvironmentUpdatedSubscription()+ const userEnvironmentDeletedSub = setupUserEnvironmentDeletedSubscription()++ subs = [+ userEnvironmentCreatedSub,+ userEnvironmentUpdatedSub,+ userEnvironmentDeletedSub,+ ]++ return () => {+ subs.forEach((sub) => sub.unsubscribe())+ }+}++async function loadUserEnvironments() {+ const res = await getUserEnvironments()++ if (E.isRight(res)) {+ const environments = res.right.me.environments++ if (environments.length > 0) {+ environments.forEach((env, index) => {+ environmentsMapper.addEntry(index, env.id)+ })++ runDispatchWithOutSyncing(() => {+ replaceEnvironments(+ environments.map(({ id, variables, name }) => ({+ id,+ name,+ variables: JSON.parse(variables),+ }))+ )+ })+ }+ }+}++async function loadGlobalEnvironments() {+ const res = await getGlobalEnvironments()++ if (E.isRight(res)) {+ const globalEnv = res.right.me.globalEnvironments++ if (globalEnv) {+ runDispatchWithOutSyncing(() => {+ setGlobalEnvVariables(JSON.parse(globalEnv.variables))+ })+ globalEnvironmentMapper.addEntry(0, globalEnv.id)+ }+ } else if (res.left.error == "user_environment/user_env_does_not_exists") {+ const res = await createUserGlobalEnvironment(JSON.stringify([]))++ if (E.isRight(res)) {+ const backendId = res.right.createUserGlobalEnvironment.id+ globalEnvironmentMapper.addEntry(0, backendId)+ }+ }+}++async function loadAllEnvironments() {+ await loadUserEnvironments()+ await loadGlobalEnvironments()+}++function setupUserEnvironmentCreatedSubscription() {+ const [userEnvironmentCreated$, userEnvironmentCreatedSub] =+ runUserEnvironmentCreatedSubscription()++ userEnvironmentCreated$.subscribe((res) => {+ console.group("Subscription: User Environment Created")+ console.log(res)+ console.groupEnd()++ if (E.isRight(res)) {+ const { name, variables } = res.right.userEnvironmentCreated++ if (name) {+ runDispatchWithOutSyncing(() => {+ createEnvironment(name, JSON.parse(variables))+ })+ }+ }+ })++ return userEnvironmentCreatedSub+}++function setupUserEnvironmentUpdatedSubscription() {+ const [userEnvironmentUpdated$, userEnvironmentUpdatedSub] =+ runUserEnvironmentUpdatedSubscription()++ userEnvironmentUpdated$.subscribe((res) => {+ console.group("Subscription: User Environment Updated")+ console.log(res)+ console.groupEnd()++ if (E.isRight(res)) {+ const { name, variables, id, isGlobal } = res.right.userEnvironmentUpdated++ // handle the case for global environments+ if (isGlobal) {+ runDispatchWithOutSyncing(() => {+ setGlobalEnvVariables(JSON.parse(variables))+ })+ } else {+ // handle the case for normal environments++ const localIndex = environmentsMapper.getIndexByBackendId(id)++ if (localIndex && name) {+ runDispatchWithOutSyncing(() => {+ updateEnvironment(localIndex, {+ name,+ variables: JSON.parse(variables),+ })+ })+ }+ }+ }+ })++ return userEnvironmentUpdatedSub+}++function setupUserEnvironmentDeletedSubscription() {+ console.log("setting up user environments for user deleted")++ const [userEnvironmentDeleted$, userEnvironmentDeletedSub] =+ runUserEnvironmentDeletedSubscription()++ userEnvironmentDeleted$.subscribe((res) => {+ console.group("Subscription: User Environment Deleted")+ console.log(res)+ console.groupEnd()++ if (E.isRight(res)) {+ const { id } = res.right.userEnvironmentDeleted++ const localIndex = environmentsMapper.getIndexByBackendId(id)++ if (localIndex) {+ runDispatchWithOutSyncing(() => {+ deleteEnvironment(localIndex)+ })++ environmentsMapper.removeEntry(id)+ } else {+ console.log("could not find the localIndex")+ // TODO:+ // handle order of events+ // eg: update coming before create+ // skipping for this release+ }+ }+ })++ return userEnvironmentDeletedSub+}diff --git a/packages/hoppscotch-selfhost-web/src/platform/environments/environments.sync.ts b/packages/hoppscotch-selfhost-web/src/platform/environments/environments.sync.tsnew file mode 100644index 000000000..32b80238b--- /dev/null+++ b/packages/hoppscotch-selfhost-web/src/platform/environments/environments.sync.ts@@ -0,0 +1,112 @@+import { environmentsStore } from "@hoppscotch/common/newstore/environments"+import {+ getSettingSubject,+ settingsStore,+} from "@hoppscotch/common/newstore/settings"++import { getSyncInitFunction } from "../../lib/sync"++import * as E from "fp-ts/Either"++import { StoreSyncDefinitionOf } from "../../lib/sync"+import { createMapper } from "../../lib/sync/mapper"+import {+ clearGlobalEnvironmentVariables,+ createUserEnvironment,+ deleteUserEnvironment,+ updateUserEnvironment,+} from "./environments.api"++export const environmentsMapper = createMapper()+export const globalEnvironmentMapper = createMapper()++export const storeSyncDefinition: StoreSyncDefinitionOf<+ typeof environmentsStore+> = {+ async createEnvironment({ name, variables }) {+ const lastCreatedEnvIndex = environmentsStore.value.environments.length - 1+ const res = await createUserEnvironment(name, JSON.stringify(variables))++ if (E.isRight(res)) {+ const id = res.right.createUserEnvironment.id+ environmentsMapper.addEntry(lastCreatedEnvIndex, id)+ }+ },+ async appendEnvironments({ envs }) {+ const appendListLength = envs.length+ let appendStart =+ environmentsStore.value.environments.length - appendListLength - 1++ envs.forEach((env) => {+ const envId = ++appendStart++ ;(async function () {+ const res = await createUserEnvironment(+ env.name,+ JSON.stringify(env.variables)+ )++ if (E.isRight(res)) {+ const id = res.right.createUserEnvironment.id+ environmentsMapper.addEntry(envId, id)+ }+ })()+ })+ },+ async duplicateEnvironment({ envIndex }) {+ const environmentToDuplicate = environmentsStore.value.environments.find(+ (_, index) => index === envIndex+ )++ const lastCreatedEnvIndex = environmentsStore.value.environments.length - 1++ if (environmentToDuplicate) {+ const res = await createUserEnvironment(+ environmentToDuplicate?.name,+ JSON.stringify(environmentToDuplicate?.variables)+ )++ if (E.isRight(res)) {+ const id = res.right.createUserEnvironment.id+ environmentsMapper.addEntry(lastCreatedEnvIndex, id)+ }+ }+ },+ updateEnvironment({ envIndex, updatedEnv }) {+ const backendId = environmentsMapper.getBackendIdByIndex(envIndex)+ console.log(environmentsMapper)++ if (backendId) {+ updateUserEnvironment(backendId, updatedEnv)()+ }+ },+ async deleteEnvironment({ envIndex }) {+ const backendId = environmentsMapper.getBackendIdByIndex(envIndex)++ if (backendId) {+ await deleteUserEnvironment(backendId)()+ environmentsMapper.removeEntry(backendId)+ }+ },+ setGlobalVariables({ entries }) {+ const backendId = globalEnvironmentMapper.getBackendIdByIndex(0)++ if (backendId) {+ updateUserEnvironment(backendId, { name: "", variables: entries })()+ }+ },+ clearGlobalVariables() {+ const backendId = globalEnvironmentMapper.getBackendIdByIndex(0)++ if (backendId) {+ clearGlobalEnvironmentVariables(backendId)+ }+ },+}++export const environnmentsSyncer = getSyncInitFunction(+ environmentsStore,+ storeSyncDefinition,+ () => settingsStore.value.syncEnvironments,+ getSettingSubject("syncEnvironments")+)diff --git a/packages/hoppscotch-selfhost-web/tsconfig.json b/packages/hoppscotch-selfhost-web/tsconfig.jsonindex be54e356a..969f1e100 100644--- a/packages/hoppscotch-selfhost-web/tsconfig.json+++ b/packages/hoppscotch-selfhost-web/tsconfig.json@@ -14,7 +14,9 @@"noEmit": true,"paths": {"@hoppscotch/common": [ "../hoppscotch-common/src/index.ts" ],- "@hoppscotch/common/*": [ "../hoppscotch-common/src/*" ]+ "@hoppscotch/common/*": [ "../hoppscotch-common/src/*" ],+ "@platform/*": ["./src/platform/*"],+ "@lib/*": ["./src/lib/*"],}},diff --git a/packages/hoppscotch-selfhost-web/vite.config.ts b/packages/hoppscotch-selfhost-web/vite.config.tsindex e2ebbff90..ce96389cd 100644--- a/packages/hoppscotch-selfhost-web/vite.config.ts+++ b/packages/hoppscotch-selfhost-web/vite.config.ts@@ -58,7 +58,8 @@ export default defineConfig({"../hoppscotch-common/src/helpers/functional"),"@workers": path.resolve(__dirname, "../hoppscotch-common/src/workers"),-+ "@platform": path.resolve(__dirname, "./src/platform"),+ "@lib": path.resolve(__dirname, "./src/lib"),stream: "stream-browserify",util: "util",},@@ -117,6 +118,11 @@ export default defineConfig({prefix: "icon",customCollections: ["hopp", "auth", "brands"],}),+ (compName: string) => {+ if (compName.startsWith("Hopp"))+ return { name: compName, from: "@hoppscotch/ui" }+ else return undefined+ },],types: [{diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 4217996ef..2c814f1d7 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -556,6 +556,14 @@ importers:packages/hoppscotch-selfhost-web:specifiers:+ '@graphql-codegen/add': ^3.2.0+ '@graphql-codegen/cli': ^2.8.0+ '@graphql-codegen/typed-document-node': ^2.3.1+ '@graphql-codegen/typescript': ^2.7.1+ '@graphql-codegen/typescript-operations': ^2.5.1+ '@graphql-codegen/typescript-urql-graphcache': ^2.3.1+ '@graphql-codegen/urql-introspection': ^2.2.0+ '@graphql-typed-document-node/core': ^3.1.1'@hoppscotch/common': workspace:^'@intlify/vite-plugin-vue-i18n': ^6.0.1'@rushstack/eslint-patch': ^1.1.4@@ -571,6 +579,8 @@ importers:eslint-plugin-prettier: ^4.2.1eslint-plugin-vue: ^9.5.1firebase: ^9.8.4+ fp-ts: ^2.13.1+ graphql: ^15.8.0process: ^0.11.10rxjs: ^7.5.5stream-browserify: ^3.0.0@@ -597,6 +607,8 @@ importers:axios: 0.21.4buffer: 6.0.3firebase: 9.8.4+ fp-ts: 2.13.1+ graphql: 15.8.0process: 0.11.10rxjs: 7.6.0stream-browserify: 3.0.0@@ -604,6 +616,14 @@ importers:vue: 3.2.45workbox-window: 6.5.4devDependencies:+ '@graphql-codegen/add': [email protected]+ '@graphql-codegen/cli': 2.8.0_ebknmq4ki2y6h7wwya2jsn57ky+ '@graphql-codegen/typed-document-node': [email protected]+ '@graphql-codegen/typescript': [email protected]+ '@graphql-codegen/typescript-operations': [email protected]+ '@graphql-codegen/typescript-urql-graphcache': [email protected]+ '@graphql-codegen/urql-introspection': [email protected]+ '@graphql-typed-document-node/core': [email protected]'@intlify/vite-plugin-vue-i18n': [email protected]'@rushstack/eslint-patch': 1.1.4'@typescript-eslint/eslint-plugin': 5.45.0_yjegg5cyoezm3fzsmuszzhetym@@ -1446,6 +1466,11 @@ packages:engines: {node: '>=6.9.0'}dev: true+ /@babel/helper-environment-visitor/7.18.9:+ resolution: {integrity: sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==}+ engines: {node: '>=6.9.0'}+ dev: true+/@babel/helper-explode-assignable-expression/7.18.6:resolution: {integrity: sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg==}engines: {node: '>=6.9.0'}@@ -1461,6 +1486,14 @@ packages:'@babel/types': 7.18.7dev: true+ /@babel/helper-function-name/7.21.0:+ resolution: {integrity: sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==}+ engines: {node: '>=6.9.0'}+ dependencies:+ '@babel/template': 7.20.7+ '@babel/types': 7.21.2+ dev: true+/@babel/helper-hoist-variables/7.18.6:resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==}engines: {node: '>=6.9.0'}@@ -1629,6 +1662,14 @@ packages:'@babel/types': 7.20.7dev: true+ /@babel/parser/7.21.2:+ resolution: {integrity: sha512-URpaIJQwEkEC2T9Kn+Ai6Xe/02iNaVCuT/PtoRz3GPVJVDpPd7mLo+VddTbhCRU9TXqW5mSrQfXZyi8kDKOVpQ==}+ engines: {node: '>=6.0.0'}+ hasBin: true+ dependencies:+ '@babel/types': 7.21.2+ dev: true+/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/7.18.6_@[email protected]:resolution: {integrity: sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ==}engines: {node: '>=6.9.0'}@@ -2574,6 +2615,24 @@ packages:- supports-colordev: true+ /@babel/traverse/7.21.2:+ resolution: {integrity: sha512-ts5FFU/dSUPS13tv8XiEObDu9K+iagEKME9kAbaP7r0Y9KtZJZ+NGndDvWoRAYNpeWafbpFeki3q9QoMD6gxyw==}+ engines: {node: '>=6.9.0'}+ dependencies:+ '@babel/code-frame': 7.18.6+ '@babel/generator': 7.21.1+ '@babel/helper-environment-visitor': 7.18.9+ '@babel/helper-function-name': 7.21.0+ '@babel/helper-hoist-variables': 7.18.6+ '@babel/helper-split-export-declaration': 7.18.6+ '@babel/parser': 7.21.2+ '@babel/types': 7.21.2+ debug: 4.3.4+ globals: 11.12.0+ transitivePeerDependencies:+ - supports-color+ dev: true+/@babel/types/7.18.7:resolution: {integrity: sha512-QG3yxTcTIBoAcQmkCs+wAPYZhu7Dk9rXKacINfNbdJDNERTbLQbHGyVG8q/YGMPeCJRIhSY0+fTc5+xuh6WPSQ==}engines: {node: '>=6.9.0'}@@ -2939,6 +2998,21 @@ packages:resolution: {integrity: sha512-8HqW8EVqjnCmWXVpqAOZf+EGESdkR27odcMMMGefgKXtar00SoYNSryGv//TELI4T3QFsECo78p+0lmalk/CFA==}dev: true+ /@endemolshinegroup/cosmiconfig-typescript-loader/3.0.2_qkc3vo3nzqm3fls2mklcv7vbki:+ resolution: {integrity: sha512-QRVtqJuS1mcT56oHpVegkKBlgtWjXw/gHNWO3eL9oyB5Sc7HBoc2OLG/nYpVfT/Jejvo3NUrD0Udk7XgoyDKkA==}+ engines: {node: '>=10.0.0'}+ peerDependencies:+ cosmiconfig: '>=6'+ dependencies:+ cosmiconfig: 7.0.1+ lodash.get: 4.4.2+ make-error: 1.3.6+ ts-node: [email protected]+ tslib: 2.4.0+ transitivePeerDependencies:+ - typescript+ dev: true+/@endemolshinegroup/cosmiconfig-typescript-loader/3.0.2_zmjss6mecb4soo3dpdlecld3xa:resolution: {integrity: sha512-QRVtqJuS1mcT56oHpVegkKBlgtWjXw/gHNWO3eL9oyB5Sc7HBoc2OLG/nYpVfT/Jejvo3NUrD0Udk7XgoyDKkA==}engines: {node: '>=10.0.0'}@@ -3517,6 +3591,53 @@ packages:tslib: 2.5.0dev: true+ /@graphql-codegen/cli/2.8.0_ebknmq4ki2y6h7wwya2jsn57ky:+ resolution: {integrity: sha512-qpLnfWLd7M6ISlXN5c9WPwUE9iZkzS6996hwlvKcYpyGWj10ZtDcEQpH+NFoNjNP3Bu+QOSt6gSnpnCnajwadA==}+ hasBin: true+ peerDependencies:+ graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0+ dependencies:+ '@graphql-codegen/core': [email protected]+ '@graphql-codegen/plugin-helpers': [email protected]+ '@graphql-tools/apollo-engine-loader': [email protected]+ '@graphql-tools/code-file-loader': [email protected]+ '@graphql-tools/git-loader': [email protected]+ '@graphql-tools/github-loader': [email protected]+ '@graphql-tools/graphql-file-loader': [email protected]+ '@graphql-tools/json-file-loader': [email protected]+ '@graphql-tools/load': [email protected]+ '@graphql-tools/prisma-loader': [email protected]+ '@graphql-tools/url-loader': [email protected]+ '@graphql-tools/utils': [email protected]+ ansi-escapes: 4.3.2+ chalk: 4.1.2+ chokidar: 3.5.3+ cosmiconfig: 7.0.1+ cross-undici-fetch: 0.4.11+ debounce: 1.2.1+ detect-indent: 6.1.0+ graphql: 15.8.0+ graphql-config: 4.3.1_ebknmq4ki2y6h7wwya2jsn57ky+ inquirer: 8.2.4+ is-glob: 4.0.3+ json-to-pretty-yaml: 1.2.2+ listr2: 4.0.5+ log-symbols: 4.1.0+ mkdirp: 1.0.4+ string-env-interpolation: 1.0.1+ ts-log: 2.2.4+ yaml: 1.10.2+ yargs: 17.5.1+ transitivePeerDependencies:+ - '@types/node'+ - bufferutil+ - encoding+ - enquirer+ - supports-color+ - typescript+ - utf-8-validate+ dev: true+/@graphql-codegen/cli/2.8.0_h5eoywvcjsa4emif44kddonyyu:resolution: {integrity: sha512-qpLnfWLd7M6ISlXN5c9WPwUE9iZkzS6996hwlvKcYpyGWj10ZtDcEQpH+NFoNjNP3Bu+QOSt6gSnpnCnajwadA==}hasBin: true@@ -3653,7 +3774,7 @@ packages:'@graphql-tools/schema': [email protected]'@graphql-tools/utils': [email protected]graphql: 15.8.0- tslib: 2.4.0+ tslib: 2.4.1dev: true/@graphql-codegen/core/[email protected]:@@ -3921,6 +4042,24 @@ packages:- supports-colordev: true+ /@graphql-codegen/typescript-urql-graphcache/[email protected]:+ resolution: {integrity: sha512-Q7bHSRqZ3Lg4C1AlCRRgVQL4jQTSnKbyO1E7L92126fTz8vfCl9x1UKCu18/1qCP71KkqtC/ipAhyNAlq5/soQ==}+ peerDependencies:+ '@urql/exchange-graphcache': ^4.1.1+ graphql: ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0+ graphql-tag: ^2.0.0+ dependencies:+ '@graphql-codegen/plugin-helpers': [email protected]+ '@graphql-codegen/visitor-plugin-common': [email protected]+ auto-bind: 4.0.0+ change-case-all: 1.0.14+ graphql: 15.8.0+ tslib: 2.4.0+ transitivePeerDependencies:+ - encoding+ - supports-color+ dev: true+/@graphql-codegen/typescript/[email protected]:resolution: {integrity: sha512-qF4SBMgBnLcegba2s9+zC3NwgRhU0Kv+eS8kl9G5ldEHx9Bpu2tft+lk6fjqqhExDzJT+MEOU3Ecog3BzL2R1g==}peerDependencies:@@ -4084,7 +4223,7 @@ packages:cross-undici-fetch: 0.4.11graphql: 15.8.0sync-fetch: 0.4.1- tslib: 2.4.0+ tslib: 2.4.1transitivePeerDependencies:- encodingdev: true@@ -4112,7 +4251,7 @@ packages:'@graphql-tools/utils': [email protected]dataloader: 2.1.0graphql: 15.8.0- tslib: 2.4.0+ tslib: 2.4.1value-or-promise: 1.0.11/@graphql-tools/batch-execute/[email protected]:@@ -4136,7 +4275,7 @@ packages:'@graphql-tools/utils': [email protected]globby: 11.1.0graphql: 15.8.0- tslib: 2.4.0+ tslib: 2.4.1unixify: 1.0.0transitivePeerDependencies:- supports-color@@ -4168,7 +4307,7 @@ packages:'@graphql-tools/utils': [email protected]dataloader: 2.1.0graphql: 15.8.0- tslib: 2.4.0+ tslib: 2.4.1value-or-promise: 1.0.11/@graphql-tools/delegate/[email protected]:@@ -4271,7 +4410,7 @@ packages:graphql: 15.8.0is-glob: 4.0.3micromatch: 4.0.5- tslib: 2.4.0+ tslib: 2.4.1unixify: 1.0.0transitivePeerDependencies:- supports-color@@ -4304,7 +4443,7 @@ packages:cross-undici-fetch: 0.4.11graphql: 15.8.0sync-fetch: 0.4.1- tslib: 2.4.0+ tslib: 2.4.1transitivePeerDependencies:- encoding- supports-color@@ -4337,7 +4476,7 @@ packages:'@graphql-tools/utils': [email protected]globby: 11.1.0graphql: 15.8.0- tslib: 2.4.0+ tslib: 2.4.1unixify: 1.0.0/@graphql-tools/graphql-file-loader/[email protected]:@@ -4363,7 +4502,7 @@ packages:'@babel/types': 7.18.7'@graphql-tools/utils': [email protected]graphql: 15.8.0- tslib: 2.4.0+ tslib: 2.4.1transitivePeerDependencies:- supports-colordev: true@@ -4393,7 +4532,7 @@ packages:'@graphql-tools/utils': [email protected]graphql: 15.8.0resolve-from: 5.0.0- tslib: 2.4.0+ tslib: 2.4.1/@graphql-tools/import/[email protected]:resolution: {integrity: sha512-bn9SgrECXq3WIasgNP7ful/uON51wBajPXtxdY+z/ce7jLWaFE6lzwTDB/GAgiZ+jo7nb0ravlxteSAz2qZmuA==}@@ -4414,7 +4553,7 @@ packages:'@graphql-tools/utils': [email protected]globby: 11.1.0graphql: 15.8.0- tslib: 2.4.0+ tslib: 2.4.1unixify: 1.0.0/@graphql-tools/json-file-loader/[email protected]:@@ -4438,7 +4577,7 @@ packages:'@graphql-tools/utils': [email protected]graphql: 15.8.0p-limit: 3.1.0- tslib: 2.4.0+ tslib: 2.4.1/@graphql-tools/load/[email protected]:resolution: {integrity: sha512-JwxgNS2c6i6oIdKttcbXns/lpKiyN7c6/MkkrJ9x2QE9rXk5HOhSJxRvPmOueCuAin1542xUrcDRGBXJ7thSig==}@@ -4530,7 +4669,7 @@ packages:'@graphql-tools/utils': [email protected]'@types/js-yaml': 4.0.5'@types/json-stable-stringify': 1.0.34- '@types/jsonwebtoken': 8.5.8+ '@types/jsonwebtoken': 8.5.9chalk: 4.1.2debug: 4.3.4dotenv: 16.0.1@@ -4545,7 +4684,7 @@ packages:lodash: 4.17.21replaceall: 0.1.6scuid: 1.1.0- tslib: 2.4.0+ tslib: 2.4.1yaml-ast-parser: 0.0.43transitivePeerDependencies:- '@types/node'@@ -4681,7 +4820,7 @@ packages:isomorphic-ws: [email protected]meros: 1.2.0sync-fetch: 0.4.1- tslib: 2.4.0+ tslib: 2.4.1value-or-promise: 1.0.11ws: 8.12.1transitivePeerDependencies:@@ -4779,7 +4918,7 @@ packages:'@graphql-tools/schema': [email protected]'@graphql-tools/utils': [email protected]graphql: 15.8.0- tslib: 2.4.0+ tslib: 2.4.1value-or-promise: 1.0.11/@graphql-tools/wrap/[email protected]:@@ -4995,8 +5134,8 @@ packages:- supports-colordev: true- /@intlify/bundle-utils/4.0.0:- resolution: {integrity: sha512-klXrYT9VXyKEXsD6UY3pShg0O5MPC07n0TZ5RrSs5ry6T1eZVolIFGJi9c3qcDrh1qjJxgikRnPBmD7qGDqbjw==}+ /@intlify/bundle-utils/5.0.1:+ resolution: {integrity: sha512-qF6reZHDm+h7jUId2npzwNZYCvrUcr0bAYnJXgiShKBxTFpxOq7nrqy7UrRWj8M2w4GTCJczeQZmQGFxc/GdFA==}engines: {node: '>= 12'}peerDependencies:petite-vue-i18n: '*'@@ -5007,15 +5146,19 @@ packages:vue-i18n:optional: truedependencies:+ '@babel/parser': 7.21.2+ '@babel/traverse': 7.21.2'@intlify/message-compiler': 9.3.0-beta.16'@intlify/shared': 9.3.0-beta.16jsonc-eslint-parser: 1.4.1source-map: 0.6.1yaml-eslint-parser: 0.3.2+ transitivePeerDependencies:+ - supports-colordev: true- /@intlify/bundle-utils/[email protected]:- resolution: {integrity: sha512-klXrYT9VXyKEXsD6UY3pShg0O5MPC07n0TZ5RrSs5ry6T1eZVolIFGJi9c3qcDrh1qjJxgikRnPBmD7qGDqbjw==}+ /@intlify/bundle-utils/[email protected]:+ resolution: {integrity: sha512-qF6reZHDm+h7jUId2npzwNZYCvrUcr0bAYnJXgiShKBxTFpxOq7nrqy7UrRWj8M2w4GTCJczeQZmQGFxc/GdFA==}engines: {node: '>= 12'}peerDependencies:petite-vue-i18n: '*'@@ -5026,12 +5169,16 @@ packages:vue-i18n:optional: truedependencies:+ '@babel/parser': 7.21.2+ '@babel/traverse': 7.21.2'@intlify/message-compiler': 9.3.0-beta.16'@intlify/shared': 9.3.0-beta.16jsonc-eslint-parser: 1.4.1source-map: 0.6.1vue-i18n: [email protected]yaml-eslint-parser: 0.3.2+ transitivePeerDependencies:+ - supports-colordev: true/@intlify/core-base/9.2.2:@@ -5088,7 +5235,7 @@ packages:vue-i18n:optional: truedependencies:- '@intlify/bundle-utils': [email protected]+ '@intlify/bundle-utils': [email protected]'@intlify/shared': 9.3.0-beta.16'@rollup/pluginutils': 4.2.1debug: 4.3.4@@ -5115,13 +5262,13 @@ packages:vue-i18n:optional: truedependencies:- '@intlify/bundle-utils': 4.0.0+ '@intlify/bundle-utils': 5.0.1'@intlify/shared': 9.3.0-beta.16'@rollup/pluginutils': 4.2.1debug: 4.3.4fast-glob: 3.2.11source-map: 0.6.1- vite: 3.2.4+ vite: [email protected]transitivePeerDependencies:- supports-colordev: true@@ -6849,12 +6996,6 @@ packages:resolution: {integrity: sha512-s2cfwagOQAS8o06TcwKfr9Wx11dNGbH2E9vJz1cqV+a/LOyhWNLUNd6JSRYNzvB4d29UuJX2M0Dj9vE1T8fRXw==}dev: true- /@types/jsonwebtoken/8.5.8:- resolution: {integrity: sha512-zm6xBQpFDIDM6o9r6HSgDeIcLy82TKWctCXEPbJJcXb5AKmi5BNNdLXneixK4lplX3PqIVcwLBCGE/kAGnlD4A==}- dependencies:- '@types/node': 17.0.45- dev: true-/@types/jsonwebtoken/8.5.9:resolution: {integrity: sha512-272FMnFGzAVMGtu9tkr29hRL6bZj4Zs1KZNeHLnKqAvp06tAIcarTMwOh8/8bz4FmKRcMxZhZNeUAQsNLoiPhg==}dependencies:@@ -7093,7 +7234,7 @@ packages:/@types/ws/8.5.3:resolution: {integrity: sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==}dependencies:- '@types/node': 17.0.45+ '@types/node': 18.11.10/@types/yargs-parser/21.0.0:resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==}@@ -7836,7 +7977,7 @@ packages:magic-string: 0.26.7regenerator-runtime: 0.13.10systemjs: 6.13.0- vite: 3.2.4+ vite: [email protected]/@vitejs/plugin-vue/[email protected]:resolution: {integrity: sha512-/QJ0Z9qfhAFtKRY+r57ziY4BSbGUTGsPRMpB/Ron3QPwBZM4OZAZHdTa4a8PafCwU5DTatXG8TMDoP8z+oDqJw==}@@ -7865,7 +8006,7 @@ packages:vite: ^3.0.0vue: ^3.2.25dependencies:- vite: 3.2.4+ vite: [email protected]vue: 3.2.45dev: true@@ -8685,7 +8826,7 @@ packages:hasBin: true/after/0.8.2:- resolution: {integrity: sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=}+ resolution: {integrity: sha512-QbJ0NTQ/I9DI3uSJA4cbexiwQeRAfjPScqIbSjUDd9TOrcg6pTkdgziesOqxBMBzit8vFCTwrP27t13vFOORRA==}dev: false/agent-base/6.0.2:@@ -9292,7 +9433,7 @@ packages:resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}/base64-arraybuffer/0.1.4:- resolution: {integrity: sha1-mBjHngWbE1X5fgQooBfIOOkLqBI=}+ resolution: {integrity: sha512-a1eIFi4R9ySrbiMuyTGx5e92uRH5tQY6kArNcFaKBUleIoLjdjBg7Zxm3Mqm3Kmkf27HLR/1fnxX9q8GQ7Iavg==}engines: {node: '>= 0.6.0'}dev: false@@ -9516,7 +9657,7 @@ packages:resolution: {integrity: sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==}dependencies:pascal-case: 3.1.2- tslib: 2.4.0+ tslib: 2.4.1/camelcase-keys/6.2.2:resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==}@@ -9545,7 +9686,7 @@ packages:resolution: {integrity: sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==}dependencies:no-case: 3.0.4- tslib: 2.4.0+ tslib: 2.4.1upper-case-first: 2.0.2/chalk/1.1.3:@@ -9626,7 +9767,7 @@ packages:path-case: 3.0.4sentence-case: 3.0.4snake-case: 3.0.4- tslib: 2.4.0+ tslib: 2.4.1/char-regex/1.0.2:resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==}@@ -9848,14 +9989,14 @@ packages:dev: true/component-bind/1.0.0:- resolution: {integrity: sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=}+ resolution: {integrity: sha512-WZveuKPeKAG9qY+FkYDeADzdHyTYdIboXS59ixDeRJL5ZhxpqUnxSOwop4FQjMsiYm3/Or8cegVbpAHNA7pHxw==}dev: false/component-emitter/1.3.0:resolution: {integrity: sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==}/component-inherit/0.0.3:- resolution: {integrity: sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=}+ resolution: {integrity: sha512-w+LhYREhatpVqTESyGFg3NlP6Iu0kEKUHETY9GoZP/pQyW4mHFZuFWRUCIqVPZ36ueVLtoOEZaAqbCF2RDndaA==}dev: false/concat-map/0.0.1:@@ -9892,7 +10033,7 @@ packages:resolution: {integrity: sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==}dependencies:no-case: 3.0.4- tslib: 2.4.0+ tslib: 2.4.1upper-case: 2.0.2/constantinople/4.0.1:@@ -10492,7 +10633,7 @@ packages:resolution: {integrity: sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==}dependencies:no-case: 3.0.4- tslib: 2.4.0+ tslib: 2.4.1/dot-prop/5.3.0:resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==}@@ -12607,6 +12748,32 @@ packages:/grapheme-splitter/1.0.4:resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==}+ /graphql-config/4.3.1_ebknmq4ki2y6h7wwya2jsn57ky:+ resolution: {integrity: sha512-czBWzJSGaLJfOHBLuUTZVRTjfgohPfvlaeN1B5nXBVptFARpiFuS7iI4FnRhCGwm6qt1h2j1g05nkg0OIGA6bg==}+ engines: {node: '>= 10.0.0'}+ peerDependencies:+ graphql: ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0+ dependencies:+ '@endemolshinegroup/cosmiconfig-typescript-loader': 3.0.2_qkc3vo3nzqm3fls2mklcv7vbki+ '@graphql-tools/graphql-file-loader': [email protected]+ '@graphql-tools/json-file-loader': [email protected]+ '@graphql-tools/load': [email protected]+ '@graphql-tools/merge': [email protected]+ '@graphql-tools/url-loader': [email protected]+ '@graphql-tools/utils': [email protected]+ cosmiconfig: 7.0.1+ cosmiconfig-toml-loader: 1.0.0+ graphql: 15.8.0+ minimatch: 4.2.1+ string-env-interpolation: 1.0.1+ transitivePeerDependencies:+ - '@types/node'+ - bufferutil+ - encoding+ - typescript+ - utf-8-validate+ dev: true+/graphql-config/4.3.1_h5eoywvcjsa4emif44kddonyyu:resolution: {integrity: sha512-czBWzJSGaLJfOHBLuUTZVRTjfgohPfvlaeN1B5nXBVptFARpiFuS7iI4FnRhCGwm6qt1h2j1g05nkg0OIGA6bg==}engines: {node: '>= 10.0.0'}@@ -12893,7 +13060,7 @@ packages:dev: false/has-cors/1.1.0:- resolution: {integrity: sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=}+ resolution: {integrity: sha512-g5VNKdkFuUuVCP9gYfDJHjK2nqdQJ7aDLTnycnc2+RvsOQbuLdF5pm7vuE5J76SEBIQjs4kQY/BWq74JUmjbXA==}dev: false/has-flag/3.0.0:@@ -12941,7 +13108,7 @@ packages:resolution: {integrity: sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==}dependencies:capital-case: 1.0.4- tslib: 2.4.0+ tslib: 2.4.1/helpertypes/0.0.18:resolution: {integrity: sha512-XRhfbSEmR+poXUC5/8AbmYNJb2riOT6qPzjGJZr0S9YedHiaY+/tzPYzWMUclYMEdCYo/1l8PDYrQFCj02v97w==}@@ -13239,7 +13406,7 @@ packages:engines: {node: '>=8'}/indexof/0.0.1:- resolution: {integrity: sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=}+ resolution: {integrity: sha512-i0G7hLJ1z0DE8dsqJa2rycj9dBmNKgXBvotXtZYXakU9oivfB9Uj2ZBC27qqef2U58/ZLwalxa1X/RDCdkHtVg==}dev: false/inflight/1.0.6:@@ -13472,7 +13639,7 @@ packages:/is-lower-case/2.0.2:resolution: {integrity: sha512-bVcMJy4X5Og6VZfdOZstSexlEy20Sr0k/p/b2IlQJlfdKAQuMpiv5w2Ccxb8sKdRUNAG1PnHVHjFSdRDVS6NlQ==}dependencies:- tslib: 2.4.0+ tslib: 2.4.1dev: true/is-map/2.0.2:@@ -13607,7 +13774,7 @@ packages:/is-upper-case/2.0.2:resolution: {integrity: sha512-44pxmxAvnnAOwBg4tHPnkfvgjPwbc5QIsSstNU+YcJ1ovxVzCWpSGosPJOZh/a1tdl81fbgnLc9LLv+x2ywbPQ==}dependencies:- tslib: 2.4.0+ tslib: 2.4.1dev: true/is-weakmap/2.0.1:@@ -15293,13 +15460,13 @@ packages:/lower-case-first/2.0.2:resolution: {integrity: sha512-EVm/rR94FJTZi3zefZ82fLWab+GX14LJN4HrWBcuo6Evmsl9hEfnqxgcHCKb9q+mNf6EVdsjx/qucYFIIB84pg==}dependencies:- tslib: 2.4.0+ tslib: 2.4.1dev: true/lower-case/2.0.2:resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==}dependencies:- tslib: 2.4.0+ tslib: 2.4.1/lru-cache/6.0.0:resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}@@ -15722,7 +15889,7 @@ packages:resolution: {integrity: sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==}dependencies:lower-case: 2.0.2- tslib: 2.4.0+ tslib: 2.4.1/node-abort-controller/3.0.1:resolution: {integrity: sha512-/ujIVxthRs+7q6hsdjHMaj8hRG9NuWmwrz+JdRwZ14jdFoKSkm+vDsCbF9PLpnSqjaWQJuTmVtcWHNLr+vrOFw==}@@ -16036,7 +16203,7 @@ packages:resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==}dependencies:dot-case: 3.0.4- tslib: 2.4.0+ tslib: 2.4.1/parent-module/1.0.1:resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==}@@ -16110,7 +16277,7 @@ packages:resolution: {integrity: sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==}dependencies:no-case: 3.0.4- tslib: 2.4.0+ tslib: 2.4.1/passport-github2/0.1.12:resolution: {integrity: sha512-3nPUCc7ttF/3HSP/k9sAXjz3SkGv5Nki84I05kSQPo01Jqq1NzJACgMblCK0fGcv9pKCG/KXU3AJRDGLqHLoIw==}@@ -16181,7 +16348,7 @@ packages:resolution: {integrity: sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==}dependencies:dot-case: 3.0.4- tslib: 2.4.0+ tslib: 2.4.1/path-exists/4.0.0:resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}@@ -17296,7 +17463,7 @@ packages:resolution: {integrity: sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==}dependencies:no-case: 3.0.4- tslib: 2.4.0+ tslib: 2.4.1upper-case-first: 2.0.2/serialize-javascript/4.0.0:@@ -17442,7 +17609,7 @@ packages:resolution: {integrity: sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==}dependencies:dot-case: 3.0.4- tslib: 2.4.0+ tslib: 2.4.1/socket.io-client/2.5.0:resolution: {integrity: sha512-lOO9clmdgssDykiOmVQQitwBAF3I6mYcQAo7hQ7AM6Ny5X7fp8hIJ3HcQs3Rjz4SoggoxA1OgrQyY8EgTbcPYw==}@@ -17611,7 +17778,7 @@ packages:/sponge-case/1.0.1:resolution: {integrity: sha512-dblb9Et4DAtiZ5YSUZHLl4XhH4uK80GhAZrVXdN4O2P4gQ40Wa5UIOPUHlA/nFd2PLblBZWUioLMMAVrgpoYcA==}dependencies:- tslib: 2.4.0+ tslib: 2.4.1dev: true/sprintf-js/1.0.3:@@ -17913,7 +18080,7 @@ packages:/swap-case/2.0.2:resolution: {integrity: sha512-kc6S2YS/2yXbtkSMunBtKdah4VFETZ8Oh6ONSmSd9bRxhqTrtARUCBUiWXH3xVPpvR7tz2CSnkuXVE42EcGnMw==}dependencies:- tslib: 2.4.0+ tslib: 2.4.1dev: true/symbol-observable/1.2.0:@@ -18097,7 +18264,7 @@ packages:/title-case/3.0.3:resolution: {integrity: sha512-e1zGYRvbffpcHIrnuqT0Dh+gEJtDaxDSoG4JAIpq4oDFyooziLBIiYQv0GBT4FUAnUop5uZ1hiIAj7oAF6sOCA==}dependencies:- tslib: 2.4.0+ tslib: 2.4.1dev: true/tmp/0.0.33:@@ -18119,7 +18286,7 @@ packages:dev: true/to-array/0.1.4:- resolution: {integrity: sha1-F+bBH3PdTz10zaek/zI46a2b+JA=}+ resolution: {integrity: sha512-LhVdShQD/4Mk4zXNroIQZJC+Ap3zgLcDuwEdcmLv9CCO73NWockQDwyUnW/m8VX/EElfL6FcYx7EeutN4HJA6A==}dev: false/to-fast-properties/2.0.0:@@ -18447,6 +18614,22 @@ packages:typescript: 4.7.4yn: 3.1.1+ /ts-node/[email protected]:+ resolution: {integrity: sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==}+ engines: {node: '>=10.0.0'}+ hasBin: true+ peerDependencies:+ typescript: '>=2.7'+ dependencies:+ arg: 4.1.3+ create-require: 1.1.1+ diff: 4.0.2+ make-error: 1.3.6+ source-map-support: 0.5.21+ typescript: 4.9.3+ yn: 3.1.1+ dev: true+/tsconfig-paths-webpack-plugin/4.0.0:resolution: {integrity: sha512-fw/7265mIWukrSHd0i+wSwx64kYUSAKPfxRDksjKIYTxSAp9W9/xcZVBF4Kl0eqQd5eBpAQ/oQrc5RyM/0c1GQ==}engines: {node: '>=10.13.0'}@@ -19048,7 +19231,7 @@ packages:dependencies:acorn: 8.8.0chokidar: 3.5.3- vite: 3.2.4+ vite: [email protected]webpack-sources: 3.2.3webpack-virtual-modules: 0.4.4dev: true@@ -19158,12 +19341,12 @@ packages:/upper-case-first/2.0.2:resolution: {integrity: sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==}dependencies:- tslib: 2.4.0+ tslib: 2.4.1/upper-case/2.0.2:resolution: {integrity: sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==}dependencies:- tslib: 2.4.0+ tslib: 2.4.1/uri-js/4.4.1:resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}@@ -19426,7 +19609,7 @@ packages:vite: ^2.0.0 || ^3.0.0dependencies:fast-glob: 3.2.11- vite: 3.2.4+ vite: [email protected]dev: true/vite-plugin-html-config/[email protected]:@@ -19444,7 +19627,7 @@ packages:peerDependencies:vite: '>=2.0.0'dependencies:- vite: 3.2.4+ vite: [email protected]dev: true/vite-plugin-inspect/[email protected]:@@ -19476,7 +19659,7 @@ packages:kolorist: 1.5.1sirv: 2.0.2ufo: 0.8.5- vite: 3.2.4+ vite: [email protected]transitivePeerDependencies:- supports-colordev: true@@ -19750,7 +19933,7 @@ packages:'@windicss/plugin-utils': 1.8.8debug: 4.3.4kolorist: 1.5.1- vite: 3.2.4+ vite: [email protected]windicss: 3.5.6transitivePeerDependencies:- supports-color@@ -19838,6 +20021,7 @@ packages:rollup: 2.79.1optionalDependencies:fsevents: 2.3.2+ dev: true/vite/[email protected]:resolution: {integrity: sha512-Z2X6SRAffOUYTa+sLy3NQ7nlHFU100xwanq1WDwqaiFiCe+25zdxP1TfCS5ojPV2oDDcXudHIoPnI1Z/66B7Yw==}@@ -20992,7 +21176,7 @@ packages:dev: false/yeast/0.1.2:- resolution: {integrity: sha1-AI4G2AlDIMNy28L47XagymyKxBk=}+ resolution: {integrity: sha512-8HFIh676uyGYP6wP13R/j6OJ/1HwJ46snpvzE7aHAN3Ryqh2yX6Xox2B4CUmTwwOIzlG3Bs7ocsP5dZH/R1Qbg==}dev: false/yn/3.1.1: