mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 11:27:47 +00:00
move enums to their own file + lint
This commit is contained in:
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|||||||
|
|
||||||
import { PamFoldersSchema } from "@app/db/schemas";
|
import { PamFoldersSchema } from "@app/db/schemas";
|
||||||
import { EventType } from "@app/ee/services/audit-log/audit-log-types";
|
import { EventType } from "@app/ee/services/audit-log/audit-log-types";
|
||||||
import { PamAccountOrderBy, PamAccountView } from "@app/ee/services/pam-account/pam-account-types";
|
import { PamAccountOrderBy, PamAccountView } from "@app/ee/services/pam-account/pam-account-enums";
|
||||||
import { SanitizedMySQLAccountWithResourceSchema } from "@app/ee/services/pam-resource/mysql/mysql-resource-schemas";
|
import { SanitizedMySQLAccountWithResourceSchema } from "@app/ee/services/pam-resource/mysql/mysql-resource-schemas";
|
||||||
import { PamResource } from "@app/ee/services/pam-resource/pam-resource-enums";
|
import { PamResource } from "@app/ee/services/pam-resource/pam-resource-enums";
|
||||||
import { SanitizedPostgresAccountWithResourceSchema } from "@app/ee/services/pam-resource/postgres/postgres-resource-schemas";
|
import { SanitizedPostgresAccountWithResourceSchema } from "@app/ee/services/pam-resource/postgres/postgres-resource-schemas";
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { DatabaseError } from "@app/lib/errors";
|
|||||||
import { ormify, selectAllTableCols } from "@app/lib/knex";
|
import { ormify, selectAllTableCols } from "@app/lib/knex";
|
||||||
import { OrderByDirection } from "@app/lib/types";
|
import { OrderByDirection } from "@app/lib/types";
|
||||||
|
|
||||||
import { PamAccountOrderBy, PamAccountView } from "./pam-account-types";
|
import { PamAccountOrderBy, PamAccountView } from "./pam-account-enums";
|
||||||
|
|
||||||
export type TPamAccountDALFactory = ReturnType<typeof pamAccountDALFactory>;
|
export type TPamAccountDALFactory = ReturnType<typeof pamAccountDALFactory>;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
export enum PamAccountOrderBy {
|
||||||
|
Name = "name"
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum PamAccountView {
|
||||||
|
Flat = "flat",
|
||||||
|
Nested = "nested"
|
||||||
|
}
|
||||||
@@ -31,14 +31,9 @@ import { TPamSessionDALFactory } from "../pam-session/pam-session-dal";
|
|||||||
import { PamSessionStatus } from "../pam-session/pam-session-enums";
|
import { PamSessionStatus } from "../pam-session/pam-session-enums";
|
||||||
import { OrgPermissionGatewayActions, OrgPermissionSubjects } from "../permission/org-permission";
|
import { OrgPermissionGatewayActions, OrgPermissionSubjects } from "../permission/org-permission";
|
||||||
import { TPamAccountDALFactory } from "./pam-account-dal";
|
import { TPamAccountDALFactory } from "./pam-account-dal";
|
||||||
|
import { PamAccountView } from "./pam-account-enums";
|
||||||
import { decryptAccount, decryptAccountCredentials, encryptAccountCredentials } from "./pam-account-fns";
|
import { decryptAccount, decryptAccountCredentials, encryptAccountCredentials } from "./pam-account-fns";
|
||||||
import {
|
import { TAccessAccountDTO, TCreateAccountDTO, TListAccountsDTO, TUpdateAccountDTO } from "./pam-account-types";
|
||||||
PamAccountView,
|
|
||||||
TAccessAccountDTO,
|
|
||||||
TCreateAccountDTO,
|
|
||||||
TListAccountsDTO,
|
|
||||||
TUpdateAccountDTO
|
|
||||||
} from "./pam-account-types";
|
|
||||||
|
|
||||||
type TPamAccountServiceFactoryDep = {
|
type TPamAccountServiceFactoryDep = {
|
||||||
pamResourceDAL: TPamResourceDALFactory;
|
pamResourceDAL: TPamResourceDALFactory;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { OrderByDirection, TProjectPermission } from "@app/lib/types";
|
import { OrderByDirection, TProjectPermission } from "@app/lib/types";
|
||||||
|
|
||||||
import { TPamAccount } from "../pam-resource/pam-resource-types";
|
import { TPamAccount } from "../pam-resource/pam-resource-types";
|
||||||
|
import { PamAccountOrderBy, PamAccountView } from "./pam-account-enums";
|
||||||
|
|
||||||
// DTOs
|
// DTOs
|
||||||
export type TCreateAccountDTO = Pick<
|
export type TCreateAccountDTO = Pick<
|
||||||
@@ -30,12 +31,3 @@ export type TListAccountsDTO = {
|
|||||||
limit?: number;
|
limit?: number;
|
||||||
offset?: number;
|
offset?: number;
|
||||||
} & TProjectPermission;
|
} & TProjectPermission;
|
||||||
|
|
||||||
export enum PamAccountOrderBy {
|
|
||||||
Name = "name"
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum PamAccountView {
|
|
||||||
Flat = "flat",
|
|
||||||
Nested = "nested"
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { DatabaseError } from "@app/lib/errors";
|
|||||||
import { ormify, selectAllTableCols } from "@app/lib/knex";
|
import { ormify, selectAllTableCols } from "@app/lib/knex";
|
||||||
import { OrderByDirection } from "@app/lib/types";
|
import { OrderByDirection } from "@app/lib/types";
|
||||||
|
|
||||||
import { PamAccountOrderBy } from "../pam-account/pam-account-types";
|
import { PamAccountOrderBy } from "../pam-account/pam-account-enums";
|
||||||
|
|
||||||
export type TPamFolderDALFactory = ReturnType<typeof pamFolderDALFactory>;
|
export type TPamFolderDALFactory = ReturnType<typeof pamFolderDALFactory>;
|
||||||
export const pamFolderDALFactory = (db: TDbClient) => {
|
export const pamFolderDALFactory = (db: TDbClient) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user