mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: modernize typescript api client/types imports (#23637)
This commit is contained in:
@@ -341,27 +341,3 @@ user.click(screen.getByRole("button"));
|
||||
const form = screen.getByTestId("form");
|
||||
user.click(within(form).getByRole("button"));
|
||||
```
|
||||
|
||||
❌ Does not work
|
||||
|
||||
```ts
|
||||
import { getUpdateCheck } from "api/api"
|
||||
|
||||
createMachine({ ... }, {
|
||||
services: {
|
||||
getUpdateCheck,
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
✅ It works
|
||||
|
||||
```ts
|
||||
import { getUpdateCheck } from "api/api"
|
||||
|
||||
createMachine({ ... }, {
|
||||
services: {
|
||||
getUpdateCheck: () => getUpdateCheck(),
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import type { Page } from "@playwright/test";
|
||||
import { expect } from "@playwright/test";
|
||||
import { API, type DeploymentConfig } from "api/api";
|
||||
import type { SerpentOption } from "api/typesGenerated";
|
||||
import dayjs from "dayjs";
|
||||
import duration from "dayjs/plugin/duration";
|
||||
import relativeTime from "dayjs/plugin/relativeTime";
|
||||
import { API, type DeploymentConfig } from "#/api/api";
|
||||
import type { SerpentOption } from "#/api/typesGenerated";
|
||||
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
+5
-5
@@ -4,15 +4,15 @@ import net from "node:net";
|
||||
import path from "node:path";
|
||||
import { Duplex } from "node:stream";
|
||||
import { type BrowserContext, expect, type Page, test } from "@playwright/test";
|
||||
import { API } from "api/api";
|
||||
import type {
|
||||
UpdateTemplateMeta,
|
||||
WorkspaceBuildParameter,
|
||||
} from "api/typesGenerated";
|
||||
import express from "express";
|
||||
import capitalize from "lodash/capitalize";
|
||||
import * as ssh from "ssh2";
|
||||
import { TarWriter } from "utils/tar";
|
||||
import { API } from "#/api/api";
|
||||
import type {
|
||||
UpdateTemplateMeta,
|
||||
WorkspaceBuildParameter,
|
||||
} from "#/api/typesGenerated";
|
||||
import {
|
||||
agentPProfPort,
|
||||
coderBinary,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as fs from "node:fs/promises";
|
||||
import type { Reporter, TestCase, TestResult } from "@playwright/test/reporter";
|
||||
import { API } from "api/api";
|
||||
import { API } from "#/api/api";
|
||||
import { coderdPProfPort } from "./constants";
|
||||
|
||||
class CoderReporter implements Reporter {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
import { API } from "api/api";
|
||||
import { API } from "#/api/api";
|
||||
import { coderPort, license, premiumTestsRequired, users } from "../constants";
|
||||
import { expectUrl } from "../expectUrl";
|
||||
import { createUser } from "../helpers";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
import { API } from "api/api";
|
||||
import { API } from "#/api/api";
|
||||
import { setupApiCalls } from "../../api";
|
||||
import { e2eFakeExperiment1, e2eFakeExperiment2 } from "../../constants";
|
||||
import { login } from "../../helpers";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { test } from "@playwright/test";
|
||||
import { API } from "api/api";
|
||||
import { API } from "#/api/api";
|
||||
import {
|
||||
setupApiCalls,
|
||||
verifyConfigFlagArray,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { test } from "@playwright/test";
|
||||
import { API } from "api/api";
|
||||
import { API } from "#/api/api";
|
||||
import {
|
||||
setupApiCalls,
|
||||
verifyConfigFlagArray,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Page } from "@playwright/test";
|
||||
import { expect, test } from "@playwright/test";
|
||||
import { API, type DeploymentConfig } from "api/api";
|
||||
import { API, type DeploymentConfig } from "#/api/api";
|
||||
import {
|
||||
findConfigOption,
|
||||
setupApiCalls,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { test } from "@playwright/test";
|
||||
import { API } from "api/api";
|
||||
import { API } from "#/api/api";
|
||||
import {
|
||||
setupApiCalls,
|
||||
verifyConfigFlagArray,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { expect, type Page, test } from "@playwright/test";
|
||||
import { API } from "api/api";
|
||||
import { API } from "#/api/api";
|
||||
import { setupApiCalls } from "../../api";
|
||||
import { coderPort, workspaceProxyPort } from "../../constants";
|
||||
import { login, randomName, requiresLicense } from "../../helpers";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Endpoints } from "@octokit/types";
|
||||
import { test } from "@playwright/test";
|
||||
import type { ExternalAuthDevice } from "api/typesGenerated";
|
||||
import type { ExternalAuthDevice } from "#/api/typesGenerated";
|
||||
import { gitAuth } from "../constants";
|
||||
import {
|
||||
Awaiter,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
import { API } from "api/api";
|
||||
import { API } from "#/api/api";
|
||||
import {
|
||||
createGroup,
|
||||
createUser,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
import { API } from "api/api";
|
||||
import { API } from "#/api/api";
|
||||
import { getCurrentOrgId, setupApiCalls } from "../../api";
|
||||
import { users } from "../../constants";
|
||||
import { login } from "../../helpers";
|
||||
|
||||
+1
-1
@@ -3,9 +3,9 @@ import "jest-location-mock";
|
||||
import { server } from "testHelpers/server";
|
||||
import crypto from "node:crypto";
|
||||
import { cleanup } from "@testing-library/react";
|
||||
import type { Region } from "api/typesGenerated";
|
||||
import type { ProxyLatencyReport } from "contexts/useProxyLatency";
|
||||
import { useMemo } from "react";
|
||||
import type { Region } from "#/api/typesGenerated";
|
||||
|
||||
// useProxyLatency does some http requests to determine latency.
|
||||
// This would fail unit testing, or at least make it very slow with
|
||||
|
||||
Vendored
+1
-1
@@ -5,7 +5,7 @@ import type {
|
||||
Organization,
|
||||
SerpentOption,
|
||||
User,
|
||||
} from "api/typesGenerated";
|
||||
} from "#/api/typesGenerated";
|
||||
import type { Permissions } from "modules/permissions";
|
||||
import type { QueryKey } from "react-query";
|
||||
import type { ReactRouterAddonStoryParameters } from "storybook-addon-remix-react-router";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { API } from "api/api";
|
||||
import type { AppearanceConfig } from "api/typesGenerated";
|
||||
import type { MetadataState } from "hooks/useEmbeddedMetadata";
|
||||
import type { QueryClient } from "react-query";
|
||||
import { API } from "#/api/api";
|
||||
import type { AppearanceConfig } from "#/api/typesGenerated";
|
||||
import { cachedQuery } from "./util";
|
||||
|
||||
export const appearanceConfigKey = ["appearance"] as const;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { API } from "api/api";
|
||||
import type { AuditLogResponse } from "api/typesGenerated";
|
||||
import type { UsePaginatedQueryOptions } from "hooks/usePaginatedQuery";
|
||||
import { API } from "#/api/api";
|
||||
import type { AuditLogResponse } from "#/api/typesGenerated";
|
||||
import { useFilterParamsKey } from "#/components/Filter/Filter";
|
||||
|
||||
export function paginatedAudits(
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { API } from "api/api";
|
||||
import type { MetadataState, MetadataValue } from "hooks/useEmbeddedMetadata";
|
||||
import { API } from "#/api/api";
|
||||
import type {
|
||||
AuthorizationRequest,
|
||||
AuthorizationResponse,
|
||||
} from "api/typesGenerated";
|
||||
import type { MetadataState, MetadataValue } from "hooks/useEmbeddedMetadata";
|
||||
} from "#/api/typesGenerated";
|
||||
import { disabledRefetchOptions } from "./util";
|
||||
|
||||
const AUTHORIZATION_KEY = "authorization";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { API } from "api/api";
|
||||
import type { BuildInfoResponse } from "api/typesGenerated";
|
||||
import type { MetadataState } from "hooks/useEmbeddedMetadata";
|
||||
import { API } from "#/api/api";
|
||||
import type { BuildInfoResponse } from "#/api/typesGenerated";
|
||||
import { cachedQuery } from "./util";
|
||||
|
||||
const buildInfoKey = ["buildInfo"] as const;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { API } from "api/api";
|
||||
import type * as TypesGen from "api/typesGenerated";
|
||||
import { QueryClient } from "react-query";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { API } from "#/api/api";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import {
|
||||
archiveChat,
|
||||
cancelChatListQueries,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { API } from "api/api";
|
||||
import type * as TypesGen from "api/typesGenerated";
|
||||
import type { QueryClient, UseInfiniteQueryOptions } from "react-query";
|
||||
import { API } from "#/api/api";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
|
||||
export const chatsKey = ["chats"] as const;
|
||||
export const chatKey = (chatId: string) => ["chats", chatId] as const;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { API } from "api/api";
|
||||
import type { ConnectionLogResponse } from "api/typesGenerated";
|
||||
import type { UsePaginatedQueryOptions } from "hooks/usePaginatedQuery";
|
||||
import { API } from "#/api/api";
|
||||
import type { ConnectionLogResponse } from "#/api/typesGenerated";
|
||||
import { useFilterParamsKey } from "#/components/Filter/Filter";
|
||||
|
||||
export function paginatedConnectionLogs(
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { API } from "api/api";
|
||||
import type { HealthSettings, UpdateHealthSettings } from "api/typesGenerated";
|
||||
import type { QueryClient, UseMutationOptions } from "react-query";
|
||||
import { API } from "#/api/api";
|
||||
import type {
|
||||
HealthSettings,
|
||||
UpdateHealthSettings,
|
||||
} from "#/api/typesGenerated";
|
||||
|
||||
export const HEALTH_QUERY_KEY = ["health"];
|
||||
export const HEALTH_QUERY_SETTINGS_KEY = ["health", "settings"];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { API } from "api/api";
|
||||
import { API } from "#/api/api";
|
||||
import { disabledRefetchOptions } from "./util";
|
||||
|
||||
export const deploymentConfigQueryKey = ["deployment", "config"];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { API } from "api/api";
|
||||
import type { Entitlements } from "api/typesGenerated";
|
||||
import type { MetadataState } from "hooks/useEmbeddedMetadata";
|
||||
import type { QueryClient } from "react-query";
|
||||
import { API } from "#/api/api";
|
||||
import type { Entitlements } from "#/api/typesGenerated";
|
||||
import { cachedQuery } from "./util";
|
||||
|
||||
const entitlementsQueryKey = ["entitlements"] as const;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { API } from "api/api";
|
||||
import { type Experiment, Experiments } from "api/typesGenerated";
|
||||
import type { MetadataState } from "hooks/useEmbeddedMetadata";
|
||||
import { API } from "#/api/api";
|
||||
import { type Experiment, Experiments } from "#/api/typesGenerated";
|
||||
import { cachedQuery } from "./util";
|
||||
|
||||
const experimentsKey = ["experiments"] as const;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { API } from "api/api";
|
||||
import type { ExternalAuth } from "api/typesGenerated";
|
||||
import type { QueryClient, UseMutationOptions } from "react-query";
|
||||
import { API } from "#/api/api";
|
||||
import type { ExternalAuth } from "#/api/typesGenerated";
|
||||
|
||||
// Returns all configured external auths for a given user.
|
||||
export const externalAuths = () => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { API } from "api/api";
|
||||
import { API } from "#/api/api";
|
||||
|
||||
export const uploadFile = () => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { API } from "api/api";
|
||||
import type { UsePaginatedQueryOptions } from "hooks/usePaginatedQuery";
|
||||
import type { QueryClient, UseQueryOptions } from "react-query";
|
||||
import { prepareQuery } from "utils/filters";
|
||||
import { API } from "#/api/api";
|
||||
import type {
|
||||
CreateGroupRequest,
|
||||
Group,
|
||||
@@ -6,10 +9,7 @@ import type {
|
||||
GroupRequest,
|
||||
PatchGroupRequest,
|
||||
UsersRequest,
|
||||
} from "api/typesGenerated";
|
||||
import type { UsePaginatedQueryOptions } from "hooks/usePaginatedQuery";
|
||||
import type { QueryClient, UseQueryOptions } from "react-query";
|
||||
import { prepareQuery } from "utils/filters";
|
||||
} from "#/api/typesGenerated";
|
||||
|
||||
type GroupSortOrder = "asc" | "desc";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { API } from "api/api";
|
||||
import type { OrganizationSyncSettings } from "api/typesGenerated";
|
||||
import type { QueryClient } from "react-query";
|
||||
import { API } from "#/api/api";
|
||||
import type { OrganizationSyncSettings } from "#/api/typesGenerated";
|
||||
|
||||
const getOrganizationIdpSyncSettingsKey = () => ["organizationIdpSyncSettings"];
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { API, type InsightsParams, type InsightsTemplateParams } from "api/api";
|
||||
import type { GetUserStatusCountsResponse } from "api/typesGenerated";
|
||||
import type { UseQueryOptions } from "react-query";
|
||||
import {
|
||||
API,
|
||||
type InsightsParams,
|
||||
type InsightsTemplateParams,
|
||||
} from "#/api/api";
|
||||
import type { GetUserStatusCountsResponse } from "#/api/typesGenerated";
|
||||
|
||||
export const insightsTemplate = (params: InsightsTemplateParams) => {
|
||||
return {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { API } from "api/api";
|
||||
import type { QueryClient, UseMutationOptions } from "react-query";
|
||||
import { API } from "#/api/api";
|
||||
import type {
|
||||
NotificationPreference,
|
||||
NotificationTemplate,
|
||||
UpdateNotificationTemplateMethod,
|
||||
UpdateUserNotificationPreferences,
|
||||
} from "api/typesGenerated";
|
||||
import type { QueryClient, UseMutationOptions } from "react-query";
|
||||
} from "#/api/typesGenerated";
|
||||
|
||||
export const userNotificationPreferencesKey = (userId: string) => [
|
||||
"users",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { API } from "api/api";
|
||||
import type * as TypesGen from "api/typesGenerated";
|
||||
import type { QueryClient } from "react-query";
|
||||
import { API } from "#/api/api";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
|
||||
const appsKey = ["oauth2-provider", "apps"];
|
||||
const userAppsKey = (userId: string) => appsKey.concat(userId);
|
||||
|
||||
@@ -1,18 +1,3 @@
|
||||
import {
|
||||
API,
|
||||
type GetProvisionerDaemonsParams,
|
||||
type GetProvisionerJobsParams,
|
||||
} from "api/api";
|
||||
import type {
|
||||
CreateOrganizationRequest,
|
||||
GroupSyncSettings,
|
||||
Organization,
|
||||
PaginatedMembersRequest,
|
||||
PaginatedMembersResponse,
|
||||
RoleSyncSettings,
|
||||
UpdateOrganizationRequest,
|
||||
UpdateWorkspaceSharingSettingsRequest,
|
||||
} from "api/typesGenerated";
|
||||
import type { MetadataState } from "hooks/useEmbeddedMetadata";
|
||||
import type { UsePaginatedQueryOptions } from "hooks/usePaginatedQuery";
|
||||
import {
|
||||
@@ -26,6 +11,21 @@ import {
|
||||
workspacePermissionChecks,
|
||||
} from "modules/permissions/workspaces";
|
||||
import type { QueryClient, UseQueryOptions } from "react-query";
|
||||
import {
|
||||
API,
|
||||
type GetProvisionerDaemonsParams,
|
||||
type GetProvisionerJobsParams,
|
||||
} from "#/api/api";
|
||||
import type {
|
||||
CreateOrganizationRequest,
|
||||
GroupSyncSettings,
|
||||
Organization,
|
||||
PaginatedMembersRequest,
|
||||
PaginatedMembersResponse,
|
||||
RoleSyncSettings,
|
||||
UpdateOrganizationRequest,
|
||||
UpdateWorkspaceSharingSettingsRequest,
|
||||
} from "#/api/typesGenerated";
|
||||
import { meKey } from "./users";
|
||||
import { cachedQuery } from "./util";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { API } from "api/api";
|
||||
import type { Role } from "api/typesGenerated";
|
||||
import type { QueryClient } from "react-query";
|
||||
import { API } from "#/api/api";
|
||||
import type { Role } from "#/api/typesGenerated";
|
||||
|
||||
const getRoleQueryKey = (organizationId: string, roleName: string) => [
|
||||
"organization",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { API } from "api/api";
|
||||
import type { QueryClient, QueryOptions } from "react-query";
|
||||
import { API } from "#/api/api";
|
||||
import type {
|
||||
UpdateUserQuietHoursScheduleRequest,
|
||||
UserQuietHoursScheduleResponse,
|
||||
} from "api/typesGenerated";
|
||||
import type { QueryClient, QueryOptions } from "react-query";
|
||||
} from "#/api/typesGenerated";
|
||||
|
||||
const userQuietHoursScheduleKey = (userId: string) => [
|
||||
"settings",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { API } from "api/api";
|
||||
import type { GitSSHKey } from "api/typesGenerated";
|
||||
import type { QueryClient } from "react-query";
|
||||
import { API } from "#/api/api";
|
||||
import type { GitSSHKey } from "#/api/typesGenerated";
|
||||
|
||||
const getUserSSHKeyQueryKey = (userId: string) => [userId, "sshKey"];
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { API } from "api/api";
|
||||
import type { Task } from "api/typesGenerated";
|
||||
import type { QueryClient } from "react-query";
|
||||
import { API } from "#/api/api";
|
||||
import type { Task } from "#/api/typesGenerated";
|
||||
|
||||
export const taskLogsKey = (user: string, taskId: string) => [
|
||||
"tasks",
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
import { API, type GetTemplatesOptions, type GetTemplatesQuery } from "api/api";
|
||||
import type { MutationOptions, QueryClient, QueryOptions } from "react-query";
|
||||
import { delay } from "utils/delay";
|
||||
import { getTemplateVersionFiles } from "utils/templateVersion";
|
||||
import {
|
||||
API,
|
||||
type GetTemplatesOptions,
|
||||
type GetTemplatesQuery,
|
||||
} from "#/api/api";
|
||||
import type {
|
||||
CreateTemplateRequest,
|
||||
CreateTemplateVersionRequest,
|
||||
@@ -8,10 +15,7 @@ import type {
|
||||
TemplateRole,
|
||||
TemplateVersion,
|
||||
UsersRequest,
|
||||
} from "api/typesGenerated";
|
||||
import type { MutationOptions, QueryClient, QueryOptions } from "react-query";
|
||||
import { delay } from "utils/delay";
|
||||
import { getTemplateVersionFiles } from "utils/templateVersion";
|
||||
} from "#/api/typesGenerated";
|
||||
|
||||
const templateKey = (templateId: string) => ["template", templateId];
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { API } from "api/api";
|
||||
import { API } from "#/api/api";
|
||||
|
||||
export const updateCheck = () => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,16 @@
|
||||
import { API } from "api/api";
|
||||
import {
|
||||
defaultMetadataManager,
|
||||
type MetadataState,
|
||||
} from "hooks/useEmbeddedMetadata";
|
||||
import type { UsePaginatedQueryOptions } from "hooks/usePaginatedQuery";
|
||||
import type {
|
||||
MutationOptions,
|
||||
QueryClient,
|
||||
UseMutationOptions,
|
||||
UseQueryOptions,
|
||||
} from "react-query";
|
||||
import { prepareQuery } from "utils/filters";
|
||||
import { API } from "#/api/api";
|
||||
import type {
|
||||
AuthorizationRequest,
|
||||
GenerateAPIKeyResponse,
|
||||
@@ -13,19 +25,7 @@ import type {
|
||||
UserAppearanceSettings,
|
||||
UserPreferenceSettings,
|
||||
UsersRequest,
|
||||
} from "api/typesGenerated";
|
||||
import {
|
||||
defaultMetadataManager,
|
||||
type MetadataState,
|
||||
} from "hooks/useEmbeddedMetadata";
|
||||
import type { UsePaginatedQueryOptions } from "hooks/usePaginatedQuery";
|
||||
import type {
|
||||
MutationOptions,
|
||||
QueryClient,
|
||||
UseMutationOptions,
|
||||
UseQueryOptions,
|
||||
} from "react-query";
|
||||
import { prepareQuery } from "utils/filters";
|
||||
} from "#/api/typesGenerated";
|
||||
import { getAuthorizationKey } from "./authCheck";
|
||||
import { cachedQuery } from "./util";
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { API } from "api/api";
|
||||
import type { QueryOptions, UseInfiniteQueryOptions } from "react-query";
|
||||
import { API } from "#/api/api";
|
||||
import type {
|
||||
WorkspaceBuild,
|
||||
WorkspaceBuildParameter,
|
||||
WorkspaceBuildsRequest,
|
||||
} from "api/typesGenerated";
|
||||
import type { QueryOptions, UseInfiniteQueryOptions } from "react-query";
|
||||
} from "#/api/typesGenerated";
|
||||
|
||||
export function workspaceBuildParametersKey(workspaceBuildId: string) {
|
||||
return ["workspaceBuilds", workspaceBuildId, "parameters"] as const;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { API } from "api/api";
|
||||
import { API } from "#/api/api";
|
||||
|
||||
export const getWorkspaceQuotaQueryKey = (
|
||||
organizationName: string,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { API } from "api/api";
|
||||
import { API } from "#/api/api";
|
||||
import type {
|
||||
DeleteWorkspaceAgentPortShareRequest,
|
||||
UpsertWorkspaceAgentPortShareRequest,
|
||||
} from "api/typesGenerated";
|
||||
} from "#/api/typesGenerated";
|
||||
|
||||
export const workspacePortShares = (workspaceId: string) => {
|
||||
return {
|
||||
|
||||
@@ -1,5 +1,18 @@
|
||||
import { API, type DeleteWorkspaceOptions } from "api/api";
|
||||
import { DetailedError, isApiValidationError } from "api/errors";
|
||||
import type { Dayjs } from "dayjs";
|
||||
import {
|
||||
type WorkspacePermissions,
|
||||
workspaceChecks,
|
||||
} from "modules/workspaces/permissions";
|
||||
import type { ConnectionStatus } from "pages/TerminalPage/types";
|
||||
import type {
|
||||
MutationOptions,
|
||||
QueryClient,
|
||||
QueryOptions,
|
||||
UseMutationOptions,
|
||||
UseQueryOptions,
|
||||
} from "react-query";
|
||||
import { API, type DeleteWorkspaceOptions } from "#/api/api";
|
||||
import { DetailedError, isApiValidationError } from "#/api/errors";
|
||||
import type {
|
||||
CreateWorkspaceRequest,
|
||||
ProvisionerLogLevel,
|
||||
@@ -15,20 +28,7 @@ import type {
|
||||
WorkspaceRole,
|
||||
WorkspacesRequest,
|
||||
WorkspacesResponse,
|
||||
} from "api/typesGenerated";
|
||||
import type { Dayjs } from "dayjs";
|
||||
import {
|
||||
type WorkspacePermissions,
|
||||
workspaceChecks,
|
||||
} from "modules/workspaces/permissions";
|
||||
import type { ConnectionStatus } from "pages/TerminalPage/types";
|
||||
import type {
|
||||
MutationOptions,
|
||||
QueryClient,
|
||||
QueryOptions,
|
||||
UseMutationOptions,
|
||||
UseQueryOptions,
|
||||
} from "react-query";
|
||||
} from "#/api/typesGenerated";
|
||||
import { checkAuthorization } from "./authCheck";
|
||||
import { disabledRefetchOptions } from "./util";
|
||||
import { workspaceBuildsKey } from "./workspaceBuilds";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getErrorDetail, getErrorMessage, getErrorStatus } from "api/errors";
|
||||
import { isAxiosError } from "axios";
|
||||
import type { FC } from "react";
|
||||
import { getErrorDetail, getErrorMessage, getErrorStatus } from "#/api/errors";
|
||||
import { Link } from "../Link/Link";
|
||||
import { Alert, AlertDescription, type AlertProps, AlertTitle } from "./Alert";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { WorkspaceTransition } from "api/typesGenerated";
|
||||
import { PlayIcon, SquareIcon, TrashIcon } from "lucide-react";
|
||||
import type { ComponentProps } from "react";
|
||||
import type { WorkspaceTransition } from "#/api/typesGenerated";
|
||||
|
||||
type SVGIcon = typeof PlayIcon;
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { useTheme } from "@emotion/react";
|
||||
import Skeleton, { type SkeletonProps } from "@mui/material/Skeleton";
|
||||
import type { Breakpoint } from "@mui/system/createTheme";
|
||||
import { useDebouncedFunction } from "hooks/debounce";
|
||||
import { ExternalLinkIcon, SlidersHorizontal } from "lucide-react";
|
||||
import { type FC, type ReactNode, useEffect, useRef, useState } from "react";
|
||||
import {
|
||||
getValidationErrorMessage,
|
||||
hasError,
|
||||
isApiValidationError,
|
||||
} from "api/errors";
|
||||
import { useDebouncedFunction } from "hooks/debounce";
|
||||
import { ExternalLinkIcon, SlidersHorizontal } from "lucide-react";
|
||||
import { type FC, type ReactNode, useEffect, useRef, useState } from "react";
|
||||
} from "#/api/errors";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
import {
|
||||
DropdownMenu,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { API } from "api/api";
|
||||
import { useAuthenticated } from "hooks";
|
||||
import type { FC } from "react";
|
||||
import { API } from "#/api/api";
|
||||
import { Avatar } from "#/components/Avatar/Avatar";
|
||||
import { ComboboxInput } from "#/components/Combobox/Combobox";
|
||||
import {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { Interpolation, Theme } from "@emotion/react";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import Link from "@mui/material/Link";
|
||||
import type { ApiErrorResponse } from "api/errors";
|
||||
import type { ExternalAuthDevice } from "api/typesGenerated";
|
||||
import { isAxiosError } from "axios";
|
||||
import { ExternalLinkIcon } from "lucide-react";
|
||||
import type { FC } from "react";
|
||||
import type { ApiErrorResponse } from "#/api/errors";
|
||||
import type { ExternalAuthDevice } from "#/api/typesGenerated";
|
||||
import { Alert, AlertDescription, AlertTitle } from "#/components/Alert/Alert";
|
||||
import { CopyButton } from "#/components/CopyButton/CopyButton";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Interpolation, Theme } from "@emotion/react";
|
||||
import type { LogLevel } from "api/typesGenerated";
|
||||
import type { FC, HTMLAttributes } from "react";
|
||||
import { MONOSPACE_FONT_FAMILY } from "theme/constants";
|
||||
import type { LogLevel } from "#/api/typesGenerated";
|
||||
|
||||
const DEFAULT_LOG_LINE_SIDE_PADDING = 24;
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { checkAuthorization } from "api/queries/authCheck";
|
||||
import { organizations } from "api/queries/organizations";
|
||||
import type { AuthorizationCheck, Organization } from "api/typesGenerated";
|
||||
import { Check } from "lucide-react";
|
||||
import { type FC, useEffect, useState } from "react";
|
||||
import { useQuery } from "react-query";
|
||||
import { checkAuthorization } from "#/api/queries/authCheck";
|
||||
import { organizations } from "#/api/queries/organizations";
|
||||
import type { AuthorizationCheck, Organization } from "#/api/typesGenerated";
|
||||
import { ChevronDownIcon } from "#/components/AnimatedIcons/ChevronDown";
|
||||
import { Avatar } from "#/components/Avatar/Avatar";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||
import { API } from "api/api";
|
||||
import { useState } from "react";
|
||||
import { expect, spyOn, userEvent, waitFor, within } from "storybook/test";
|
||||
import { API } from "#/api/api";
|
||||
import { PasswordField } from "./PasswordField";
|
||||
|
||||
const meta: Meta<typeof PasswordField> = {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import TextField, { type TextFieldProps } from "@mui/material/TextField";
|
||||
import { API } from "api/api";
|
||||
import { useDebouncedValue } from "hooks/debounce";
|
||||
import type { FC } from "react";
|
||||
import { keepPreviousData, useQuery } from "react-query";
|
||||
import { API } from "#/api/api";
|
||||
|
||||
// TODO: @BrunoQuaresma: Unable to integrate Yup + Formik for validation. The
|
||||
// validation was triggering on the onChange event, but the form.errors were not
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { chromatic } from "testHelpers/chromatic";
|
||||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||
import type { TemplateVersionParameter } from "api/typesGenerated";
|
||||
import type { TemplateVersionParameter } from "#/api/typesGenerated";
|
||||
import { RichParameterInput } from "./RichParameterInput";
|
||||
|
||||
const meta: Meta<typeof RichParameterInput> = {
|
||||
|
||||
@@ -5,13 +5,13 @@ import type { InputBaseComponentProps } from "@mui/material/InputBase";
|
||||
import Radio from "@mui/material/Radio";
|
||||
import RadioGroup from "@mui/material/RadioGroup";
|
||||
import TextField, { type TextFieldProps } from "@mui/material/TextField";
|
||||
import type { TemplateVersionParameter } from "api/typesGenerated";
|
||||
import { CircleAlertIcon, SettingsIcon } from "lucide-react";
|
||||
import { type FC, type ReactNode, useState } from "react";
|
||||
import type {
|
||||
AutofillBuildParameter,
|
||||
AutofillSource,
|
||||
} from "utils/richParameters";
|
||||
import type { TemplateVersionParameter } from "#/api/typesGenerated";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
import { ExternalImage } from "#/components/ExternalImage/ExternalImage";
|
||||
import { MemoizedMarkdown } from "#/components/Markdown/Markdown";
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { getErrorMessage } from "api/errors";
|
||||
import { organizationMembers } from "api/queries/organizations";
|
||||
import { users, workspaceAvailableUsers } from "api/queries/users";
|
||||
import type {
|
||||
MinimalUser,
|
||||
OrganizationMemberWithUserData,
|
||||
User,
|
||||
} from "api/typesGenerated";
|
||||
import { useDebouncedFunction, useDebouncedValue } from "hooks/debounce";
|
||||
import { type FC, useId, useState } from "react";
|
||||
import { keepPreviousData, useQuery } from "react-query";
|
||||
import { cn } from "utils/cn";
|
||||
import { prepareQuery } from "utils/filters";
|
||||
import { getErrorMessage } from "#/api/errors";
|
||||
import { organizationMembers } from "#/api/queries/organizations";
|
||||
import { users, workspaceAvailableUsers } from "#/api/queries/users";
|
||||
import type {
|
||||
MinimalUser,
|
||||
OrganizationMemberWithUserData,
|
||||
User,
|
||||
} from "#/api/typesGenerated";
|
||||
import { ChevronDownIcon } from "#/components/AnimatedIcons/ChevronDown";
|
||||
import { Avatar } from "#/components/Avatar/Avatar";
|
||||
import { AvatarData } from "#/components/Avatar/AvatarData";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||
import { API } from "api/api";
|
||||
import { expect, spyOn, within } from "storybook/test";
|
||||
import { reactRouterParameters } from "storybook-addon-remix-react-router";
|
||||
import { API } from "#/api/api";
|
||||
import { Tool } from "./Tool";
|
||||
|
||||
const samplePlan = [
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { API } from "api/api";
|
||||
import { LoaderIcon, TriangleAlertIcon } from "lucide-react";
|
||||
import type React from "react";
|
||||
import { useQuery } from "react-query";
|
||||
import { cn } from "utils/cn";
|
||||
import { API } from "#/api/api";
|
||||
import {
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { useTheme } from "@emotion/react";
|
||||
import { FileDiff, File as FileViewer } from "@pierre/diffs/react";
|
||||
import type * as TypesGen from "api/typesGenerated";
|
||||
import { LoaderIcon, TriangleAlertIcon } from "lucide-react";
|
||||
import { type ComponentPropsWithRef, type FC, memo } from "react";
|
||||
import { cn } from "utils/cn";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { ScrollArea } from "#/components/ScrollArea/ScrollArea";
|
||||
import {
|
||||
Tooltip,
|
||||
|
||||
@@ -12,8 +12,8 @@ import {
|
||||
import { server } from "testHelpers/server";
|
||||
import { screen } from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import type { Region } from "api/typesGenerated";
|
||||
import { HttpResponse, http } from "msw";
|
||||
import type { Region } from "#/api/typesGenerated";
|
||||
import {
|
||||
getPreferredProxy,
|
||||
ProxyProvider,
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
import { API } from "api/api";
|
||||
import { cachedQuery } from "api/queries/util";
|
||||
import type { Region, WorkspaceProxy } from "api/typesGenerated";
|
||||
import { useAuthenticated } from "hooks";
|
||||
import { useEmbeddedMetadata } from "hooks/useEmbeddedMetadata";
|
||||
import {
|
||||
@@ -13,6 +10,9 @@ import {
|
||||
useState,
|
||||
} from "react";
|
||||
import { useQuery } from "react-query";
|
||||
import { API } from "#/api/api";
|
||||
import { cachedQuery } from "#/api/queries/util";
|
||||
import type { Region, WorkspaceProxy } from "#/api/typesGenerated";
|
||||
import { type ProxyLatencyReport, useProxyLatency } from "./useProxyLatency";
|
||||
|
||||
export type Proxies = readonly Region[] | readonly WorkspaceProxy[];
|
||||
|
||||
@@ -11,7 +11,6 @@ import {
|
||||
ThemeProvider as MuiThemeProvider,
|
||||
StyledEngineProvider,
|
||||
} from "@mui/material/styles";
|
||||
import { appearanceSettings } from "api/queries/users";
|
||||
import { useEmbeddedMetadata } from "hooks/useEmbeddedMetadata";
|
||||
import {
|
||||
type FC,
|
||||
@@ -23,6 +22,7 @@ import {
|
||||
} from "react";
|
||||
import { useQuery } from "react-query";
|
||||
import themes, { DEFAULT_THEME, type Theme } from "theme";
|
||||
import { appearanceSettings } from "#/api/queries/users";
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
import { isApiError } from "api/errors";
|
||||
import { checkAuthorization } from "api/queries/authCheck";
|
||||
import {
|
||||
hasFirstUser,
|
||||
login,
|
||||
logout,
|
||||
me,
|
||||
updateProfile as updateProfileOptions,
|
||||
} from "api/queries/users";
|
||||
import type { UpdateUserProfileRequest, User } from "api/typesGenerated";
|
||||
import { useEmbeddedMetadata } from "hooks/useEmbeddedMetadata";
|
||||
import { type Permissions, permissionChecks } from "modules/permissions";
|
||||
import {
|
||||
@@ -19,6 +9,16 @@ import {
|
||||
} from "react";
|
||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { isApiError } from "#/api/errors";
|
||||
import { checkAuthorization } from "#/api/queries/authCheck";
|
||||
import {
|
||||
hasFirstUser,
|
||||
login,
|
||||
logout,
|
||||
me,
|
||||
updateProfile as updateProfileOptions,
|
||||
} from "#/api/queries/users";
|
||||
import type { UpdateUserProfileRequest, User } from "#/api/typesGenerated";
|
||||
|
||||
export type AuthContextValue = {
|
||||
isLoading: boolean;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { API } from "api/api";
|
||||
import { isApiError } from "api/errors";
|
||||
import { ProxyProvider as ProductionProxyProvider } from "contexts/ProxyContext";
|
||||
import { DashboardProvider as ProductionDashboardProvider } from "modules/dashboard/DashboardProvider";
|
||||
import { type FC, useEffect } from "react";
|
||||
import { Navigate, Outlet, useLocation } from "react-router";
|
||||
import { embedRedirect } from "utils/redirect";
|
||||
import { API } from "#/api/api";
|
||||
import { isApiError } from "#/api/errors";
|
||||
import { Loader } from "#/components/Loader/Loader";
|
||||
import { useAuthContext } from "./AuthProvider";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { API } from "api/api";
|
||||
import type { Region } from "api/typesGenerated";
|
||||
import { useEffect, useReducer, useState } from "react";
|
||||
import { generateRandomString } from "utils/random";
|
||||
import { API } from "#/api/api";
|
||||
import type { Region } from "#/api/typesGenerated";
|
||||
|
||||
const proxyIntervalSeconds = 30; // seconds
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { API } from "api/api";
|
||||
import { buildInfo } from "api/queries/buildInfo";
|
||||
import { experiments } from "api/queries/experiments";
|
||||
import { useEmbeddedMetadata } from "hooks/useEmbeddedMetadata";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useQuery } from "react-query";
|
||||
import { API } from "#/api/api";
|
||||
import { buildInfo } from "#/api/queries/buildInfo";
|
||||
import { experiments } from "#/api/queries/experiments";
|
||||
|
||||
interface WebpushNotifications {
|
||||
readonly enabled: boolean;
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
MockUserOwner,
|
||||
} from "testHelpers/entities";
|
||||
import { act, renderHook } from "@testing-library/react";
|
||||
import type { Region, User } from "api/typesGenerated";
|
||||
import type { Region, User } from "#/api/typesGenerated";
|
||||
import {
|
||||
DEFAULT_METADATA_KEY,
|
||||
type MetadataKey,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { Permissions } from "modules/permissions";
|
||||
import { useMemo, useSyncExternalStore } from "react";
|
||||
import type {
|
||||
AppearanceConfig,
|
||||
BuildInfoResponse,
|
||||
@@ -7,9 +9,7 @@ import type {
|
||||
Region,
|
||||
User,
|
||||
UserAppearanceSettings,
|
||||
} from "api/typesGenerated";
|
||||
import type { Permissions } from "modules/permissions";
|
||||
import { useMemo, useSyncExternalStore } from "react";
|
||||
} from "#/api/typesGenerated";
|
||||
export const DEFAULT_METADATA_KEY = "property";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { templateVersionExternalAuth } from "api/queries/templates";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { useQuery } from "react-query";
|
||||
import { templateVersionExternalAuth } from "#/api/queries/templates";
|
||||
|
||||
export type ExternalAuthPollingState = "idle" | "polling" | "abandoned";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { watchBuildLogsByBuildId } from "api/api";
|
||||
import type { ProvisionerJobLog } from "api/typesGenerated";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { toast } from "sonner";
|
||||
import { watchBuildLogsByBuildId } from "#/api/api";
|
||||
import type { ProvisionerJobLog } from "#/api/typesGenerated";
|
||||
|
||||
export const useWorkspaceBuildLogs = (
|
||||
// buildId is optional because sometimes the build is not loaded yet
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import type { WorkspaceAppStatusState } from "api/typesGenerated";
|
||||
import {
|
||||
BanIcon,
|
||||
CircleAlertIcon,
|
||||
@@ -9,6 +8,7 @@ import {
|
||||
} from "lucide-react";
|
||||
import type { FC } from "react";
|
||||
import { cn } from "utils/cn";
|
||||
import type { WorkspaceAppStatusState } from "#/api/typesGenerated";
|
||||
import { Spinner } from "#/components/Spinner/Spinner";
|
||||
|
||||
type AppStatusStateIconProps = {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { toast } from "sonner";
|
||||
import type {
|
||||
Workspace,
|
||||
WorkspaceAgent,
|
||||
WorkspaceApp,
|
||||
} from "api/typesGenerated";
|
||||
import { toast } from "sonner";
|
||||
} from "#/api/typesGenerated";
|
||||
|
||||
// This is a magic undocumented string that is replaced
|
||||
// with a brand-new session token from the backend.
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { apiKey } from "api/queries/users";
|
||||
import type {
|
||||
Workspace,
|
||||
WorkspaceAgent,
|
||||
WorkspaceApp,
|
||||
} from "api/typesGenerated";
|
||||
import { useProxy } from "contexts/ProxyContext";
|
||||
import type React from "react";
|
||||
import { useQuery } from "react-query";
|
||||
import { toast } from "sonner";
|
||||
import { apiKey } from "#/api/queries/users";
|
||||
import type {
|
||||
Workspace,
|
||||
WorkspaceAgent,
|
||||
WorkspaceApp,
|
||||
} from "#/api/typesGenerated";
|
||||
import {
|
||||
getAppHref,
|
||||
isExternalApp,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useTheme } from "@emotion/react";
|
||||
import type { WorkspaceBuild } from "api/typesGenerated";
|
||||
import { useClassName } from "hooks/useClassName";
|
||||
import type { FC } from "react";
|
||||
import { getDisplayWorkspaceBuildStatus } from "utils/workspace";
|
||||
import type { WorkspaceBuild } from "#/api/typesGenerated";
|
||||
import { Avatar, type AvatarProps } from "#/components/Avatar/Avatar";
|
||||
import { BuildIcon } from "#/components/BuildIcon/BuildIcon";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { BannerConfig } from "api/typesGenerated";
|
||||
import { useDashboard } from "modules/dashboard/useDashboard";
|
||||
import type { FC } from "react";
|
||||
import type { BannerConfig } from "#/api/typesGenerated";
|
||||
import { AnnouncementBannerView } from "./AnnouncementBannerView";
|
||||
|
||||
export const AnnouncementBanners: FC = () => {
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
import { appearance } from "api/queries/appearance";
|
||||
import { buildInfo } from "api/queries/buildInfo";
|
||||
import { entitlements } from "api/queries/entitlements";
|
||||
import { experiments } from "api/queries/experiments";
|
||||
import { organizations } from "api/queries/organizations";
|
||||
import { useAuthenticated } from "hooks";
|
||||
import { useEmbeddedMetadata } from "hooks/useEmbeddedMetadata";
|
||||
import { canViewAnyOrganization } from "modules/permissions";
|
||||
import { createContext, type FC, type PropsWithChildren } from "react";
|
||||
import { useQuery } from "react-query";
|
||||
import { appearance } from "#/api/queries/appearance";
|
||||
import { buildInfo } from "#/api/queries/buildInfo";
|
||||
import { entitlements } from "#/api/queries/entitlements";
|
||||
import { experiments } from "#/api/queries/experiments";
|
||||
import { organizations } from "#/api/queries/organizations";
|
||||
import type {
|
||||
AppearanceConfig,
|
||||
BuildInfoResponse,
|
||||
Entitlements,
|
||||
Experiment,
|
||||
Organization,
|
||||
} from "api/typesGenerated";
|
||||
import { useAuthenticated } from "hooks";
|
||||
import { useEmbeddedMetadata } from "hooks/useEmbeddedMetadata";
|
||||
import { canViewAnyOrganization } from "modules/permissions";
|
||||
import { createContext, type FC, type PropsWithChildren } from "react";
|
||||
import { useQuery } from "react-query";
|
||||
} from "#/api/typesGenerated";
|
||||
import { ErrorAlert } from "#/components/Alert/ErrorAlert";
|
||||
import { Loader } from "#/components/Loader/Loader";
|
||||
import { selectFeatureVisibility } from "./entitlements";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { health } from "api/queries/debug";
|
||||
import { deploymentStats } from "api/queries/deployment";
|
||||
import { useAuthenticated } from "hooks";
|
||||
import type { FC } from "react";
|
||||
import { useQuery } from "react-query";
|
||||
import { useLocation } from "react-router";
|
||||
import { health } from "#/api/queries/debug";
|
||||
import { deploymentStats } from "#/api/queries/deployment";
|
||||
import { DeploymentBannerView } from "./DeploymentBannerView";
|
||||
|
||||
const HIDE_DEPLOYMENT_BANNER_PATHS = [
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
import type {
|
||||
DeploymentStats,
|
||||
HealthcheckReport,
|
||||
WorkspaceStatus,
|
||||
} from "api/typesGenerated";
|
||||
import dayjs from "dayjs";
|
||||
import {
|
||||
AppWindowIcon,
|
||||
@@ -24,6 +19,11 @@ import {
|
||||
} from "react";
|
||||
import { Link as RouterLink } from "react-router";
|
||||
import { getDisplayWorkspaceStatus } from "utils/workspace";
|
||||
import type {
|
||||
DeploymentStats,
|
||||
HealthcheckReport,
|
||||
WorkspaceStatus,
|
||||
} from "#/api/typesGenerated";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
import { HelpTooltipTitle } from "#/components/HelpTooltip/HelpTooltip";
|
||||
import { JetBrainsIcon } from "#/components/Icons/JetBrainsIcon";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { chromatic } from "testHelpers/chromatic";
|
||||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||
import { LicenseManagedAgentLimitExceededWarningText } from "api/typesGenerated";
|
||||
import { LicenseManagedAgentLimitExceededWarningText } from "#/api/typesGenerated";
|
||||
import { LicenseBannerView } from "./LicenseBannerView";
|
||||
|
||||
const meta: Meta<typeof LicenseBannerView> = {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import {
|
||||
LicenseManagedAgentLimitExceededWarningText,
|
||||
LicenseTelemetryRequiredErrorText,
|
||||
} from "api/typesGenerated";
|
||||
import { useState } from "react";
|
||||
import { cn } from "utils/cn";
|
||||
import { docs } from "utils/docs";
|
||||
import {
|
||||
LicenseManagedAgentLimitExceededWarningText,
|
||||
LicenseTelemetryRequiredErrorText,
|
||||
} from "#/api/typesGenerated";
|
||||
import { Expander } from "#/components/Expander/Expander";
|
||||
import { Link } from "#/components/Link/Link";
|
||||
import { Pill } from "#/components/Pill/Pill";
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import type * as TypesGen from "api/typesGenerated";
|
||||
import type { ProxyContextValue } from "contexts/ProxyContext";
|
||||
import {
|
||||
ChevronRightIcon,
|
||||
@@ -10,6 +9,7 @@ import { type FC, useState } from "react";
|
||||
import { Link } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import { cn } from "utils/cn";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { Avatar } from "#/components/Avatar/Avatar";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { buildInfo } from "api/queries/buildInfo";
|
||||
import type { LinkConfig } from "api/typesGenerated";
|
||||
import { useProxy } from "contexts/ProxyContext";
|
||||
import { useAuthenticated } from "hooks";
|
||||
import { useEmbeddedMetadata } from "hooks/useEmbeddedMetadata";
|
||||
@@ -7,6 +5,8 @@ import { useDashboard } from "modules/dashboard/useDashboard";
|
||||
import { canViewDeploymentSettings } from "modules/permissions";
|
||||
import type { FC } from "react";
|
||||
import { useQuery } from "react-query";
|
||||
import { buildInfo } from "#/api/queries/buildInfo";
|
||||
import type { LinkConfig } from "#/api/typesGenerated";
|
||||
import { useFeatureVisibility } from "../useFeatureVisibility";
|
||||
import { NavbarView } from "./NavbarView";
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ import { chromaticWithTablet } from "testHelpers/chromatic";
|
||||
import { MockTasks, MockUserMember, MockUserOwner } from "testHelpers/entities";
|
||||
import { withDashboardProvider } from "testHelpers/storybook";
|
||||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||
import type { TasksFilter } from "api/typesGenerated";
|
||||
import { userEvent, within } from "storybook/test";
|
||||
import type { TasksFilter } from "#/api/typesGenerated";
|
||||
import { NavbarView } from "./NavbarView";
|
||||
|
||||
const tasksFilter: TasksFilter = {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { API } from "api/api";
|
||||
import type * as TypesGen from "api/typesGenerated";
|
||||
import type { ProxyContextValue } from "contexts/ProxyContext";
|
||||
import { useEmbeddedMetadata } from "hooks/useEmbeddedMetadata";
|
||||
import { useDashboard } from "modules/dashboard/useDashboard";
|
||||
@@ -9,6 +7,8 @@ import { useQuery } from "react-query";
|
||||
import { NavLink, useLocation } from "react-router";
|
||||
import { isDevBuild } from "utils/buildInfo";
|
||||
import { cn } from "utils/cn";
|
||||
import { API } from "#/api/api";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { Badge } from "#/components/Badge/Badge";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
import { ExternalImage } from "#/components/ExternalImage/ExternalImage";
|
||||
|
||||
@@ -7,11 +7,11 @@ import {
|
||||
} from "testHelpers/entities";
|
||||
import { withDesktopViewport } from "testHelpers/storybook";
|
||||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||
import { getAuthorizationKey } from "api/queries/authCheck";
|
||||
import { AuthProvider } from "contexts/auth/AuthProvider";
|
||||
import { getPreferredProxy } from "contexts/ProxyContext";
|
||||
import { permissionChecks } from "modules/permissions";
|
||||
import { fn, userEvent, within } from "storybook/test";
|
||||
import { getAuthorizationKey } from "#/api/queries/authCheck";
|
||||
import { ProxyMenu } from "./ProxyMenu";
|
||||
|
||||
const defaultProxyContextValue = {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import Skeleton from "@mui/material/Skeleton";
|
||||
import type * as TypesGen from "api/typesGenerated";
|
||||
import type { ProxyContextValue } from "contexts/ProxyContext";
|
||||
import { useAuthenticated } from "hooks";
|
||||
import { type FC, useState } from "react";
|
||||
import { Link } from "react-router";
|
||||
import { toast } from "sonner";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { Abbr } from "#/components/Abbr/Abbr";
|
||||
import { ChevronDownIcon } from "#/components/AnimatedIcons/ChevronDown";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type * as TypesGen from "api/typesGenerated";
|
||||
import type { FC } from "react";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { Avatar } from "#/components/Avatar/Avatar";
|
||||
import {
|
||||
DropdownMenu,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import type * as TypesGen from "api/typesGenerated";
|
||||
import { useClipboard } from "hooks/useClipboard";
|
||||
import {
|
||||
CircleUserIcon,
|
||||
@@ -9,6 +8,7 @@ import {
|
||||
} from "lucide-react";
|
||||
import type { FC } from "react";
|
||||
import { Link } from "react-router";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import { CheckIcon } from "#/components/AnimatedIcons/Check";
|
||||
import {
|
||||
DropdownMenuItem,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Entitlements, Feature, FeatureName } from "api/typesGenerated";
|
||||
import type { Entitlements, Feature, FeatureName } from "#/api/typesGenerated";
|
||||
|
||||
/**
|
||||
* @param hasLicense true if Enterprise edition
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FeatureName } from "api/typesGenerated";
|
||||
import type { FeatureName } from "#/api/typesGenerated";
|
||||
import { selectFeatureVisibility } from "./entitlements";
|
||||
import { useDashboard } from "./useDashboard";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { updateCheck } from "api/queries/updateCheck";
|
||||
import { useMemo, useState } from "react";
|
||||
import { useQuery } from "react-query";
|
||||
import { updateCheck } from "#/api/queries/updateCheck";
|
||||
|
||||
export const useUpdateCheck = (enabled: boolean) => {
|
||||
const [dismissedVersion, setDismissedVersion] = useState(() =>
|
||||
|
||||
@@ -4,7 +4,7 @@ import type {
|
||||
ReducedUser,
|
||||
User,
|
||||
WorkspaceUser,
|
||||
} from "api/typesGenerated";
|
||||
} from "#/api/typesGenerated";
|
||||
|
||||
/**
|
||||
* Union of all user-like types that can be distinguished from Group.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type * as TypesGen from "api/typesGenerated";
|
||||
import type { PreviewParameter } from "api/typesGenerated";
|
||||
import { useEffect, useRef } from "react";
|
||||
import type * as TypesGen from "#/api/typesGenerated";
|
||||
import type { PreviewParameter } from "#/api/typesGenerated";
|
||||
|
||||
type UseSyncFormParametersProps = {
|
||||
parameters: readonly PreviewParameter[];
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { DeploymentConfig } from "api/api";
|
||||
import { deploymentConfig } from "api/queries/deployment";
|
||||
import { createContext, type FC, useContext } from "react";
|
||||
import { useQuery } from "react-query";
|
||||
import { Outlet } from "react-router";
|
||||
import type { DeploymentConfig } from "#/api/api";
|
||||
import { deploymentConfig } from "#/api/queries/deployment";
|
||||
import { ErrorAlert } from "#/components/Alert/ErrorAlert";
|
||||
import { Loader } from "#/components/Loader/Loader";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { BuildInfoResponse, Experiment } from "api/typesGenerated";
|
||||
import { ArrowUpRight } from "lucide-react";
|
||||
import type { Permissions } from "modules/permissions";
|
||||
import type { FC } from "react";
|
||||
import { isDevBuild } from "utils/buildInfo";
|
||||
import type { BuildInfoResponse, Experiment } from "#/api/typesGenerated";
|
||||
import {
|
||||
Sidebar as BaseSidebar,
|
||||
SettingsSidebarNavItem as SidebarNavItem,
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { organizationsPermissions } from "api/queries/organizations";
|
||||
import type { Organization } from "api/typesGenerated";
|
||||
import { useDashboard } from "modules/dashboard/useDashboard";
|
||||
import {
|
||||
canViewOrganization,
|
||||
@@ -9,6 +7,8 @@ import NotFoundPage from "pages/404Page/404Page";
|
||||
import { createContext, type FC, Suspense, useContext } from "react";
|
||||
import { useQuery } from "react-query";
|
||||
import { Outlet, useParams } from "react-router";
|
||||
import { organizationsPermissions } from "#/api/queries/organizations";
|
||||
import type { Organization } from "#/api/typesGenerated";
|
||||
import { ErrorAlert } from "#/components/Alert/ErrorAlert";
|
||||
import { Avatar } from "#/components/Avatar/Avatar";
|
||||
import {
|
||||
|
||||
@@ -8,8 +8,8 @@ import {
|
||||
} from "testHelpers/entities";
|
||||
import { withDashboardProvider } from "testHelpers/storybook";
|
||||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||
import type { Organization } from "api/typesGenerated";
|
||||
import { expect, userEvent, waitFor, within } from "storybook/test";
|
||||
import type { Organization } from "#/api/typesGenerated";
|
||||
import { OrganizationSidebarView } from "./OrganizationSidebarView";
|
||||
|
||||
const meta: Meta<typeof OrganizationSidebarView> = {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { Organization } from "api/typesGenerated";
|
||||
import { Check, Plus } from "lucide-react";
|
||||
import type { Permissions } from "modules/permissions";
|
||||
import type { OrganizationPermissions } from "modules/permissions/organizations";
|
||||
import { type FC, useState } from "react";
|
||||
import { useNavigate } from "react-router";
|
||||
import type { Organization } from "#/api/typesGenerated";
|
||||
import { ChevronDownIcon } from "#/components/AnimatedIcons/ChevronDown";
|
||||
import { Avatar } from "#/components/Avatar/Avatar";
|
||||
import { Button } from "#/components/Button/Button";
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user