mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Slug projects and filter type
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
|||||||
import { PROJECTS } from "@app/lib/api-docs";
|
import { PROJECTS } from "@app/lib/api-docs";
|
||||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||||
import { AuthMode } from "@app/services/auth/auth-type";
|
import { AuthMode } from "@app/services/auth/auth-type";
|
||||||
|
import { ProjectFilterType } from "@app/services/project/project-types";
|
||||||
|
|
||||||
import { integrationAuthPubSchema } from "../sanitizedSchemas";
|
import { integrationAuthPubSchema } from "../sanitizedSchemas";
|
||||||
import { sanitizedServiceTokenSchema } from "../v2/service-token-router";
|
import { sanitizedServiceTokenSchema } from "../v2/service-token-router";
|
||||||
@@ -137,10 +138,11 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
|
|||||||
onRequest: verifyAuth([AuthMode.JWT, AuthMode.SERVICE_TOKEN, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
onRequest: verifyAuth([AuthMode.JWT, AuthMode.SERVICE_TOKEN, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
||||||
handler: async (req) => {
|
handler: async (req) => {
|
||||||
const workspace = await server.services.project.getAProject({
|
const workspace = await server.services.project.getAProject({
|
||||||
|
filterType: ProjectFilterType.ID,
|
||||||
|
filter: req.params.workspaceId,
|
||||||
actorId: req.permission.id,
|
actorId: req.permission.id,
|
||||||
actor: req.permission.type,
|
actor: req.permission.type,
|
||||||
actorOrgId: req.permission.orgId,
|
actorOrgId: req.permission.orgId
|
||||||
projectId: req.params.workspaceId
|
|
||||||
});
|
});
|
||||||
return { workspace };
|
return { workspace };
|
||||||
}
|
}
|
||||||
@@ -189,10 +191,11 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
|
|||||||
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
||||||
handler: async (req) => {
|
handler: async (req) => {
|
||||||
const workspace = await server.services.project.deleteProject({
|
const workspace = await server.services.project.deleteProject({
|
||||||
|
filterType: ProjectFilterType.ID,
|
||||||
|
filter: req.params.workspaceId,
|
||||||
actorId: req.permission.id,
|
actorId: req.permission.id,
|
||||||
actor: req.permission.type,
|
actor: req.permission.type,
|
||||||
actorOrgId: req.permission.orgId,
|
actorOrgId: req.permission.orgId
|
||||||
projectId: req.params.workspaceId
|
|
||||||
});
|
});
|
||||||
return { workspace };
|
return { workspace };
|
||||||
}
|
}
|
||||||
@@ -253,17 +256,18 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onRequest: verifyAuth([AuthMode.JWT]),
|
onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
||||||
handler: async (req) => {
|
handler: async (req) => {
|
||||||
const workspace = await server.services.project.updateProject({
|
const workspace = await server.services.project.updateProject({
|
||||||
actorId: req.permission.id,
|
filterType: ProjectFilterType.ID,
|
||||||
actor: req.permission.type,
|
filter: req.params.workspaceId,
|
||||||
actorOrgId: req.permission.orgId,
|
|
||||||
projectId: req.params.workspaceId,
|
|
||||||
update: {
|
update: {
|
||||||
name: req.body.name,
|
name: req.body.name,
|
||||||
autoCapitalization: req.body.autoCapitalization
|
autoCapitalization: req.body.autoCapitalization
|
||||||
}
|
},
|
||||||
|
actorId: req.permission.id,
|
||||||
|
actor: req.permission.type,
|
||||||
|
actorOrgId: req.permission.orgId
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
workspace
|
workspace
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { authRateLimit } from "@app/server/config/rateLimiter";
|
|||||||
import { getTelemetryDistinctId } from "@app/server/lib/telemetry";
|
import { getTelemetryDistinctId } from "@app/server/lib/telemetry";
|
||||||
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
import { verifyAuth } from "@app/server/plugins/auth/verify-auth";
|
||||||
import { AuthMode } from "@app/services/auth/auth-type";
|
import { AuthMode } from "@app/services/auth/auth-type";
|
||||||
|
import { ProjectFilterType } from "@app/services/project/project-types";
|
||||||
import { PostHogEventTypes } from "@app/services/telemetry/telemetry-types";
|
import { PostHogEventTypes } from "@app/services/telemetry/telemetry-types";
|
||||||
|
|
||||||
const projectWithEnv = ProjectsSchema.merge(
|
const projectWithEnv = ProjectsSchema.merge(
|
||||||
@@ -178,6 +179,7 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* Delete a project by slug */
|
||||||
server.route({
|
server.route({
|
||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
url: "/:slug",
|
url: "/:slug",
|
||||||
@@ -186,21 +188,25 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
|
|||||||
slug: slugSchema.describe("The slug of the project to delete.")
|
slug: slugSchema.describe("The slug of the project to delete.")
|
||||||
}),
|
}),
|
||||||
response: {
|
response: {
|
||||||
200: z.void()
|
200: ProjectsSchema
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onRequest: verifyAuth([AuthMode.JWT, AuthMode.API_KEY, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
onRequest: verifyAuth([AuthMode.JWT, AuthMode.API_KEY, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
||||||
|
|
||||||
handler: async (req) => {
|
handler: async (req) => {
|
||||||
await server.services.project.deleteProjectBySlug({
|
const project = await server.services.project.deleteProject({
|
||||||
|
filterType: ProjectFilterType.SLUG,
|
||||||
|
filter: req.params.slug,
|
||||||
actorId: req.permission.id,
|
actorId: req.permission.id,
|
||||||
actorOrgId: req.permission.orgId,
|
actorOrgId: req.permission.orgId,
|
||||||
actor: req.permission.type,
|
actor: req.permission.type
|
||||||
slug: req.params.slug
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return project;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* Get a project by slug */
|
||||||
server.route({
|
server.route({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
url: "/:slug",
|
url: "/:slug",
|
||||||
@@ -214,11 +220,47 @@ export const registerProjectRouter = async (server: FastifyZodProvider) => {
|
|||||||
},
|
},
|
||||||
onRequest: verifyAuth([AuthMode.JWT, AuthMode.API_KEY, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
onRequest: verifyAuth([AuthMode.JWT, AuthMode.API_KEY, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
||||||
handler: async (req) => {
|
handler: async (req) => {
|
||||||
const project = await server.services.project.getProjectBySlug({
|
const project = await server.services.project.getAProject({
|
||||||
|
filter: req.params.slug,
|
||||||
|
filterType: ProjectFilterType.SLUG,
|
||||||
actorId: req.permission.id,
|
actorId: req.permission.id,
|
||||||
actorOrgId: req.permission.orgId,
|
actorOrgId: req.permission.orgId,
|
||||||
|
actor: req.permission.type
|
||||||
|
});
|
||||||
|
|
||||||
|
return project;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/* Update a project by slug */
|
||||||
|
server.route({
|
||||||
|
method: "PATCH",
|
||||||
|
url: "/:slug",
|
||||||
|
schema: {
|
||||||
|
params: z.object({
|
||||||
|
slug: slugSchema.describe("The slug of the project to update.")
|
||||||
|
}),
|
||||||
|
body: z.object({
|
||||||
|
name: z.string().trim().optional().describe("The new name of the project."),
|
||||||
|
autoCapitalization: z.boolean().optional().describe("The new auto-capitalization setting.")
|
||||||
|
}),
|
||||||
|
response: {
|
||||||
|
200: ProjectsSchema
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onRequest: verifyAuth([AuthMode.JWT, AuthMode.API_KEY, AuthMode.IDENTITY_ACCESS_TOKEN]),
|
||||||
|
handler: async (req) => {
|
||||||
|
const project = await server.services.project.updateProject({
|
||||||
|
filterType: ProjectFilterType.SLUG,
|
||||||
|
filter: req.params.slug,
|
||||||
|
update: {
|
||||||
|
name: req.body.name,
|
||||||
|
autoCapitalization: req.body.autoCapitalization
|
||||||
|
},
|
||||||
|
actorId: req.permission.id,
|
||||||
actor: req.permission.type,
|
actor: req.permission.type,
|
||||||
slug: req.params.slug
|
actorOrgId: req.permission.orgId
|
||||||
});
|
});
|
||||||
|
|
||||||
return project;
|
return project;
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import { ProjectsSchema, ProjectUpgradeStatus, ProjectVersion, TableName, TProje
|
|||||||
import { BadRequestError, DatabaseError } from "@app/lib/errors";
|
import { BadRequestError, DatabaseError } from "@app/lib/errors";
|
||||||
import { ormify, selectAllTableCols, sqlNestRelationships } from "@app/lib/knex";
|
import { ormify, selectAllTableCols, sqlNestRelationships } from "@app/lib/knex";
|
||||||
|
|
||||||
|
import { ProjectFilterType } from "./project-types";
|
||||||
|
|
||||||
export type TProjectDALFactory = ReturnType<typeof projectDALFactory>;
|
export type TProjectDALFactory = ReturnType<typeof projectDALFactory>;
|
||||||
|
|
||||||
export const projectDALFactory = (db: TDbClient) => {
|
export const projectDALFactory = (db: TDbClient) => {
|
||||||
@@ -139,7 +141,7 @@ export const projectDALFactory = (db: TDbClient) => {
|
|||||||
{ column: `${TableName.Project}.name`, order: "asc" },
|
{ column: `${TableName.Project}.name`, order: "asc" },
|
||||||
{ column: `${TableName.Environment}.position`, order: "asc" }
|
{ column: `${TableName.Environment}.position`, order: "asc" }
|
||||||
]);
|
]);
|
||||||
return sqlNestRelationships({
|
const project = sqlNestRelationships({
|
||||||
data: workspaces,
|
data: workspaces,
|
||||||
key: "id",
|
key: "id",
|
||||||
parentMapper: ({ _id, ...el }) => ({ _id, ...ProjectsSchema.parse(el) }),
|
parentMapper: ({ _id, ...el }) => ({ _id, ...ProjectsSchema.parse(el) }),
|
||||||
@@ -155,6 +157,12 @@ export const projectDALFactory = (db: TDbClient) => {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
})?.[0];
|
})?.[0];
|
||||||
|
|
||||||
|
if (!project) {
|
||||||
|
throw new BadRequestError({ message: "Project not found" });
|
||||||
|
}
|
||||||
|
|
||||||
|
return project;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new DatabaseError({ error, name: "Find all projects" });
|
throw new DatabaseError({ error, name: "Find all projects" });
|
||||||
}
|
}
|
||||||
@@ -177,7 +185,7 @@ export const projectDALFactory = (db: TDbClient) => {
|
|||||||
{ column: `${TableName.Project}.name`, order: "asc" },
|
{ column: `${TableName.Project}.name`, order: "asc" },
|
||||||
{ column: `${TableName.Environment}.position`, order: "asc" }
|
{ column: `${TableName.Environment}.position`, order: "asc" }
|
||||||
]);
|
]);
|
||||||
return sqlNestRelationships({
|
const project = sqlNestRelationships({
|
||||||
data: projects,
|
data: projects,
|
||||||
key: "id",
|
key: "id",
|
||||||
parentMapper: ({ _id, ...el }) => ({ _id, ...ProjectsSchema.parse(el) }),
|
parentMapper: ({ _id, ...el }) => ({ _id, ...ProjectsSchema.parse(el) }),
|
||||||
@@ -193,11 +201,31 @@ export const projectDALFactory = (db: TDbClient) => {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
})?.[0];
|
})?.[0];
|
||||||
|
|
||||||
|
if (!project) {
|
||||||
|
throw new BadRequestError({ message: "Project not found" });
|
||||||
|
}
|
||||||
|
|
||||||
|
return project;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new DatabaseError({ error, name: "Find project by slug" });
|
throw new DatabaseError({ error, name: "Find project by slug" });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const findProjectByFilter = async (filter: string, type: ProjectFilterType) => {
|
||||||
|
try {
|
||||||
|
if (type === ProjectFilterType.ID) {
|
||||||
|
return await findProjectById(filter);
|
||||||
|
}
|
||||||
|
if (type === ProjectFilterType.SLUG) {
|
||||||
|
return await findProjectBySlug(filter);
|
||||||
|
}
|
||||||
|
throw new BadRequestError({ message: "Invalid filter type" });
|
||||||
|
} catch (error) {
|
||||||
|
throw new DatabaseError({ error, name: `Failed to find project by ${type}` });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const checkProjectUpgradeStatus = async (projectId: string) => {
|
const checkProjectUpgradeStatus = async (projectId: string) => {
|
||||||
const project = await projectOrm.findById(projectId);
|
const project = await projectOrm.findById(projectId);
|
||||||
const upgradeInProgress =
|
const upgradeInProgress =
|
||||||
@@ -217,6 +245,7 @@ export const projectDALFactory = (db: TDbClient) => {
|
|||||||
findAllProjectsByIdentity,
|
findAllProjectsByIdentity,
|
||||||
findProjectGhostUser,
|
findProjectGhostUser,
|
||||||
findProjectById,
|
findProjectById,
|
||||||
|
findProjectByFilter,
|
||||||
findProjectBySlug,
|
findProjectBySlug,
|
||||||
checkProjectUpgradeStatus
|
checkProjectUpgradeStatus
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -32,11 +32,11 @@ import { assignWorkspaceKeysToMembers, createProjectKey } from "./project-fns";
|
|||||||
import { TProjectQueueFactory } from "./project-queue";
|
import { TProjectQueueFactory } from "./project-queue";
|
||||||
import {
|
import {
|
||||||
TCreateProjectDTO,
|
TCreateProjectDTO,
|
||||||
TDeleteProjectBySlugDTO,
|
|
||||||
TDeleteProjectDTO,
|
TDeleteProjectDTO,
|
||||||
TGetProjectBySlugDTO,
|
|
||||||
TGetProjectDTO,
|
TGetProjectDTO,
|
||||||
|
TToggleProjectAutoCapitalizationDTO,
|
||||||
TUpdateProjectDTO,
|
TUpdateProjectDTO,
|
||||||
|
TUpdateProjectNameDTO,
|
||||||
TUpgradeProjectDTO
|
TUpgradeProjectDTO
|
||||||
} from "./project-types";
|
} from "./project-types";
|
||||||
|
|
||||||
@@ -312,27 +312,8 @@ export const projectServiceFactory = ({
|
|||||||
return results;
|
return results;
|
||||||
};
|
};
|
||||||
|
|
||||||
const deleteProject = async ({ actor, actorId, actorOrgId, projectId }: TDeleteProjectDTO) => {
|
const deleteProject = async ({ actor, actorId, actorOrgId, filter, filterType }: TDeleteProjectDTO) => {
|
||||||
const { permission } = await permissionService.getProjectPermission(actor, actorId, projectId, actorOrgId);
|
const project = await projectDAL.findProjectByFilter(filter, filterType);
|
||||||
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Delete, ProjectPermissionSub.Project);
|
|
||||||
|
|
||||||
const deletedProject = await projectDAL.transaction(async (tx) => {
|
|
||||||
const project = await projectDAL.deleteById(projectId, tx);
|
|
||||||
const projectGhostUser = await projectMembershipDAL.findProjectGhostUser(projectId).catch(() => null);
|
|
||||||
|
|
||||||
// Delete the org membership for the ghost user if it's found.
|
|
||||||
if (projectGhostUser) {
|
|
||||||
await userDAL.deleteById(projectGhostUser.id, tx);
|
|
||||||
}
|
|
||||||
|
|
||||||
return project;
|
|
||||||
});
|
|
||||||
|
|
||||||
return deletedProject;
|
|
||||||
};
|
|
||||||
|
|
||||||
const deleteProjectBySlug = async ({ actor, actorId, actorOrgId, slug }: TDeleteProjectBySlugDTO) => {
|
|
||||||
const project = await projectDAL.findOne({ slug });
|
|
||||||
|
|
||||||
const { permission } = await permissionService.getProjectPermission(actor, actorId, project.id, actorOrgId);
|
const { permission } = await permissionService.getProjectPermission(actor, actorId, project.id, actorOrgId);
|
||||||
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Delete, ProjectPermissionSub.Project);
|
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Delete, ProjectPermissionSub.Project);
|
||||||
@@ -357,22 +338,20 @@ export const projectServiceFactory = ({
|
|||||||
return workspaces;
|
return workspaces;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getAProject = async ({ actorId, actorOrgId, projectId, actor }: TGetProjectDTO) => {
|
const getAProject = async ({ actorId, actorOrgId, filter, filterType, actor }: TGetProjectDTO) => {
|
||||||
await permissionService.getProjectPermission(actor, actorId, projectId, actorOrgId);
|
const project = await projectDAL.findProjectByFilter(filter, filterType);
|
||||||
return projectDAL.findProjectById(projectId);
|
|
||||||
};
|
|
||||||
|
|
||||||
const getProjectBySlug = async ({ actorId, actorOrgId, slug, actor }: TGetProjectBySlugDTO) => {
|
|
||||||
const project = await projectDAL.findProjectBySlug(slug);
|
|
||||||
await permissionService.getProjectPermission(actor, actorId, project.id, actorOrgId);
|
await permissionService.getProjectPermission(actor, actorId, project.id, actorOrgId);
|
||||||
return project;
|
return project;
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateProject = async ({ projectId, actor, actorId, actorOrgId, update }: TUpdateProjectDTO) => {
|
const updateProject = async ({ actor, actorId, actorOrgId, update, filter, filterType }: TUpdateProjectDTO) => {
|
||||||
const { permission } = await permissionService.getProjectPermission(actor, actorId, projectId, actorOrgId);
|
const project = await projectDAL.findProjectByFilter(filter, filterType);
|
||||||
|
|
||||||
|
const { permission } = await permissionService.getProjectPermission(actor, actorId, project.id, actorOrgId);
|
||||||
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Edit, ProjectPermissionSub.Settings);
|
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Edit, ProjectPermissionSub.Settings);
|
||||||
|
|
||||||
const updatedProject = await projectDAL.updateById(projectId, {
|
const updatedProject = await projectDAL.updateById(project.id, {
|
||||||
name: update.name,
|
name: update.name,
|
||||||
autoCapitalization: update.autoCapitalization
|
autoCapitalization: update.autoCapitalization
|
||||||
});
|
});
|
||||||
@@ -385,7 +364,7 @@ export const projectServiceFactory = ({
|
|||||||
actorId,
|
actorId,
|
||||||
actorOrgId,
|
actorOrgId,
|
||||||
autoCapitalization
|
autoCapitalization
|
||||||
}: TGetProjectDTO & { autoCapitalization: boolean }) => {
|
}: TToggleProjectAutoCapitalizationDTO) => {
|
||||||
const { permission } = await permissionService.getProjectPermission(actor, actorId, projectId, actorOrgId);
|
const { permission } = await permissionService.getProjectPermission(actor, actorId, projectId, actorOrgId);
|
||||||
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Edit, ProjectPermissionSub.Settings);
|
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Edit, ProjectPermissionSub.Settings);
|
||||||
|
|
||||||
@@ -393,7 +372,7 @@ export const projectServiceFactory = ({
|
|||||||
return updatedProject;
|
return updatedProject;
|
||||||
};
|
};
|
||||||
|
|
||||||
const updateName = async ({ projectId, actor, actorId, actorOrgId, name }: TGetProjectDTO & { name: string }) => {
|
const updateName = async ({ projectId, actor, actorId, actorOrgId, name }: TUpdateProjectNameDTO) => {
|
||||||
const { permission } = await permissionService.getProjectPermission(actor, actorId, projectId, actorOrgId);
|
const { permission } = await permissionService.getProjectPermission(actor, actorId, projectId, actorOrgId);
|
||||||
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Edit, ProjectPermissionSub.Settings);
|
ForbiddenError.from(permission).throwUnlessCan(ProjectPermissionActions.Edit, ProjectPermissionSub.Settings);
|
||||||
|
|
||||||
@@ -446,10 +425,8 @@ export const projectServiceFactory = ({
|
|||||||
deleteProject,
|
deleteProject,
|
||||||
getProjects,
|
getProjects,
|
||||||
updateProject,
|
updateProject,
|
||||||
deleteProjectBySlug,
|
|
||||||
getProjectUpgradeStatus,
|
getProjectUpgradeStatus,
|
||||||
getAProject,
|
getAProject,
|
||||||
getProjectBySlug,
|
|
||||||
toggleAutoCapitalization,
|
toggleAutoCapitalization,
|
||||||
updateName,
|
updateName,
|
||||||
upgradeProject
|
upgradeProject
|
||||||
|
|||||||
@@ -3,6 +3,11 @@ import { TProjectPermission } from "@app/lib/types";
|
|||||||
|
|
||||||
import { ActorType } from "../auth/auth-type";
|
import { ActorType } from "../auth/auth-type";
|
||||||
|
|
||||||
|
export enum ProjectFilterType {
|
||||||
|
ID = "id",
|
||||||
|
SLUG = "slug"
|
||||||
|
}
|
||||||
|
|
||||||
export type TCreateProjectDTO = {
|
export type TCreateProjectDTO = {
|
||||||
actor: ActorType;
|
actor: ActorType;
|
||||||
actorId: string;
|
actorId: string;
|
||||||
@@ -12,13 +17,6 @@ export type TCreateProjectDTO = {
|
|||||||
slug?: string;
|
slug?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TDeleteProjectDTO = {
|
|
||||||
actor: ActorType;
|
|
||||||
actorId: string;
|
|
||||||
actorOrgId?: string;
|
|
||||||
projectId: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type TDeleteProjectBySlugDTO = {
|
export type TDeleteProjectBySlugDTO = {
|
||||||
slug: string;
|
slug: string;
|
||||||
actor: ActorType;
|
actor: ActorType;
|
||||||
@@ -27,25 +25,33 @@ export type TDeleteProjectBySlugDTO = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type TGetProjectDTO = {
|
export type TGetProjectDTO = {
|
||||||
actor: ActorType;
|
filter: string;
|
||||||
actorId: string;
|
filterType: ProjectFilterType;
|
||||||
actorOrgId?: string;
|
} & Omit<TProjectPermission, "projectId">;
|
||||||
projectId: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export type TGetProjectBySlugDTO = {
|
export type TToggleProjectAutoCapitalizationDTO = {
|
||||||
slug: string;
|
autoCapitalization: boolean;
|
||||||
actor: ActorType;
|
} & TProjectPermission;
|
||||||
actorId: string;
|
export type TUpdateProjectNameDTO = {
|
||||||
actorOrgId?: string;
|
name: string;
|
||||||
};
|
} & TProjectPermission;
|
||||||
|
|
||||||
export type TUpdateProjectDTO = {
|
export type TUpdateProjectDTO = {
|
||||||
|
filter: string;
|
||||||
|
filterType: ProjectFilterType;
|
||||||
update: {
|
update: {
|
||||||
name?: string;
|
name?: string;
|
||||||
autoCapitalization?: boolean;
|
autoCapitalization?: boolean;
|
||||||
};
|
};
|
||||||
} & TProjectPermission;
|
} & Omit<TProjectPermission, "projectId">;
|
||||||
|
|
||||||
|
export type TDeleteProjectDTO = {
|
||||||
|
filter: string;
|
||||||
|
filterType: ProjectFilterType;
|
||||||
|
actor: ActorType;
|
||||||
|
actorId: string;
|
||||||
|
actorOrgId?: string;
|
||||||
|
} & Omit<TProjectPermission, "projectId">;
|
||||||
|
|
||||||
export type TUpgradeProjectDTO = {
|
export type TUpgradeProjectDTO = {
|
||||||
userPrivateKey: string;
|
userPrivateKey: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user