Merge remote-tracking branch 'origin/main' into feat/acme-and-external-ca

This commit is contained in:
Sheen Capadngan
2025-05-19 20:11:48 +08:00
292 changed files with 9372 additions and 1110 deletions
@@ -16,5 +16,6 @@ export enum AppConnection {
Auth0 = "auth0",
HCVault = "hashicorp-vault",
LDAP = "ldap",
TeamCity = "teamcity"
TeamCity = "teamcity",
OCI = "oci"
}
@@ -0,0 +1,2 @@
export * from "./queries";
export * from "./types";
@@ -0,0 +1,108 @@
import { useQuery, UseQueryOptions } from "@tanstack/react-query";
import { apiRequest } from "@app/config/request";
import { appConnectionKeys } from "../queries";
import {
TListOCIVaultKeys,
TListOCIVaults,
TOCICompartment,
TOCIVault,
TOCIVaultKey
} from "./types";
const ociConnectionKeys = {
all: [...appConnectionKeys.all, "oci"] as const,
listCompartments: (connectionId: string) =>
[...ociConnectionKeys.all, "compartments", connectionId] as const,
listVaults: (connectionId: string, compartmentOcid: string) =>
[...ociConnectionKeys.all, "vaults", connectionId, compartmentOcid] as const,
listVaultKeys: (connectionId: string, compartmentOcid: string, vaultOcid: string) =>
[...ociConnectionKeys.all, "keys", connectionId, compartmentOcid, vaultOcid] as const
};
export const useOCIConnectionListCompartments = (
connectionId: string,
options?: Omit<
UseQueryOptions<
TOCICompartment[],
unknown,
TOCICompartment[],
ReturnType<typeof ociConnectionKeys.listCompartments>
>,
"queryKey" | "queryFn"
>
) => {
return useQuery({
queryKey: ociConnectionKeys.listCompartments(connectionId),
queryFn: async () => {
const { data } = await apiRequest.get<TOCICompartment[]>(
`/api/v1/app-connections/oci/${connectionId}/compartments`
);
return data;
},
...options
});
};
export const useOCIConnectionListVaults = (
{ connectionId, compartmentOcid }: TListOCIVaults,
options?: Omit<
UseQueryOptions<
TOCIVault[],
unknown,
TOCIVault[],
ReturnType<typeof ociConnectionKeys.listVaults>
>,
"queryKey" | "queryFn"
>
) => {
return useQuery({
queryKey: ociConnectionKeys.listVaults(connectionId, compartmentOcid),
queryFn: async () => {
const { data } = await apiRequest.get<TOCIVault[]>(
`/api/v1/app-connections/oci/${connectionId}/vaults`,
{
params: {
compartmentOcid
}
}
);
return data;
},
...options
});
};
export const useOCIConnectionListVaultKeys = (
{ connectionId, compartmentOcid, vaultOcid }: TListOCIVaultKeys,
options?: Omit<
UseQueryOptions<
TOCIVaultKey[],
unknown,
TOCIVaultKey[],
ReturnType<typeof ociConnectionKeys.listVaultKeys>
>,
"queryKey" | "queryFn"
>
) => {
return useQuery({
queryKey: ociConnectionKeys.listVaultKeys(connectionId, compartmentOcid, vaultOcid),
queryFn: async () => {
const { data } = await apiRequest.get<TOCIVaultKey[]>(
`/api/v1/app-connections/oci/${connectionId}/vault-keys`,
{
params: {
compartmentOcid,
vaultOcid
}
}
);
return data;
},
...options
});
};
@@ -0,0 +1,27 @@
// Response types
export type TOCICompartment = {
id: string;
name: string;
};
export type TOCIVault = {
id: string;
displayName: string;
};
export type TOCIVaultKey = {
id: string;
displayName: string;
};
// Param types
export type TListOCIVaults = {
connectionId: string;
compartmentOcid: string;
};
export type TListOCIVaultKeys = {
connectionId: string;
compartmentOcid: string;
vaultOcid: string;
};
@@ -84,6 +84,10 @@ export type TTeamCityConnectionOption = TAppConnectionOptionBase & {
app: AppConnection.TeamCity;
};
export type TOCIConnectionOption = TAppConnectionOptionBase & {
app: AppConnection.OCI;
};
export type TAppConnectionOption =
| TAwsConnectionOption
| TGitHubConnectionOption
@@ -101,7 +105,8 @@ export type TAppConnectionOption =
| TWindmillConnectionOption
| TAuth0ConnectionOption
| THCVaultConnectionOption
| TTeamCityConnectionOption;
| TTeamCityConnectionOption
| TOCIConnectionOption;
export type TAppConnectionOptionMap = {
[AppConnection.AWS]: TAwsConnectionOption;
@@ -122,4 +127,5 @@ export type TAppConnectionOptionMap = {
[AppConnection.HCVault]: THCVaultConnectionOption;
[AppConnection.LDAP]: TLdapConnectionOption;
[AppConnection.TeamCity]: TTeamCityConnectionOption;
[AppConnection.OCI]: TOCIConnectionOption;
};
@@ -13,6 +13,7 @@ import { THCVaultConnection } from "./hc-vault-connection";
import { THumanitecConnection } from "./humanitec-connection";
import { TLdapConnection } from "./ldap-connection";
import { TMsSqlConnection } from "./mssql-connection";
import { TOCIConnection } from "./oci-connection";
import { TPostgresConnection } from "./postgres-connection";
import { TTeamCityConnection } from "./teamcity-connection";
import { TTerraformCloudConnection } from "./terraform-cloud-connection";
@@ -32,6 +33,7 @@ export * from "./hc-vault-connection";
export * from "./humanitec-connection";
export * from "./ldap-connection";
export * from "./mssql-connection";
export * from "./oci-connection";
export * from "./postgres-connection";
export * from "./teamcity-connection";
export * from "./terraform-cloud-connection";
@@ -56,7 +58,8 @@ export type TAppConnection =
| TAuth0Connection
| THCVaultConnection
| TLdapConnection
| TTeamCityConnection;
| TTeamCityConnection
| TOCIConnection;
export type TAvailableAppConnection = Pick<TAppConnection, "name" | "id">;
@@ -102,4 +105,5 @@ export type TAppConnectionMap = {
[AppConnection.HCVault]: THCVaultConnection;
[AppConnection.LDAP]: TLdapConnection;
[AppConnection.TeamCity]: TTeamCityConnection;
[AppConnection.OCI]: TOCIConnection;
};
@@ -0,0 +1,17 @@
import { AppConnection } from "@app/hooks/api/appConnections/enums";
import { TRootAppConnection } from "@app/hooks/api/appConnections/types/root-connection";
export enum OCIConnectionMethod {
AccessKey = "access-key"
}
export type TOCIConnection = TRootAppConnection & { app: AppConnection.OCI } & {
method: OCIConnectionMethod.AccessKey;
credentials: {
userOcid: string;
tenancyOcid: string;
region: string;
fingerprint: string;
privateKey: string;
};
};
@@ -48,7 +48,7 @@ export const useGetCertBundle = (serialNumber: string) => {
certificate: string;
certificateChain: string;
serialNumber: string;
privateKey: string;
privateKey: string | null;
}>(`/api/v1/pki/certificates/${serialNumber}/bundle`);
return data;
},
+2 -2
View File
@@ -20,8 +20,8 @@ export const useDeleteGatewayById = () => {
export const useUpdateGatewayById = () => {
const queryClient = useQueryClient();
return useMutation({
mutationFn: ({ id, name, projectIds }: TUpdateGatewayDTO) => {
return apiRequest.patch(`/api/v1/gateways/${id}`, { name, projectIds });
mutationFn: ({ id, name }: TUpdateGatewayDTO) => {
return apiRequest.patch(`/api/v1/gateways/${id}`, { name });
},
onSuccess: () => {
queryClient.invalidateQueries(gatewaysQueryKeys.list());
+1 -16
View File
@@ -2,7 +2,7 @@ import { queryOptions } from "@tanstack/react-query";
import { apiRequest } from "@app/config/request";
import { TGateway, TListProjectGatewayDTO, TProjectGateway } from "./types";
import { TGateway } from "./types";
export const gatewaysQueryKeys = {
allKey: () => ["gateways"],
@@ -14,20 +14,5 @@ export const gatewaysQueryKeys = {
const { data } = await apiRequest.get<{ gateways: TGateway[] }>("/api/v1/gateways");
return data.gateways;
}
}),
listProjectGatewayKey: ({ projectId }: TListProjectGatewayDTO) => [
...gatewaysQueryKeys.allKey(),
"list",
{ projectId }
],
listProjectGateways: ({ projectId }: TListProjectGatewayDTO) =>
queryOptions({
queryKey: gatewaysQueryKeys.listProjectGatewayKey({ projectId }),
queryFn: async () => {
const { data } = await apiRequest.get<{ gateways: TProjectGateway[] }>(
`/api/v1/gateways/projects/${projectId}`
);
return data.gateways;
}
})
};
-26
View File
@@ -11,39 +11,13 @@ export type TGateway = {
name: string;
id: string;
};
projects: {
name: string;
id: string;
slug: string;
}[];
};
export type TProjectGateway = {
id: string;
identityId: string;
name: string;
createdAt: string;
updatedAt: string;
issuedAt: string;
serialNumber: string;
heartbeat: string;
projectGatewayId: string;
identity: {
name: string;
id: string;
};
};
export type TUpdateGatewayDTO = {
id: string;
name?: string;
projectIds?: string[];
};
export type TDeleteGatewayDTO = {
id: string;
};
export type TListProjectGatewayDTO = {
projectId: string;
};
@@ -7,6 +7,7 @@ export const identityAuthToNameMap: { [I in IdentityAuthMethod]: string } = {
[IdentityAuthMethod.GCP_AUTH]: "GCP Auth",
[IdentityAuthMethod.AWS_AUTH]: "AWS Auth",
[IdentityAuthMethod.AZURE_AUTH]: "Azure Auth",
[IdentityAuthMethod.OCI_AUTH]: "OCI Auth",
[IdentityAuthMethod.OIDC_AUTH]: "OIDC Auth",
[IdentityAuthMethod.LDAP_AUTH]: "LDAP Auth",
[IdentityAuthMethod.JWT_AUTH]: "JWT Auth"
@@ -5,6 +5,7 @@ export enum IdentityAuthMethod {
GCP_AUTH = "gcp-auth",
AWS_AUTH = "aws-auth",
AZURE_AUTH = "azure-auth",
OCI_AUTH = "oci-auth",
OIDC_AUTH = "oidc-auth",
LDAP_AUTH = "ldap-auth",
JWT_AUTH = "jwt-auth"
+107 -4
View File
@@ -11,6 +11,7 @@ import {
AddIdentityJwtAuthDTO,
AddIdentityKubernetesAuthDTO,
AddIdentityLdapAuthDTO,
AddIdentityOciAuthDTO,
AddIdentityOidcAuthDTO,
AddIdentityTokenAuthDTO,
AddIdentityUniversalAuthDTO,
@@ -27,6 +28,7 @@ import {
DeleteIdentityJwtAuthDTO,
DeleteIdentityKubernetesAuthDTO,
DeleteIdentityLdapAuthDTO,
DeleteIdentityOciAuthDTO,
DeleteIdentityOidcAuthDTO,
DeleteIdentityTokenAuthDTO,
DeleteIdentityUniversalAuthClientSecretDTO,
@@ -39,6 +41,7 @@ import {
IdentityJwtAuth,
IdentityKubernetesAuth,
IdentityLdapAuth,
IdentityOciAuth,
IdentityOidcAuth,
IdentityTokenAuth,
IdentityUniversalAuth,
@@ -51,6 +54,7 @@ import {
UpdateIdentityJwtAuthDTO,
UpdateIdentityKubernetesAuthDTO,
UpdateIdentityLdapAuthDTO,
UpdateIdentityOciAuthDTO,
UpdateIdentityOidcAuthDTO,
UpdateIdentityTokenAuthDTO,
UpdateIdentityUniversalAuthDTO,
@@ -452,6 +456,101 @@ export const useDeleteIdentityAwsAuth = () => {
});
};
export const useAddIdentityOciAuth = () => {
const queryClient = useQueryClient();
return useMutation<IdentityOciAuth, object, AddIdentityOciAuthDTO>({
mutationFn: async ({
identityId,
tenancyOcid,
allowedUsernames,
accessTokenTTL,
accessTokenMaxTTL,
accessTokenNumUsesLimit,
accessTokenTrustedIps
}) => {
const {
data: { identityOciAuth }
} = await apiRequest.post<{ identityOciAuth: IdentityOciAuth }>(
`/api/v1/auth/oci-auth/identities/${identityId}`,
{
tenancyOcid,
allowedUsernames,
accessTokenTTL,
accessTokenMaxTTL,
accessTokenNumUsesLimit,
accessTokenTrustedIps
}
);
return identityOciAuth;
},
onSuccess: (_, { identityId, organizationId }) => {
queryClient.invalidateQueries({
queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
});
queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityOciAuth(identityId) });
}
});
};
export const useUpdateIdentityOciAuth = () => {
const queryClient = useQueryClient();
return useMutation<IdentityOciAuth, object, UpdateIdentityOciAuthDTO>({
mutationFn: async ({
identityId,
tenancyOcid,
allowedUsernames,
accessTokenTTL,
accessTokenMaxTTL,
accessTokenNumUsesLimit,
accessTokenTrustedIps
}) => {
const {
data: { identityOciAuth }
} = await apiRequest.patch<{ identityOciAuth: IdentityOciAuth }>(
`/api/v1/auth/oci-auth/identities/${identityId}`,
{
tenancyOcid,
allowedUsernames,
accessTokenTTL,
accessTokenMaxTTL,
accessTokenNumUsesLimit,
accessTokenTrustedIps
}
);
return identityOciAuth;
},
onSuccess: (_, { identityId, organizationId }) => {
queryClient.invalidateQueries({
queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
});
queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityOciAuth(identityId) });
}
});
};
export const useDeleteIdentityOciAuth = () => {
const queryClient = useQueryClient();
return useMutation<IdentityOciAuth, object, DeleteIdentityOciAuthDTO>({
mutationFn: async ({ identityId }) => {
const {
data: { identityOciAuth }
} = await apiRequest.delete(`/api/v1/auth/oci-auth/identities/${identityId}`);
return identityOciAuth;
},
onSuccess: (_, { organizationId, identityId }) => {
queryClient.invalidateQueries({
queryKey: organizationKeys.getOrgIdentityMemberships(organizationId)
});
queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityById(identityId) });
queryClient.invalidateQueries({ queryKey: identitiesKeys.getIdentityOciAuth(identityId) });
}
});
};
export const useUpdateIdentityOidcAuth = () => {
const queryClient = useQueryClient();
return useMutation<IdentityOidcAuth, object, UpdateIdentityOidcAuthDTO>({
@@ -741,7 +840,8 @@ export const useAddIdentityKubernetesAuth = () => {
accessTokenTTL,
accessTokenMaxTTL,
accessTokenNumUsesLimit,
accessTokenTrustedIps
accessTokenTrustedIps,
gatewayId
}) => {
const {
data: { identityKubernetesAuth }
@@ -757,7 +857,8 @@ export const useAddIdentityKubernetesAuth = () => {
accessTokenTTL,
accessTokenMaxTTL,
accessTokenNumUsesLimit,
accessTokenTrustedIps
accessTokenTrustedIps,
gatewayId
}
);
@@ -846,7 +947,8 @@ export const useUpdateIdentityKubernetesAuth = () => {
accessTokenTTL,
accessTokenMaxTTL,
accessTokenNumUsesLimit,
accessTokenTrustedIps
accessTokenTrustedIps,
gatewayId
}) => {
const {
data: { identityKubernetesAuth }
@@ -862,7 +964,8 @@ export const useUpdateIdentityKubernetesAuth = () => {
accessTokenTTL,
accessTokenMaxTTL,
accessTokenNumUsesLimit,
accessTokenTrustedIps
accessTokenTrustedIps,
gatewayId
}
);
@@ -14,6 +14,7 @@ import {
IdentityLdapAuth,
IdentityMembership,
IdentityMembershipOrg,
IdentityOciAuth,
IdentityOidcAuth,
IdentityTokenAuth,
IdentityUniversalAuth,
@@ -32,6 +33,7 @@ export const identitiesKeys = {
getIdentityGcpAuth: (identityId: string) => [{ identityId }, "identity-gcp-auth"] as const,
getIdentityOidcAuth: (identityId: string) => [{ identityId }, "identity-oidc-auth"] as const,
getIdentityAwsAuth: (identityId: string) => [{ identityId }, "identity-aws-auth"] as const,
getIdentityOciAuth: (identityId: string) => [{ identityId }, "identity-oci-auth"] as const,
getIdentityAzureAuth: (identityId: string) => [{ identityId }, "identity-azure-auth"] as const,
getIdentityTokenAuth: (identityId: string) => [{ identityId }, "identity-token-auth"] as const,
getIdentityJwtAuth: (identityId: string) => [{ identityId }, "identity-jwt-auth"] as const,
@@ -170,6 +172,27 @@ export const useGetIdentityAwsAuth = (
});
};
export const useGetIdentityOciAuth = (
identityId: string,
options?: TReactQueryOptions["options"]
) => {
return useQuery({
queryKey: identitiesKeys.getIdentityOciAuth(identityId),
queryFn: async () => {
const {
data: { identityOciAuth }
} = await apiRequest.get<{ identityOciAuth: IdentityOciAuth }>(
`/api/v1/auth/oci-auth/identities/${identityId}`
);
return identityOciAuth;
},
staleTime: 0,
gcTime: 0,
...options,
enabled: Boolean(identityId) && (options?.enabled ?? true)
});
};
export const useGetIdentityAzureAuth = (
identityId: string,
options?: TReactQueryOptions["options"]
@@ -290,6 +290,48 @@ export type DeleteIdentityAwsAuthDTO = {
identityId: string;
};
export type IdentityOciAuth = {
identityId: string;
type: "iam";
tenancyOcid: string;
allowedUsernames?: string | null;
accessTokenTTL: number;
accessTokenMaxTTL: number;
accessTokenNumUsesLimit: number;
accessTokenTrustedIps: IdentityTrustedIp[];
};
export type AddIdentityOciAuthDTO = {
organizationId: string;
identityId: string;
tenancyOcid: string;
allowedUsernames?: string | null;
accessTokenTTL: number;
accessTokenMaxTTL: number;
accessTokenNumUsesLimit: number;
accessTokenTrustedIps: {
ipAddress: string;
}[];
};
export type UpdateIdentityOciAuthDTO = {
organizationId: string;
identityId: string;
tenancyOcid?: string;
allowedUsernames?: string | null;
accessTokenTTL?: number;
accessTokenMaxTTL?: number;
accessTokenNumUsesLimit?: number;
accessTokenTrustedIps?: {
ipAddress: string;
}[];
};
export type DeleteIdentityOciAuthDTO = {
organizationId: string;
identityId: string;
};
export type IdentityAzureAuth = {
identityId: string;
tenantId: string;
@@ -346,6 +388,7 @@ export type IdentityKubernetesAuth = {
accessTokenMaxTTL: number;
accessTokenNumUsesLimit: number;
accessTokenTrustedIps: IdentityTrustedIp[];
gatewayId?: string | null;
};
export type AddIdentityKubernetesAuthDTO = {
@@ -356,6 +399,7 @@ export type AddIdentityKubernetesAuthDTO = {
allowedNamespaces: string;
allowedNames: string;
allowedAudience: string;
gatewayId?: string | null;
caCert: string;
accessTokenTTL: number;
accessTokenMaxTTL: number;
@@ -373,6 +417,7 @@ export type UpdateIdentityKubernetesAuthDTO = {
allowedNamespaces?: string;
allowedNames?: string;
allowedAudience?: string;
gatewayId?: string | null;
caCert?: string;
accessTokenTTL?: number;
accessTokenMaxTTL?: number;
@@ -112,7 +112,13 @@ export const useUpdateOrg = () => {
selectedMfaMethod,
allowSecretSharingOutsideOrganization,
bypassOrgAuthEnabled,
userTokenExpiration
userTokenExpiration,
secretsProductEnabled,
pkiProductEnabled,
kmsProductEnabled,
sshProductEnabled,
scannerProductEnabled,
shareSecretsProductEnabled
}) => {
return apiRequest.patch(`/api/v1/organization/${orgId}`, {
name,
@@ -124,7 +130,13 @@ export const useUpdateOrg = () => {
selectedMfaMethod,
allowSecretSharingOutsideOrganization,
bypassOrgAuthEnabled,
userTokenExpiration
userTokenExpiration,
secretsProductEnabled,
pkiProductEnabled,
kmsProductEnabled,
sshProductEnabled,
scannerProductEnabled,
shareSecretsProductEnabled
});
},
onSuccess: () => {
@@ -20,6 +20,12 @@ export type Organization = {
allowSecretSharingOutsideOrganization?: boolean;
userTokenExpiration?: string;
userRole: string;
secretsProductEnabled: boolean;
pkiProductEnabled: boolean;
kmsProductEnabled: boolean;
sshProductEnabled: boolean;
scannerProductEnabled: boolean;
shareSecretsProductEnabled: boolean;
};
export type UpdateOrgDTO = {
@@ -34,6 +40,12 @@ export type UpdateOrgDTO = {
allowSecretSharingOutsideOrganization?: boolean;
bypassOrgAuthEnabled?: boolean;
userTokenExpiration?: string;
secretsProductEnabled?: boolean;
pkiProductEnabled?: boolean;
kmsProductEnabled?: boolean;
sshProductEnabled?: boolean;
scannerProductEnabled?: boolean;
shareSecretsProductEnabled?: boolean;
};
export type BillingDetails = {
+2 -2
View File
@@ -19,7 +19,7 @@ export type TProjectRole = {
id: string;
createdAt: string;
updatedAt: string;
description?: string;
description?: string | null;
permissions: TProjectPermission[];
};
@@ -76,7 +76,7 @@ export type TDeleteOrgRoleDTO = {
export type TCreateProjectRoleDTO = {
projectId: string;
name: string;
description?: string;
description?: string | null;
slug: string;
permissions: TProjectPermission[];
};
+2 -1
View File
@@ -12,7 +12,8 @@ export enum SecretSync {
Vercel = "vercel",
Windmill = "windmill",
HCVault = "hashicorp-vault",
TeamCity = "teamcity"
TeamCity = "teamcity",
OCIVault = "oci-vault"
}
export enum SecretSyncStatus {
@@ -11,6 +11,7 @@ import { TGcpSync } from "./gcp-sync";
import { TGitHubSync } from "./github-sync";
import { THCVaultSync } from "./hc-vault-sync";
import { THumanitecSync } from "./humanitec-sync";
import { TOCIVaultSync } from "./oci-vault-sync";
import { TTeamCitySync } from "./teamcity-sync";
import { TTerraformCloudSync } from "./terraform-cloud-sync";
import { TVercelSync } from "./vercel-sync";
@@ -36,7 +37,8 @@ export type TSecretSync =
| TVercelSync
| TWindmillSync
| THCVaultSync
| TTeamCitySync;
| TTeamCitySync
| TOCIVaultSync;
export type TListSecretSyncs = { secretSyncs: TSecretSync[] };
@@ -0,0 +1,17 @@
import { AppConnection } from "@app/hooks/api/appConnections/enums";
import { SecretSync } from "@app/hooks/api/secretSyncs";
import { TRootSecretSync } from "@app/hooks/api/secretSyncs/types/root-sync";
export type TOCIVaultSync = TRootSecretSync & {
destination: SecretSync.OCIVault;
destinationConfig: {
compartmentOcid: string;
vaultOcid: string;
keyOcid: string;
};
connection: {
app: AppConnection.OCI;
name: string;
id: string;
};
};
@@ -4,8 +4,7 @@ import { SecretSyncInitialSyncBehavior, SecretSyncStatus } from "@app/hooks/api/
export type RootSyncOptions = {
initialSyncBehavior: SecretSyncInitialSyncBehavior;
disableSecretDeletion?: boolean;
// prependPrefix?: string;
// appendSuffix?: string;
keySchema?: string;
};
export type TRootSecretSync = {
+9 -2
View File
@@ -277,13 +277,20 @@ export const useUpdateProject = () => {
const queryClient = useQueryClient();
return useMutation<Workspace, object, UpdateProjectDTO>({
mutationFn: async ({ projectID, newProjectName, newProjectDescription, newSlug }) => {
mutationFn: async ({
projectID,
newProjectName,
newProjectDescription,
newSlug,
secretSharing
}) => {
const { data } = await apiRequest.patch<{ workspace: Workspace }>(
`/api/v1/workspace/${projectID}`,
{
name: newProjectName,
description: newProjectDescription,
slug: newSlug
slug: newSlug,
secretSharing
}
);
return data.workspace;
+3 -1
View File
@@ -37,6 +37,7 @@ export type Workspace = {
createdAt: string;
roles?: TProjectRole[];
hasDeleteProtection: boolean;
secretSharing: boolean;
};
export type WorkspaceEnv = {
@@ -73,9 +74,10 @@ export type CreateWorkspaceDTO = {
export type UpdateProjectDTO = {
projectID: string;
newProjectName: string;
newProjectName?: string;
newProjectDescription?: string;
newSlug?: string;
secretSharing?: boolean;
};
export type UpdatePitVersionLimitDTO = { projectSlug: string; pitVersionLimit: number };