[PR #4704] [MERGED] feat: foundational changes to support subdomain based cloud instances #4910

Closed
opened 2026-03-17 02:24:08 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/4704
Author: @jamesgeorge007
Created: 1/28/2025
Status: Merged
Merged: 2/24/2025
Merged by: @jamesgeorge007

Base: nextHead: refactor/subdomain-cloud-instances-foundation


📝 Commits (5)

  • 8212e32 refactor: foundational changes to support subdomain based cloud instances
  • 0dff117 chore: copy text updates in user profile view
  • a6d5b49 refactor: introduce UI platform definitions for custom business logic
  • eb2e565 chore: i18n string entry additions
  • d7c4b2b chore: remove reference to initiateOnboarding action at the platform level

📊 Changes

25 files changed (+1222 additions, -351 deletions)

View changed files

📝 packages/hoppscotch-common/locales/en.json (+412 -5)
📝 packages/hoppscotch-common/src/components.d.ts (+30 -60)
📝 packages/hoppscotch-common/src/components/embeds/index.vue (+22 -4)
📝 packages/hoppscotch-common/src/components/firebase/Logout.vue (+16 -0)
📝 packages/hoppscotch-common/src/components/profile/UserDelete.vue (+39 -11)
📝 packages/hoppscotch-common/src/components/share/CustomizeModal.vue (+37 -9)
📝 packages/hoppscotch-common/src/components/share/templates/Link.vue (+31 -4)
📝 packages/hoppscotch-common/src/components/teams/Invite.vue (+45 -22)
📝 packages/hoppscotch-common/src/components/workspace/Selector.vue (+14 -0)
📝 packages/hoppscotch-common/src/helpers/backend/mutations/Shortcode.ts (+2 -11)
📝 packages/hoppscotch-common/src/helpers/backend/mutations/Team.ts (+5 -12)
📝 packages/hoppscotch-common/src/helpers/backend/mutations/TeamInvitation.ts (+8 -22)
📝 packages/hoppscotch-common/src/helpers/shortcode/ShortcodeListAdapter.ts (+4 -12)
📝 packages/hoppscotch-common/src/helpers/teams/TeamListAdapter.ts (+6 -9)
📝 packages/hoppscotch-common/src/pages/enter.vue (+16 -1)
📝 packages/hoppscotch-common/src/pages/join-team.vue (+90 -116)
📝 packages/hoppscotch-common/src/pages/r/_id.vue (+206 -43)
packages/hoppscotch-common/src/platform/backend.ts (+72 -0)
📝 packages/hoppscotch-common/src/platform/index.ts (+4 -0)
packages/hoppscotch-common/src/platform/organization.ts (+9 -0)

...and 5 more files

📄 Description

What's changed

This PR is associated with the introduction of subdomain-based instances with the cloud offering adding the relevant foundational business logic catering to the updates at the platform level.

A new platform-level definition corresponding to certain actions abstracts the n/w calls. It accommodates additional arguments supplied to the same GQL queries/mutations to support subdomain-based cloud instances where a new organization entity is introduced.

Also, a few ui platform definitions are added with slots for custom business logic implemented at the platform level.

i18n string entries are added herewith.

New platform level definition for actions that need a platform level override

export type BackendPlatformDef = {
  // Read actions via GQL queries
  getInviteDetails: <GetInviteDetailsError extends string>(
    inviteID: string
  ) => ReturnType<
    typeof useGQLQuery<
      GetInviteDetailsQuery,
      GetInviteDetailsQueryVariables,
      GetInviteDetailsError
    >
  >

  getUserShortcodes: (
    cursor?: string
  ) => Promise<E.Either<GQLError<"">, GetUserShortcodesQuery>>

  // Sample use case for `matchAllTeams` would be at the cloud platform level where the list of teams across instances is fetched
  // and not limited to a single instance.
  getUserTeams: (
    cursor?: string,
    matchAllTeams?: boolean
  ) => Promise<E.Either<GQLError<"">, GetMyTeamsQuery>>

  // Write actions via GQL mutations
  createTeam: <CreateTeamErrors extends string>(
    name: TeamName
  ) => TE.TaskEither<GQLError<CreateTeamErrors>, CreateTeamMutation>

  createTeamInvitation: <CreateTeamInvitationErrors extends string>(
    inviteeEmail: Email,
    inviteeRole: TeamMemberRole,
    teamID: string
  ) => TE.TaskEither<
    GQLError<CreateTeamInvitationErrors>,
    CreateTeamInvitationMutation
  >

  acceptTeamInvitation: <AcceptTeamInvitationErrors extends string>(
    inviteID: string
  ) => TE.TaskEither<
    GQLError<AcceptTeamInvitationErrors>,
    AcceptTeamInvitationMutation
  >

  createShortcode: (
    request: HoppRESTRequest,
    properties?: string
  ) => TE.TaskEither<GQLError<string>, CreateShortcodeMutation>
}

The existing actions are specified across platforms keeping the default behavior.

Business logic specific to subdomain-based cloud instances exposed via a new platform definition

export type OrganizationPlatformDef = {
  isDefaultCloudInstance: boolean
  getOrgInfo: () => Promise<{
    orgID: string
    orgDomain: string
  } | null>
  getRootDomain: () => string
}

Notes to reviewers

Please ensure to verify the following flows on SH instances:

  • Listing teams/shortcodes.
  • Creating a team.
  • Sending a team invite.
  • Joining a team.
  • Creating/accessing shortcodes.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/4704 **Author:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Created:** 1/28/2025 **Status:** ✅ Merged **Merged:** 2/24/2025 **Merged by:** [@jamesgeorge007](https://github.com/jamesgeorge007) **Base:** `next` ← **Head:** `refactor/subdomain-cloud-instances-foundation` --- ### 📝 Commits (5) - [`8212e32`](https://github.com/hoppscotch/hoppscotch/commit/8212e32c8255e0dd4008298b0aa7c154cf54544b) refactor: foundational changes to support subdomain based cloud instances - [`0dff117`](https://github.com/hoppscotch/hoppscotch/commit/0dff11746789cc59c356e648d6dcf72d808b4949) chore: copy text updates in user profile view - [`a6d5b49`](https://github.com/hoppscotch/hoppscotch/commit/a6d5b4988ef629e9f628032b95a47b1c532897c1) refactor: introduce UI platform definitions for custom business logic - [`eb2e565`](https://github.com/hoppscotch/hoppscotch/commit/eb2e565dc7d7c06d1b6df76fbd68d755fd21590d) chore: i18n string entry additions - [`d7c4b2b`](https://github.com/hoppscotch/hoppscotch/commit/d7c4b2b283545f84c7d9200b2ee5bfcd2563fe16) chore: remove reference to `initiateOnboarding` action at the platform level ### 📊 Changes **25 files changed** (+1222 additions, -351 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/locales/en.json` (+412 -5) 📝 `packages/hoppscotch-common/src/components.d.ts` (+30 -60) 📝 `packages/hoppscotch-common/src/components/embeds/index.vue` (+22 -4) 📝 `packages/hoppscotch-common/src/components/firebase/Logout.vue` (+16 -0) 📝 `packages/hoppscotch-common/src/components/profile/UserDelete.vue` (+39 -11) 📝 `packages/hoppscotch-common/src/components/share/CustomizeModal.vue` (+37 -9) 📝 `packages/hoppscotch-common/src/components/share/templates/Link.vue` (+31 -4) 📝 `packages/hoppscotch-common/src/components/teams/Invite.vue` (+45 -22) 📝 `packages/hoppscotch-common/src/components/workspace/Selector.vue` (+14 -0) 📝 `packages/hoppscotch-common/src/helpers/backend/mutations/Shortcode.ts` (+2 -11) 📝 `packages/hoppscotch-common/src/helpers/backend/mutations/Team.ts` (+5 -12) 📝 `packages/hoppscotch-common/src/helpers/backend/mutations/TeamInvitation.ts` (+8 -22) 📝 `packages/hoppscotch-common/src/helpers/shortcode/ShortcodeListAdapter.ts` (+4 -12) 📝 `packages/hoppscotch-common/src/helpers/teams/TeamListAdapter.ts` (+6 -9) 📝 `packages/hoppscotch-common/src/pages/enter.vue` (+16 -1) 📝 `packages/hoppscotch-common/src/pages/join-team.vue` (+90 -116) 📝 `packages/hoppscotch-common/src/pages/r/_id.vue` (+206 -43) ➕ `packages/hoppscotch-common/src/platform/backend.ts` (+72 -0) 📝 `packages/hoppscotch-common/src/platform/index.ts` (+4 -0) ➕ `packages/hoppscotch-common/src/platform/organization.ts` (+9 -0) _...and 5 more files_ </details> ### 📄 Description ### What's changed This PR is associated with the introduction of subdomain-based instances with the cloud offering adding the relevant foundational business logic catering to the updates at the platform level. A new platform-level definition corresponding to certain actions abstracts the n/w calls. It accommodates additional arguments supplied to the same GQL queries/mutations to support subdomain-based cloud instances where a new organization entity is introduced. Also, a few `ui` platform definitions are added with slots for custom business logic implemented at the platform level. `i18n` string entries are added herewith. > New platform level definition for actions that need a platform level override ```ts export type BackendPlatformDef = { // Read actions via GQL queries getInviteDetails: <GetInviteDetailsError extends string>( inviteID: string ) => ReturnType< typeof useGQLQuery< GetInviteDetailsQuery, GetInviteDetailsQueryVariables, GetInviteDetailsError > > getUserShortcodes: ( cursor?: string ) => Promise<E.Either<GQLError<"">, GetUserShortcodesQuery>> // Sample use case for `matchAllTeams` would be at the cloud platform level where the list of teams across instances is fetched // and not limited to a single instance. getUserTeams: ( cursor?: string, matchAllTeams?: boolean ) => Promise<E.Either<GQLError<"">, GetMyTeamsQuery>> // Write actions via GQL mutations createTeam: <CreateTeamErrors extends string>( name: TeamName ) => TE.TaskEither<GQLError<CreateTeamErrors>, CreateTeamMutation> createTeamInvitation: <CreateTeamInvitationErrors extends string>( inviteeEmail: Email, inviteeRole: TeamMemberRole, teamID: string ) => TE.TaskEither< GQLError<CreateTeamInvitationErrors>, CreateTeamInvitationMutation > acceptTeamInvitation: <AcceptTeamInvitationErrors extends string>( inviteID: string ) => TE.TaskEither< GQLError<AcceptTeamInvitationErrors>, AcceptTeamInvitationMutation > createShortcode: ( request: HoppRESTRequest, properties?: string ) => TE.TaskEither<GQLError<string>, CreateShortcodeMutation> } ``` The existing actions are specified across platforms keeping the default behavior. > Business logic specific to subdomain-based cloud instances exposed via a new platform definition ```ts export type OrganizationPlatformDef = { isDefaultCloudInstance: boolean getOrgInfo: () => Promise<{ orgID: string orgDomain: string } | null> getRootDomain: () => string } ``` ### Notes to reviewers Please ensure to verify the following flows on SH instances: - Listing teams/shortcodes. - Creating a team. - Sending a team invite. - Joining a team. - Creating/accessing shortcodes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 02:24:08 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#4910
No description provided.