Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

304 KB
Raw Blame
import { AGENT_VAULT_MAX_REFERENCES_PER_FIELD } from "@app/ee/services/agent-vault/agent-vault-variable-fns";
import { SecretRotation } from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-enums";
import {
  getSecretRotationConnectionApps,
  SECRET_ROTATION_NAME_MAP
} from "@app/ee/services/secret-rotation-v2/secret-rotation-v2-maps";
import { SecretScanningDataSource } from "@app/ee/services/secret-scanning-v2/secret-scanning-v2-enums";
import {
  AUTO_SYNC_DESCRIPTION_HELPER,
  SECRET_SCANNING_DATA_SOURCE_CONNECTION_MAP,
  SECRET_SCANNING_DATA_SOURCE_NAME_MAP
} from "@app/ee/services/secret-scanning-v2/secret-scanning-v2-maps";
import { AppConnection } from "@app/services/app-connection/app-connection-enums";
import { APP_CONNECTION_NAME_MAP } from "@app/services/app-connection/app-connection-maps";
import { CaType } from "@app/services/certificate-authority/certificate-authority-enums";
import { CERTIFICATE_AUTHORITIES_TYPE_MAP } from "@app/services/certificate-authority/certificate-authority-maps";
import { SecretSync } from "@app/services/secret-sync/secret-sync-enums";
import { SECRET_SYNC_CONNECTION_MAP, SECRET_SYNC_NAME_MAP } from "@app/services/secret-sync/secret-sync-maps";
import { MAX_PREVENT_DUPLICATE_SECRET_VALUE_VERSIONS } from "@app/services/secret-validation-rule/secret-validation-rule-constants";
import { SecretValidationRuleType } from "@app/services/secret-validation-rule/secret-validation-rule-enums";
import { SECRET_VALIDATION_RULE_NAME_MAP } from "@app/services/secret-validation-rule/secret-validation-rule-maps";

const IDENTITY_AUTH_SUB_ORGANIZATION_NAME =
  "When set, this will scope the login session to the specified organization the machine identity has access to. If omitted, the session defaults to the organization where the machine identity was created in.";

export enum ApiDocsTags {
  Identities = "Identities",
  IdentityTemplates = "Identity Templates",
  TokenAuth = "Token Auth",
  UniversalAuth = "Universal Auth",
  GcpAuth = "GCP Auth",
  AliCloudAuth = "Alibaba Cloud Auth",
  TlsCertAuth = "TLS Certificate Auth",
  AwsAuth = "AWS Auth",
  OciAuth = "OCI Auth",
  AzureAuth = "Azure Auth",
  KubernetesAuth = "Kubernetes Auth",
  JwtAuth = "JWT Auth",
  SpiffeAuth = "SPIFFE Auth",
  OidcAuth = "OIDC Auth",
  LdapAuth = "LDAP Auth",
  Groups = "Groups",
  Organizations = "Organizations",
  OrganizationRoles = "Organization Roles",
  OrgIdentityMembership = "Organization Identity Membership",
  SubOrganizations = "Sub Organizations",
  Projects = "Projects",
  ProjectUsers = "Project Users",
  ProjectGroups = "Project Groups",
  ProjectIdentities = "Project Identities",
  IdentityProjectMembership = "Project Identity Membership",
  ProjectRoles = "Project Roles",
  ProjectTemplates = "Project Templates",
  Environments = "Environments",
  Folders = "Folders",
  SecretTags = "Secret Tags",
  Secrets = "Secrets",
  DynamicSecrets = "Dynamic Secrets",
  SecretImports = "Secret Imports",
  SecretRotations = "Secret Rotations",
  SecretValidationRules = "Secret Validation Rules",
  ProxiedServices = "Proxied Services",
  IdentitySpecificPrivilegesV1 = "Identity Specific Privileges",
  IdentitySpecificPrivilegesV2 = "Identity Specific Privileges V2",
  FolderAccess = "Folder Access",
  AppConnections = "App Connections",
  SecretSyncs = "Secret Syncs",
  PkiSyncs = "PKI Syncs",
  Integrations = "Integrations",
  ServiceTokens = "Service Tokens",
  AuditLogs = "Audit Logs",
  Alerting = "Alerting",
  PkiCertificateAuthorities = "PKI Certificate Authorities",
  PkiCertificates = "PKI Certificates",
  PkiCertificatePolicies = "PKI Certificate Policies",
  PkiCertificateTemplates = "PKI Certificate Templates",
  PkiCertificateProfiles = "PKI Certificate Profiles",
  PkiApplications = "PKI Applications",
  CertManagerInstance = "Certificate Manager Instance",
  PkiCertificateCollections = "PKI Certificate Collections",
  PkiAlerting = "PKI Alerting",
  HsmConnectors = "HSM Connectors",
  PkiDiscovery = "PKI Discovery",
  PkiInstallations = "PKI Installations",
  PkiSigners = "PKI Signers",
  PkiSubscribers = "PKI Subscribers",
  PkiAcme = "PKI ACME",
  KmsKeys = "KMS Keys",
  KmsEncryption = "KMS Encryption",
  KmsSigning = "KMS Signing",
  SecretScanning = "Secret Scanning",
  SecretSharing = "Secret Sharing",
  OidcSso = "OIDC SSO",
  SamlSso = "SAML SSO",
  LdapSso = "LDAP SSO",
  Scim = "SCIM",
  Events = "Event Subscriptions",
  GatewaysV3 = "Gateways",
  PamAccounts = "PAM Accounts",
  PamFolders = "PAM Folders",
  PamAccountTemplates = "PAM Account Templates",
  PamSessions = "PAM Sessions",
  PamMemberships = "PAM Memberships",
  PamRoles = "PAM Roles",
  PamDiscovery = "PAM Discovery",
  AgentVault = "Agent Vault",
  AgentVaultAccessBundles = "Agent Vault Access Bundles",
  AgentVaultVariables = "Agent Vault Variables",
  AgentVaultSkills = "Agent Vault Skills",
  AgentVaultSessions = "Agent Vault Sessions",
  AgentVaultProxies = "Agent Vault Proxies",
  AgentVaultMembers = "Agent Vault Members",
  AgentVaultDelegations = "Agent Vault Delegations",
  AgentVaultSessionLogs = "Agent Vault Session Logs",
  AgentVaultSettings = "Agent Vault Settings",
  AgentVaultAppConnections = "Agent Vault App Connections",
  KmipServers = "KMIP Servers",
  Instance = "Instance"
}

export const GROUPS = {
  CREATE: {
    name: "The name of the group to create.",
    slug: "The slug of the group to create.",
    role: "The role of the group to create."
  },
  UPDATE: {
    id: "The ID of the group to update.",
    name: "The new name of the group to update to.",
    slug: "The new slug of the group to update to.",
    role: "The new role of the group to update to."
  },
  DELETE: {
    id: "The ID of the group to delete.",
    slug: "The slug of the group to delete."
  },
  LIST_USERS: {
    id: "The ID of the group to list users for.",
    offset: "The offset to start from. If you enter 10, it will start from the 10th user.",
    limit: "The number of users to return.",
    username: "The username to search for.",
    search: "The text string that user email or name will be filtered by.",
    projectId: "The ID of the project the group belongs to.",
    filterUsers:
      "Whether to filter the list of returned users. 'existingMembers' will only return existing users in the group, 'nonMembers' will only return users not in the group, undefined will return all users in the organization."
  },
  LIST_MACHINE_IDENTITIES: {
    id: "The ID of the group to list identities for.",
    offset: "The offset to start from. If you enter 10, it will start from the 10th identity.",
    limit: "The number of identities to return.",
    search: "The text string that machine identity name will be filtered by.",
    filterMachineIdentities:
      "Whether to filter the list of returned identities. 'assignedMachineIdentities' will only return identities assigned to the group, 'nonAssignedMachineIdentities' will only return identities not assigned to the group, undefined will return all identities in the organization."
  },
  LIST_MEMBERS: {
    id: "The ID of the group to list members for.",
    offset: "The offset to start from. If you enter 10, it will start from the 10th member.",
    limit: "The number of members to return.",
    search:
      "The text string that member email(in case of users) or name(in case of machine identities) will be filtered by.",
    orderBy: "The column to order members by.",
    orderDirection: "The direction to order members in.",
    memberTypeFilter:
      "Filter members by type. Can be a single value ('users' or 'machineIdentities') or an array of values. If not specified, both users and machine identities will be returned."
  },
  LIST_PROJECTS: {
    id: "The ID of the group to list projects for.",
    offset: "The offset to start from. If you enter 10, it will start from the 10th project.",
    limit: "The number of projects to return.",
    search: "The text string that project name or slug will be filtered by.",
    filterProjects:
      "Whether to filter the list of returned projects. 'assignedProjects' will only return projects assigned to the group, 'unassignedProjects' will only return projects not assigned to the group, undefined will return all projects in the organization.",
    orderBy: "The column to order projects by.",
    orderDirection: "The direction to order projects in."
  },
  ADD_USER: {
    id: "The ID of the group to add the user to.",
    username: "The username of the user to add to the group."
  },
  ADD_MACHINE_IDENTITY: {
    id: "The ID of the group to add the machine identity to.",
    machineIdentityId: "The ID of the machine identity to add to the group."
  },
  GET_BY_ID: {
    id: "The ID of the group to fetch."
  },
  DELETE_USER: {
    id: "The ID of the group to remove the user from.",
    username: "The username of the user to remove from the group."
  },
  DELETE_MACHINE_IDENTITY: {
    id: "The ID of the group to remove the machine identity from.",
    machineIdentityId: "The ID of the machine identity to remove from the group."
  }
} as const;

export const IDENTITIES = {
  CREATE: {
    name: "The name of the identity to create.",
    organizationId: "The organization ID to which the identity belongs.",
    role: "The role of the identity. Possible values are 'no-access', 'member', and 'admin'.",
    hasDeleteProtection: "Prevents deletion of the identity when enabled.",
    metadata: "An optional array of key-value pairs to attach to the identity."
  },
  UPDATE: {
    identityId: "The ID of the machine identity to update.",
    name: "The new name of the identity.",
    role: "The new role of the identity.",
    hasDeleteProtection: "Prevents deletion of the identity when enabled.",
    metadata: "An optional array of key-value pairs to attach to the identity."
  },
  DELETE: {
    identityId: "The ID of the machine identity to delete."
  },
  GET_BY_ID: {
    identityId: "The ID of the machine identity to get details.",
    orgId: "The ID of the org of the identity"
  },
  LIST: {
    orgId: "The ID of the organization to list identities.",
    search: "The text string that identity names will be filtered by.",
    offset: "The offset to start from. If you enter 10, it will start from the 10th identity.",
    limit: "The number of identities to return."
  },
  SEARCH: {
    search: {
      desc: "The filters to apply to the search.",
      name: "The name of the identity to filter by.",
      role: "The organizational role of the identity to filter by."
    },
    offset: "The offset to start from. If you enter 10, it will start from the 10th identity.",
    limit: "The number of identities to return.",
    orderBy: "The column to order identities by.",
    orderDirection: "The direction to order identities in."
  }
} as const;

export const IDENTITIES_V2 = {
  SEARCH: {
    scope:
      "Array of scopes to search across. Accepts 'organization' to include organization-level identities and/or 'project' to include identities from projects the caller has access to. Defaults to ['organization'].",
    search: {
      desc: "The filters to apply to the search.",
      name: "The name of the identity to filter by.",
      role: "The role to filter by. Matches against the role name or slug for custom roles and the role type for predefined roles."
    },
    offset: "The offset to start from. If you enter 10, it will start from the 10th identity.",
    limit: "The number of identities to return.",
    orderBy: "The column to order identities by.",
    orderDirection: "The direction to order identities in."
  },
  SEARCH_COUNT: {
    scope:
      "Array of scopes to count. Returns a count for each requested scope. Accepts 'organization' and/or 'project'.",
    search: {
      desc: "The filters to apply when counting.",
      name: "The name of the identity to filter by.",
      role: "The role to filter by. Matches against the role name or slug for custom roles and the role type for predefined roles."
    }
  }
} as const;

export const UNIVERSAL_AUTH = {
  LOGIN: {
    clientId: "Your Machine Identity Client ID.",
    clientSecret: "Your Machine Identity Client Secret.",
    organizationSlug: IDENTITY_AUTH_SUB_ORGANIZATION_NAME
  },
  ATTACH: {
    identityId: "The ID of the machine identity to attach the configuration onto.",
    clientSecretTrustedIps:
      "A list of IPs or CIDR ranges that the Client Secret can be used from together with the Client ID to get back an access token. You can use 0.0.0.0/0, to allow usage from any network address.",
    accessTokenTrustedIps:
      "A list of IPs or CIDR ranges that access tokens can be used from. You can use 0.0.0.0/0, to allow usage from any network address.",
    accessTokenTTL: "The lifetime for an access token in seconds. This value will be referenced at renewal time.",
    accessTokenMaxTTL:
      "The maximum lifetime for an access token in seconds. This value will be referenced at renewal time.",
    accessTokenNumUsesLimit:
      "The maximum number of times that an access token can be used; a value of 0 implies infinite number of uses.",
    accessTokenPeriod:
      "The period for an access token in seconds. This value will be referenced at renewal time. Default value is 0.",
    lockoutEnabled: "Whether the lockout feature is enabled.",
    lockoutThreshold: "The amount of times login must fail before locking the identity auth method.",
    lockoutDurationSeconds: "How long an identity auth method lockout lasts.",
    lockoutCounterResetSeconds:
      "How long to wait from the most recent failed login until resetting the lockout counter."
  },
  RETRIEVE: {
    identityId: "The ID of the machine identity to retrieve the auth method for."
  },
  REVOKE: {
    identityId: "The ID of the machine identity to revoke the auth method for."
  },
  UPDATE: {
    identityId: "The ID of the machine identity to update the auth method for.",
    clientSecretTrustedIps: "The new list of IPs or CIDR ranges that the Client Secret can be used from.",
    accessTokenTrustedIps: "The new list of IPs or CIDR ranges that access tokens can be used from.",
    accessTokenTTL: "The new lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The new maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The new maximum number of times that an access token can be used.",
    accessTokenPeriod: "The new period for an access token in seconds.",
    lockoutEnabled: "Whether the lockout feature is enabled.",
    lockoutThreshold: "The amount of times login must fail before locking the identity auth method.",
    lockoutDurationSeconds: "How long an identity auth method lockout lasts.",
    lockoutCounterResetSeconds:
      "How long to wait from the most recent failed login until resetting the lockout counter."
  },
  CREATE_CLIENT_SECRET: {
    identityId: "The ID of the machine identity to create a client secret for.",
    description: "The description of the client secret.",
    numUsesLimit:
      "The maximum number of times that the client secret can be used; a value of 0 implies infinite number of uses.",
    ttl: "The lifetime for the client secret in seconds."
  },
  LIST_CLIENT_SECRETS: {
    identityId: "The ID of the machine identity to list client secrets for."
  },
  GET_CLIENT_SECRET: {
    identityId: "The ID of the machine identity to get the client secret from.",
    clientSecretId: "The ID of the client secret to get details."
  },
  REVOKE_CLIENT_SECRET: {
    identityId: "The ID of the machine identity to revoke the client secret from.",
    clientSecretId: "The ID of the client secret to revoke."
  },
  CLEAR_CLIENT_LOCKOUTS: {
    identityId: "The ID of the machine identity to clear the client lockouts from."
  },
  RENEW_ACCESS_TOKEN: {
    accessToken: "The access token to renew."
  },
  REVOKE_ACCESS_TOKEN: {
    accessToken: "The access token to revoke."
  }
} as const;

export const LDAP_AUTH = {
  LOGIN: {
    identityId: "The ID of the machine identity to login.",
    username: "The username of the LDAP user to login.",
    password: "The password of the LDAP user to login.",
    organizationSlug: IDENTITY_AUTH_SUB_ORGANIZATION_NAME
  },
  ATTACH: {
    templateId: "The ID of the identity auth template to attach the configuration onto.",
    identityId: "The ID of the machine identity to attach the configuration onto.",
    url: "The URL of the LDAP server.",
    allowedFields:
      "The comma-separated array of key/value pairs of required fields that the LDAP entry must have in order to authenticate.",
    searchBase: "The base DN to search for the LDAP user.",
    searchFilter: "The filter to use to search for the LDAP user.",
    bindDN: "The DN of the user to bind to the LDAP server.",
    bindPass: "The password of the user to bind to the LDAP server.",
    ldapCaCertificate: "The PEM-encoded CA certificate for the LDAP server.",
    accessTokenTTL: "The lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The maximum number of times that an access token can be used.",
    accessTokenTrustedIps: "The IPs or CIDR ranges that access tokens can be used from.",
    lockoutEnabled: "Whether the lockout feature is enabled.",
    lockoutThreshold: "The amount of times login must fail before locking the identity auth method.",
    lockoutDurationSeconds: "How long an identity auth method lockout lasts.",
    lockoutCounterResetSeconds:
      "How long to wait from the most recent failed login until resetting the lockout counter."
  },
  UPDATE: {
    identityId: "The ID of the machine identity to update the configuration for.",
    url: "The new URL of the LDAP server.",
    allowedFields: "The comma-separated list of allowed fields to return from the LDAP user.",
    searchBase: "The new base DN to search for the LDAP user.",
    searchFilter: "The new filter to use to search for the LDAP user.",
    bindDN: "The new DN of the user to bind to the LDAP server.",
    bindPass: "The new password of the user to bind to the LDAP server.",
    ldapCaCertificate: "The new PEM-encoded CA certificate for the LDAP server.",
    accessTokenTTL: "The new lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The new maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The new maximum number of times that an access token can be used.",
    accessTokenTrustedIps: "The new IPs or CIDR ranges that access tokens can be used from.",
    templateId: "The ID of the identity auth template to update the configuration to.",
    lockoutEnabled: "Whether the lockout feature is enabled.",
    lockoutThreshold: "The amount of times login must fail before locking the identity auth method.",
    lockoutDurationSeconds: "How long an identity auth method lockout lasts.",
    lockoutCounterResetSeconds:
      "How long to wait from the most recent failed login until resetting the lockout counter."
  },
  RETRIEVE: {
    identityId: "The ID of the machine identity to retrieve the configuration for."
  },
  REVOKE: {
    identityId: "The ID of the machine identity to revoke the configuration for."
  },
  CLEAR_CLIENT_LOCKOUTS: {
    identityId: "The ID of the machine identity to clear the client lockouts from."
  }
} as const;

export const ALICLOUD_AUTH = {
  LOGIN: {
    identityId: "The ID of the machine identity to login.",
    Action: "The Alibaba Cloud API action. For STS GetCallerIdentity, this should be 'GetCallerIdentity'.",
    Format: "The response format. For STS GetCallerIdentity, this should be 'JSON'.",
    Version: "The API version. This should be in 'YYYY-MM-DD' format (e.g., '2015-04-01').",
    AccessKeyId: "The AccessKey ID of the RAM user or STS token.",
    SignatureMethod: "The signature algorithm. For STS GetCallerIdentity, this should be 'HMAC-SHA1'.",
    Timestamp: "The timestamp of the request in UTC, formatted as 'YYYY-MM-DDTHH:mm:ssZ'.",
    SignatureVersion: "The signature version. For STS GetCallerIdentity, this should be '1.0'.",
    SignatureNonce: "A unique random string to prevent replay attacks.",
    Signature: "The signature string calculated based on the request parameters and AccessKey Secret.",
    organizationSlug: IDENTITY_AUTH_SUB_ORGANIZATION_NAME
  },
  ATTACH: {
    identityId: "The ID of the machine identity to attach the configuration onto.",
    allowedArns: "The comma-separated list of trusted ARNs that are allowed to authenticate with Infisical.",
    accessTokenTTL: "The lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The maximum number of times that an access token can be used.",
    accessTokenTrustedIps: "The IPs or CIDR ranges that access tokens can be used from."
  },
  UPDATE: {
    identityId: "The ID of the machine identity to update the auth method for.",
    allowedArns: "The comma-separated list of trusted ARNs that are allowed to authenticate with Infisical.",
    accessTokenTTL: "The new lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The new maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The new maximum number of times that an access token can be used.",
    accessTokenTrustedIps: "The new IPs or CIDR ranges that access tokens can be used from."
  },
  RETRIEVE: {
    identityId: "The ID of the machine identity to retrieve the auth method for."
  },
  REVOKE: {
    identityId: "The ID of the machine identity to revoke the auth method for."
  }
} as const;

export const TLS_CERT_AUTH = {
  LOGIN: {
    identityId: "The ID of the machine identity to login.",
    organizationSlug: IDENTITY_AUTH_SUB_ORGANIZATION_NAME
  },
  ATTACH: {
    identityId: "The ID of the machine identity to attach the configuration onto.",
    allowedCommonNames:
      "The comma-separated list of trusted common names that are allowed to authenticate with Infisical.",
    allowedSubjectAltNames:
      "The comma-separated list of trusted subject alternative names that are allowed to authenticate with Infisical. Prefix entries by type (URI:, DNS:, IP:, EMAIL:). Bare entries are treated as DNS names.",
    caCertificate: "The PEM-encoded CA certificate to validate client certificates.",
    verifyClientCertificateChain:
      "When false (default), the CA certificate must be the direct issuer of the client's leaf certificate. When true, the CA certificate is treated as a trust anchor and the client-presented chain (leaf plus intermediates) is validated up to it, supporting issuers that rotate beneath a stable root such as SPIRE X.509-SVIDs.",
    bindAccessTokenToCertificate:
      "When true, access tokens issued by this auth method only work on requests that present the same client certificate used to log in.",
    accessTokenTTL: "The lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The maximum number of times that an access token can be used.",
    accessTokenTrustedIps: "The IPs or CIDR ranges that access tokens can be used from."
  },
  UPDATE: {
    identityId: "The ID of the machine identity to update the auth method for.",
    allowedCommonNames:
      "The comma-separated list of trusted common names that are allowed to authenticate with Infisical.",
    allowedSubjectAltNames:
      "The comma-separated list of trusted subject alternative names that are allowed to authenticate with Infisical. Prefix entries by type (URI:, DNS:, IP:, EMAIL:). Bare entries are treated as DNS names.",
    caCertificate: "The PEM-encoded CA certificate to validate client certificates.",
    verifyClientCertificateChain:
      "When false (default), the CA certificate must be the direct issuer of the client's leaf certificate. When true, the CA certificate is treated as a trust anchor and the client-presented chain (leaf plus intermediates) is validated up to it, supporting issuers that rotate beneath a stable root such as SPIRE X.509-SVIDs.",
    bindAccessTokenToCertificate:
      "When true, access tokens issued by this auth method only work on requests that present the same client certificate used to log in. Turning this on revokes the identity's existing TLS Certificate Auth access tokens.",
    accessTokenTTL: "The new lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The new maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The new maximum number of times that an access token can be used.",
    accessTokenTrustedIps: "The new IPs or CIDR ranges that access tokens can be used from."
  },
  RETRIEVE: {
    identityId: "The ID of the machine identity to retrieve the auth method for."
  },
  REVOKE: {
    identityId: "The ID of the machine identity to revoke the auth method for."
  }
} as const;

export const AWS_AUTH = {
  LOGIN: {
    identityId: "The ID of the machine identity to login.",
    iamHttpRequestMethod: "The HTTP request method used in the signed request.",
    iamRequestUrl:
      "The base64-encoded HTTP URL used in the signed request. Most likely, the base64-encoding of https://sts.amazonaws.com/.",
    iamRequestBody:
      "The base64-encoded body of the signed request. Most likely, the base64-encoding of Action=GetCallerIdentity&Version=2011-06-15.",
    iamRequestHeaders: "The base64-encoded headers of the sts:GetCallerIdentity signed request.",
    organizationSlug: IDENTITY_AUTH_SUB_ORGANIZATION_NAME
  },
  ATTACH: {
    identityId: "The ID of the machine identity to attach the configuration onto.",
    allowedPrincipalArns:
      "The comma-separated list of trusted IAM principal ARNs that are allowed to authenticate with Infisical.",
    allowedAccountIds:
      "The comma-separated list of trusted AWS account IDs that are allowed to authenticate with Infisical.",
    accessTokenTTL: "The lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The maximum lifetime for an access token in seconds.",
    stsEndpoint: "The endpoint URL for the AWS STS API.",
    accessTokenNumUsesLimit: "The maximum number of times that an access token can be used.",
    accessTokenTrustedIps: "The IPs or CIDR ranges that access tokens can be used from."
  },
  UPDATE: {
    identityId: "The ID of the machine identity to update the auth method for.",
    allowedPrincipalArns:
      "The new comma-separated list of trusted IAM principal ARNs that are allowed to authenticate with Infisical.",
    allowedAccountIds:
      "The new comma-separated list of trusted AWS account IDs that are allowed to authenticate with Infisical.",
    accessTokenTTL: "The new lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The new maximum lifetime for an access token in seconds.",
    stsEndpoint: "The new endpoint URL for the AWS STS API.",
    accessTokenNumUsesLimit: "The new maximum number of times that an access token can be used.",
    accessTokenTrustedIps: "The new IPs or CIDR ranges that access tokens can be used from."
  },
  RETRIEVE: {
    identityId: "The ID of the machine identity to retrieve the auth method for."
  },
  REVOKE: {
    identityId: "The ID of the machine identity to revoke the auth method for."
  }
} as const;

export const OCI_AUTH = {
  LOGIN: {
    identityId: "The ID of the machine identity to login.",
    userOcid: "The OCID of the user attempting login.",
    headers: "The headers of the signed request.",
    organizationSlug: IDENTITY_AUTH_SUB_ORGANIZATION_NAME
  },
  ATTACH: {
    identityId: "The ID of the machine identity to attach the configuration onto.",
    tenancyOcid: "The OCID of your tenancy.",
    allowedUsernames:
      "The comma-separated list of trusted OCI account usernames that are allowed to authenticate with Infisical.",
    accessTokenTTL: "The lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The maximum number of times that an access token can be used.",
    accessTokenTrustedIps: "The IPs or CIDR ranges that access tokens can be used from."
  },
  UPDATE: {
    identityId: "The ID of the machine identity to update the auth method for.",
    tenancyOcid: "The OCID of your tenancy.",
    allowedUsernames:
      "The comma-separated list of trusted OCI account usernames that are allowed to authenticate with Infisical.",
    accessTokenTTL: "The new lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The new maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The new maximum number of times that an access token can be used.",
    accessTokenTrustedIps: "The new IPs or CIDR ranges that access tokens can be used from."
  },
  RETRIEVE: {
    identityId: "The ID of the machine identity to retrieve the auth method for."
  },
  REVOKE: {
    identityId: "The ID of the machine identity to revoke the auth method for."
  }
} as const;

export const AZURE_AUTH = {
  LOGIN: {
    identityId: "The ID of the machine identity to login.",
    organizationSlug: IDENTITY_AUTH_SUB_ORGANIZATION_NAME
  },
  ATTACH: {
    identityId: "The ID of the machine identity to attach the configuration onto.",
    tenantId: "The tenant ID for the Azure AD organization.",
    resource: "The resource URL for the application registered in Azure AD.",
    allowedServicePrincipalIds:
      "The comma-separated list of Azure AD service principal IDs that are allowed to authenticate with Infisical.",
    accessTokenTrustedIps: "The IPs or CIDR ranges that access tokens can be used from.",
    accessTokenTTL: "The lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The maximum number of times that an access token can be used."
  },
  UPDATE: {
    identityId: "The ID of the machine identity to update the auth method for.",
    tenantId: "The new tenant ID for the Azure AD organization.",
    resource: "The new resource URL for the application registered in Azure AD.",
    allowedServicePrincipalIds:
      "The new comma-separated list of Azure AD service principal IDs that are allowed to authenticate with Infisical.",
    accessTokenTrustedIps: "The new IPs or CIDR ranges that access tokens can be used from.",
    accessTokenTTL: "The new lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The new maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The new maximum number of times that an access token can be used."
  },
  RETRIEVE: {
    identityId: "The ID of the machine identity to retrieve the auth method for."
  },
  REVOKE: {
    identityId: "The ID of the machine identity to revoke the auth method for."
  }
} as const;

export const GCP_AUTH = {
  LOGIN: {
    identityId: "The ID of the machine identity to login.",
    organizationSlug: IDENTITY_AUTH_SUB_ORGANIZATION_NAME
  },
  ATTACH: {
    identityId: "The ID of the machine identity to attach the configuration onto.",
    allowedServiceAccounts:
      "The comma-separated list of trusted service account emails corresponding to the GCE resource(s) allowed to authenticate with Infisical.",
    allowedProjects:
      "The comma-separated list of trusted GCP projects that the GCE instance must belong to authenticate with Infisical.",
    allowedZones:
      "The comma-separated list of trusted zones that the GCE instances must belong to authenticate with Infisical.",
    accessTokenTrustedIps: "The IPs or CIDR ranges that access tokens can be used from.",
    accessTokenTTL: "The lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The maximum number of times that an access token can be used."
  },
  UPDATE: {
    identityId: "The ID of the machine identity to update the auth method for.",
    allowedServiceAccounts:
      "The new comma-separated list of trusted service account emails corresponding to the GCE resource(s) allowed to authenticate with Infisical.",
    allowedProjects:
      "The new comma-separated list of trusted GCP projects that the GCE instance must belong to authenticate with Infisical.",
    allowedZones:
      "The new comma-separated list of trusted zones that the GCE instances must belong to authenticate with Infisical.",
    accessTokenTrustedIps: "The new IPs or CIDR ranges that access tokens can be used from.",
    accessTokenTTL: "The new lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The new maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The new maximum number of times that an access token can be used."
  },
  RETRIEVE: {
    identityId: "The ID of the machine identity to retrieve the auth method for."
  },
  REVOKE: {
    identityId: "The ID of the machine identity to revoke the auth method for."
  }
} as const;

export const KUBERNETES_AUTH = {
  LOGIN: {
    identityId: "The ID of the machine identity to login.",
    organizationSlug: IDENTITY_AUTH_SUB_ORGANIZATION_NAME
  },
  ATTACH: {
    identityId: "The ID of the machine identity to attach the configuration onto.",
    templateId:
      "The ID of the Kubernetes auth template to source connection settings from. When provided, the host, CA certificate, token reviewer JWT, token review mode, gateway, and allowed audience are taken from the template and cannot be set individually.",
    kubernetesHost: "The host string, host:port pair, or URL to the base of the Kubernetes API server.",
    caCert:
      "The PEM-encoded CA certificate used to validate the Kubernetes API server's TLS certificate. Required when verifyTlsCertificate is true. Supplying a non-empty caCert always implies verifyTlsCertificate=true; explicitly setting the toggle to false in the same request is rejected.",
    verifyTlsCertificate:
      "Whether to verify the Kubernetes API server's TLS certificate against the configured CA certificate. When true, caCert is required. When false, the connection is still over HTTPS but the API server's certificate is not verified, and caCert must be empty. If omitted, defaults to true when caCert is provided and false otherwise.",
    tokenReviewerJwt:
      "Optional JWT token for accessing Kubernetes TokenReview API. If provided, this long-lived token will be used to validate service account tokens during authentication. If omitted, the client's own JWT will be used instead, which requires the client to have the system:auth-delegator ClusterRole binding.",
    tokenReviewMode:
      "The mode to use for token review. Must be one of: 'api', 'gateway'. Defaults to 'api' when omitted. If gateway is selected, the gateway must be deployed in Kubernetes, and the gateway must have the system:auth-delegator ClusterRole binding.",
    allowedNamespaces:
      "The comma-separated list of trusted namespaces that service accounts must belong to authenticate with Infisical.",
    allowedNames: "The comma-separated list of trusted service account names that can authenticate with Infisical.",
    allowedAudience:
      "The optional audience claim that the service account JWT token must have to authenticate with Infisical.",
    gatewayId: "The ID of the gateway to use when performing kubernetes API requests.",
    accessTokenTrustedIps: "The IPs or CIDR ranges that access tokens can be used from.",
    accessTokenTTL: "The lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The maximum number of times that an access token can be used."
  },
  UPDATE: {
    identityId: "The ID of the machine identity to update the auth method for.",
    templateId:
      "The ID of the Kubernetes auth template to link. While linked, connection settings are managed by the template and cannot be set individually. Pass null to unlink the template; the settings copied from it are kept.",
    kubernetesHost: "The new host string, host:port pair, or URL to the base of the Kubernetes API server.",
    caCert:
      "The new PEM-encoded CA certificate used to validate the Kubernetes API server's TLS certificate. Required when verifyTlsCertificate is true. Supplying a non-empty caCert always implies verifyTlsCertificate=true; the update is rejected if the resulting effective state would store a CA together with verifyTlsCertificate=false.",
    verifyTlsCertificate:
      "Whether to verify the Kubernetes API server's TLS certificate against the configured CA certificate. When true, caCert is required. When false, the connection is still over HTTPS but the API server's certificate is not verified, and the resulting effective CA must be empty. If omitted while supplying a non-empty caCert in the same update, the toggle is auto-promoted to true; otherwise the stored value is preserved.",
    tokenReviewerJwt:
      "Optional JWT token for accessing Kubernetes TokenReview API. If provided, this long-lived token will be used to validate service account tokens during authentication. If omitted, the client's own JWT will be used instead, which requires the client to have the system:auth-delegator ClusterRole binding.",
    tokenReviewMode:
      "The mode to use for token review. Must be one of: 'api', 'gateway'. If gateway is selected, the gateway must be deployed in Kubernetes, and the gateway must have the system:auth-delegator ClusterRole binding.",
    allowedNamespaces:
      "The new comma-separated list of trusted namespaces that service accounts must belong to authenticate with Infisical.",
    allowedNames: "The new comma-separated list of trusted service account names that can authenticate with Infisical.",
    allowedAudience:
      "The new optional audience claim that the service account JWT token must have to authenticate with Infisical.",
    gatewayId: "The ID of the gateway to use when performing kubernetes API requests.",
    accessTokenTrustedIps: "The new IPs or CIDR ranges that access tokens can be used from.",
    accessTokenTTL: "The new lifetime for an acccess token in seconds.",
    accessTokenMaxTTL: "The new maximum lifetime for an acccess token in seconds.",
    accessTokenNumUsesLimit: "The new maximum number of times that an access token can be used."
  },
  RETRIEVE: {
    identityId: "The ID of the machine identity to retrieve the auth method for."
  },
  REVOKE: {
    identityId: "The ID of the machine identity to revoke the auth method for."
  }
} as const;

export const TOKEN_AUTH = {
  ATTACH: {
    identityId: "The ID of the machine identity to attach the configuration onto.",
    accessTokenTrustedIps: "The IPs or CIDR ranges that access tokens can be used from.",
    accessTokenTTL: "The lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The maximum number of times that an access token can be used."
  },
  UPDATE: {
    identityId: "The ID of the machine identity to update the auth method for.",
    accessTokenTrustedIps: "The new IPs or CIDR ranges that access tokens can be used from.",
    accessTokenTTL: "The new lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The new maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The new maximum number of times that an access token can be used."
  },
  RETRIEVE: {
    identityId: "The ID of the machine identity to retrieve the auth method for."
  },
  REVOKE: {
    identityId: "The ID of the machine identity to revoke the auth method for."
  },
  GET_TOKENS: {
    identityId: "The ID of the machine identity to list token metadata for.",
    offset: "The offset to start from. If you enter 10, it will start from the 10th token.",
    limit: "The number of tokens to return."
  },
  GET_TOKEN: {
    identityId: "The ID of the machine identity to get the token for.",
    tokenId: "The ID of the token to get metadata for."
  },
  CREATE_TOKEN: {
    identityId: "The ID of the machine identity to create the token for.",
    name: "The name of the token to create.",
    organizationSlug: "The sub organization name to scope the token to."
  },
  UPDATE_TOKEN: {
    tokenId: "The ID of the token to update metadata for.",
    name: "The name of the token to update to."
  },
  REVOKE_TOKEN: {
    tokenId: "The ID of the token to revoke."
  }
} as const;

export const OIDC_AUTH = {
  LOGIN: {
    identityId: "The ID of the machine identity to login.",
    organizationSlug: IDENTITY_AUTH_SUB_ORGANIZATION_NAME
  },
  ATTACH: {
    identityId: "The ID of the machine identity to attach the configuration onto.",
    templateId:
      "The ID of the OIDC auth template to source identity provider settings from. When provided, the OIDC discovery URL, issuer, audiences, and CA certificate are taken from the template and cannot be set individually.",
    oidcDiscoveryUrl: "The URL used to retrieve the OpenID Connect configuration from the identity provider.",
    caCert: "The PEM-encoded CA cert for establishing secure communication with the Identity Provider endpoints.",
    boundIssuer: "The unique identifier of the identity provider issuing the JWT.",
    boundAudiences: "The list of intended recipients.",
    boundClaims: "The attributes that should be present in the JWT for it to be valid.",
    claimMetadataMapping: "The attributes that should be present in the permission metadata from the JWT.",
    boundSubject: "The expected principal that is the subject of the JWT.",
    accessTokenTrustedIps: "The IPs or CIDR ranges that access tokens can be used from.",
    accessTokenTTL: "The lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The maximum number of times that an access token can be used."
  },
  UPDATE: {
    identityId: "The ID of the machine identity to update the auth method for.",
    templateId:
      "The ID of the OIDC auth template to link. While linked, identity provider settings are managed by the template and cannot be set individually. Pass null to unlink the template; the settings copied from it are kept.",
    oidcDiscoveryUrl: "The new URL used to retrieve the OpenID Connect configuration from the identity provider.",
    caCert: "The new PEM-encoded CA cert for establishing secure communication with the Identity Provider endpoints.",
    boundIssuer: "The new unique identifier of the identity provider issuing the JWT.",
    boundAudiences: "The new list of intended recipients.",
    boundClaims: "The new attributes that should be present in the JWT for it to be valid.",
    claimMetadataMapping: "The new attributes that should be present in the permission metadata from the JWT.",
    boundSubject: "The new expected principal that is the subject of the JWT.",
    accessTokenTrustedIps: "The new IPs or CIDR ranges that access tokens can be used from.",
    accessTokenTTL: "The new lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The new maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The new maximum number of times that an access token can be used."
  },
  RETRIEVE: {
    identityId: "The ID of the machine identity to retrieve the auth method for."
  },
  REVOKE: {
    identityId: "The ID of the machine identity to revoke the auth method for."
  }
} as const;

export const JWT_AUTH = {
  LOGIN: {
    identityId: "The ID of the machine identity to login.",
    organizationSlug: IDENTITY_AUTH_SUB_ORGANIZATION_NAME
  },
  ATTACH: {
    identityId: "The ID of the machine identity to attach the configuration onto.",
    configurationType: "The configuration for validating JWTs. Must be one of: 'jwks', 'static'",
    jwksUrl:
      "The URL of the JWKS endpoint. Required if configurationType is 'jwks'. This endpoint must serve JSON Web Key Sets (JWKS) containing the public keys used to verify JWT signatures.",
    jwksCaCert: "The PEM-encoded CA certificate for validating the TLS connection to the JWKS endpoint.",
    publicKeys:
      "A list of PEM-encoded public keys used to verify JWT signatures. Required if configurationType is 'static'. Each key must be in RSA or ECDSA format and properly PEM-encoded with BEGIN/END markers.",
    boundIssuer: "The unique identifier of the JWT provider.",
    boundAudiences: "The list of intended recipients.",
    boundClaims: "The attributes that should be present in the JWT for it to be valid.",
    boundSubject: "The expected principal that is the subject of the JWT.",
    accessTokenTrustedIps: "The IPs or CIDR ranges that access tokens can be used from.",
    accessTokenTTL: "The lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The maximum number of times that an access token can be used."
  },
  UPDATE: {
    identityId: "The ID of the machine identity to update the auth method for.",
    configurationType: "The new configuration for validating JWTs. Must be one of: 'jwks', 'static'",
    jwksUrl:
      "The new URL of the JWKS endpoint. This endpoint must serve JSON Web Key Sets (JWKS) containing the public keys used to verify JWT signatures.",
    jwksCaCert: "The new PEM-encoded CA certificate for validating the TLS connection to the JWKS endpoint.",
    publicKeys:
      "A new list of PEM-encoded public keys used to verify JWT signatures. Each key must be in RSA or ECDSA format and properly PEM-encoded with BEGIN/END markers.",
    boundIssuer: "The new unique identifier of the JWT provider.",
    boundAudiences: "The new list of intended recipients.",
    boundClaims: "The new attributes that should be present in the JWT for it to be valid.",
    boundSubject: "The new expected principal that is the subject of the JWT.",
    accessTokenTrustedIps: "The new IPs or CIDR ranges that access tokens can be used from.",
    accessTokenTTL: "The new lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The new maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The new maximum number of times that an access token can be used."
  },
  RETRIEVE: {
    identityId: "The ID of the machine identity to retrieve the auth method for."
  },
  REVOKE: {
    identityId: "The ID of the machine identity to revoke the auth method for."
  }
} as const;

export const SPIFFE_AUTH = {
  LOGIN: {
    identityId: "The ID of the machine identity to login.",
    jwt: "The JWT-SVID token to authenticate with.",
    organizationSlug: IDENTITY_AUTH_SUB_ORGANIZATION_NAME
  },
  ATTACH: {
    identityId: "The ID of the machine identity to attach the configuration onto.",
    trustDomain: "The SPIFFE trust domain (e.g. prod.example.com).",
    allowedSpiffeIds:
      "Comma-separated list of allowed SPIFFE ID patterns. Supports picomatch glob patterns (e.g. spiffe://prod.example.com/**).",
    allowedAudiences: "Comma-separated list of allowed audiences for JWT-SVID validation.",
    trustBundleDistribution: {
      profile:
        "The trust bundle distribution profile. Must be one of: 'static' (admin uploads JWKS), 'https_web_bundle' (auto-refresh from HTTPS endpoint).",
      bundle: "The JWKS JSON containing public keys for JWT-SVID verification. Required when profile is 'static'.",
      endpointUrl:
        "The SPIRE bundle endpoint URL for automatic trust bundle retrieval. Required when profile is 'https_web_bundle'.",
      caCert:
        "Optional PEM-encoded root CA certificate for verifying the bundle endpoint TLS connection. Defaults to system root CAs when not provided.",
      refreshHintSeconds: "The interval in seconds between bundle refresh attempts. Defaults to 3600."
    },
    accessTokenTrustedIps: "The IPs or CIDR ranges that access tokens can be used from.",
    accessTokenTTL: "The lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The maximum number of times that an access token can be used."
  },
  UPDATE: {
    identityId: "The ID of the machine identity to update the auth method for.",
    trustDomain: "The new SPIFFE trust domain.",
    allowedSpiffeIds: "The new comma-separated list of allowed SPIFFE ID patterns.",
    allowedAudiences: "The new comma-separated list of allowed audiences.",
    trustBundleDistribution: {
      profile: "The new trust bundle distribution profile.",
      bundle: "The new JWKS JSON containing public keys.",
      endpointUrl: "The new SPIRE bundle endpoint URL.",
      caCert: "The new PEM-encoded CA certificate for the bundle endpoint.",
      refreshHintSeconds: "The new interval in seconds between bundle refresh attempts."
    },
    accessTokenTrustedIps: "The new IPs or CIDR ranges that access tokens can be used from.",
    accessTokenTTL: "The new lifetime for an access token in seconds.",
    accessTokenMaxTTL: "The new maximum lifetime for an access token in seconds.",
    accessTokenNumUsesLimit: "The new maximum number of times that an access token can be used."
  },
  RETRIEVE: {
    identityId: "The ID of the machine identity to retrieve the auth method for."
  },
  REVOKE: {
    identityId: "The ID of the machine identity to revoke the auth method for."
  },
  REFRESH: {
    identityId: "The ID of the machine identity to force-refresh the cached SPIFFE trust bundle for."
  }
} as const;

export const ORGANIZATIONS = {
  LIST_USER_MEMBERSHIPS: {
    organizationId: "The ID of the organization to get memberships from."
  },
  LIST_USER_ACCESS: {
    organizationId: "The ID of the organization to list user access for.",
    user: "The user who can reach the organization.",
    membership:
      "The user's direct organization membership, or null when they only reach the organization through groups.",
    groups: "The groups holding an organization membership that the user belongs to.",
    groupRoles: "The group's active organization roles, permanent roles first. Expired temporary roles are left out.",
    groupRole: "The role slug, or 'custom' when it is a custom role.",
    groupRoleId: "The ID of the custom role, or null for a built-in role."
  },
  GET_USER_MEMBERSHIP: {
    organizationId: "The ID of the organization to get the membership for.",
    membershipId: "The ID of the membership to get."
  },
  UPDATE_USER_MEMBERSHIP: {
    organizationId: "The ID of the organization to update the membership for.",
    membershipId: "The ID of the membership to update.",
    role: "The new role of the membership.",
    isActive: "The active status of the membership",
    metadata: {
      key: "The key for user metadata tag.",
      value: "The value for user metadata tag."
    }
  },
  DELETE_USER_MEMBERSHIP: {
    organizationId: "The ID of the organization to delete the membership from.",
    membershipId: "The ID of the membership to delete."
  },
  BULK_DELETE_USER_MEMBERSHIPS: {
    organizationId: "The ID of the organization to delete the memberships from.",
    membershipIds: "The IDs of the memberships to delete."
  },
  LIST_IDENTITY_MEMBERSHIPS: {
    orgId: "The ID of the organization to get identity memberships from.",
    offset: "The offset to start from. If you enter 10, it will start from the 10th identity membership.",
    limit: "The number of identity memberships to return.",
    orderBy: "The column to order identity memberships by.",
    orderDirection: "The direction identity memberships will be sorted in.",
    search: "The text string that identity membership names will be filtered by."
  },
  GET_PROJECTS: {
    organizationId: "The ID of the organization to get projects from.",
    type: "The type of project to filter by."
  },
  LIST_GROUPS: {
    organizationId: "The ID of the organization to list groups for."
  },
  GET_PRODUCT_STATS: {
    secretScanningFindingsCount:
      "The number of findings across the organization's Secret Scanning projects, in any status. Cached for up to 5 minutes."
  }
} as const;

export const INSIGHTS = {
  GET_SECRETS_SUMMARY: {
    activeLeases:
      "The number of dynamic secret leases currently active across the organization's secret management projects. Revoked and expired leases are not counted.",
    users: "The number of users who have accepted an active membership in the organization.",
    identities: "The number of machine identities that belong to the organization."
  },
  GET_SECRETS_PROJECTS: {
    offset: "The number of projects to skip before returning results.",
    limit: "The maximum number of projects to return per page.",
    projectId: "The ID of the project.",
    projectName: "The name of the project.",
    projectSlug: "The slug of the project.",
    duplicatedSecrets:
      "The number of secrets in the project whose value is shared with at least one other secret in the same project. Secrets whose value is a reference to another secret are counted as duplicates. Null when the project does not have secret blind indexing enabled.",
    staleSecrets: "The number of secrets in the project that have not been updated in the last 90 days.",
    failedRotations: "The number of secret rotations in the project whose last rotation attempt failed.",
    failedSyncs: "The number of secret syncs in the project whose last sync attempt failed.",
    orphanedLeases:
      "The number of dynamic secret leases in the project that failed to be revoked and require manual cleanup.",
    totalSecrets: "The total number of shared secrets in the project.",
    warnings: "The counts of outstanding issues detected in the project.",
    severityScore:
      "A relative score used to rank projects by the severity of their outstanding issues. The scoring heuristic may change over time.",
    totalProjects: "The total number of secret management projects in the organization.",
    projectsWithIssues: "The number of secret management projects in the organization with at least one issue."
  },
  GET_UNUSED_ACCESS: {
    projectId: "The ID of the project to list unused access for.",
    offset: "The number of actors to skip before returning results.",
    limit: "The maximum number of actors to return per page.",
    search: "Only actors whose name contains this text, ignoring case.",
    actors:
      "The users and machine identities that can read secrets they have not read in the last 30 days, those with the most such secrets first. Project admins are left out: they can read everything by design. Empty until unusedAccessFrom.",
    actorType: "Whether the actor is a user or a machine identity.",
    actorId: "The ID of the user or machine identity.",
    name: "The username of the user, or the name of the machine identity.",
    accessibleSecretCount: "How many secrets the actor can read the value of today.",
    unusedSecretCount:
      "How many of those it has not read, or an import or reference of, in the last 30 days. A secret only counts once it and the actor's access are both older than that.",
    environments: "The slugs of the environments holding the unread secrets.",
    accessPaths: "How the actor has its access to the project's secrets.",
    roles: "The project roles the actor holds directly, not through a group.",
    roleId: "The ID of the custom role. Null for a built-in role.",
    roleSlug: "The slug of the built-in role, or 'custom' for a custom role.",
    roleName: "The name of the role.",
    groups: "The groups the actor belongs to that are members of the project.",
    groupId: "The ID of the group.",
    groupName: "The name of the group.",
    groupRoles: "The project roles the group gives its members.",
    additionalPrivileges:
      "The project-wide additional privileges the actor holds. Access granted on a folder is listed under folderAccess instead.",
    additionalPrivilegeId: "The ID of the additional privilege.",
    additionalPrivilegeName: "The name of the additional privilege.",
    folderAccess:
      "The folder access the actor has been granted directly on folders, active grants only. It applies whether the actor is a direct member or reaches the project through a group.",
    folderAccessId: "The ID of the folder access grant.",
    folderId: "The ID of the folder.",
    folderEnvironment: "The slug of the environment the folder is in.",
    folderSecretPath: "The path of the folder.",
    folderRole: "The access level granted on the folder: list, read, edit, manage or full-access.",
    totalCount: "The number of actors the caller can page through.",
    unusedAccessFrom:
      "When unused access starts being judged for the project: 30 days after reads started being tracked for it. Nothing is listed before then, since reads from before tracking began are unknown. Results are recomputed once a day."
  },
  GET_UNUSED_ACCESS_ACTOR: {
    projectId: "The ID of the project.",
    actorType: "Whether the actor is a user or a machine identity.",
    actorId: "The ID of the user or machine identity.",
    secrets:
      "The secrets the actor can read but has not read in the last 30 days, ordered by environment and path. The list can be shorter than the actor's unusedSecretCount: it holds at most 200, only those the caller can see, and none deleted since the results were computed.",
    secretKey: "The key of the secret.",
    environment: "The slug of the environment the secret is in.",
    secretPath: "The path of the folder the secret is in."
  },
  GET_SECRET_READ_ACTIVITY: {
    projectId: "The ID of the project where the secret is located.",
    secretName: "The name of the secret.",
    environment: "The slug of the environment where the secret is located.",
    secretPath: "The folder path where the secret is located.",
    readsTrackedSince:
      "Reads are reported from this date: the latest of 30 days ago, when reads started being tracked for the project, and when the secret and its folder were created.",
    unusedAccessFrom:
      "When unused access starts being judged for the project: 30 days after reads started being tracked for it. Before then no actor counts as unused access.",
    actors:
      "One entry for each user or machine identity that can read the secret's value today, directly or through a group, ordered by name. Project admins are included so their reads show.",
    actorType: "Whether the actor is a user or a machine identity.",
    actorId: "The ID of the user or machine identity.",
    name: "The username of the user, or the name of the machine identity.",
    isProjectAdmin:
      "Whether the actor is a project admin, directly or through a group. Admins can read everything by design, so they never count as unused access.",
    lastReadAt:
      "When the actor last read the secret, or an import or reference of it, since readsTrackedSince, as the first read of that day. Null when they have not.",
    accessSince:
      "When the actor got access to this secret: the oldest of their roles, groups, privileges and folder grants that gives it on its own, from when it was last created or changed. An edit to a custom role's rules counts for every secret the role gives, since which secrets an edit opened is not recorded.",
    readStatus:
      "read: the actor read the secret since readsTrackedSince. unused: no read, and the secret and their access are both older than 30 days, so it counts as unused access. not-judged: no read, but it does not count yet; notJudgedReason says why.",
    notJudgedReason:
      "Why an actor without a read is not counted as unused access. project-admin: admins are never counted. tracking-too-new: reads have been tracked for less than 30 days, until unusedAccessFrom. access-too-new: they got access to the secret in the last 30 days. secret-too-new: the secret is newer than 30 days. Null unless readStatus is not-judged."
  },
  GET_SECRETS_ACCESS_VOLUME: {
    days: "One entry for each of the last seven days, oldest first. Days with no secret access are included with a total of zero.",
    date: "The day the accesses happened on, in UTC, as YYYY-MM-DD.",
    total:
      "The number of times a secret value was accessed across every project in the organization on this day, by any user or machine identity."
  },
  GET_SECRETS_AUTH_METHOD_DISTRIBUTION: {
    methods:
      "One entry for each machine identity authentication method that was used to access a secret value in the last seven days, ordered from most to least used. Methods that were not used are not included.",
    authMethod: "The machine identity authentication method that was used to authenticate the accesses.",
    count:
      "The number of times a secret value was accessed across every project in the organization using this authentication method.",
    totalFetches:
      "The total number of times a secret value was accessed by a machine identity across every project in the organization in the last seven days. Accesses by users are not counted, and neither are accesses whose authentication method could not be determined, which happens for accesses recorded before the method was captured in audit logs."
  },
  GET_STATIC_SECRETS_USAGE: {
    weeks:
      "One entry for each of the last twelve weeks, oldest first. Weeks in which no secret was created are included with a count of zero.",
    weekStart:
      "The Monday the week starts on, in UTC, as YYYY-MM-DD. Weeks are UTC calendar weeks, not a rolling window anchored on today.",
    totalSecrets:
      "The number of static secrets created across every secret management project in the organization during this week. Each week is counted on its own, so this is not a running total. Personal secret overrides are not counted, and neither are secrets in projects or environments that have been deleted. Because deleted secrets leave no record, a week counts only the secrets created then that still exist today, so earlier weeks understate what was created at the time and drift lower as those secrets are deleted.",
    isPartial:
      "Whether the week is still in progress. True for the last entry only, which covers Monday through now rather than a full week, so its count is not comparable to the weeks before it."
  }
} as const;

export const ORG_IDENTITY_MEMBERSHIP = {
  CREATE_IDENTITY_MEMBERSHIP: {
    identityId: "The ID of the machine identity to create the membership for.",
    roles: {
      description: "A list of role slugs to assign to the identity organization membership.",
      role: "The role slug to assign to the newly created identity organization membership.",
      isTemporary:
        "Whether the assigned role is temporary. If isTemporary is set true, must provide temporaryMode, temporaryRange and temporaryAccessStartTime.",
      temporaryMode: "Type of temporary expiry.",
      temporaryRange: "Expiry time for temporary access. In relative mode it could be 1s, 2m, 3h, etc.",
      temporaryAccessStartTime: "Time to which the temporary access starts."
    }
  },
  UPDATE_IDENTITY_MEMBERSHIP: {
    identityId: "The ID of the machine identity to update the membership for.",
    roles: {
      description: "A list of role slugs to assign to the identity organization membership.",
      role: "The role slug to assign to the identity organization membership.",
      isTemporary:
        "Whether the assigned role is temporary. If isTemporary is set true, must provide temporaryMode, temporaryRange and temporaryAccessStartTime.",
      temporaryMode: "Type of temporary expiry.",
      temporaryRange: "Expiry time for temporary access. In relative mode it could be 1s, 2m, 3h, etc.",
      temporaryAccessStartTime: "Time to which the temporary access starts."
    }
  },
  DELETE_IDENTITY_MEMBERSHIP: {
    identityId: "The ID of the machine identity to delete the membership from."
  },
  LIST_IDENTITY_MEMBERSHIPS: {
    offset: "The offset to start from. If you enter 10, it will start from the 10th identity membership.",
    limit: "The number of identity memberships to return.",
    identityName: "",
    roles: "The role slugs to filter identity memberships by."
  },
  GET_IDENTITY_MEMBERSHIP_BY_ID: {
    identityId: "The ID of the machine identity to get the membership for."
  },
  LIST_AVAILABLE_IDENTITIES: {
    offset: "The offset to start from. If you enter 10, it will start from the 10th identity.",
    limit: "The number of identities to return.",
    identityName: "The text string that identity membership names will be filtered by."
  }
} as const;

export const SUB_ORGANIZATIONS = {
  CREATE: {
    name: "The display name of the sub-organization (e.g. 'Acme Corp'). Allows alphanumeric characters, spaces, dashes, and underscores.",
    slug: "Optional. The slug of the sub-organization (e.g. 'acme-corp'). If not provided, it is auto-generated from the name. Must be lowercase with hyphens only."
  },
  UPDATE: {
    name: "Optional. The display name of the sub-organization. When only the name is provided (no slug), both name and slug are updated.",
    slug: "Optional. The slug of the sub-organization. Can be updated independently when both name and slug are provided.",
    subOrgId: "The id of the sub organization to update."
  },
  LIST: {
    limit: "The number of sub organizations to return.",
    offset: "The offset to start from. If you enter 10, it will start from the 10th sub organization.",
    search: "Optional. Filter sub organizations by name (case-insensitive substring match).",
    orderBy: "The field to order sub organizations by. Currently only 'name' is supported.",
    orderDirection: "The direction to order sub organizations. Either 'asc' or 'desc'.",
    isAccessible: "Filter to only return sub organizations that the actor has access to."
  },
  DELETE: {
    subOrgId: "The id of the sub organization to delete."
  },
  JOIN: {
    subOrgId: "The id of the sub organization to create a membership in."
  }
} as const;

export const PROJECTS = {
  CREATE: {
    organizationSlug: "The slug of the organization to create the project in.",
    projectName: "The name of the project to create.",
    projectDescription: "An optional description label for the project.",
    slug: "An optional slug for the project.",
    template: "The name of the project template, if specified, to apply to this project."
  },
  DELETE: {
    projectId: "The ID of the project to delete.",
    hardDelete:
      "When true, the project is permanently deleted shortly after the request. When false or omitted, a secret manager project is soft-deleted (preserved and scheduled for permanent deletion after a grace period) and hidden from subsequent reads."
  },
  LIST_DELETED: {
    type: "The type of soft-deleted projects to list."
  },
  RESTORE: {
    projectId: "The ID of the soft-deleted project to restore."
  },
  PERMANENTLY_DELETE: {
    projectId: "The ID of the soft-deleted project to permanently delete."
  },
  GET: {
    projectId: "The ID of the project."
  },
  UPDATE: {
    projectId: "The ID of the project to update.",
    name: "The new name of the project.",
    projectDescription: "An optional description label for the project.",
    autoCapitalization: "Disable or enable auto-capitalization for the project.",
    slug: "An optional slug for the project. (must be unique within the organization)",
    hasDeleteProtection: "Enable or disable delete protection for the project.",
    secretSharing: "Enable or disable secret sharing for the project.",
    showSnapshotsLegacy: "Enable or disable legacy snapshots for the project.",
    defaultProduct: "The default product in which the project will open",
    secretDetectionIgnoreValues: "The list of secret values to ignore for secret detection.",
    enforceEncryptedSecretManagerSecretMetadata:
      "Enable or disable enforcement of encrypted secret metadata for the project.",
    auditLogsRetentionDays:
      "The number of days to retain audit logs for. Can only be set on self-hosted and dedicated instances, and cannot exceed the retention period included in your plan."
  },
  GET_KEY: {
    projectId: "The ID of the project to get the key from."
  },
  ADD_GROUP_TO_PROJECT: {
    projectId: "The ID of the project to add the group to.",
    groupIdOrName: "The ID or name of the group to add to the project.",
    role: "The role for the group to assume in the project."
  },
  UPDATE_GROUP_IN_PROJECT: {
    projectId: "The ID of the project to update the group in.",
    groupId: "The ID of the group to update in the project.",
    roles: "A list of roles to update the group to."
  },
  REMOVE_GROUP_FROM_PROJECT: {
    projectId: "The ID of the project to delete the group from.",
    groupId: "The ID of the group to delete from the project."
  },
  LIST_GROUPS_IN_PROJECT: {
    projectId: "The ID of the project to list groups for."
  },
  LIST_INTEGRATION: {
    projectId: "The ID of the project to list integrations for."
  },
  LIST_INTEGRATION_AUTHORIZATION: {
    projectId: "The ID of the project to list integration auths for."
  },
  LIST_CAS: {
    slug: "The slug of the project to list CAs for.",
    status: "The status of the CA to filter by.",
    friendlyName: "The friendly name of the CA to filter by.",
    commonName: "The common name of the CA to filter by.",
    offset: "The offset to start from. If you enter 10, it will start from the 10th CA.",
    limit: "The number of CAs to return."
  },
  LIST_CERTIFICATES: {
    slug: "The slug of the project to list certificates for.",
    friendlyName: "The friendly name of the certificate to filter by.",
    commonName: "The common name of the certificate to filter by.",
    offset: "The offset to start from. If you enter 10, it will start from the 10th certificate.",
    limit: "The number of certificates to return."
  },
  SEARCH_CERTIFICATES: {
    friendlyName: "The friendly name of the certificate to filter by.",
    commonName: "The common name of the certificate to filter by.",
    offset: "The offset to start from. If you enter 10, it will start from the 10th certificate.",
    limit: "The number of certificates to return.",
    forPkiSync: "Retrieve only certificates available for PKI sync.",
    search: "Search by SAN, CN, certificate ID, or serial number.",
    status:
      "Comma-separated list of certificate statuses to filter by. Supported values are active, renewed, expired, revoked and deleted. A certificate superseded by a renewal matches renewed rather than active until it expires or is revoked. Deleted certificates match only deleted.",
    includeDeleted:
      "Include deleted certificates in the results when no status filter is set. Deleted certificates are excluded by default.",
    profileIds: "Filter by certificate profile IDs.",
    fromDate: "Filter certificates created from this date.",
    toDate: "Filter certificates created until this date.",
    metadata:
      "Filter by metadata key-value pairs. Each entry should have a key (required) and optionally a value to match against.",
    extendedKeyUsage:
      "Filter by extended key usage. Only certificates containing this EKU will be returned (e.g. 'codeSigning', 'serverAuth').",
    keyAlgorithm: "Filter by key algorithm (e.g. 'RSA_2048', 'EC_prime256v1').",
    signatureAlgorithm: "Filter by signature algorithm (e.g. 'RSA-SHA256', 'ECDSA-SHA256').",
    keySizes: "Filter by key sizes in bits (e.g. [2048, 4096]).",
    caIds: "Filter by certificate authority IDs.",
    enrollmentTypes: "Filter by enrollment types (e.g. 'api', 'est', 'acme', 'scep').",
    source: "Filter by certificate source ('issued', 'discovered', 'imported').",
    notAfterFrom: "Filter certificates expiring on or after this date.",
    notAfterTo: "Filter certificates expiring on or before this date.",
    notBeforeFrom: "Filter certificates issued on or after this date.",
    notBeforeTo: "Filter certificates issued on or before this date.",
    sortBy: "Column to sort by (e.g. 'notAfter', 'notBefore', 'commonName').",
    sortOrder: "Sort direction: 'asc' or 'desc'."
  },
  LIST_PKI_SUBSCRIBERS: {
    projectId: "The ID of the project to list PKI subscribers for."
  }
} as const;

export const PROJECT_USERS = {
  INVITE_MEMBER: {
    projectId: "The ID of the project to invite the member to.",
    emails: "A list of organization member emails to invite to the project.",
    usernames: "A list of usernames to invite to the project.",
    roleSlugs:
      "A list of role slugs to assign to the newly created project membership. If nothing is provided, it will default to the Member role."
  },
  LIST_AVAILABLE_USERS: {
    projectId:
      "The ID of the project to list available users for. Includes users who reach the project's organization through a group."
  },
  REMOVE_MEMBER: {
    projectId: "The ID of the project to remove the member from.",
    emails: "A list of organization member emails to remove from the project.",
    usernames: "A list of usernames to remove from the project."
  },
  GET_USER_MEMBERSHIPS: {
    projectId: "The ID of the project to get memberships from."
  },
  GET_USER_MEMBERSHIP: {
    projectId: "The ID of the project to get memberships from.",
    membershipId: "The ID of the user's project membership.",
    username: "The username to get project membership of. Email is the default username."
  },
  GET_USER_MEMBERSHIP_BY_USER_ID: {
    projectId: "The ID of the project to get the membership from.",
    userId: "The ID of the user to get the project membership of."
  },
  UPDATE_USER_MEMBERSHIP: {
    projectId: "The ID of the project to update the membership for.",
    membershipId: "The ID of the membership to update.",
    roles: "A list of roles to update the membership to."
  }
};

export const PROJECT_IDENTITIES = {
  LIST_IDENTITY_MEMBERSHIPS: {
    projectId: "The ID of the project to get identity memberships from.",
    offset: "The offset to start from. If you enter 10, it will start from the 10th identity membership.",
    limit: "The number of identity memberships to return.",
    orderBy: "The column to order identity memberships by.",
    orderDirection: "The direction identity memberships will be sorted in.",
    search: "The text string that identity membership names will be filtered by."
  },
  GET_IDENTITY_MEMBERSHIP_BY_ID: {
    identityId: "The ID of the machine identity to get the membership for.",
    projectId: "The ID of the project to get the identity membership for."
  },
  UPDATE_IDENTITY_MEMBERSHIP: {
    projectId: "The ID of the project to update the identity membership for.",
    identityId: "The ID of the machine identity to update the membership for.",
    roles: {
      description: "A list of role slugs to assign to the identity project membership.",
      role: "The role slug to assign to the newly created identity project membership.",
      isTemporary:
        "Whether the assigned role is temporary. If isTemporary is set true, must provide temporaryMode, temporaryRange and temporaryAccessStartTime.",
      temporaryMode: "Type of temporary expiry.",
      temporaryRange: "Expiry time for temporary access. In relative mode it could be 1s, 2m ,3h, etc.",
      temporaryAccessStartTime: "Time to which the temporary access starts."
    }
  },
  DELETE_IDENTITY_MEMBERSHIP: {
    projectId: "The ID of the project to delete the identity membership from.",
    identityId: "The ID of the machine identity to delete the membership from."
  },
  CREATE_IDENTITY_MEMBERSHIP: {
    projectId: "The ID of the project to create the identity membership from.",
    identityId: "The ID of the machine identity to create the membership from.",
    role: "The role slug to assign to the newly created identity project membership.",
    roles: {
      description: "A list of role slugs to assign to the newly created identity project membership.",
      role: "The role slug to assign to the newly created identity project membership.",
      isTemporary:
        "Whether the assigned role is temporary. If isTemporary is set true, must provide temporaryMode, temporaryRange and temporaryAccessStartTime.",
      temporaryMode: "Type of temporary expiry.",
      temporaryRange: "Expiry time for temporary access. In relative mode it could be 1s, 2m, 3h, etc.",
      temporaryAccessStartTime: "Time to which the temporary access starts."
    }
  }
};

export const PROJECT_IDENTITY_MEMBERSHIP = {
  CREATE_IDENTITY_MEMBERSHIP: {
    projectId: "The ID of the project to create the identity membership for.",
    identityId: "The ID of the machine identity to create the membership for.",
    roles: {
      description: "A list of role slugs to assign to the identity project membership.",
      role: "The role slug to assign to the newly created identity project membership.",
      isTemporary:
        "Whether the assigned role is temporary. If isTemporary is set true, must provide temporaryMode, temporaryRange and temporaryAccessStartTime.",
      temporaryMode: "Type of temporary expiry.",
      temporaryRange: "Expiry time for temporary access. In relative mode it could be 1s, 2m, 3h, etc.",
      temporaryAccessStartTime: "Time to which the temporary access starts."
    }
  },
  UPDATE_IDENTITY_MEMBERSHIP: {
    projectId: "The ID of the project to update the identity membership for.",
    identityId: "The ID of the machine identity to update the membership for.",
    roles: {
      description: "A list of role slugs to assign to the identity project membership.",
      role: "The role slug to assign to the identity project membership.",
      isTemporary:
        "Whether the assigned role is temporary. If isTemporary is set true, must provide temporaryMode, temporaryRange and temporaryAccessStartTime.",
      temporaryMode: "Type of temporary expiry.",
      temporaryRange: "Expiry time for temporary access. In relative mode it could be 1s, 2m, 3h, etc.",
      temporaryAccessStartTime: "Time to which the temporary access starts."
    }
  },
  DELETE_IDENTITY_MEMBERSHIP: {
    projectId: "The ID of the project to delete the identity membership from.",
    identityId: "The ID of the machine identity to delete the membership from."
  },
  LIST_IDENTITY_MEMBERSHIPS: {
    projectId: "The ID of the project to list identity memberships from.",
    offset: "The offset to start from. If you enter 10, it will start from the 10th identity membership.",
    limit: "The number of identity memberships to return.",
    identityName: "The text string that identity membership names will be filtered by.",
    roles: "The role slugs to filter identity memberships by."
  },
  GET_IDENTITY_MEMBERSHIP_BY_ID: {
    projectId: "The ID of the project to get the identity membership for.",
    identityId: "The ID of the machine identity to get the membership for."
  },
  LIST_AVAILABLE_IDENTITIES: {
    projectId: "The ID of the project to list available identities for.",
    offset: "The offset to start from. If you enter 10, it will start from the 10th identity.",
    limit: "The number of identities to return.",
    identityName: "The text string that identity membership names will be filtered by."
  }
} as const;

export const ENVIRONMENTS = {
  CREATE: {
    projectId: "The ID of the project to create the environment in.",
    name: "The name of the environment to create.",
    slug: "The slug of the environment to create.",
    position: "The position of the environment. The lowest number will be displayed as the first environment."
  },
  UPDATE: {
    projectId: "The ID of the project to update the environment in.",
    id: "The ID of the environment to update.",
    name: "The new name of the environment.",
    slug: "The new slug of the environment.",
    position: "The new position of the environment. The lowest number will be displayed as the first environment."
  },
  DELETE: {
    projectId: "The ID of the project to delete the environment from.",
    id: "The ID of the environment to delete.",
    hardDelete:
      "When true, permanently removes the environment. When false or omitted, the environment is soft-deleted (preserved and scheduled for permanent deletion after a grace period) and hidden from subsequent reads."
  },
  RESTORE: {
    projectId: "The ID of the project the environment belongs to.",
    id: "The ID of the soft-deleted environment to restore."
  },
  GET: {
    projectId: "The ID of the project the environment belongs to.",
    id: "The ID of the environment to fetch."
  },
  GET_BY_SLUG: {
    projectId: "The ID of the project the environment belongs to.",
    slug: "The slug of the environment to fetch."
  }
} as const;

export const FOLDERS = {
  LIST: {
    projectId: "The ID of the project to list folders from.",
    environment: "The slug of the environment to list folders from.",
    path: "The path to list folders from.",
    directory: "The directory to list folders from. (Deprecated in favor of path)",
    recursive: "Whether or not to fetch all folders from the specified base path, and all of its subdirectories.",
    lastSecretModified:
      "The timestamp used to filter folders with secrets modified after the specified date. The format for this timestamp is ISO 8601 (e.g. 2025-04-01T09:41:45-04:00)"
  },
  GET_BY_ID: {
    folderId: "The ID of the folder to get details."
  },
  CREATE: {
    projectId: "The ID of the project to create the folder in.",
    environment: "The slug of the environment to create the folder in.",
    name: "The name of the folder to create.",
    path: "The path of the folder to create.",
    directory: "The directory of the folder to create. (Deprecated in favor of path)",
    description: "An optional description label for the folder."
  },
  UPDATE: {
    folderId: "The ID of the folder to update.",
    environment: "The slug of the environment where the folder is located.",
    name: "The new name of the folder.",
    path: "The path of the folder to update.",
    directory: "The new directory of the folder to update. (Deprecated in favor of path)",
    projectSlug: "The slug of the project where the folder is located.",
    projectId: "The ID of the project where the folder is located.",
    description: "An optional description label for the folder."
  },
  DELETE: {
    folderIdOrName: "The ID or name of the folder to delete.",
    projectId: "The ID of the project to delete the folder from.",
    environment: "The slug of the environment where the folder is located.",
    directory: "The directory of the folder to delete. (Deprecated in favor of path)",
    path: "The path of the folder to delete.",
    forceDelete: "Whether to force delete the folder even if it contains resources."
  }
} as const;

export const SECRETS = {
  ATTACH_TAGS: {
    secretName: "The name of the secret to attach tags to.",
    secretPath: "The path of the secret to attach tags to.",
    type: "The type of the secret to attach tags to. (shared/personal)",
    environment: "The slug of the environment where the secret is located",
    viewSecretValue: "Whether or not to retrieve the secret value.",
    projectSlug: "The slug of the project where the secret is located.",
    tagSlugs: "An array of existing tag slugs to attach to the secret."
  },
  DETACH_TAGS: {
    secretName: "The name of the secret to detach tags from.",
    secretPath: "The path of the secret to detach tags from.",
    type: "The type of the secret to attach tags to. (shared/personal)",
    environment: "The slug of the environment where the secret is located.",
    projectSlug: "The slug of the project where the secret is located.",
    tagSlugs: "An array of existing tag slugs to detach from the secret."
  }
} as const;

export const RAW_SECRETS = {
  LIST: {
    expand: "Whether or not to expand secret references.",
    recursive:
      "Whether or not to fetch all secrets from the specified base path, and all of its subdirectories. Note, the max depth is 20 deep.",
    projectId: "The ID of the project to list secrets from.",
    workspaceSlug:
      "The slug of the project to list secrets from. This parameter is only applicable by machine identities.",
    environment: "The slug of the environment to list secrets from.",
    secretPath: "The secret path to list secrets from.",
    viewSecretValue: "Whether or not to retrieve the secret value.",
    includeImports: "Weather to include imported secrets or not.",
    tagSlugs: "The comma separated tag slugs to filter secrets.",
    metadataFilter:
      "Unencrypted secret metadata key-value pairs used to filter secrets. Only metadata with unencrypted values is supported. When querying for multiple metadata pairs, the query is treated as an AND operation. Secret metadata format is key=value1,value=value2|key=value3,value=value4.",
    includePersonalOverrides:
      "Whether or not to include personal secrets in the response. When enabled, personal secrets will be included in the response. Shared secrets will still be included, but personal secrets will take priority, and the corresponding shared secrets will be replaced with the personal secrets."
  },
  CREATE: {
    secretName: "The name of the secret to create.",
    projectSlug: "The slug of the project to create the secret in.",
    environment: "The slug of the environment to create the secret in.",
    secretComment: "Attach a comment to the secret.",
    secretPath: "The path to create the secret in.",
    secretValue: "The value of the secret to create.",
    skipMultilineEncoding: "Skip multiline encoding for the secret value.",
    type: "The type of the secret to create.",
    projectId: "The ID of the project to create the secret in.",
    tagIds: "The ID of the tags to be attached to the created secret.",
    secretReminderRepeatDays: "Interval for secret rotation notifications, measured in days.",
    secretReminderNote: "Note to be attached in notification email."
  },
  GET: {
    expand: "Whether or not to expand secret references.",
    secretName: "The name of the secret to get.",
    projectId: "The ID of the project to get the secret from.",
    workspaceSlug: "The slug of the project to get the secret from.",
    environment: "The slug of the environment to get the secret from.",
    secretPath: "The path of the secret to get.",
    version: "The version of the secret to get.",
    type: "The type of the secret to get.",
    viewSecretValue: "Whether or not to retrieve the secret value.",
    includeImports: "Weather to include imported secrets or not."
  },
  UPDATE: {
    secretName: "The name of the secret to update.",
    secretComment: "Update comment to the secret.",
    environment: "The slug of the environment where the secret is located.",
    mode: "Defines how the system should handle missing secrets during an update.",
    secretPath: "The default path for secrets to update or upsert, if not provided in the secret details.",
    secretValue: "The new value of the secret.",
    skipMultilineEncoding: "Skip multiline encoding for the secret value.",
    type: "The type of the secret to update.",
    projectSlug: "The slug of the project to update the secret in.",
    projectId: "The ID of the project to update the secret in.",
    tagIds: "The ID of the tags to be attached to the updated secret.",
    secretReminderRepeatDays: "Interval for secret rotation notifications, measured in days.",
    secretReminderNote: "Note to be attached in notification email.",
    secretReminderRecipients:
      "An array of user IDs that will receive the reminder email. If not specified, all project members will receive the reminder email.",
    newSecretName: "The new name for the secret."
  },
  DELETE: {
    secretName: "The name of the secret to delete.",
    environment: "The slug of the environment where the secret is located.",
    secretPath: "The path of the secret.",
    type: "The type of the secret to delete.",
    projectSlug: "The slug of the project to delete the secret in.",
    projectId: "The ID of the project where the secret is located."
  },
  GET_REFERENCE_TREE: {
    secretName: "The name of the secret to get the reference tree for.",
    projectId: "The ID of the project where the secret is located.",
    environment: "The slug of the environment where the the secret is located.",
    secretPath: "The folder path where the secret is located."
  },
  GET_ACCESS_LIST: {
    secretName: "The name of the secret to get the access list for.",
    projectId: "The ID of the project where the secret is located.",
    environment: "The slug of the environment where the the secret is located.",
    secretPath: "The folder path where the secret is located.",
    includeAllEntities:
      "When true, includes all project users, identities, and groups in the response, even those without any access to the secret."
  },
  DUPLICATE_SECRET: {
    projectId: "The ID of the project containing the secret.",
    sourceEnvironment: "The slug of the source environment.",
    sourceSecretPath: "The folder path of the source secret.",
    destinationEnvironment: "The slug of the destination environment.",
    destinationSecretPath: "The folder path where the secret will be duplicated to.",
    secretIds:
      "Array of source secret IDs to duplicate. All secrets must belong to the source environment and path. Rotation and honey-token secrets cannot be duplicated. Maximum 50 secrets per request.",
    shouldOverwrite:
      "When true, overwrite an existing secret with the same key at the destination. When false (default), the request fails if the destination already has a secret with that key.",
    attributesToCopy:
      "Object specifying which attributes of the source secret to copy to the destination. Each key is optional and defaults to false. Available keys: value, comment, tags, metadata, skipMultilineEncoding."
  }
} as const;

export const SECRET_IMPORTS = {
  LIST: {
    projectId: "The ID of the project to list secret imports from.",
    environment: "The slug of the environment to list secret imports from.",
    path: "The path to list secret imports from."
  },
  GET: {
    secretImportId: "The ID of the secret import to fetch."
  },
  CREATE: {
    environment: "The slug of the environment to import into.",
    path: "The path to import into.",
    projectId: "The ID of the project you are working in.",
    isReplication:
      "When true, secrets from the source will be automatically sent to the destination. If approval policies exist at the destination, the secrets will be sent as approval requests instead of being applied immediately.",
    import: {
      projectId: "The ID of the project to import from.",
      environment: "The slug of the environment to import from.",
      path: "The path to import from."
    }
  },
  UPDATE: {
    secretImportId: "The ID of the secret import to update.",
    environment: "The slug of the environment where the secret import is located.",
    import: {
      environment: "The new environment slug to import from.",
      path: "The new path to import from.",
      position: "The new position of the secret import. The lowest number will be displayed as the first import."
    },
    path: "The path of the secret import to update.",
    projectId: "The ID of the project where the secret import is located."
  },
  DELETE: {
    projectId: "The ID of the project to delete the secret import from.",
    secretImportId: "The ID of the secret import to delete.",
    environment: "The slug of the environment where the secret import is located.",
    path: "The path of the secret import to delete."
  }
} as const;

export const DASHBOARD = {
  SECRET_METADATA_SEARCH: {
    searchLimit: "The candidate limit applied independently to plaintext matches and encrypted metadata candidates.",
    tags: "The tags attached to the secret, including each tag's ID and slug."
  },
  SECRET_METADATA_LIST: {
    projectId: "The ID of the project containing the secrets.",
    environment: "The slug of the environment containing the secrets.",
    secretPath: "The root folder to list shared secret metadata from, including all descendant folders.",
    cursor:
      "The opaque nextCursor returned by the previous page, valid for five minutes for the same caller and query. Omit it to restart.",
    limit: "The maximum number of accessible shared secrets to return.",
    secrets: "Shared secrets the caller can describe. Values, comments, tags and custom metadata are not returned.",
    nextCursor:
      "An opaque continuation cursor, or null when scanning is complete. Continue even when the page is empty or shorter than the limit.",
    id: "The secret ID.",
    secretKey: "The secret key.",
    path: "The absolute folder path containing the secret.",
    type: "The secret type. Only shared secrets are returned.",
    isHoneyTokenSecret: "Whether the secret belongs to a honey token.",
    isRotatedSecret: "Whether the secret is managed by a rotation.",
    secretValueHidden: "Whether the caller lacks permission to read this secret's value. No values are returned."
  },
  SECRET_OVERVIEW_LIST: {
    projectId: "The ID of the project to list secrets/folders from.",
    environments:
      "The slugs of the environments to list secrets/folders from (comma separated, ie 'environments=dev,staging,prod').",
    secretPath: "The secret path to list secrets/folders from.",
    offset: "The offset to start from. If you enter 10, it will start from the 10th secret/folder.",
    limit: "The number of secrets/folders to return.",
    orderBy: "The column to order secrets/folders by.",
    orderDirection: "The direction to order secrets/folders in.",
    sortEnvironment:
      "The environment slug whose secret timestamps determine recency ordering. Required for multi-environment recency sorting.",
    search: "The text string to filter secret keys and folder names by.",
    tags: "The tags to filter secrets by (comma separated, ie 'tags=billing,engineering').",
    includeSecrets: "Whether to include project secrets in the response.",
    includeFolders: "Whether to include project folders in the response.",
    includeDynamicSecrets: "Whether to include dynamic project secrets in the response.",
    includeHoneyTokens: "Whether to include honey tokens in the response.",
    includeProxiedServices: "Whether to include proxied services in the response.",
    includeImports: "Whether to include project secret imports in the response.",
    includeSecretRotations: "Whether to include project secret rotations in the response."
  },
  SECRET_DETAILS_LIST: {
    projectId: "The ID of the project to list secrets/folders from.",
    environment: "The slug of the environment to list secrets/folders from.",
    secretPath: "The secret path to list secrets/folders from.",
    offset: "The offset to start from. If you enter 10, it will start from the 10th secret/folder.",
    limit: "The number of secrets/folders to return.",
    orderBy: "The column to order secrets/folders by.",
    orderDirection: "The direction to order secrets/folders in.",
    search: "The text string to filter secret keys and folder names by.",
    tags: "The tags to filter secrets by (comma separated, ie 'tags=billing,engineering').",
    includeSecrets: "Whether to include project secrets in the response.",
    includeFolders: "Whether to include project folders in the response.",
    includeImports: "Whether to include project secret imports in the response.",
    includeDynamicSecrets: "Whether to include dynamic project secrets in the response.",
    includeSecretRotations: "Whether to include secret rotations in the response.",
    includeHoneyTokens: "Whether to include honey tokens in the response.",
    includeProxiedServices: "Whether to include proxied services in the response."
  },
  SECRET_DEEP_SEARCH: {
    offset: "The offset to start from, applied to each resource type separately.",
    limit: "The number of results to return per resource type."
  }
} as const;

export const AUDIT_LOGS = {
  EXPORT: {
    projectId:
      "Optionally filter logs by project ID. If not provided, logs from the entire organization will be returned.",
    environment:
      "The environment to filter logs by. If not provided, logs from all environments will be returned. Note that the projectId parameter must also be provided.",
    eventType: "The type of the event to export.",
    eventClass:
      "Filter by event class, comma-separated for multiple values (management, authentication, authorization, data-access). Combined with eventType, only event types in both are returned. If the selected classes include secret events, the environment, secretPath, and secretKey filters drop every event whose metadata doesn't match, including events that aren't about secrets. If they don't, those filters are ignored.",
    secretPath:
      "The path of the secret to query audit logs for. Note that the projectId parameter must also be provided.",
    secretKey:
      "The key of the secret to query audit logs for. Note that the projectId parameter must also be provided.",
    userAgentType: "Choose which consuming application to export audit logs for.",
    eventMetadata:
      "Filter by event metadata key-value pairs. Formatted as `key1=value1,key2=value2`, with comma-separation.",
    startDate: "The date to start the export from.",
    endDate: "The date to end the export at.",
    offset: "The offset to start from. If you enter 10, it will start from the 10th audit log.",
    limit: "The number of audit logs to return.",
    actor:
      "The ID of a specific actor to filter audit logs by. For user actors this is the userId; for identity actors this is the identityId. When filtering non-user actor types, the actorType parameter must also be provided.",
    actorType:
      "The type of actor to filter audit logs by. Must be provided when the actor parameter targets a non-user actor type (e.g. identity, kmipClient)."
  }
} as const;

export const DYNAMIC_SECRETS = {
  LIST: {
    projectSlug: "The slug of the project to create dynamic secret in.",
    environmentSlug: "The slug of the environment to list folders from.",
    path: "The path to list folders from."
  },
  LIST_LEASES_BY_NAME: {
    projectSlug: "The slug of the project to create dynamic secret in.",
    environmentSlug: "The slug of the environment to list folders from.",
    path: "The path to list folders from.",
    name: "The name of the dynamic secret."
  },
  GET_BY_NAME: {
    projectSlug: "The slug of the project to create dynamic secret in.",
    environmentSlug: "The slug of the environment to list folders from.",
    path: "The path to list folders from.",
    name: "The name of the dynamic secret."
  },
  CREATE: {
    projectSlug: "The slug of the project to create dynamic secret in.",
    environmentSlug: "The slug of the environment to create the dynamic secret in.",
    path: "The path to create the dynamic secret in.",
    name: "The name of the dynamic secret.",
    provider: "The type of dynamic secret.",
    defaultTTL: "The default TTL that will be applied for all the leases.",
    maxTTL: "The maximum limit a TTL can be leases or renewed."
  },
  UPDATE: {
    projectSlug: "The slug of the project to update dynamic secret in.",
    environmentSlug: "The slug of the environment to update the dynamic secret in.",
    path: "The path to update the dynamic secret in.",
    name: "The name of the dynamic secret.",
    inputs: "The new partial values for the configured provider of the dynamic secret",
    defaultTTL: "The default TTL that will be applied for all the leases.",
    maxTTL: "The maximum limit a TTL can be leases or renewed.",
    newName: "The new name for the dynamic secret."
  },
  DELETE: {
    projectSlug: "The slug of the project to delete dynamic secret in.",
    environmentSlug: "The slug of the environment to delete the dynamic secret in.",
    path: "The path to delete the dynamic secret in.",
    name: "The name of the dynamic secret.",
    isForced:
      "A boolean flag to delete the the dynamic secret from Infisical without trying to remove it from external provider. Used when the dynamic secret got modified externally."
  }
} as const;

export const DYNAMIC_SECRET_LEASES = {
  GET_BY_LEASEID: {
    projectSlug: "The slug of the project to create dynamic secret in.",
    environmentSlug: "The slug of the environment to list folders from.",
    path: "The path to list folders from.",
    leaseId: "The ID of the dynamic secret lease."
  },
  CREATE: {
    projectSlug: "The slug of the project of the dynamic secret in.",
    environmentSlug: "The slug of the environment of the dynamic secret in.",
    path: "The path of the dynamic secret in.",
    dynamicSecretName: "The name of the dynamic secret.",
    ttl: "The lease lifetime TTL. If not provided the default TTL of dynamic secret will be used."
  },
  RENEW: {
    projectSlug: "The slug of the project of the dynamic secret in.",
    environmentSlug: "The slug of the environment of the dynamic secret in.",
    path: "The path of the dynamic secret in.",
    leaseId: "The ID of the dynamic secret lease.",
    ttl: "The renew TTL that gets added with current expiry (ensure it's below max TTL) for a total less than creation time + max TTL."
  },
  DELETE: {
    projectSlug: "The slug of the project of the dynamic secret in.",
    environmentSlug: "The slug of the environment of the dynamic secret in.",
    path: "The path of the dynamic secret in.",
    leaseId: "The ID of the dynamic secret lease.",
    isForced:
      "A boolean flag to delete the the dynamic secret from Infisical without trying to remove it from external provider. Used when the dynamic secret got modified externally."
  },
  KUBERNETES: {
    CREATE: {
      config: {
        namespace:
          "The Kubernetes namespace to create the lease in. If not specified, the first namespace defined in the configuration will be used."
      }
    }
  }
} as const;

export const PROXIED_SERVICES = {
  CREATE: {
    projectId: "The ID of the project to create the proxied service in.",
    environment: "The slug of the environment to create the proxied service in.",
    secretPath: "The secret path (folder) to create the proxied service in.",
    name: "The name of the proxied service.",
    hostPattern:
      "One or more comma-separated host patterns the service applies to, e.g. 'api.stripe.com, *.stripe.com'. Each pattern is host[:port][/path]; a '*.' wildcard matches exactly one label.",
    isEnabled: "Whether the proxied service is enabled. The agent proxy skips disabled services.",
    credentials: "The credentials the agent proxy applies to requests matching the host pattern."
  },
  LIST: {
    projectId: "The ID of the project to list proxied services from.",
    environment: "The slug of the environment to list proxied services from.",
    secretPath: "The secret path (folder) to list proxied services from."
  },
  GET: {
    serviceId: "The ID of the proxied service.",
    name: "The name of the proxied service.",
    projectId: "The ID of the project the proxied service is in.",
    environment: "The slug of the environment the proxied service is in.",
    secretPath: "The secret path (folder) the proxied service is in."
  },
  UPDATE: {
    serviceId: "The ID of the proxied service to update.",
    name: "The new name of the proxied service.",
    hostPattern: "The new comma-separated host patterns.",
    isEnabled: "Whether the proxied service is enabled. The agent proxy skips disabled services.",
    credentials:
      "The new credentials. When provided, the entire credentials collection is replaced; when omitted, existing credentials are left unchanged."
  },
  DELETE: {
    serviceId: "The ID of the proxied service to delete."
  },
  CREDENTIAL: {
    secretKey:
      "The key name of the referenced static secret. The secret must live in the same folder as the service. Provide exactly one of secretKey or dynamicSecretName.",
    dynamicSecretName:
      "The name of the referenced dynamic secret. The dynamic secret must live in the same folder as the service; the agent proxy mints a lease and injects a field from its output. Provide exactly one of secretKey or dynamicSecretName. Referenced by name (like secretKey), so a deleted-then-recreated dynamic secret with the same name re-links automatically.",
    dynamicSecretField:
      "For a dynamic secret credential: which lease output field to inject (e.g. 'DB_PASSWORD', 'TOKEN'). Must be a valid output field for the dynamic secret's provider type.",
    role: "How the credential is applied: 'header-rewrite' sets an HTTP header on the outbound request; 'credential-substitution' replaces a placeholder value in the request.",
    headerName: "For header rewriting: the header to set, e.g. 'Authorization' or 'x-api-key'.",
    headerPrefix: "For header rewriting: an optional prefix joined to the secret value with a space, e.g. 'Bearer'.",
    headerPurpose:
      "For HTTP basic auth: 'username' or 'password'. The agent proxy combines the pair into a single 'Authorization: Basic' header. Cannot be combined with headerName or headerPrefix.",
    placeholderKey: "For credential substitution: the environment variable name the agent receives.",
    placeholderValue:
      "For credential substitution: the placeholder value the agent proxy swaps for the real secret value on the wire.",
    substitutionSurfaces:
      "For credential substitution: which request surfaces are scanned for the placeholder. Allowed values: 'header', 'path', 'query', 'body'."
  }
} as const;

export const SECRET_TAGS = {
  LIST: {
    projectId: "The ID of the project to list tags from."
  },
  GET_TAG_BY_ID: {
    projectId: "The ID of the project to get tags from.",
    tagId: "The ID of the tag to get details."
  },
  GET_TAG_BY_SLUG: {
    projectId: "The ID of the project to get tags from.",
    tagSlug: "The slug of the tag to get details."
  },
  CREATE: {
    projectId: "The ID of the project to create the tag in.",
    name: "The name of the tag to create.",
    slug: "The slug of the tag to create.",
    color: "The color of the tag to create."
  },
  UPDATE: {
    projectId: "The ID of the project to update the tag in.",
    tagId: "The ID of the tag to get details.",
    name: "The name of the tag to update.",
    slug: "The slug of the tag to update.",
    color: "The color of the tag to update."
  },
  DELETE: {
    tagId: "The ID of the tag to delete.",
    projectId: "The ID of the project to delete the tag from."
  }
} as const;

export const IDENTITY_ADDITIONAL_PRIVILEGE = {
  CREATE: {
    projectSlug: "The slug of the project of the identity in.",
    identityId: "The ID of the machine identity to create.",
    slug: "The slug of the privilege to create.",
    permissions: `@deprecated - use privilegePermission
The permission object for the privilege.
- Read secrets
\`\`\`
{ "permissions": [{"action": "read", "subject": "secrets"]}
\`\`\`
- Read and Write secrets
\`\`\`
{ "permissions": [{"action": "read", "subject": "secrets"], {"action": "write", "subject": "secrets"]}
\`\`\`
- Read secrets scoped to an environment and secret path
\`\`\`
- { "permissions": [{"action": "read", "subject": "secrets", "conditions": { "environment": "dev", "secretPath": { "$glob": "/" } }}] }
\`\`\`
`,
    privilegePermission: "The permission object for the privilege.",
    isPackPermission: "Whether the server should pack(compact) the permission object.",
    isTemporary: "Whether the privilege is temporary.",
    temporaryMode: "Type of temporary access given. Types: relative.",
    temporaryRange: "TTL for the temporary time. Eg: 1m, 1h, 1d.",
    temporaryAccessStartTime: "ISO time for which temporary access should begin."
  },
  UPDATE: {
    projectSlug: "The slug of the project of the identity in.",
    identityId: "The ID of the machine identity to update.",
    slug: "The slug of the privilege to update.",
    newSlug: "The new slug of the privilege to update.",
    permissions: `@deprecated - use privilegePermission
The permission object for the privilege.
- Read secrets
\`\`\`
{ "permissions": [{"action": "read", "subject": "secrets"]}
\`\`\`
- Read and Write secrets
\`\`\`
{ "permissions": [{"action": "read", "subject": "secrets"], {"action": "write", "subject": "secrets"]}
\`\`\`
- Read secrets scoped to an environment and secret path
\`\`\`
- { "permissions": [{"action": "read", "subject": "secrets", "conditions": { "environment": "dev", "secretPath": { "$glob": "/" } }}] }
\`\`\`
`,
    privilegePermission: "The permission object for the privilege.",
    isTemporary: "Whether the privilege is temporary.",
    temporaryMode: "Type of temporary access given. Types: relative.",
    temporaryRange: "TTL for the temporary time. Eg: 1m, 1h, 1d.",
    temporaryAccessStartTime: "ISO time for which temporary access should begin."
  },
  DELETE: {
    projectSlug: "The slug of the project of the identity in.",
    identityId: "The ID of the machine identity to delete.",
    slug: "The slug of the privilege to delete."
  },
  GET_BY_SLUG: {
    projectSlug: "The slug of the project of the identity in.",
    identityId: "The ID of the machine identity to list.",
    slug: "The slug of the privilege."
  },
  LIST: {
    projectSlug: "The slug of the project of the identity in.",
    identityId: "The ID of the machine identity to list.",
    unpacked: "Whether the system should send the permissions as unpacked."
  }
};

export const FOLDER_ACCESS = {
  CREATE: {
    projectId: "The ID of the project the folder is in.",
    environmentSlug: "The slug of the environment the folder is in.",
    secretPath: "The path of the folder to grant access on.",
    userId: "The ID of the user to grant folder access to.",
    identityId: "The ID of the machine identity to grant folder access to.",
    permission:
      "The folder role to grant. One of: list, read, edit, manage, full-access. The full-access role cannot be temporary.",
    isTemporary:
      "Whether the folder access is temporary. Omit the type object for permanent access. The full-access role must be permanent.",
    temporaryMode: "Type of temporary access given. Types: relative.",
    temporaryRange: "How long the access lasts from its start time. Eg: 30m, 4h, 1d.",
    temporaryAccessStartTime: "ISO time the temporary access starts."
  },
  UPDATE: {
    projectId: "The ID of the project the folder is in.",
    environmentSlug: "The slug of the environment the folder is in.",
    secretPath: "The path of the folder the access is on.",
    userId: "The ID of the user whose folder access to update.",
    identityId: "The ID of the machine identity whose folder access to update.",
    permission:
      "The folder role to change the access to. One of: list, read, edit, manage, full-access. The full-access role cannot be temporary.",
    isTemporary:
      "Whether the folder access is temporary. Pass isTemporary false to make it permanent; omit the type object to leave the current temporal state unchanged. The full-access role must be permanent, so making an access temporary also requires lowering its role.",
    temporaryMode: "Type of temporary access given. Types: relative.",
    temporaryRange: "How long the access lasts from its start time. Eg: 30m, 4h, 1d.",
    temporaryAccessStartTime: "ISO time the temporary access starts."
  },
  DELETE: {
    projectId: "The ID of the project the folder is in.",
    environmentSlug: "The slug of the environment the folder is in.",
    secretPath: "The path of the folder the access is on.",
    userId: "The ID of the user whose folder access to revoke.",
    identityId: "The ID of the machine identity whose folder access to revoke."
  },
  LIST_USERS: {
    projectId: "The ID of the project the folder is in.",
    environmentSlug: "The slug of the environment the folder is in.",
    secretPath: "The path of the folder to list access for.",
    offset:
      "The offset to start from in the project's users. The page is then split into the users with access and the users without access.",
    limit: "The number of users to return, counting both lists together.",
    search: "The text string that user names and email addresses will be filtered by.",
    users:
      "The users whose project roles or folder access give them access on the folder. membership.roles lists only the roles that grant that access, so it is empty when the access comes from the folder access alone.",
    usersWithoutAccess:
      "The users of the project with no access on the folder. membership.roles lists all of their active project roles and folderRBACAccess is always null.",
    totalCount: "The number of users of the project that match the search, with and without access together."
  },
  LIST_IDENTITIES: {
    projectId: "The ID of the project the folder is in.",
    environmentSlug: "The slug of the environment the folder is in.",
    secretPath: "The path of the folder to list access for.",
    offset:
      "The offset to start from in the project's machine identities. The page is then split into the ones with access and the ones without access.",
    limit: "The number of machine identities to return, counting both lists together.",
    search: "The text string that machine identity names will be filtered by.",
    identities:
      "The machine identities whose project roles or folder access give them access on the folder. membership.roles lists only the roles that grant that access, so it is empty when the access comes from the folder access alone.",
    identitiesWithoutAccess:
      "The machine identities of the project with no access on the folder. membership.roles lists all of their active project roles and folderRBACAccess is always null.",
    totalCount:
      "The number of machine identities of the project that match the search, with and without access together."
  },
  LIST_USER_GRANTS: {
    projectId: "The ID of the project to list the user's folder access grants in.",
    userId: "The ID of the user whose folder access grants to list."
  },
  LIST_IDENTITY_GRANTS: {
    projectId: "The ID of the project to list the machine identity's folder access grants in.",
    identityId: "The ID of the machine identity whose folder access grants to list."
  },
  PERMISSION_AUDIT: {
    includeFolderPermissions: "Whether to include folder-scoped access grants in the returned permission sources."
  }
};

export const PROJECT_USER_ADDITIONAL_PRIVILEGE = {
  CREATE: {
    projectMembershipId: "Project membership ID of user.",
    slug: "The slug of the privilege to create.",
    permissions:
      "The permission object for the privilege. Refer https://casl.js.org/v6/en/guide/define-rules#the-shape-of-raw-rule to understand the shape.",
    isPackPermission: "Whether the server should pack (compact) the permission object.",
    isTemporary: "Whether the privilege is temporary.",
    temporaryMode: "Type of temporary access given. Types: relative.",
    temporaryRange: "TTL for the temporary time. Eg: 1m, 1h, 1d.",
    temporaryAccessStartTime: "ISO time for which temporary access should begin."
  },
  UPDATE: {
    privilegeId: "The ID of privilege object.",
    slug: "The slug of the privilege to create.",
    newSlug: "The new slug of the privilege to create.",
    permissions:
      "The permission object for the privilege. Refer https://casl.js.org/v6/en/guide/define-rules#the-shape-of-raw-rule to understand the shape.",
    isPackPermission: "Whether the server should pack (compact) the permission object.",
    isTemporary: "Whether the privilege is temporary.",
    temporaryMode: "Type of temporary access given. Types: relative.",
    temporaryRange: "TTL for the temporary time. Eg: 1m, 1h, 1d.",
    temporaryAccessStartTime: "ISO time for which temporary access should begin."
  },
  DELETE: {
    privilegeId: "The ID of privilege object."
  },
  GET_BY_PRIVILEGE_ID: {
    privilegeId: "The ID of privilege object."
  },
  LIST: {
    projectMembershipId: "Project membership ID of user."
  }
};

export const IDENTITY_ADDITIONAL_PRIVILEGE_V2 = {
  CREATE: {
    identityId: "The ID of the machine identity to create the privilege for.",
    projectId: "The ID of the project of the identity in.",
    slug: "The slug of the privilege to create.",
    permission: "The permission for the privilege.",
    isTemporary: "Whether the privilege is temporary or permanent.",
    temporaryMode: "Type of temporary access given. Types: relative.",
    temporaryRange: "The TTL for the temporary access given. Eg: 1m, 1h, 1d.",
    temporaryAccessStartTime: "The start time in ISO format when the temporary access should begin."
  },
  UPDATE: {
    id: "The ID of the identity privilege.",
    identityId: "The ID of the machine identity to update.",
    slug: "The slug of the privilege to update.",
    privilegePermission: "The permission for the privilege.",
    isTemporary: "Whether the privilege is temporary.",
    temporaryMode: "Type of temporary access given. Types: relative.",
    temporaryRange: "The TTL for the temporary access given. Eg: 1m, 1h, 1d.",
    temporaryAccessStartTime: "The start time in ISO format when the temporary access should begin."
  },
  DELETE: {
    id: "The ID of the identity privilege.",
    identityId: "The ID of the machine identity to delete.",
    slug: "The slug of the privilege to delete."
  },
  GET_BY_SLUG: {
    projectSlug: "The slug of the project of the identity in.",
    identityId: "The ID of the machine identity to list.",
    slug: "The slug of the privilege."
  },
  GET_BY_ID: {
    id: "The ID of the identity privilege."
  },
  LIST: {
    projectId: "The ID of the project that the identity is in.",
    identityId: "The ID of the machine identity to list."
  }
};

export const INTEGRATION_AUTH = {
  GET: {
    integrationAuthId: "The ID of integration authentication object."
  },
  DELETE: {
    integration: "The slug of the integration to be unauthorized.",
    projectId: "The ID of the project to delete the integration auth from."
  },
  DELETE_BY_ID: {
    integrationAuthId: "The ID of integration authentication object to delete."
  },
  UPDATE_BY_ID: {
    integrationAuthId: "The ID of integration authentication object to update."
  },
  CREATE_ACCESS_TOKEN: {
    workspaceId: "The ID of the project to create the integration auth for.",
    integration: "The slug of integration for the auth object.",
    accessId: "The unique authorized access ID of the external integration provider.",
    accessToken: "The unique authorized access token of the external integration provider.",
    awsAssumeIamRoleArn: "The AWS IAM Role to be assumed by Infisical.",
    url: "",
    namespace: "",
    refreshToken: "The refresh token for integration authorization."
  }
} as const;

export const INTEGRATION = {
  CREATE: {
    integrationAuthId: "The ID of the integration auth object to link with integration.",
    app: "The name of the external integration providers app entity that you want to sync secrets with. Used in Netlify, GitHub, Vercel integrations.",
    isActive: "Whether the integration should be active or disabled.",
    appId:
      "The ID of the external integration providers app entity that you want to sync secrets with. Used in Netlify, GitHub, Vercel integrations.",
    secretPath: "The path of the secrets to sync secrets from.",
    sourceEnvironment: "The environment to sync secret from.",
    targetEnvironment:
      "The target environment of the integration provider. Used in cloudflare pages, TeamCity, Gitlab integrations.",
    targetEnvironmentId:
      "The target environment ID of the integration provider. Used in cloudflare pages, teamcity, gitlab integrations.",
    targetService:
      "The service based grouping identifier of the external provider. Used in Terraform cloud, Checkly, Railway and NorthFlank.",
    targetServiceId:
      "The service based grouping identifier ID of the external provider. Used in Terraform cloud, Checkly, Railway and NorthFlank.",
    owner: "External integration providers service entity owner. Used in Github.",
    url: "The self-hosted URL of the platform to integrate with.",
    path: "Path to save the synced secrets. Used by Gitlab, AWS Parameter Store, Vault.",
    region: "AWS region to sync secrets to.",
    scope: "Scope of the provider. Used by Github, Qovery.",
    metadata: {
      secretPrefix: "The prefix for the saved secret. Used by GCP.",
      secretSuffix: "The suffix for the saved secret. Used by GCP.",
      initialSyncBehavoir: "Type of syncing behavoir with the integration.",
      mappingBehavior: "The mapping behavior of the integration.",
      shouldAutoRedeploy: "Used by Render to trigger auto deploy.",
      secretGCPLabel: "The label for GCP secrets.",
      secretAWSTag: "The tags for AWS secrets.",
      azureLabel: "Define which label to assign to secrets created in Azure App Configuration.",
      githubVisibility:
        "Define where the secrets from the Github Integration should be visible. Option 'selected' lets you directly define which repositories to sync secrets to.",
      githubVisibilityRepoIds:
        "The repository IDs to sync secrets to when using the Github Integration. Only applicable when using Organization scope, and visibility is set to 'selected'.",
      kmsKeyId: "The ID of the encryption key from AWS KMS.",
      shouldDisableDelete: "The flag to disable deletion of secrets in AWS Parameter Store.",
      shouldMaskSecrets: "Specifies if the secrets synced from Infisical to Gitlab should be marked as 'Masked'.",
      shouldProtectSecrets: "Specifies if the secrets synced from Infisical to Gitlab should be marked as 'Protected'.",
      shouldEnableDelete: "The flag to enable deletion of secrets.",
      octopusDeployScopeValues: "Specifies the scope values to set on synced secrets to Octopus Deploy.",
      metadataSyncMode: "The mode for syncing metadata to external system"
    }
  },
  UPDATE: {
    integrationId: "The ID of the integration object.",
    region: "AWS region to sync secrets to.",
    app: "The name of the external integration providers app entity that you want to sync secrets with. Used in Netlify, GitHub, Vercel integrations.",
    appId:
      "The ID of the external integration providers app entity that you want to sync secrets with. Used in Netlify, GitHub, Vercel integrations.",
    isActive: "Whether the integration should be active or disabled.",
    secretPath: "The path of the secrets to sync secrets from.",
    path: "Path to save the synced secrets. Used by Gitlab, AWS Parameter Store, Vault.",
    owner: "External integration providers service entity owner. Used in Github.",
    targetEnvironment:
      "The target environment of the integration provider. Used in cloudflare pages, TeamCity, Gitlab integrations.",
    environment: "The environment to sync secrets from."
  },
  DELETE: {
    integrationId: "The ID of the integration object."
  },
  SYNC: {
    integrationId: "The ID of the integration object to manually sync."
  }
};

export const AUDIT_LOG_SETTINGS = {
  eventClass: "The audit log event class: management, authentication, data-access, or authorization.",
  isEnabled: "Whether events of this class are recorded.",
  shouldUseNewPrivilegeSystem:
    "Whether the organization is on the new privilege system. Permission denials (the authorization class) are only recorded on the new privilege system.",
  eventClasses:
    "Every event class except management and data-access, each exactly once. The request replaces the current settings. Management and data-access events are always recorded, so a request that includes either class is rejected. The authorization class can only be turned on for organizations on the new privilege system; otherwise the request is rejected.",
  UPDATE_ORG: {
    isEnabled:
      "Whether to record events of this class for the organization. This only covers organization-level events; each project has its own setting."
  },
  UPDATE_PROJECT: {
    projectId: "The ID of the project to update the audit log settings for.",
    isEnabled:
      "Whether to record events of this class for the project. A project that has never saved a setting uses the default."
  },
  GET_PROJECT: {
    projectId: "The ID of the project to get the audit log settings for."
  }
} as const;

export const AUDIT_LOG_STREAMS = {
  CREATE: {
    url: "The HTTP URL to push logs to.",
    headers: {
      desc: "The HTTP headers attached for the external provider requests.",
      key: "The HTTP header key name.",
      value: "The HTTP header value."
    }
  },
  UPDATE: {
    id: "The ID of the audit log stream to update.",
    url: "The HTTP URL to push logs to.",
    headers: {
      desc: "The HTTP headers attached for the external provider requests.",
      key: "The HTTP header key name.",
      value: "The HTTP header value."
    }
  },
  DELETE: {
    id: "The ID of the audit log stream to delete."
  },
  GET_BY_ID: {
    id: "The ID of the audit log stream to get details."
  }
};

export const CERTIFICATE_AUTHORITIES = {
  CREATE: {
    projectSlug: "Slug of the project to create the CA in.",
    type: "The type of CA to create.",
    friendlyName: "A friendly name for the CA.",
    organization: "The organization (O) for the CA.",
    ou: "The organization unit (OU) for the CA.",
    country: "The country name (C) for the CA.",
    province: "The state of province name for the CA.",
    locality: "The locality name for the CA.",
    commonName: "The common name (CN) for the CA.",
    notBefore: "The date and time when the CA becomes valid in YYYY-MM-DDTHH:mm:ss.sssZ format.",
    notAfter: "The date and time when the CA expires in YYYY-MM-DDTHH:mm:ss.sssZ format.",
    maxPathLength:
      "The maximum number of intermediate CAs that may follow this CA in the certificate / CA chain. A maxPathLength of -1 implies no path limit on the chain.",
    keyAlgorithm:
      "The type of public key algorithm and size, in bits, of the key pair for the CA; when you create an intermediate CA, you must use a key algorithm supported by the parent CA.",
    requireTemplateForIssuance:
      "Whether or not certificates for this CA can only be issued through certificate templates."
  },
  GET: {
    caId: "The ID of the CA to get."
  },
  UPDATE: {
    caId: "The ID of the CA to update.",
    status: "The status of the CA to update to. This can be one of active or disabled.",
    requireTemplateForIssuance:
      "Whether or not certificates for this CA can only be issued through certificate templates."
  },
  DELETE: {
    caId: "The ID of the CA to delete."
  },
  GET_CSR: {
    caId: "The ID of the CA to generate CSR from.",
    csr: "The generated CSR from the CA."
  },
  RENEW_CA_CERT: {
    caId: "The ID of the CA to renew the CA certificate for.",
    type: "The type of behavior to use for the renewal operation. Currently Infisical is only able to renew a CA certificate with the same key pair.",
    notAfter: "The expiry date and time for the renewed CA certificate in YYYY-MM-DDTHH:mm:ss.sssZ format.",
    certificate: "The renewed CA certificate body.",
    certificateChain: "The certificate chain of the CA.",
    serialNumber: "The serial number of the renewed CA certificate."
  },
  GET_CERT: {
    caId: "The ID of the CA to get the certificate body and certificate chain from.",
    certificate: "The certificate body of the CA.",
    certificateChain: "The certificate chain of the CA.",
    serialNumber: "The serial number of the CA certificate."
  },
  GET_CERT_BY_ID: {
    caId: "The ID of the CA to get the CA certificate from.",
    caCertId: "The ID of the CA certificate to get."
  },
  GET_CA_CERTS: {
    caId: "The ID of the CA to get the CA certificates for.",
    certificate: "The certificate body of the CA certificate.",
    certificateChain: "The certificate chain of the CA certificate.",
    serialNumber: "The serial number of the CA certificate.",
    version: "The version of the CA certificate. The version is incremented for each CA renewal operation."
  },
  GENERATE_CA_CERTIFICATE: {
    caId: "The ID of the CA to generate a certificate for.",
    parentCaId: "The ID of the parent CA to sign the intermediate certificate with. Not required for root CAs.",
    notBefore: "The date and time when the CA becomes valid in YYYY-MM-DDTHH:mm:ss.sssZ format.",
    notAfter: "The date and time when the CA expires in YYYY-MM-DDTHH:mm:ss.sssZ format.",
    maxPathLength:
      "The maximum number of intermediate CAs that may follow this CA in the certificate / CA chain. A maxPathLength of -1 implies no path limit on the chain.",
    certificate: "The generated CA certificate.",
    certificateChain: "The certificate chain of the CA.",
    serialNumber: "The serial number of the CA certificate."
  },
  SIGN_INTERMEDIATE: {
    caId: "The ID of the CA to sign the intermediate certificate with.",
    csr: "The pem-encoded CSR to sign with the CA.",
    notBefore: "The date and time when the intermediate CA becomes valid in YYYY-MM-DDTHH:mm:ss.sssZ format.",
    notAfter: "The date and time when the intermediate CA expires in YYYY-MM-DDTHH:mm:ss.sssZ format.",
    maxPathLength:
      "The maximum number of intermediate CAs that may follow this CA in the certificate / CA chain. A maxPathLength of -1 implies no path limit on the chain.",
    certificate: "The signed intermediate certificate.",
    certificateChain: "The certificate chain of the intermediate certificate.",
    issuingCaCertificate: "The certificate of the issuing CA.",
    serialNumber: "The serial number of the intermediate certificate."
  },
  IMPORT_CERT: {
    caId: "The ID of the CA to import the certificate for.",
    certificate: "The certificate body to import.",
    certificateChain: "The certificate chain to import."
  },
  ISSUE_CERT: {
    caId: "The ID of the CA to issue the certificate from.",
    certificateTemplateId: "The ID of the certificate template to issue the certificate from.",
    pkiCollectionId: "The ID of the PKI collection to add the certificate to.",
    friendlyName: "A friendly name for the certificate.",
    commonName: "The common name (CN) for the certificate.",
    altNames:
      "A comma-delimited list of Subject Alternative Names (SANs) for the certificate; these can be host names or email addresses.",
    ttl: "The time to live for the certificate such as 1m, 1h, 1d, 1y, ...",
    notBefore: "The date and time when the certificate becomes valid in YYYY-MM-DDTHH:mm:ss.sssZ format.",
    notAfter: "The date and time when the certificate expires in YYYY-MM-DDTHH:mm:ss.sssZ format.",
    certificate: "The issued certificate.",
    issuingCaCertificate: "The certificate of the issuing CA.",
    certificateChain: "The certificate chain of the issued certificate.",
    privateKey: "The private key of the issued certificate.",
    serialNumber: "The serial number of the issued certificate.",
    keyUsages: "The key usage extension of the certificate.",
    extendedKeyUsages: "The extended key usage extension of the certificate."
  },
  SIGN_CERT: {
    caId: "The ID of the CA to issue the certificate from.",
    pkiCollectionId: "The ID of the PKI collection to add the certificate to.",
    keyUsages: "The key usage extension of the certificate.",
    extendedKeyUsages: "The extended key usage extension of the certificate.",
    csr: "The pem-encoded CSR to sign with the CA to be used for certificate issuance.",
    friendlyName: "A friendly name for the certificate.",
    commonName: "The common name (CN) for the certificate.",
    altNames:
      "A comma-delimited list of Subject Alternative Names (SANs) for the certificate; these can be host names or email addresses.",
    ttl: "The time to live for the certificate such as 1m, 1h, 1d, 1y, ...",
    notBefore: "The date and time when the certificate becomes valid in YYYY-MM-DDTHH:mm:ss.sssZ format.",
    notAfter: "The date and time when the certificate expires in YYYY-MM-DDTHH:mm:ss.sssZ format.",
    certificate: "The issued certificate.",
    issuingCaCertificate: "The certificate of the issuing CA.",
    certificateChain: "The certificate chain of the issued certificate.",
    serialNumber: "The serial number of the issued certificate."
  },
  GET_CRLS: {
    caId: "The ID of the CA to get the certificate revocation lists (CRLs) for.",
    id: "The ID of certificate revocation list (CRL).",
    crl: "The certificate revocation list (CRL)."
  },
  INSTALL_CERT_VENAFI: {
    caId: "The ID of the CA to install the certificate for via Venafi."
  },
  INSTALL_CERT_ADCS: {
    caId: "The ID of the CA to install the certificate for via Azure AD CS."
  },
  INSTALL_CERT_ADCS_NATIVE: {
    caId: "The ID of the CA to install the certificate for via ADCS."
  },
  CREATE_SIGNING_CONFIG: {
    caId: "The ID of the CA to create a signing configuration for."
  },
  GET_SIGNING_CONFIG: {
    caId: "The ID of the CA to get the signing configuration for."
  },
  UPDATE_SIGNING_CONFIG: {
    caId: "The ID of the CA to update the signing configuration for."
  },
  GET_AUTO_RENEWAL: {
    caId: "The ID of the CA to get the auto-renewal configuration for."
  },
  UPDATE_AUTO_RENEWAL: {
    caId: "The ID of the CA to update the auto-renewal configuration for."
  }
};

export const CERTIFICATES = {
  GET: {
    id: "The ID of the certificate to get.",
    serialNumber: "The serial number of the certificate to get.",
    includeDeleted: "Return the certificate even if it was deleted. Without it, a deleted certificate returns 404.",
    hasPrivateKey: "Whether Infisical holds the private key for this certificate.",
    externalMetadata:
      "Identifies this certificate at the provider that issued it, for certificates issued by or linked to an external certificate authority. Null for everything else.",
    latestRenewalCertificateId:
      "The ID of the newest certificate that has replaced this one through renewal, or null if no newer replacement is available. Revoked and deleted certificates are never named, so this is null when this certificate has never been renewed and also when every renewal of it has since been revoked or deleted. Use this to follow renewals without walking the chain one certificate at a time.",
    deletedAt:
      "When this certificate was deleted, or null if it has not been. A deleted certificate keeps its record, metadata and renewal history, but its certificate and private key are no longer available.",
    deletedByActorType: "The type of actor that deleted this certificate: 'user' or 'identity'.",
    deletedByActorId: "The ID of the user or machine identity that deleted this certificate.",
    deletedByActorName: "The name of the user or machine identity that deleted this certificate, if it still exists."
  },
  RENEW: {
    id: "The ID of the certificate to renew.",
    renewalKeySource:
      "How the renewed certificate's key pair is handled. 'new' generates a fresh pair, 'reuse' keeps the current one so the renewed certificate carries the same public key, and 'csr' takes the key from a supplied signing request. Defaults to 'new'.",
    csr: "A PEM-encoded certificate signing request to renew from. Its subject, key and extensions take precedence, so only TTL and basic constraints may be set alongside it.",
    attributes:
      "Certificate fields to change on renewal. Anything omitted is copied from the certificate being renewed. Profile defaults are not applied.",
    removeRootsFromChain: "Whether to remove the root certificate from the returned certificate chain.",
    externalConfiguration: "Options for certificates issued by an external certificate authority.",
    reissue:
      "Whether to reissue the certificate on its current order with the issuing CA instead of placing a new order. Defaults to `false`. Only for CAs that support reissuing (currently DigiCert), and `ttl` can't be set. If the reissue removes or changes a name, the CA revokes the current certificate (DigiCert within 72 hours), so you also need permission to revoke it."
  },
  RENEWAL_PREVIEW: {
    id: "The ID of the certificate to preview a renewal for.",
    hasOriginatingRequest:
      "Whether the certificate has a recorded originating request. When false the preview falls back to the issued certificate, which is the case for imported and discovered certificates.",
    hasOriginatingCsr:
      "Whether the request that produced this certificate carried a CSR. When Infisical holds neither the private key nor this CSR, renewing with the existing key pair is refused.",
    request:
      "The values a renewal will request, taken from the request that produced this certificate including any profile defaults it recorded.",
    issuerModifiedFields:
      "Fields the issuing authority set differently from the request, each with the requested and issued values. A renewal asks for the requested value again unless it is changed."
  },
  REVOKE: {
    id: "The ID or SHA-1/SHA-256 thumbprint of the certificate to revoke. Thumbprint colons and casing are ignored.",
    serialNumber:
      "The serial number of the certificate to revoke. The revoked certificate will be added to the certificate revocation list (CRL) of the CA.",
    revocationReason: "The reason for revoking the certificate.",
    revokedAt: "The date and time when the certificate was revoked.",
    serialNumberRes: "The serial number of the revoked certificate."
  },
  DELETE: {
    id: "The ID of the certificate to delete.",
    serialNumber: "The serial number of the certificate to delete."
  },
  GET_CERT: {
    id: "The ID of the certificate to get the certificate body and certificate chain for.",
    serialNumber: "The serial number of the certificate to get the certificate body and certificate chain for.",
    certificate: "The certificate body of the certificate.",
    certificateChain: "The certificate chain of the certificate.",
    serialNumberRes: "The serial number of the certificate.",
    privateKey: "The private key of the certificate."
  },
  EXPORT_PKCS12: {
    password:
      "Password to protect the PKCS#12 keystore with. Must be 14 to 100 characters, contain a letter, a number and a special character, have no more than 3 repeated consecutive characters, and contain no escape characters (newline, tab, carriage return or backslash).",
    alias: "Friendly name for the certificate inside the keystore.",
    keystore:
      "The PKCS#12 keystore (.p12) as binary data, containing the certificate, its chain and its private key, encrypted with the given password."
  },
  IMPORT: {
    projectSlug: "Slug of the project to import the certificate into.",
    certificatePem: "The PEM-encoded leaf certificate.",
    privateKeyPem: "Optional PEM-encoded private key associated with the certificate.",
    chainPem: "Optional PEM-encoded chain of intermediate certificates.",
    friendlyName: "A friendly name for the certificate.",
    pkiCollectionId: "The ID of the PKI collection to add the certificate to.",
    profileId:
      "The certificate profile that will manage this certificate's lifecycle. The certificate must satisfy the profile's certificate policy, or the request is rejected with a 400 naming the attributes that failed. Omit to track the certificate without renewal, reissue or revocation.",
    externalMetadata:
      'Identifies this certificate at the provider that issued it. Required when the chosen profile issues from an external certificate authority. For DigiCert, pass the CertCentral order ID as { type: "digicert", orderId: 2081714 }.',

    certificateId: "The ID of the imported certificate.",
    certificate: "The imported certificate.",
    certificateChain:
      "The certificate chain associated with the imported certificate. Returned only when a chain was supplied at import.",
    privateKey:
      "The PEM-encoded private key associated with the imported certificate. Returned only when a private key was supplied at import.",
    serialNumber: "The serial number of the imported certificate."
  }
};

const domainComponentRule = (rule: string) =>
  `Domain component sequences that are ${rule}. Each entry is one sequence, its components comma-joined most specific first: "corp,example,com" matches DC=corp,DC=example,DC=com. A request matches a sequence only when its components line up position by position, so the same labels in another order do not match.`;

const DOMAIN_COMPONENT_DENIED_RULE = `Domain component sequences that are rejected, each comma-joined most specific first. A sequence is rejected wherever it appears in the chain, so "example,com" rejects DC=example,DC=com and DC=host,DC=example,DC=com alike.`;

export const CERTIFICATE_POLICIES = {
  CUSTOM_EXTENSION_RULES:
    "Rules for custom X.509 extensions, one per OID. Omit the field to leave custom extensions unconstrained; send an empty array to forbid them entirely.",
  CUSTOM_EXTENSION_RULE: {
    allowed:
      "Value patterns this extension may take, with * as a wildcard. Use * on its own to accept any value. Omit to place no allow-list constraint on the value.",
    required:
      "Value patterns this extension must match, with * as a wildcard. Setting any required pattern also makes the extension mandatory on every request.",
    denied:
      "Value patterns this extension must not take, with * as a wildcard. A denied match is rejected even when an allowed pattern also matches."
  },
  SUBJECT_DOMAIN_COMPONENT_RULE: {
    allowed: domainComponentRule("permitted"),
    required: domainComponentRule("required"),
    denied: DOMAIN_COMPONENT_DENIED_RULE
  }
};

export const CERTIFICATE_TEMPLATES = {
  CREATE: {
    caId: "The ID of the certificate authority to associate the template with.",
    pkiCollectionId: "The ID of the PKI collection to bind to the template.",
    name: "The name of the template.",
    commonName: "The regular expression string to use for validating common names.",
    subjectAlternativeName: "The regular expression string to use for validating subject alternative names.",
    ttl: "The max TTL for the template.",
    keyUsages: "The key usage constraint or default value for when template is used during certificate issuance.",
    extendedKeyUsages:
      "The extended key usage constraint or default value for when template is used during certificate issuance."
  },
  GET: {
    certificateTemplateId: "The ID of the certificate template to get."
  },
  UPDATE: {
    certificateTemplateId: "The ID of the certificate template to update.",
    caId: "The ID of the certificate authority to update the association with the template.",
    pkiCollectionId: "The ID of the PKI collection to update the binding to the template.",
    name: "The updated name of the template.",
    commonName: "The updated regular expression string for validating common names.",
    subjectAlternativeName: "The updated regular expression string for validating subject alternative names.",
    ttl: "The updated max TTL for the template.",
    keyUsages:
      "The updated key usage constraint or default value for when template is used during certificate issuance.",
    extendedKeyUsages:
      "The updated extended key usage constraint or default value for when template is used during certificate issuance."
  },
  DELETE: {
    certificateTemplateId: "The ID of the certificate template to delete."
  }
};

export const CA_CRLS = {
  GET: {
    crlId: "The ID of the certificate revocation list (CRL) to get.",
    crl: "The certificate revocation list (CRL)."
  }
};

export const ALERTING = {
  CREATE: {
    name: "The name of the alert.",
    description: "The description of the alert.",
    resourceType: "The type of resource the alert watches, for example `cert-manager.application`.",
    resourceId:
      "The ID of the resource the alert watches. Set to null to watch every resource of this type, where the resource type supports it.",
    eventType: "The event that triggers the alert, for example `cert-manager.application.certificate.expiry`.",
    condition:
      "The settings of the alert's event, for example `alertBefore` on an expiry event. The accepted fields depend on `eventType`.",
    enabled: "Whether the alert is enabled. Defaults to true.",
    projectId: "The ID of the project to create the alert in. Optional when the resource belongs to a project.",
    channels: "The channels the alert notifies. Each is email, Slack, webhook, or PagerDuty."
  },
  TEST_CHANNEL: {
    resourceType: "The type of resource the alert watches.",
    resourceId: "The ID of the resource the alert watches.",
    projectId: "The ID of the project the alert belongs to.",
    alertId: "The ID of the saved alert the channel belongs to.",
    channelId: "The ID of the saved channel to test."
  },
  LIST: {
    resourceType: "The type of resource to list alerts for.",
    resourceId:
      "The ID of the resource to list alerts for. If omitted, lists every alert on the resource type. For resource types that support alerts covering all of their resources, such as `cert-manager`, lists only those alerts.",
    projectId: "The ID of the project to list alerts in.",
    enabled: "Whether to list only enabled or only disabled alerts."
  },
  GET: {
    alertId: "The ID of the alert to get.",
    filters:
      "The resources named in the alert's condition, such as applications, certificate profiles, and signers, each as `{ id, name }`. `name` is null for a deleted resource."
  },
  UPDATE: {
    alertId: "The ID of the alert to update.",
    name: "The new name of the alert.",
    description: "The new description of the alert. Set to null to remove it.",
    condition: "The new settings of the alert's event. The accepted fields depend on the alert's `eventType`.",
    enabled: "Whether the alert is enabled.",
    channels: "The alert's channels. Replaces the current channels, so channels left out are deleted."
  },
  DELETE: {
    alertId: "The ID of the alert to delete."
  }
};

export const ALERTS = {
  CREATE: {
    projectId: "The ID of the project to create the alert in.",
    pkiCollectionId: "The ID of the PKI collection to bind to the alert.",
    name: "The name of the alert.",
    alertBeforeDays: "The number of days before the certificate expires to trigger the alert.",
    emails: "The email addresses to send the alert email to."
  },
  GET: {
    alertId: "The ID of the alert to get."
  },
  UPDATE: {
    alertId: "The ID of the alert to update.",
    name: "The name of the alert to update to.",
    alertBeforeDays: "The number of days before the certificate expires to trigger the alert to update to.",
    pkiCollectionId: "The ID of the PKI collection to bind to the alert to update to.",
    emails: "The email addresses to send the alert email to update to."
  },
  DELETE: {
    alertId: "The ID of the alert to delete."
  }
};

export const PKI_SUBSCRIBERS = {
  GET: {
    subscriberName: "The name of the PKI subscriber to get.",
    projectId: "The ID of the project to get the PKI subscriber for."
  },
  GET_LATEST_CERT_BUNDLE: {
    subscriberName: "The name of the PKI subscriber to get the active certificate bundle for.",
    projectId: "The ID of the project to get the active certificate bundle for.",
    certificate: "The active certificate for the subscriber.",
    certificateChain: "The certificate chain of the active certificate for the subscriber.",
    privateKey: "The private key of the active certificate for the subscriber.",
    serialNumber: "The serial number of the active certificate for the subscriber."
  },
  CREATE: {
    projectId: "The ID of the project to create the PKI subscriber in.",
    caId: "The ID of the CA that will issue certificates for the PKI subscriber.",
    name: "The name of the PKI subscriber.",
    commonName: "The common name (CN) to be used on certificates issued for this subscriber.",
    status: "The status of the PKI subscriber. This can be one of active or disabled.",
    ttl: "The time to live for the certificates issued for this subscriber such as 1m, 1h, 1d, 1y, ...",
    subjectAlternativeNames:
      "A list of Subject Alternative Names (SANs) to be used on certificates issued for this subscriber; these can be host names or email addresses.",
    keyUsages: "The key usage extension to be used on certificates issued for this subscriber.",
    extendedKeyUsages: "The extended key usage extension to be used on certificates issued for this subscriber.",
    enableAutoRenewal: "Whether or not to enable auto renewal for the PKI subscriber.",
    autoRenewalPeriodInDays: "The period in days to auto renew the PKI subscriber's certificates."
  },
  UPDATE: {
    projectId: "The ID of the project to update the PKI subscriber in.",
    subscriberName: "The name of the PKI subscriber to update.",
    caId: "The ID of the CA that will issue certificates for the PKI subscriber to update to.",
    name: "The name of the PKI subscriber to update to.",
    commonName: "The common name (CN) to be used on certificates issued for this subscriber to update to.",
    status: "The status of the PKI subscriber to update to. This can be one of active or disabled.",
    ttl: "The time to live for the certificates issued for this subscriber such as 1m, 1h, 1d, 1y, ...",
    subjectAlternativeNames:
      "A comma-delimited list of Subject Alternative Names (SANs) to be used on certificates issued for this subscriber; these can be host names or email addresses.",
    keyUsages: "The key usage extension to be used on certificates issued for this subscriber to update to.",
    extendedKeyUsages:
      "The extended key usage extension to be used on certificates issued for this subscriber to update to.",
    enableAutoRenewal: "Whether or not to enable auto renewal for the PKI subscriber.",
    autoRenewalPeriodInDays: "The period in days to auto renew the PKI subscriber's certificates."
  },
  DELETE: {
    subscriberName: "The name of the PKI subscriber to delete.",
    projectId: "The ID of the project of the PKI subscriber to delete."
  },
  ISSUE_CERT: {
    subscriberName: "The name of the PKI subscriber to issue the certificate for.",
    projectId: "The ID of the project of the PKI subscriber to issue the certificate for.",
    certificate: "The issued certificate.",
    issuingCaCertificate: "The certificate of the issuing CA.",
    certificateChain: "The certificate chain of the issued certificate.",
    privateKey: "The private key of the issued certificate.",
    serialNumber: "The serial number of the issued certificate."
  },
  SIGN_CERT: {
    subscriberName: "The name of the PKI subscriber to sign the certificate for.",
    projectId: "The ID of the project of the PKI subscriber to sign the certificate for.",
    csr: "The CSR to be used to sign the certificate.",
    certificate: "The signed certificate.",
    issuingCaCertificate: "The certificate of the issuing CA.",
    certificateChain: "The certificate chain of the signed certificate.",
    serialNumber: "The serial number of the signed certificate."
  },
  LIST_CERTS: {
    subscriberName: "The name of the PKI subscriber to list the certificates for.",
    projectId: "The ID of the project of the PKI subscriber to list the certificates for.",
    offset: "The offset to start from.",
    limit: "The number of certificates to return."
  }
};

export const PKI_COLLECTIONS = {
  CREATE: {
    projectId: "The ID of the project to create the PKI collection in.",
    name: "The name of the PKI collection.",
    description: "A description for the PKI collection."
  },
  GET: {
    collectionId: "The ID of the PKI collection to get."
  },
  UPDATE: {
    collectionId: "The ID of the PKI collection to update.",
    name: "The name of the PKI collection to update to.",
    description: "The description for the PKI collection to update to."
  },
  DELETE: {
    collectionId: "The ID of the PKI collection to delete."
  },
  LIST_ITEMS: {
    collectionId: "The ID of the PKI collection to list items from.",
    type: "The type of the PKI collection item to list.",
    offset: "The offset to start from.",
    limit: "The number of items to return."
  },
  ADD_ITEM: {
    collectionId: "The ID of the PKI collection to add the item to.",
    type: "The type of the PKI collection item to add.",
    itemId: "The resource ID of the PKI collection item to add."
  },
  DELETE_ITEM: {
    collectionId: "The ID of the PKI collection to delete the item from.",
    collectionItemId: "The ID of the PKI collection item to delete.",
    type: "The type of the deleted PKI collection item.",
    itemId: "The resource ID of the deleted PKI collection item."
  }
};

export const PROJECT_ROLE = {
  CREATE: {
    projectSlug: "Slug of the project to create the role for.",
    projectId: "Id of the project to create the role for.",
    slug: "The slug of the role.",
    name: "The name of the role.",
    description: "The description for the role.",
    permissions: "The permissions assigned to the role."
  },
  UPDATE: {
    projectSlug: "The slug of the project to update the role for.",
    projectId: "The ID of the project to update the role for.",
    roleId: "The ID of the role to update",
    slug: "The slug of the role.",
    name: "The name of the role.",
    description: "The description for the role.",
    permissions: "The permissions assigned to the role."
  },
  DELETE: {
    projectSlug: "The slug of the project to delete this role for.",
    projectId: "The ID of the project to delete the role for.",
    roleId: "The ID of the role to update"
  },
  GET_ROLE_BY_SLUG: {
    projectSlug: "The slug of the project.",
    projectId: "The ID of the project.",
    roleSlug: "The slug of the role to get details."
  },
  GET_ROLE_BY_ID: {
    roleId: "The ID of the role to get."
  },
  LIST: {
    projectSlug: "The slug of the project to list the roles of.",
    projectId: "The ID of the project."
  }
};

export const ORG_ROLE = {
  CREATE: {
    slug: "The slug of the role.",
    name: "The name of the role.",
    description: "The description for the role.",
    permissions: "The permissions assigned to the role."
  },
  UPDATE: {
    roleId: "The ID of the role to update.",
    slug: "The slug of the role.",
    name: "The name of the role.",
    description: "The description for the role.",
    permissions: "The permissions assigned to the role."
  },
  DELETE: {
    roleId: "The ID of the role to delete."
  },
  GET: {
    roleId: "The ID of the role to get."
  },
  GET_ROLE_BY_SLUG: {
    roleSlug: "The slug of the role to get details."
  },
  LIST: {}
};

export const KMS = {
  CREATE_KEY: {
    projectId: "The ID of the project to create the key in.",
    name: "The name of the key to be created. Must be slug-friendly.",
    description: "An optional description of the key.",
    algorithm: "The cryptographic algorithm of the key (e.g. aes-256-gcm, RSA_4096, HMAC_SHA_256).",
    encryptionAlgorithm: "Deprecated: use 'algorithm' instead. Retained as an alias for backwards compatibility.",
    type: "The type of key to be created, either encrypt-decrypt or sign-verify, based on your intended use for the key.",
    isExportable:
      "Whether the raw key material can be exported after creation. When set to false, the key can never be exported regardless of permissions. This cannot be changed after creation.",
    hasDeleteProtection: "Prevents deletion of the key when enabled."
  },
  UPDATE_KEY: {
    keyId: "The ID of the key to be updated.",
    name: "The updated name of this key. Must be slug-friendly.",
    description: "The updated description of this key.",
    isDisabled: "The flag to enable or disable this key.",
    hasDeleteProtection: "Enable or disable delete protection for this key."
  },
  ROTATE_KEY: {
    keyId: "The ID of the key to be rotated."
  },
  DELETE_KEY: {
    keyId: "The ID of the key to be deleted."
  },
  LIST_KEYS: {
    projectId: "The ID of the project to list keys from.",
    offset: "The offset to start from. If you enter 10, it will start from the 10th key.",
    limit: "The number of keys to return.",
    orderBy: "The column to order keys by.",
    orderDirection: "The direction to order keys in.",
    search: "The text string to filter key names by."
  },
  GET_KEY_BY_ID: {
    keyId: "The ID of the KMS key to retrieve."
  },
  GET_KEY_BY_NAME: {
    keyName: "The name of the KMS key to retrieve.",
    projectId: "The ID of the project the key belongs to."
  },
  ENCRYPT: {
    keyId: "The ID of the key to encrypt the data with.",
    plaintext: "The plaintext to be encrypted (base64 encoded)."
  },
  DECRYPT: {
    keyId: "The ID of the key to decrypt the data with.",
    ciphertext: "The ciphertext to be decrypted (base64 encoded)."
  },

  LIST_SIGNING_ALGORITHMS: {
    keyId: "The ID of the key to list the signing algorithms for. The key must be for signing and verifying."
  },

  GET_PUBLIC_KEY: {
    keyId: "The ID of the key to get the public key for. The key must be for signing and verifying."
  },

  GET_PRIVATE_KEY: {
    keyId: "The ID of the key to export the private key or key material for."
  },

  BULK_EXPORT_PRIVATE_KEYS: {
    keyIds: "An array of KMS key IDs to export. Maximum 100 keys per request."
  },

  SIGN: {
    keyId: "The ID of the key to sign the data with.",
    data: "The data in string format to be signed (base64 encoded).",
    isDigest:
      "Whether the data is already digested or not. Please be aware that if you are passing a digest the algorithm used to create the digest must match the signing algorithm used to sign the digest.",
    signingAlgorithm: "The algorithm to use when performing cryptographic operations with the key."
  },
  VERIFY: {
    keyId: "The ID of the key to verify the data with.",
    data: "The data in string format to be verified (base64 encoded). For data larger than 1MB you must first create a digest of the data and then pass the digest in the data parameter.",
    signature: "The signature to be verified (base64 encoded).",
    isDigest: "Whether the data is already digested or not."
  },
  GENERATE_MAC: {
    keyId: "The ID of the key to generate the MAC with. The key must be for generating and verifying MACs.",
    data: "The data in string format to generate the MAC for (base64 encoded)."
  },
  VERIFY_MAC: {
    keyId: "The ID of the key to verify the MAC with. The key must be for generating and verifying MACs.",
    data: "The data in string format the MAC was generated for (base64 encoded).",
    mac: "The MAC to be verified (base64 encoded)."
  }
};

export const ProjectTemplates = {
  LIST: {
    type: "The type of project template to list."
  },
  CREATE: {
    name: "The name of the project template to be created. Must be slug-friendly.",
    type: "The type of project template to be created.",
    description: "An optional description of the project template.",
    roles: "The roles to be created when the template is applied to a project.",
    environments: "The environments to be created when the template is applied to a project.",
    users:
      "The users to be automatically added to projects created from this template. Each user is identified by username and assigned one or more roles.",
    groups:
      "The groups to be automatically added to projects created from this template. Each group is identified by slug and assigned one or more roles.",
    identities:
      "The organization-owned identities to be automatically added to projects created from this template. Each identity is identified by ID and assigned one or more roles.",
    projectManagedIdentities:
      "The project-owned identities to be automatically created for projects created from this template. Each identity is identified by name and assigned one or more roles."
  },
  UPDATE: {
    templateId: "The ID of the project template to be updated.",
    name: "The updated name of the project template. Must be slug-friendly.",
    description: "The updated description of the project template.",
    roles: "The updated roles to be created when the template is applied to a project.",
    environments: "The updated environments to be created when the template is applied to a project.",
    users:
      "The updated users to be automatically added to projects created from this template. Each user is identified by username and assigned one or more roles.",
    groups:
      "The updated groups to be automatically added to projects created from this template. Each group is identified by slug and assigned one or more roles.",
    identities:
      "The updated organization-owned identities to be automatically added to projects created from this template. Each identity is identified by ID and assigned one or more roles.",
    projectManagedIdentities:
      "The updated project-owned identities to be automatically created for projects created from this template. Each identity is identified by name and assigned one or more roles."
  },
  DELETE: {
    templateId: "The ID of the project template to be deleted."
  }
};

export const CertificateAuthorities = {
  CREATE: (type: CaType) => ({
    name: `The name of the ${CERTIFICATE_AUTHORITIES_TYPE_MAP[type]} Certificate Authority to create. Must be slug-friendly.`,
    projectId: `The ID of the project to create the Certificate Authority in.`,
    enableDirectIssuance: `Whether or not to enable direct issuance of certificates for the ${CERTIFICATE_AUTHORITIES_TYPE_MAP[type]} Certificate Authority.`,
    status: `The status of the ${CERTIFICATE_AUTHORITIES_TYPE_MAP[type]} Certificate Authority.`
  }),
  UPDATE: (type: CaType) => ({
    caId: `The ID of the ${CERTIFICATE_AUTHORITIES_TYPE_MAP[type]} Certificate Authority to update.`,
    projectId: `The ID of the project to update the Certificate Authority in.`,
    name: `The updated name of the ${CERTIFICATE_AUTHORITIES_TYPE_MAP[type]} Certificate Authority. Must be slug-friendly.`,
    enableDirectIssuance: `Whether or not to enable direct issuance of certificates for the ${CERTIFICATE_AUTHORITIES_TYPE_MAP[type]} Certificate Authority.`,
    status: `The updated status of the ${CERTIFICATE_AUTHORITIES_TYPE_MAP[type]} Certificate Authority.`
  }),
  CONFIGURATIONS: {
    ACME: {
      dnsAppConnectionId: `The ID of the App Connection to use for creating and managing DNS TXT records required for ACME domain validation. This connection must have permissions to create and delete TXT records in your DNS provider (e.g., Route53) for the ACME challenge process.`,
      directoryUrl: `The directory URL for the ACME Certificate Authority.`,
      accountEmail: `The email address for the ACME Certificate Authority.`,
      provider: `The DNS provider for the ACME Certificate Authority.`,
      hostedZoneId: `The hosted zone ID for the ACME Certificate Authority. For Google Cloud DNS, use the managed zone resource name in the format projects/{projectId}/managedZones/{zoneName}.`,
      eabKid: `The External Account Binding (EAB) Key ID for the ACME Certificate Authority. Required if the ACME provider uses EAB.`,
      eabHmacKey: `The External Account Binding (EAB) HMAC key for the ACME Certificate Authority. Required if the ACME provider uses EAB.`,
      dnsResolver: `An optional custom DNS resolver IP address to use for verifying DNS propagation during ACME challenges. Must be a valid IP address (e.g. 8.8.8.8). When not set, the system default DNS resolver is used.`
    },
    AWS_PCA: {
      appConnectionId: `The ID of the AWS App Connection to use for authenticating with AWS Private Certificate Authority (PCA). This connection must have permissions to issue, get, and revoke certificates from the specified PCA.`,
      certificateAuthorityArn: `The ARN of the AWS Private Certificate Authority to use for issuing certificates.`,
      region: `The AWS region where the Private Certificate Authority is located.`
    },
    AWS_ACM_PUBLIC_CA: {
      appConnectionId: `The ID of the AWS App Connection to use for authenticating with AWS Certificate Manager (ACM). This connection must have permissions to request, describe, export, renew, and delete certificates.`,
      dnsAppConnectionId: `The ID of the AWS App Connection to use for creating and managing Route 53 CNAME records required for ACM domain validation.`,
      hostedZoneId: `The Route 53 hosted zone ID to use for ACM DNS validation CNAME records.`,
      region: `The AWS region to use for the ACM API calls.`
    },
    INTERNAL: {
      type: "The type of CA to create.",
      friendlyName: "A friendly name for the CA.",
      organization: "The organization (O) for the CA.",
      ou: "The organization unit (OU) for the CA.",
      country: "The country name (C) for the CA.",
      province: "The state of province name for the CA.",
      locality: "The locality name for the CA.",
      commonName: "The common name (CN) for the CA.",
      notBefore: "The date and time when the CA becomes valid in YYYY-MM-DDTHH:mm:ss.sssZ format.",
      notAfter: "The date and time when the CA expires in YYYY-MM-DDTHH:mm:ss.sssZ format.",
      maxPathLength:
        "The maximum number of intermediate CAs that may follow this CA in the certificate / CA chain. A maxPathLength of -1 implies no path limit on the chain.",
      keyAlgorithm:
        "The type of public key algorithm and size, in bits, of the key pair for the CA; when you create an intermediate CA, you must use a key algorithm supported by the parent CA.",
      keySource:
        "Where the CA's signing key is generated and stored. 'infisical' keeps the key in Infisical's KMS; 'hsm' generates and stores the key in the HSM reached through the specified HSM Connector; 'aws-kms' generates the key in AWS KMS through the specified AWS connection, and every signature is made by AWS KMS.",
      hsmConnectorId:
        "The ID of the HSM Connector to generate and store the CA's signing key in. Required when keySource is 'hsm'.",
      hsmKeyLabel:
        "Deprecated: use externalKeyId, which holds the same key label for HSM-backed CAs. The label of the CA's signing key on the HSM.",
      appConnectionId:
        "The ID of the AWS connection used to create the CA's signing key in AWS KMS and to sign with it. Required when keySource is 'aws-kms'.",
      appConnectionName: "The name of the AWS connection the CA's signing key is reached through. Not user-supplied.",
      hsmConnectorName: "The name of the HSM Connector the CA's signing key is reached through. Not user-supplied.",
      region:
        "The AWS region the CA's signing key is created in. Required when keySource is 'aws-kms', and returned when reading the CA.",
      externalKeyId:
        "The identifier of the CA's signing key in its key source: the key ARN for AWS KMS, or the key label for HSM. Not user-supplied: the key is created when the CA is created.",
      crlDistributionPointUrls:
        "Additional CRL Distribution Point URLs (HTTP/HTTPS) embedded in every certificate issued by this CA. Up to 4 URLs; the Infisical-managed CRL endpoint is included by default unless disabled.",
      disableManagedCrlDistributionPointUrl:
        "When set to true, the Infisical-managed CRL endpoint URL will not be embedded in certificates issued by this CA. Only custom CRL Distribution Point URLs (if any) will be included.",
      isOcspEnabled:
        "When set to true, certificates issued by this CA carry the Infisical-managed OCSP responder URL in their Authority Information Access extension, and that responder answers revocation status queries for them. Applies to certificates issued after it is enabled."
    }
  }
};

export const AppConnections = {
  LIST: (app?: AppConnection) => ({
    projectId: `The ID of the project to list ${app ? APP_CONNECTION_NAME_MAP[app] : "App"} Connections from.`
  }),
  GET_BY_ID: (app: AppConnection) => ({
    connectionId: `The ID of the ${APP_CONNECTION_NAME_MAP[app]} Connection to retrieve.`
  }),
  GET_BY_NAME: (app: AppConnection) => ({
    connectionName: `The name of the ${APP_CONNECTION_NAME_MAP[app]} Connection to retrieve.`,
    projectId: `The project ID of the ${APP_CONNECTION_NAME_MAP[app]} Connection is associated with. Leave unspecified to get organization-level connections.`
  }),
  CREATE: (app: AppConnection) => {
    const appName = APP_CONNECTION_NAME_MAP[app];
    return {
      name: `The name of the ${appName} Connection to create. Must be slug-friendly.`,
      description: `An optional description for the ${appName} Connection.`,
      credentials: `The credentials used to connect with ${appName}.`,
      method: `The method used to authenticate with ${appName}.`,
      stsEndpoint: `An optional custom endpoint URL for the AWS STS API to use when connecting with ${appName}.`,
      isPlatformManagedCredentials: `Whether or not the ${appName} Connection credentials should be managed by Infisical. Once enabled this cannot be reversed.`,
      projectId: `The ID of the project to create the ${appName} Connection in.`,
      isAutoRotationEnabled: `Whether or not automatic credential rotation is enabled for the ${appName} Connection.`,
      rotation: `The credential rotation configuration for the ${appName} Connection.`
    };
  },
  UPDATE: (app: AppConnection) => {
    const appName = APP_CONNECTION_NAME_MAP[app];
    return {
      connectionId: `The ID of the ${appName} Connection to be updated.`,
      name: `The updated name of the ${appName} Connection. Must be slug-friendly.`,
      description: `The updated description of the ${appName} Connection.`,
      credentials: `The credentials used to connect with ${appName}.`,
      method: `The method used to authenticate with ${appName}.`,
      stsEndpoint: `An optional custom endpoint URL for the AWS STS API to use when connecting with ${appName}.`,
      isPlatformManagedCredentials: `Whether or not the ${appName} Connection credentials should be managed by Infisical. Once enabled this cannot be reversed.`,
      isAutoRotationEnabled: `Whether or not automatic credential rotation is enabled for the ${appName} Connection.`,
      rotation: `The updated credential rotation configuration for the ${appName} Connection.`
    };
  },
  DELETE: (app: AppConnection) => ({
    connectionId: `The ID of the ${APP_CONNECTION_NAME_MAP[app]} Connection to be deleted.`
  }),
  ROTATE_CREDENTIALS: (app: AppConnection) => ({
    connectionId: `The ID of the ${APP_CONNECTION_NAME_MAP[app]} Connection to rotate credentials for.`
  }),
  KEEPER: {
    LIST_SHARED_FOLDERS: {
      connectionId: "The ID of the Keeper Connection to list shared folders from.",
      sharedFolders: "The Keeper shared folders the connection can access, sorted by name.",
      uid: "The UID of the Keeper shared folder.",
      name: "The name of the Keeper shared folder. Falls back to the UID when the folder has no name."
    }
  },
  CREDENTIALS: {
    IMPERVA: {
      apiId: "The API ID of an Imperva API key, shown beside the key in the Cloud Security Console.",
      apiKey: "The Imperva API key. It has to be enabled, and its role needs the Manage SSL Certificates permission.",
      accountId:
        "The numeric Imperva account ID to act on. Set it to manage websites in a sub-account. Defaults to the account the API key belongs to."
    },
    PALO_ALTO_NETWORKS: {
      hostname: "The IP address or hostname of the management interface of the firewall or Panorama.",
      port: "The HTTPS port of the management interface. Defaults to 443.",
      username: "The username of the PAN-OS administrator to connect with.",
      password: "The password of the PAN-OS administrator.",
      sslRejectUnauthorized: "Whether to reject the management interface's TLS certificate if it isn't trusted.",
      sslCertificate: "The PEM-encoded CA certificate to trust for the management interface's TLS certificate."
    },
    AUTH0_CONNECTION: {
      domain: "The domain of the Auth0 instance to connect to.",
      clientId: "Your Auth0 application's Client ID.",
      clientSecret: "Your Auth0 application's Client Secret.",
      audience: "The unique identifier of the target API you want to access."
    },
    SALESFORCE_CONNECTION: {
      instanceUrl: "The instance URL of the Salesforce org to connect to.",
      consumerKey: "The Consumer Key of your Salesforce External App.",
      consumerSecret: "The Consumer Secret of your Salesforce External App."
    },
    SQL_CONNECTION: {
      host: "The hostname of the database server.",
      port: "The port number of the database.",
      database: "The name of the database to connect to.",
      username: "The username to connect to the database with.",
      password: "The password to connect to the database with.",
      sslEnabled: "Whether or not to use SSL when connecting to the database.",
      sslRejectUnauthorized: "Whether or not to reject unauthorized SSL certificates.",
      sslCertificate: "The SSL certificate to use for connection."
    },
    TERRAFORM_CLOUD: {
      apiToken: "The API token to use to connect with Terraform Cloud."
    },
    VERCEL: {
      apiToken: "The API token used to authenticate with Vercel."
    },
    ONA: {
      personalAccessToken: "The Personal Access Token used to authenticate with Ona."
    },
    DIGICERT: {
      apiKey: "The CertCentral API Key used to authenticate with DigiCert.",
      region: "The CertCentral region the API key belongs to (us or eu)."
    },
    GODADDY: {
      apiKey: "The GoDaddy API Key used to authenticate with the GoDaddy API.",
      apiSecret: "The GoDaddy API Secret used to authenticate with the GoDaddy API."
    },
    TRAVISCI: {
      apiToken: "The API token used to authenticate with Travis CI."
    },
    CAMUNDA: {
      clientId: "The client ID used to authenticate with Camunda.",
      clientSecret: "The client secret used to authenticate with Camunda."
    },
    DATABRICKS: {
      scopes:
        "The OAuth scopes to request for the service principal's token: secrets for secret syncs, and authentication and scim for secret rotations. Each must be assigned to the client secret. Defaults to all-apis when omitted or empty."
    },
    WINDMILL: {
      instanceUrl: "The Windmill instance URL to connect with (defaults to https://app.windmill.dev).",
      accessToken: "The access token to use to connect with Windmill."
    },
    HC_VAULT: {
      instanceUrl: "The Hashicrop Vault instance URL to connect with.",
      namespace: "The Hashicrop Vault namespace to connect with.",
      accessToken: "The access token used to connect with Hashicorp Vault.",
      roleId: "The Role ID used to connect with Hashicorp Vault.",
      secretId: "The Secret ID used to connect with Hashicorp Vault."
    },
    LDAP: {
      provider: "The type of LDAP provider. Determines provider-specific behaviors.",
      url: "The LDAP/LDAPS URL to connect to (e.g., 'ldap://domain-or-ip:389' or 'ldaps://domain-or-ip:636').",
      dn: "The Distinguished Name (DN) or User Principal Name (UPN) of the principal to bind with (e.g., 'CN=John,CN=Users,DC=example,DC=com').",
      password: "The password to bind with for authentication.",
      sslRejectUnauthorized:
        "Whether or not to reject unauthorized SSL certificates (true/false) when using ldaps://. Set to false only in test environments.",
      sslCertificate:
        "The SSL certificate (PEM format) to use for secure connection when using ldaps:// with a self-signed certificate."
    },
    TEAMCITY: {
      instanceUrl: "The TeamCity instance URL to connect with.",
      accessToken: "The access token to use to connect with TeamCity."
    },
    AZURE_CLIENT_SECRETS: {
      code: "The OAuth code to use to connect with Azure Client Secrets.",
      tenantId: "The Tenant ID to use to connect with Azure Client Secrets.",
      clientId: "The Client ID to use to connect with Azure Client Secrets.",
      clientSecret: "The Client Secret to use to connect with Azure Client Secrets.",
      certificateBody: "The certificate body in PEM format to use to connect with Azure Client Secrets.",
      privateKey:
        "The private key to use to connect with Azure Client Secrets. This is never transmitted to Azure and is only used to sign the Azure client assertion with.",
      clientSecretKeyId:
        "The Key ID of the client secret in Azure AD. Required when enabling credential rotation so the original secret can be revoked."
    },
    AZURE_DEVOPS: {
      code: "The OAuth code to use to connect with Azure DevOps.",
      tenantId: "The Tenant ID to use to connect with Azure DevOps.",
      orgName: "The Organization name to use to connect with Azure DevOps.",
      clientId: "The Client ID to use to connect with Azure Client Secrets.",
      clientSecret: "The Client Secret to use to connect with Azure Client Secrets."
    },
    OCI: {
      userOcid: "The OCID (Oracle Cloud Identifier) of the user making the request.",
      tenancyOcid: "The OCID (Oracle Cloud Identifier) of the tenancy in Oracle Cloud Infrastructure.",
      region: "The region identifier in Oracle Cloud Infrastructure where the vault is located.",
      fingerprint: "The fingerprint of the public key uploaded to the user's API keys.",
      privateKey: "The private key content in PEM format used to sign API requests."
    },
    ONEPASS: {
      instanceUrl: "The URL of the 1Password Connect Server instance to authenticate with.",
      apiToken: "The API token used to access the 1Password Connect Server."
    },
    FLYIO: {
      accessToken: "The Access Token used to access fly.io."
    },
    TRIGGER_DEV: {
      apiKey: "The Personal Access Token (tr_pat_...) used to authenticate with Trigger.dev.",
      instanceUrl: "The URL of the Trigger.dev instance to connect to. Defaults to https://api.trigger.dev."
    },
    DEVIN: {
      apiKey: "The Devin service-user API key used to authenticate against the Devin v3 API."
    },
    DAYTONA: {
      apiKey: "The Daytona API key used to authenticate with Daytona. It must carry the manage:secrets permission.",
      organizationId:
        "The Daytona organization the API key belongs to. Resolved from Daytona when the connection is created."
    },
    GITLAB: {
      instanceUrl: "The GitLab instance URL to connect with.",
      accessToken: "The Access Token used to access GitLab.",
      code: "The OAuth code to use to connect with GitLab.",
      accessTokenType: "The type of token used to connect with GitLab."
    },
    BITBUCKET: {
      email: "The email used to access Bitbucket.",
      apiToken: "The API token used to access Bitbucket."
    },
    ZABBIX: {
      apiToken: "The API Token used to access Zabbix.",
      instanceUrl: "The Zabbix instance URL to connect with."
    },
    SERVICENOW: {
      instanceUrl: "The base URL of the ServiceNow instance to connect with, without a path or trailing slash.",
      username: "The User ID of the ServiceNow integration user.",
      password: "The password of the ServiceNow integration user."
    },
    RAILWAY: {
      apiToken: "The API token used to authenticate with Railway."
    },
    NORTHFLANK: {
      apiToken: "The API token used to authenticate with Northflank."
    },
    CHECKLY: {
      apiKey: "The API key used to authenticate with Checkly."
    },
    SUPABASE: {
      accessKey: "The Key used to access Supabase.",
      instanceUrl: "The URL used to access Supabase."
    },
    DIGITAL_OCEAN_APP_PLATFORM: {
      apiToken: "The API token used to authenticate with Digital Ocean App Platform."
    },
    NETLIFY: {
      accessToken: "The Access token used to authenticate with Netlify."
    },
    OKTA: {
      instanceUrl: "The URL used to access your Okta organization.",
      apiToken: "The API token used to authenticate with Okta."
    },
    AZURE_ADCS: {
      adcsUrl:
        "The HTTPS URL of the Azure ADCS instance to connect with (e.g., 'https://adcs.yourdomain.com/certsrv').",
      username: "The username used to access Azure ADCS (format: 'DOMAIN\\username' or '[email protected]').",
      password: "The password used to access Azure ADCS.",
      sslRejectUnauthorized:
        "Whether or not to reject unauthorized SSL certificates (true/false). Set to false only in test environments with self-signed certificates.",
      sslCertificate: "The SSL certificate (PEM format) to use for secure connection."
    },
    LARAVEL_FORGE: {
      apiToken: "The API token used to authenticate with Laravel Forge."
    },
    CHEF: {
      serverUrl: "The URL of the Chef server to connect to.",
      orgName: "The short name of the Chef organization to connect to.",
      userName: "The username used to access Chef.",
      privateKey: "The private key used to access Chef.",
      dataBagSecret:
        "The shared secret (the contents of your encrypted_data_bag_secret file) used to encrypt and decrypt Chef encrypted data bag items. Required by secret syncs that encrypt secrets or read a data bag item that's already encrypted."
    },
    OCTOPUS_DEPLOY: {
      instanceUrl: "The Octopus Deploy instance URL to connect to.",
      apiKey: "The API key used to authenticate with Octopus Deploy."
    },
    RUNDECK: {
      instanceUrl: "The Rundeck instance URL to connect to.",
      apiToken: "The API token used to authenticate with Rundeck."
    },
    PORTAINER: {
      instanceUrl: "The Portainer instance URL to connect to.",
      apiToken: "The API token used to authenticate with Portainer."
    },
    QOVERY: {
      accessToken: "The project access token used to authenticate with Qovery."
    },
    DATADOG: {
      url: "The Datadog site URL to connect to (e.g., 'https://api.datadoghq.com').",
      apiKey: "The Datadog API key used to authenticate.",
      applicationKey: "The Datadog Application key used to authenticate.",
      token: "The Datadog Service Access Token used to authenticate."
    },
    SSH: {
      host: "The hostname or IP address of the SSH server.",
      port: "The port number of the SSH server (default: 22).",
      username: "The username for SSH authentication.",
      authMethod: "The authentication method to use (password or ssh-key).",
      password: "The password for SSH authentication (required when authMethod is 'password').",
      privateKey: "The private key in PEM format for SSH authentication (required when authMethod is 'ssh-key').",
      passphrase: "The passphrase for the private key, if encrypted (optional, only for 'ssh-key' authMethod).",
      blockedUsers:
        "A comma-separated list of usernames that are blocked from being used in operations like secret rotation (e.g., 'root,admin,ubuntu')."
    },
    HPE_ILO: {
      hostname: "The hostname or IP address of the HPE iLO management interface (e.g., 'ilo.example.com').",
      port: "The HTTPS port of the HPE iLO Redfish API (default: 443).",
      username: "The iLO local account username used to authenticate with the Redfish API.",
      password: "The password for the iLO local account.",
      sslRejectUnauthorized:
        "Whether or not to reject untrusted SSL certificates (true/false). Set to false for iLO interfaces using self-signed certificates.",
      sslCertificate: "The CA certificate (PEM format) used to verify the iLO interface's TLS certificate."
    },
    JIRA: {
      instanceUrl:
        "The URL of your Jira site (e.g., 'https://your-domain.atlassian.net' for Jira Cloud or 'https://jira.example.com' for Jira Data Center).",
      email: "The email address of the Atlassian account that owns the API token.",
      apiToken: "The Atlassian API token used to authenticate with Jira Cloud.",
      personalAccessToken: "The personal access token used to authenticate with Jira Data Center.",
      sslRejectUnauthorized:
        "Whether or not to reject untrusted SSL certificates (true/false). Set to false for Jira Data Center sites using self-signed certificates.",
      sslCertificate: "The CA certificate (PEM format) used to verify the Jira Data Center site's TLS certificate."
    },
    DBT: {
      apiToken: "The API token used to authenticate with DBT.",
      accountId: "The account ID of your DBT account.",
      instanceUrl: "The base URL of your DBT instance."
    },
    SMB: {
      host: "The hostname or IP address of the Windows server.",
      port: "The SMB port (defaults to 445).",
      domain: "The Windows domain name (optional).",
      username: "The username for SMB authentication.",
      password: "The password for SMB authentication."
    },
    OPEN_ROUTER: {
      apiKey: "The OpenRouter Provisioning API key used to manage API keys."
    },
    OPENAI: {
      apiKey: "The OpenAI Admin API key used to manage project service accounts."
    },
    ANTHROPIC: {
      apiKey: "The Anthropic API key used to authenticate with the Anthropic API."
    },
    LITELLM: {
      apiKey: "The LiteLLM API key used to authenticate with the LiteLLM instance.",
      instanceUrl: "The base URL of your LiteLLM instance (e.g. https://litellm.example.com)."
    },
    KEEPER: {
      apiKey: "The API key generated for Keeper Commander Service Mode.",
      instanceUrl: "The base URL of your Keeper Commander Service Mode instance (e.g. https://keeper.company.com)."
    },
    FIREWORKS: {
      apiKey: "The Fireworks API key used to authenticate with the Fireworks API.",
      accountId: "The Fireworks account ID used to identify the Fireworks account."
    },
    CLOUD66: {
      accessToken: "The Personal Access Token used to authenticate with the Cloud 66 API."
    },
    CONVEX: {
      accessToken: "The Convex deploy key or access token used to authenticate with the Convex API.",
      instanceUrl: "The Convex API instance URL. Defaults to 'https://api.convex.dev' if not provided."
    },
    HASURA_CLOUD: {
      accessToken: "The Hasura Cloud access token used to authenticate with the Hasura Cloud GraphQL API."
    },
    OVH: {
      privateKey:
        "The PEM-encoded private key issued by OVH OKMS for client certificate authentication (including the -----BEGIN/END PRIVATE KEY----- markers).",
      certificate:
        "The PEM-encoded public certificate issued by OVH OKMS for client certificate authentication (including the -----BEGIN/END CERTIFICATE----- markers).",
      okmsDomain: "The OKMS base URL (e.g., 'https://ca-east-bhs.okms.ovh.net').",
      okmsId: "The OKMS instance identifier from the OVH Control Panel, used as a path segment in all API calls."
    },
    SNOWFLAKE: {
      account: "The Snowflake account identifier (e.g., xy12345.us-east-1).",
      username: "The username (login name) used to authenticate with Snowflake.",
      password: "The Programmatic Access Token used to authenticate with Snowflake."
    },
    VENAFI: {
      apiKey: "The API key used to authenticate with Venafi TLS Protect Cloud.",
      region: "The region of your Venafi TLS Protect Cloud instance (e.g., 'us', 'eu')."
    },
    VENAFI_TPP: {
      tppUrl: "The HTTPS URL of the Venafi TPP instance (e.g., 'https://tpp.example.com'). Must use HTTPS.",
      clientId:
        "The OAuth client ID registered in the Venafi TPP API Integration. Used for token-based authentication.",
      username:
        "The username used to authenticate with Venafi TPP. Supports formats: 'DOMAIN\\\\username', '[email protected]', or local usernames.",
      password: "The password used to authenticate with Venafi TPP."
    },
    SPACELIFT: {
      apiUrl: "The Spacelift API URL to connect with (e.g., 'https://mycorp.app.spacelift.io').",
      apiKeyId: "The API Key ID used to authenticate with Spacelift.",
      apiKeySecret: "The API Key Secret used to authenticate with Spacelift."
    },
    S3_COMPATIBLE: {
      endpoint:
        "The S3 API endpoint of the storage provider, without a bucket name: 'https://s3.<region>.amazonaws.com' (AWS S3), 'https://<account-id>.r2.cloudflarestorage.com' (Cloudflare R2), 'https://storage.googleapis.com' (Google Cloud Storage), 'https://<namespace>.compat.objectstorage.<region>.oraclecloud.com' (OCI Object Storage), or a hostname allowed in the Server Console.",
      accessKeyId: "The Access Key ID used to authenticate with the storage provider.",
      secretAccessKey: "The Secret Access Key used to authenticate with the storage provider.",
      region:
        "The region to sign requests for when the endpoint is a hostname allowed in the Server Console. Defaults to 'us-east-1'. The built-in providers take the region from the endpoint."
    }
  },
  PALO_ALTO_NETWORKS_LOOKUPS: {
    connectionId: "The ID of the Palo Alto Networks Connection to read from.",
    template: "The Panorama template to read from. Leave it out when the connection points to a firewall."
  }
};

export const SecretSyncs = {
  LIST: (destination?: SecretSync) => ({
    projectId: `The ID of the project to list ${destination ? SECRET_SYNC_NAME_MAP[destination] : "Secret"} Syncs from.`
  }),
  GET_BY_ID: (destination: SecretSync) => ({
    syncId: `The ID of the ${SECRET_SYNC_NAME_MAP[destination]} Sync to retrieve.`
  }),
  GET_BY_NAME: (destination: SecretSync) => ({
    syncName: `The name of the ${SECRET_SYNC_NAME_MAP[destination]} Sync to retrieve.`,
    projectId: `The ID of the project the ${SECRET_SYNC_NAME_MAP[destination]} Sync is associated with.`
  }),
  CREATE: (destination: SecretSync) => {
    const destinationName = SECRET_SYNC_NAME_MAP[destination];
    return {
      name: `The name of the ${destinationName} Sync to create. Must be slug-friendly.`,
      description: `An optional description for the ${destinationName} Sync.`,
      projectId: "The ID of the project to create the sync in.",
      environment: `The slug of the project environment to sync secrets from.`,
      secretPath: `The folder path to sync secrets from.`,
      connectionId: `The ID of the ${
        APP_CONNECTION_NAME_MAP[SECRET_SYNC_CONNECTION_MAP[destination]]
      } Connection to use for syncing.`,
      isAutoSyncEnabled: `Whether secrets should be automatically synced when changes occur at the source location or not.`,
      syncOptions: "Optional parameters to modify how secrets are synced."
    };
  },
  UPDATE: (destination: SecretSync) => {
    const destinationName = SECRET_SYNC_NAME_MAP[destination];
    return {
      syncId: `The ID of the ${destinationName} Sync to be updated.`,
      connectionId: `The updated ID of the ${
        APP_CONNECTION_NAME_MAP[SECRET_SYNC_CONNECTION_MAP[destination]]
      } Connection to use for syncing.`,
      name: `The updated name of the ${destinationName} Sync. Must be slug-friendly.`,
      environment: `The updated slug of the project environment to sync secrets from.`,
      secretPath: `The updated folder path to sync secrets from.`,
      description: `The updated description of the ${destinationName} Sync.`,
      isAutoSyncEnabled: `Whether secrets should be automatically synced when changes occur at the source location or not.`,
      syncOptions: "Optional parameters to modify how secrets are synced."
    };
  },
  DELETE: (destination: SecretSync) => ({
    syncId: `The ID of the ${SECRET_SYNC_NAME_MAP[destination]} Sync to be deleted.`,
    removeSecrets: `Whether previously synced secrets should be removed prior to deletion.`
  }),
  SYNC_SECRETS: (destination: SecretSync) => ({
    syncId: `The ID of the ${SECRET_SYNC_NAME_MAP[destination]} Sync to trigger a sync for.`
  }),
  IMPORT_SECRETS: (destination: SecretSync) => ({
    syncId: `The ID of the ${SECRET_SYNC_NAME_MAP[destination]} Sync to trigger importing secrets for.`,
    importBehavior: `Specify whether Infisical should prioritize secret values from Infisical or ${SECRET_SYNC_NAME_MAP[destination]}.`
  }),
  REMOVE_SECRETS: (destination: SecretSync) => ({
    syncId: `The ID of the ${SECRET_SYNC_NAME_MAP[destination]} Sync to trigger removing secrets for.`
  }),
  SYNC_OPTIONS: (destination: SecretSync) => {
    const destinationName = SECRET_SYNC_NAME_MAP[destination];
    return {
      initialSyncBehavior: `Specify how Infisical should resolve the initial sync to the ${destinationName} destination.`,
      keySchema: `Specify the format to use for structuring secret keys in the ${destinationName} destination.`,
      disableSecretDeletion: `Enable this flag to prevent removal of secrets from the ${destinationName} destination when syncing.`,
      includeAllSubFolders: `Whether to sync secrets from folders beneath the source path as well.`
    };
  },
  ADDITIONAL_SYNC_OPTIONS: {
    AWS_PARAMETER_STORE: {
      keyId: "The AWS KMS key ID or alias to use when encrypting parameters synced by Infisical.",
      tags: "Optional resource tags to add to parameters synced by Infisical.",
      syncSecretMetadataAsTags: `Whether Infisical secret metadata should be added as resource tags to parameters synced by Infisical.`
    },
    AWS_SECRETS_MANAGER: {
      keyId: "The AWS KMS key ID or alias to use when encrypting parameters synced by Infisical.",
      tags: "Optional tags to add to secrets synced by Infisical.",
      syncSecretMetadataAsTags: `Whether Infisical secret metadata should be added as tags to secrets synced by Infisical.`
    },
    RENDER: {
      autoRedeployServices:
        "Whether Infisical should automatically redeploy the configured Render service upon secret changes."
    },
    FLYIO: {
      autoRedeploy: "Whether Infisical should automatically redeploy the configured Fly.io app upon secret changes."
    },
    TRIGGER_DEV: {
      markAsSecret:
        "Whether synced variables should be marked as secret (redacted) environment variables in Trigger.dev."
    },
    AZURE_KEY_VAULT: {
      disableCertificateImport:
        "Whether Infisical should skip importing certificate objects from Azure Key Vault when syncing secrets."
    },
    CLOUDFLARE_WORKERS: {
      syncNonSecretBindings:
        "Whether Infisical should also sync plaintext and JSON variable bindings in addition to secret bindings. Only applies when variableType is secret_text or omitted."
    },
    SPACELIFT: {
      writeOnly:
        "Whether secrets should be marked as secret in Spacelift. Secret values are only available to Runs and Tasks and are not accessible in the web GUI or through the API."
    }
  },
  DESTINATION_CONFIG: {
    AWS_PARAMETER_STORE: {
      region: "The AWS region to sync secrets to.",
      path: "The Parameter Store path to sync secrets to."
    },
    AWS_SECRETS_MANAGER: {
      region: "The AWS region to sync secrets to.",
      mappingBehavior: "How secrets from Infisical should be mapped to AWS Secrets Manager; one-to-one or many-to-one.",
      secretName: "The secret name in AWS Secrets Manager to sync to when using mapping behavior many-to-one."
    },
    GITHUB: {
      scope: "The GitHub scope that secrets should be synced to",
      org: "The name of the GitHub organization.",
      owner: "The name of the GitHub account owner of the repository.",
      repo: "The name of the GitHub repository.",
      env: "The name of the GitHub environment.",
      secretType:
        "The type of GitHub secret to sync to: actions, dependabot, or codespaces. Defaults to actions. The repository-environment scope only supports actions, and codespaces is not available on GitHub Enterprise Server."
    },
    AZURE_ENTRA_ID_SCIM: {
      servicePrincipalId:
        "The Object ID of the Azure Entra ID Enterprise Application service principal to sync the SCIM token to.",
      servicePrincipalDisplayName: "The display name of the Azure Entra ID Enterprise Application service principal."
    },
    AZURE_KEY_VAULT: {
      vaultBaseUrl: "The base URL of the Azure Key Vault to sync secrets to. Example: https://example.vault.azure.net/",
      tenantId: "The Tenant ID to use to connect with Azure Client Secrets.",
      clientId: "The Client ID to use to connect with Azure Client Secrets.",
      clientSecret: "The Client Secret to use to connect with Azure Client Secrets."
    },
    AZURE_APP_CONFIGURATION: {
      configurationUrl:
        "The URL of the Azure App Configuration to sync secrets to. Example: https://example.azconfig.io/",
      label: "An optional label to assign to secrets created in Azure App Configuration.",
      tenantId: "The Tenant ID to use to connect with Azure Client Secrets.",
      clientId: "The Client ID to use to connect with Azure Client Secrets.",
      clientSecret: "The Client Secret to use to connect with Azure Client Secrets."
    },
    AZURE_DEVOPS: {
      devopsProjectId: "The ID of the Azure DevOps project to sync secrets to.",
      devopsProjectName: "The name of the Azure DevOps project to sync secrets to."
    },
    GCP: {
      scope: "The Google project scope that secrets should be synced to.",
      projectId: "The ID of the Google project secrets should be synced to.",
      locationId: 'The ID of the Google project location secrets should be synced to (ie "us-west4").',
      userReplicaLocationIds:
        'The Google project locations to replicate secrets to under user-managed replication (global scope, ie ["us-west4"]).'
    },
    DATABRICKS: {
      scope: "The Databricks secret scope that secrets should be synced to."
    },
    CAMUNDA: {
      scope: "The Camunda scope that secrets should be synced to.",
      clusterUUID: "The UUID of the Camunda cluster that secrets should be synced to."
    },
    HUMANITEC: {
      app: "The ID of the Humanitec app to sync secrets to.",
      org: "The ID of the Humanitec org to sync secrets to.",
      env: "The ID of the Humanitec environment to sync secrets to.",
      scope: "The Humanitec scope that secrets should be synced to."
    },
    TERRAFORM_CLOUD: {
      org: "The ID of the Terraform Cloud org to sync secrets to.",
      variableSetName: "The name of the Terraform Cloud Variable Set to sync secrets to.",
      variableSetId: "The ID of the Terraform Cloud Variable Set to sync secrets to.",
      workspaceName: "The name of the Terraform Cloud workspace to sync secrets to.",
      workspaceId: "The ID of the Terraform Cloud workspace to sync secrets to.",
      scope: "The Terraform Cloud scope that secrets should be synced to.",
      category: "The Terraform Cloud category that secrets should be synced to."
    },
    ONA: {
      projectId: "The Ona project ID to sync secrets to.",
      projectName: "An optional display name for the Ona project."
    },
    VERCEL: {
      app: "The ID of the Vercel app to sync secrets to.",
      appName: "The name of the Vercel app to sync secrets to.",
      env: "The ID of the Vercel environment to sync secrets to.",
      branch: "The branch to sync preview secrets to.",
      teamId: "The ID of the Vercel team to sync secrets to.",
      teamName:
        "The name of the team to sync the secrets to. This is an optional field only intended for display purposes.",
      targetEnvironments:
        "An optional array of Vercel default environments (development, preview, production) to add shared environment variables to.",
      applyToAllCustomEnvironments:
        "Whether to apply shared environment variables to all custom environments in the team.",
      targetProjects: "An optional array of Vercel projects to add shared environment variables to.",
      sensitive:
        "Whether to create Vercel environment variables as Sensitive (cannot be read back). Not allowed when targeting the Development environment."
    },
    QOVERY: {
      organizationId: "The ID of the Qovery organization to sync secrets to.",
      organizationName: "The name of the Qovery organization to sync secrets to.",
      projectId: "The ID of the Qovery project to sync secrets to.",
      projectName: "The name of the Qovery project to sync secrets to.",
      environmentId:
        "The ID of the Qovery environment to sync secrets to. When omitted, secrets are synced at the project level.",
      environmentName: "The name of the Qovery environment to sync secrets to.",
      variableType:
        "Whether to sync values as Qovery environment secrets or environment variables. Environment variables expose their value; secrets do not."
    },
    LARAVEL_FORGE: {
      orgSlug: "The slug of the Laravel Forge org to sync secrets to.",
      orgName: "The name of the Laravel Forge org to sync secrets to.",
      serverId: "The ID of the Laravel Forge server to sync secrets to.",
      serverName: "The name of the Laravel Forge server to sync secrets to.",
      siteId: "The ID of the Laravel Forge site to sync secrets to.",
      siteName: "The name of the Laravel Forge site to sync secrets to."
    },
    OCTOPUS_DEPLOY: {
      spaceId: "The ID of the Octopus Deploy space to sync secrets to.",
      spaceName: "The name of the Octopus Deploy space to sync secrets to.",
      projectId: "The ID of the Octopus Deploy project to sync secrets to.",
      projectName: "The name of the Octopus Deploy project to sync secrets to.",
      scope: "The Octopus Deploy scope that secrets should be synced to.",
      scopeValues: "The Octopus Deploy scope values that secrets should be synced to."
    },
    WINDMILL: {
      workspace: "The Windmill workspace to sync secrets to.",
      path: "The Windmill workspace path to sync secrets to."
    },
    HC_VAULT: {
      mount: "The Hashicorp Vault Secrets Engine Mount to sync secrets to.",
      path: "The Hashicorp Vault path to sync secrets to."
    },
    OVH: {
      path: "The path in OVH OKMS where secrets will be stored as key/value pairs."
    },
    TEAMCITY: {
      project: "The TeamCity project to sync secrets to.",
      buildConfig: "The TeamCity build configuration to sync secrets to."
    },
    OCI_VAULT: {
      compartmentOcid: "The OCID (Oracle Cloud Identifier) of the compartment where the vault is located.",
      vaultOcid: "The OCID (Oracle Cloud Identifier) of the vault to sync secrets to.",
      keyOcid: "The OCID (Oracle Cloud Identifier) of the encryption key to use when creating secrets in the vault."
    },
    ONEPASS: {
      vaultId: "The ID of the 1Password vault to sync secrets to.",
      valueLabel: "The label of the entry that holds the secret value."
    },
    KEEPER: {
      folderUid: "The UID of the Keeper Password Manager shared folder to sync secrets to.",
      folderName: "The name of the Keeper Password Manager shared folder to sync secrets to."
    },
    HEROKU: {
      app: "The ID of the Heroku app to sync secrets to.",
      appName: "The name of the Heroku app to sync secrets to."
    },
    RENDER: {
      serviceId: "The ID of the Render service to sync secrets to.",
      environmentGroupId: "The ID of the Render environment group to sync secrets to.",
      scope: "The Render scope that secrets should be synced to.",
      type: "The Render resource type to sync secrets to."
    },
    FLYIO: {
      appId: "The ID of the Fly.io app to sync secrets to."
    },
    TRIGGER_DEV: {
      projectRef: "The reference of the Trigger.dev project to sync secrets to.",
      environment: "The Trigger.dev environment to sync secrets to."
    },
    DEVIN: {
      orgId: "The Devin organization ID to sync secrets to."
    },
    GITLAB: {
      projectId: "The GitLab Project ID to sync secrets to.",
      projectName: "The GitLab Project Name to sync secrets to.",
      groupId: "The GitLab Group ID to sync secrets to.",
      groupName: "The GitLab Group Name to sync secrets to.",
      scope: "The GitLab scope that secrets should be synced to. (default: project)",
      targetEnvironment: "The GitLab environment scope that secrets should be synced to. (default: *)",
      shouldProtectSecrets: "Whether variables should be protected",
      shouldMaskSecrets: "Whether variables should be masked in logs",
      shouldHideSecrets: "Whether variables should be hidden"
    },
    CLOUDFLARE_PAGES: {
      projectName: "The name of the Cloudflare Pages project to sync secrets to.",
      environment: "The environment of the Cloudflare Pages project to sync secrets to.",
      variableType:
        "The type of environment variable to sync secrets as: secret_text (default) or plain_text. If a secret already exists in the environment as the other type, the sync fails and nothing is changed. Syncs created before this option existed have no type and skip those secrets instead. Infisical only deletes variables of this type."
    },
    CLOUDFLARE_WORKERS: {
      scriptId: "The ID of the Cloudflare Workers script to sync secrets to.",
      variableType:
        "The type of variable to sync secrets as: secret_text (default), plain_text or json. If a secret already exists on the Worker as a different type, the sync fails and nothing is changed, except that with syncNonSecretBindings on, a secret_text sync updates existing plaintext and JSON variables as they are. Syncs created before this option existed have no type and skip those secrets instead. Infisical only deletes variables of this type."
    },
    CLOUDFLARE_SECRETS_STORE: {
      storeId: "The ID of the Cloudflare Secrets Store to sync secrets to.",
      storeName: "An optional display name for the Cloudflare Secrets Store.",
      scopes:
        "The Cloudflare services allowed to use the synced secrets. Applied every time a secret is written, so it replaces scopes set in Cloudflare."
    },
    ZABBIX: {
      scope: "The Zabbix scope that secrets should be synced to.",
      hostId: "The ID of the Zabbix host to sync secrets to.",
      hostName: "The name of the Zabbix host to sync secrets to.",
      macroType: "The type of macro to sync secrets to. (0: Text, 1: Secret)"
    },
    RAILWAY: {
      projectId: "The ID of the Railway project to sync secrets to.",
      projectName: "The name of the Railway project to sync secrets to.",
      environmentId: "The Railway environment to sync secrets to.",
      environmentName: "The Railway environment to sync secrets to.",
      serviceId: "The Railway service that secrets should be synced to.",
      serviceName: "The Railway service that secrets should be synced to."
    },
    HASURA_CLOUD: {
      projectId: "The ID of the Hasura Cloud project to sync secrets to.",
      projectName: "The name of the Hasura Cloud project to sync secrets to."
    },
    CHECKLY: {
      accountId: "The ID of the Checkly account to sync secrets to."
    },
    SUPABASE: {
      projectId: "The ID of the Supabase project to sync secrets to.",
      projectName: "The name of the Supabase project to sync secrets to."
    },
    BITBUCKET: {
      workspaceSlug: "The Bitbucket Workspace slug to sync secrets to.",
      repositorySlug: "The Bitbucket Repository slug to sync secrets to.",
      environmentId: "The Bitbucket Deployment Environment uuid to sync secrets to."
    },
    NETLIFY: {
      accountId: "The ID of the Netlify account to sync secrets to.",
      accountName: "The name of the Netlify account to sync secrets to.",
      siteName: "The name of the Netlify site to sync secrets to.",
      siteId: "The ID of the Netlify site to sync secrets to.",
      context: "The Netlify context to sync secrets to."
    },
    CHEF: {
      dataBagName: "The name of the Chef data bag to sync secrets to.",
      dataBagItemName: "The name of the Chef data bag item to sync secrets to.",
      shouldEncryptSecrets:
        "Whether to write the data bag item as a Chef encrypted data bag item (version 3), using the data bag secret on the Chef connection."
    },
    CLOUD66: {
      stackId: "The unique identifier (uid) of the Cloud 66 stack to sync secrets to.",
      stackName: "The name of the Cloud 66 stack to sync secrets to."
    },
    NORTHFLANK: {
      projectId: "The ID of the Northflank project to sync secrets to.",
      projectName: "The name of the Northflank project to sync secrets to.",
      secretGroupId: "The ID of the Northflank secret group to sync secrets to.",
      secretGroupName: "The name of the Northflank secret group to sync secrets to."
    },
    CIRCLECI: {
      orgName: "The CircleCI organization name to sync secrets to.",
      projectId: "The CircleCI project ID to sync secrets to.",
      projectName: "The CircleCI project name to sync secrets to."
    },
    EXTERNAL_INFISICAL: {
      projectId: "The ID of the project on the external Infisical instance to sync secrets to.",
      environment: "The environment slug on the external Infisical instance to sync secrets to.",
      secretPath: "The secret path on the external Infisical instance to sync secrets to."
    },
    TRAVIS_CI: {
      repositoryId: "The ID of the Travis CI repository to sync secrets to.",
      repositorySlug: "The slug (owner/repo) of the Travis CI repository to sync secrets to.",
      branch:
        "The branch of the Travis CI repository to sync secrets to. If omitted, secrets sync to the repository-level scope."
    },
    SNOWFLAKE: {
      database: "The name of the Snowflake database to sync secrets to.",
      schema: "The name of the Snowflake schema (within the database) to sync secrets to."
    },
    SPACELIFT: {
      contextId: "The ID of the Spacelift context to sync secrets to.",
      contextName: "The name of the Spacelift context to sync secrets to.",
      configType:
        "The type of config element to create in Spacelift. Either 'environment-variable' for individual environment variables or 'file-mount' for a single .env file mount.",
      mountPath:
        "The file path for the mounted file relative to /mnt/workspace/. Required when configType is 'file-mount'. When fileMountFormat is 'secret-per-file', this is the directory path. Example: 'secrets.env' or 'secrets/'.",
      fileMountFormat:
        "The format for file mount config elements. Either 'dot-env' (default) to store all secrets in a single .env file, or 'secret-per-file' to create a separate file mount per secret under the mount path directory."
    },
    PORTAINER: {
      environmentId: "The ID of the Portainer environment (endpoint) that hosts the stack.",
      stackId: "The ID of the Portainer stack to sync secrets to."
    }
  }
};

export const SecretRotations = {
  LIST: (type?: SecretRotation) => ({
    projectId: `The ID of the project to list ${type ? SECRET_ROTATION_NAME_MAP[type] : "Secret"} Rotations from.`
  }),
  GET_BY_ID: (type: SecretRotation) => ({
    rotationId: `The ID of the ${SECRET_ROTATION_NAME_MAP[type]} Rotation to retrieve.`
  }),
  GET_GENERATED_CREDENTIALS_BY_ID: (type: SecretRotation) => ({
    rotationId: `The ID of the ${SECRET_ROTATION_NAME_MAP[type]} Rotation to retrieve the generated credentials for.`
  }),
  GET_BY_NAME: (type: SecretRotation) => ({
    rotationName: `The name of the ${SECRET_ROTATION_NAME_MAP[type]} Rotation to retrieve.`,
    projectId: `The ID of the project the ${SECRET_ROTATION_NAME_MAP[type]} Rotation is located in.`,
    secretPath: `The secret path the ${SECRET_ROTATION_NAME_MAP[type]} Rotation is located at.`,
    environment: `The environment the ${SECRET_ROTATION_NAME_MAP[type]} Rotation is located in.`
  }),
  CREATE: (type: SecretRotation) => {
    const destinationName = SECRET_ROTATION_NAME_MAP[type];
    return {
      name: `The name of the ${destinationName} Rotation to create. Must be slug-friendly.`,
      description: `An optional description for the ${destinationName} Rotation.`,
      projectId: "The ID of the project to create the rotation in.",
      environment: `The slug of the project environment to create the rotation in.`,
      secretPath: `The secret path of the project to create the rotation in.`,
      connectionId: `The ID of the ${getSecretRotationConnectionApps(type)
        .map((app) => APP_CONNECTION_NAME_MAP[app])
        .join(" or ")} Connection to use for rotation.`,
      isAutoRotationEnabled: `Whether secrets should be automatically rotated when the specified rotation interval has elapsed.`,
      rotationInterval: `The interval, in days, to automatically rotate secrets.`,
      rotateAtUtc: `The hours and minutes rotation should occur at in UTC. Defaults to Midnight (00:00) UTC.`
    };
  },
  UPDATE: (type: SecretRotation) => {
    const typeName = SECRET_ROTATION_NAME_MAP[type];
    return {
      rotationId: `The ID of the ${typeName} Rotation to be updated.`,
      name: `The updated name of the ${typeName} Rotation. Must be slug-friendly.`,
      description: `The updated description of the ${typeName} Rotation.`,
      isAutoRotationEnabled: `Whether secrets should be automatically rotated when the specified rotation interval has elapsed.`,
      rotationInterval: `The updated interval, in days, to automatically rotate secrets.`,
      rotateAtUtc: `The updated hours and minutes rotation should occur at in UTC.`
    };
  },
  DELETE: (type: SecretRotation) => ({
    rotationId: `The ID of the ${SECRET_ROTATION_NAME_MAP[type]} Rotation to be deleted.`,
    deleteSecrets: `Whether the mapped secrets belonging to this rotation should be deleted.`,
    revokeGeneratedCredentials: `Whether the generated credentials associated with this rotation should be revoked.`
  }),
  ROTATE: (type: SecretRotation) => ({
    rotationId: `The ID of the ${SECRET_ROTATION_NAME_MAP[type]} Rotation to rotate generated credentials for.`
  }),
  RECONCILE: {
    rotationId: "The ID of the SSH Password Rotation to reconcile credentials for."
  },
  CHECK_CREDENTIALS: (type: SecretRotation) => ({
    rotationId: `The ID of the ${SECRET_ROTATION_NAME_MAP[type]} Rotation to check active credentials for.`
  }),
  PARAMETERS: {
    SQL_CREDENTIALS: {
      username1:
        "The username of the first login to rotate passwords for. This user must already exists in your database.",
      username2:
        "The username of the second login to rotate passwords for. This user must already exists in your database.",
      rotationStatement: "The SQL template query used for rotation."
    },
    AUTH0_CLIENT_SECRET: {
      clientId: "The client ID of the Auth0 Application to rotate the client secret for."
    },
    AZURE_CLIENT_SECRET: {
      objectId: "The ID of the Azure Application to rotate the client secret for.",
      appName: "The name of the Azure Application to rotate the client secret for.",
      clientId: "The client ID of the Azure Application to rotate the client secret for."
    },
    LDAP_PASSWORD: {
      dn: "The Distinguished Name (DN) or User Principal Name (UPN) of the principal to rotate the password for.",
      rotationMethod:
        'Whether the rotation should be performed by the LDAP "connection-principal" or the "target-principal" (defaults to \'connection-principal\').',
      password: 'The password of the provided principal if "parameters.rotationMethod" is set to "target-principal".'
    },
    UNIX_LINUX_LOCAL_ACCOUNT: {
      username: "The username of the Unix/Linux user account to rotate the password for.",
      rotationMethod:
        'Whether the rotation should be performed using "login-as-target" (the target user\'s own credentials) or "login-as-root" (the SSH connection\'s admin credentials). Defaults to "login-as-target".',
      password:
        'The current password of the target user. Required if "parameters.rotationMethod" is set to "login-as-target".',
      useSudo: "If true, uses sudo when executing the password rotation command. Defaults to false."
    },
    WINDOWS_LOCAL_ACCOUNT: {
      username: "The username of the Windows user account to rotate the password for.",
      rotationMethod:
        'Whether the rotation should be performed using "login-as-target" (the target user\'s own credentials) or "login-as-root" (the SSH connection\'s admin credentials). Defaults to "login-as-target".',
      password:
        'The current password of the target user. Required if "parameters.rotationMethod" is set to "login-as-target".'
    },
    HP_ILO: {
      username: "The username of the HP iLO account to rotate the password for.",
      rotationMethod:
        'Whether the rotation should be performed using "login-as-target" (the target user\'s own credentials) or "login-as-root" (the SSH connection\'s admin credentials). Defaults to "login-as-root".',
      password:
        'The current password of the target user. Required if "parameters.rotationMethod" is set to "login-as-target".'
    },
    GENERAL: {
      PASSWORD_REQUIREMENTS: {
        base: "The password requirements to use when generating the new password.",
        length: "The length of the password to generate.",
        required: {
          digits: "The amount of digits to require in the generated password.",
          lowercase: "The amount of lowercase characters to require in the generated password.",
          uppercase: "The amount of uppercase characters to require in the generated password.",
          symbols: "The amount of symbols to require in the generated password."
        },
        allowedSymbols: 'The allowed symbols to use in the generated password (defaults to "-_.~!*").'
      }
    },
    AWS_IAM_USER_SECRET: {
      userName: "The name of the client to rotate credentials for.",
      region: "The AWS region the client is present in."
    },
    OKTA_CLIENT_SECRET: {
      clientId: "The ID of the Okta Application to rotate the client secret for."
    },
    REDIS_CREDENTIALS: {
      permissionScope: "The ACL permission scope to assign to the issued Redis users."
    },
    MONGODB_CREDENTIALS: {
      username1:
        "The username of the first MongoDB user to rotate passwords for. This user must already exist in your database.",
      username2:
        "The username of the second MongoDB user to rotate passwords for. This user must already exist in your database."
    },
    DATABRICKS_SERVICE_PRINCIPAL_SECRET: {
      servicePrincipalId: "The ID of the Databricks Service Principal to rotate the OAuth secret for.",
      servicePrincipalName: "The name of the Databricks Service Principal to rotate the OAuth secret for.",
      clientId: "The client ID of the Databricks Service Principal to rotate the OAuth secret for."
    },
    DATABRICKS_SERVICE_ACCOUNT_SECRET: {
      servicePrincipalId: "The ID of the Databricks Service Principal to rotate the OAuth secret for.",
      servicePrincipalName: "The name of the Databricks Service Principal to rotate the OAuth secret for.",
      clientId: "The client ID of the Databricks Service Principal to rotate the OAuth secret for."
    },
    DBT_SERVICE_TOKEN: {
      permissionGrants: "The permission grants to apply to the service token.",
      tokenName: "The name of the service token to create."
    },
    OPEN_ROUTER_API_KEY: {
      name: "The name for the generated OpenRouter API key.",
      workspaceId:
        "The optional ID of the OpenRouter workspace to create API keys in. If omitted, OpenRouter creates keys in the account's Default workspace.",
      limit: "The optional spending limit in USD for the generated API key.",
      limitReset: "The type of limit reset for the API key (daily, weekly, monthly, or null for no reset).",
      includeByokInLimit:
        "Whether to include BYOK (Bring Your Own Key) usage in the spending limit. When enabled, usage from your own provider keys counts toward this key's limit. See OpenRouter BYOK docs for details."
    },
    LITELLM_API_KEY: {
      name: "The name for the generated LiteLLM API key. Infisical appends a timestamp to keep each rotated key unique and record its creation time.",
      userId: "The ID of the LiteLLM user to associate the generated key with.",
      teamId: "The ID of the LiteLLM team to associate the generated key with.",
      models: "The list of model names the generated key is allowed to access. An empty list allows all models.",
      additionalOptions:
        "A JSON object of additional LiteLLM /key/generate options (e.g. max_budget, tpm_limit, metadata). Reserved fields (key_alias, auto_rotate, rotation_interval, duration, send_invite_email, key_type, user_id, team_id, models) are managed by Infisical or set via dedicated fields and cannot be set here."
    },
    OPENAI_SERVICE_ACCOUNT: {
      projectId: "The ID of the OpenAI project to create service accounts in.",
      name: "The name for the generated OpenAI service account."
    },
    SUPABASE_API_KEY: {
      projectRef: "The reference ID of the Supabase project to rotate the API key for.",
      keyType: "The type of the API key to rotate (e.g. publishable, secret)."
    },
    SALESFORCE_OAUTH_CREDENTIALS: {
      appId: "The identifier of the Salesforce External Client App to rotate the consumer secret for.",
      appName: "The developer name of the Salesforce External Client App to rotate the consumer secret for."
    },
    DATADOG_APPLICATION_KEY_SECRET: {
      serviceAccountId: "The ID of the Datadog service account to rotate the application key for."
    },
    DATADOG_API_KEY: {
      name: "The name for the generated Datadog API key."
    },
    CLOUDFLARE_API_TOKEN: {
      name: "The name for the generated Cloudflare API token.",
      policies:
        "The access policies to attach to the generated Cloudflare API token. Each policy scopes a set of permission groups to the entire account, to all zones in the account, or to a specific set of zones.",
      allowedIps: "The IP addresses or CIDR blocks the generated Cloudflare API token is restricted to.",
      disallowedIps: "The IP addresses or CIDR blocks the generated Cloudflare API token is denied from."
    },
    CLOUDFLARE_R2_ACCESS_KEY: {
      name: "The name for the generated Cloudflare API token that backs the R2 access key.",
      buckets:
        "The R2 buckets the generated access key is scoped to. Each entry is a bucket name plus its jurisdiction (default, eu, or fedramp).",
      accessLevel:
        "The level of access the generated key has over the selected buckets (object-read for read and list, object-read-write to also write).",
      allowedIps: "The IP addresses or CIDR blocks the generated R2 access key is restricted to.",
      disallowedIps: "The IP addresses or CIDR blocks the generated R2 access key is denied from."
    },
    CONVEX_ACCESS_KEY: {
      namePrefix: "A prefix to use when naming the generated Convex access key."
    },
    FIREWORKS_API_KEY: {
      serviceAccountUserId: "The user ID of the Fireworks service account to create the API key for."
    },
    SNOWFLAKE_USER_KEY_PAIR: {
      username:
        "The Snowflake user whose RSA key pair will be rotated. If the user does not exist, it is created as a key-pair-only SERVICE user.",
      modulusLength: "The modulus length in bits of the generated RSA key pairs. Defaults to 2048."
    },
    STRIPE_API_KEY: {
      keyName:
        "The name for each Stripe API key this rotation creates, up to 80 characters. Infisical appends a timestamp so the old and new key can be told apart. Defaults to 'infisical-managed'.",
      permissions:
        "The permissions granted to the generated Stripe API key. Stripe has no wildcard permission, so this is the full list of what the key may do."
    },
    GCP_SERVICE_ACCOUNT_KEY: {
      serviceAccountEmail:
        "The email of the GCP service account whose keys will be rotated, e.g. [email protected]. The connection's service account needs the Service Account Key Admin role (roles/iam.serviceAccountKeyAdmin) on it."
    }
  },
  SECRETS_MAPPING: {
    REDIS_CREDENTIALS: {
      username: "The name of the secret that the username will be mapped to.",
      password: "The name of the secret that the rotated password will be mapped to."
    },
    SQL_CREDENTIALS: {
      username: "The name of the secret that the active username will be mapped to.",
      password: "The name of the secret that the generated password will be mapped to."
    },
    AUTH0_CLIENT_SECRET: {
      clientId: "The name of the secret that the client ID will be mapped to.",
      clientSecret: "The name of the secret that the rotated client secret will be mapped to."
    },
    AZURE_CLIENT_SECRET: {
      clientId: "The name of the secret that the client ID will be mapped to.",
      clientSecret: "The name of the secret that the rotated client secret will be mapped to."
    },
    LDAP_PASSWORD: {
      dn: "The name of the secret that the Distinguished Name (DN) or User Principal Name (UPN) of the principal will be mapped to.",
      password: "The name of the secret that the rotated password will be mapped to."
    },
    UNIX_LINUX_LOCAL_ACCOUNT: {
      username: "The name of the secret that the username will be mapped to.",
      password: "The name of the secret that the rotated password will be mapped to."
    },
    WINDOWS_LOCAL_ACCOUNT: {
      username: "The name of the secret that the username will be mapped to.",
      password: "The name of the secret that the rotated password will be mapped to."
    },
    HP_ILO: {
      username: "The name of the secret that the username will be mapped to.",
      password: "The name of the secret that the rotated password will be mapped to."
    },
    AWS_IAM_USER_SECRET: {
      accessKeyId: "The name of the secret that the access key ID will be mapped to.",
      secretAccessKey: "The name of the secret that the rotated secret access key will be mapped to."
    },
    OKTA_CLIENT_SECRET: {
      clientId: "The name of the secret that the client ID will be mapped to.",
      clientSecret: "The name of the secret that the rotated client secret will be mapped to."
    },
    MONGODB_CREDENTIALS: {
      username: "The name of the secret that the active username will be mapped to.",
      password: "The name of the secret that the generated password will be mapped to."
    },
    DATABRICKS_SERVICE_PRINCIPAL_SECRET: {
      clientId: "The name of the secret that the client ID will be mapped to.",
      clientSecret: "The name of the secret that the rotated OAuth client secret will be mapped to."
    },
    DATABRICKS_SERVICE_ACCOUNT_SECRET: {
      clientId: "The name of the secret that the client ID will be mapped to.",
      clientSecret: "The name of the secret that the rotated OAuth client secret will be mapped to."
    },
    DBT_SERVICE_TOKEN: {
      serviceToken: "The name of the secret that the service token will be mapped to."
    },
    OPEN_ROUTER_API_KEY: {
      apiKey: "The name of the secret that the rotated OpenRouter API key will be mapped to."
    },
    LITELLM_API_KEY: {
      apiKey: "The name of the secret that the rotated LiteLLM API key will be mapped to."
    },
    OPENAI_SERVICE_ACCOUNT: {
      apiKey: "The name of the secret that the rotated OpenAI service account API key will be mapped to."
    },
    SUPABASE_API_KEY: {
      apiKey: "The name of the secret that the rotated Supabase API key will be mapped to."
    },
    SALESFORCE_OAUTH_CREDENTIALS: {
      consumerKey: "The name of the secret that the rotated Salesforce consumer key will be mapped to.",
      consumerSecret: "The name of the secret that the rotated Salesforce consumer secret will be mapped to."
    },
    DATADOG_APPLICATION_KEY_SECRET: {
      applicationKeyId: "The name of the secret that the rotated Datadog application key ID will be mapped to.",
      applicationKey: "The name of the secret that the rotated Datadog application key value will be mapped to."
    },
    DATADOG_API_KEY: {
      apiKeyId: "The name of the secret that the rotated Datadog API key ID will be mapped to.",
      apiKey: "The name of the secret that the rotated Datadog API key value will be mapped to."
    },
    CLOUDFLARE_API_TOKEN: {
      tokenId: "The name of the secret that the rotated Cloudflare API token ID will be mapped to.",
      apiToken: "The name of the secret that the rotated Cloudflare API token value will be mapped to."
    },
    CLOUDFLARE_R2_ACCESS_KEY: {
      accessKeyId: "The name of the secret that the rotated R2 access key ID will be mapped to.",
      secretAccessKey: "The name of the secret that the rotated R2 secret access key will be mapped to."
    },
    CONVEX_ACCESS_KEY: {
      accessKey: "The name of the secret that the rotated Convex access key will be mapped to."
    },
    FIREWORKS_API_KEY: {
      apiKey: "The name of the secret that the rotated Fireworks API key will be mapped to."
    },
    SNOWFLAKE_USER_KEY_PAIR: {
      privateKey: "The name of the secret that the generated RSA private key (PKCS#8 PEM) will be mapped to.",
      publicKey: "The name of the secret that the generated RSA public key (SPKI PEM) will be mapped to."
    },
    STRIPE_API_KEY: {
      apiKey: "The name of the secret that the rotated Stripe API key will be mapped to."
    },
    GCP_SERVICE_ACCOUNT_KEY: {
      serviceAccountKey:
        "The name of the secret that the rotated service account key (the JSON key file) will be mapped to."
    }
  }
};

export const SecretScanningDataSources = {
  LIST: (type?: SecretScanningDataSource) => ({
    projectId: `The ID of the project to list ${
      type ? SECRET_SCANNING_DATA_SOURCE_NAME_MAP[type] : "Scanning"
    } Data Sources from. Defaults to the organization's active Secret Scanning project.`
  }),
  GET_BY_ID: (type: SecretScanningDataSource) => ({
    dataSourceId: `The ID of the ${SECRET_SCANNING_DATA_SOURCE_NAME_MAP[type]} Data Source to retrieve.`
  }),
  GET_BY_NAME: (type: SecretScanningDataSource) => ({
    sourceName: `The name of the ${SECRET_SCANNING_DATA_SOURCE_NAME_MAP[type]} Data Source to retrieve.`,
    projectId: `The ID of the project the ${SECRET_SCANNING_DATA_SOURCE_NAME_MAP[type]} Data Source is located in. Defaults to the organization's active Secret Scanning project.`
  }),
  CREATE: (type: SecretScanningDataSource) => {
    const sourceType = SECRET_SCANNING_DATA_SOURCE_NAME_MAP[type];
    const autoScanDescription = AUTO_SYNC_DESCRIPTION_HELPER[type];
    return {
      name: `The name of the ${sourceType} Data Source to create. Must be slug-friendly.`,
      description: `An optional description for the ${sourceType} Data Source.`,
      projectId: `The ID of the project to create the ${sourceType} Data Source in. Defaults to the organization's active Secret Scanning project.`,
      connectionId: `The ID of the ${
        APP_CONNECTION_NAME_MAP[SECRET_SCANNING_DATA_SOURCE_CONNECTION_MAP[type]]
      } Connection to use for this Data Source.`,
      isAutoScanEnabled: `Deprecated: use isHistoricalScanEnabled and isScanNewCommitsEnabled. Sets both when they are not provided.`,
      isHistoricalScanEnabled: `Whether a full scan of existing history runs for ${autoScanDescription.noun} when this Data Source is created, and for ${autoScanDescription.noun} added to its configuration later. Defaults to true.`,
      isScanNewCommitsEnabled: `Whether a scan runs when a ${autoScanDescription.verb} occurs to ${autoScanDescription.noun} associated with this Data Source. Defaults to true.`,
      isDiscoveryEnabled: `Whether ${autoScanDescription.noun} added to the provider after setup are scanned automatically. Defaults to true, except for GitLab project scope, which does not support it.`,
      config: `The configuration parameters to use for this Data Source.`
    };
  },
  UPDATE: (type: SecretScanningDataSource) => {
    const typeName = SECRET_SCANNING_DATA_SOURCE_NAME_MAP[type];
    const autoScanDescription = AUTO_SYNC_DESCRIPTION_HELPER[type];

    return {
      dataSourceId: `The ID of the ${typeName} Data Source to be updated.`,
      name: `The updated name of the ${typeName} Data Source. Must be slug-friendly.`,
      description: `The updated description of the ${typeName} Data Source.`,
      isAutoScanEnabled: `Deprecated: use isHistoricalScanEnabled and isScanNewCommitsEnabled. Sets both when they are not provided.`,
      isHistoricalScanEnabled: `Whether a full scan of existing history runs for ${autoScanDescription.noun} added to this Data Source's configuration.`,
      isScanNewCommitsEnabled: `Whether a scan runs when a ${autoScanDescription.verb} occurs to ${autoScanDescription.noun} associated with this Data Source.`,
      isDiscoveryEnabled: `Whether ${autoScanDescription.noun} added to the provider after setup are scanned automatically. Not supported for GitLab project scope.`,
      config: `The updated configuration parameters to use for this Data Source.`
    };
  },
  DELETE: (type: SecretScanningDataSource) => ({
    dataSourceId: `The ID of the ${SECRET_SCANNING_DATA_SOURCE_NAME_MAP[type]} Data Source to be deleted.`
  }),
  SCAN: (type: SecretScanningDataSource) => ({
    dataSourceId: `The ID of the ${SECRET_SCANNING_DATA_SOURCE_NAME_MAP[type]} Data Source to trigger a scan for.`,
    resourceId: `The ID of the individual Data Source resource to trigger a scan for.`
  }),
  LIST_RESOURCES: (type: SecretScanningDataSource) => ({
    dataSourceId: `The ID of the ${SECRET_SCANNING_DATA_SOURCE_NAME_MAP[type]} Data Source to list resources from.`,
    search: "Only return resources whose name contains this text, ignoring case.",
    orderBy:
      "The field to order resources by: name, status, or lastScanned. Status orders by what needs attention first in ascending order: failed scans, unresolved findings (most first), running scans, queued scans, never scanned, then clean.",
    orderDirection: "The direction to order resources in. Either 'asc' or 'desc'.",
    offset: "The number of resources to skip.",
    limit: "The number of resources to return."
  }),
  LIST_SCANS: (type: SecretScanningDataSource) => ({
    dataSourceId: `The ID of the ${SECRET_SCANNING_DATA_SOURCE_NAME_MAP[type]} Data Source to list scans for.`
  }),
  ADD_RESOURCE: (type: SecretScanningDataSource) => ({
    dataSourceId: `The ID of the ${SECRET_SCANNING_DATA_SOURCE_NAME_MAP[type]} Data Source to add resources to.`,
    resourceName: `The full name of the ${SECRET_SCANNING_DATA_SOURCE_NAME_MAP[type]} resource to scan, as the App Connection lists it. A resource already added is ignored.`
  }),
  REMOVE_RESOURCE: (type: SecretScanningDataSource) => ({
    dataSourceId: `The ID of the ${SECRET_SCANNING_DATA_SOURCE_NAME_MAP[type]} Data Source to remove the resource from.`,
    resourceId: "The ID of the resource to remove. Its scans and findings are deleted with it."
  }),
  CONFIG: {
    GITLAB: {
      scope:
        "Where projects are added from: account (projects the connection can read, added one at a time), group, or project (deprecated, kept for existing Data Sources).",
      projectId: "The ID of the project to scan.",
      projectName: "The name of the project to scan.",
      groupId: "The ID of the group to scan projects from.",
      groupName: "The name of the group to scan projects from."
    },
    BITBUCKET: {
      workspaceSlug: "The workspace to scan."
    }
  }
};

export const SecretScanningFindings = {
  LIST: {
    projectId: `The ID of the project to list Secret Scanning Findings from. Defaults to the organization's active Secret Scanning project.`,
    status: "Only return findings with this status.",
    dataSourceId: "Only return findings detected in this Data Source.",
    resourceId: "Only return findings detected in this resource, such as a repository or project.",
    orderBy: "The field to sort findings by.",
    orderDirection: "The direction to sort findings in.",
    offset: "The number of findings to skip, for pagination.",
    limit: "The maximum number of findings to return, from 1 to 100."
  },
  UPDATE: {
    findingId: "The ID of the Secret Scanning Finding to update.",
    status: "The updated status of the specified Secret Scanning Finding.",
    triageComment: "A comment explaining the status given to this finding."
  }
};

export const SecretScanningConfigs = {
  GET_BY_PROJECT_ID: {
    projectId: `The ID of the project to retrieve the Secret Scanning Configuration for. Defaults to the organization's active Secret Scanning project.`
  },
  UPDATE: {
    projectId:
      "The ID of the project to update the Secret Scanning Configuration for. Defaults to the organization's active Secret Scanning project.",
    content: "The contents of the Secret Scanning Configuration file."
  }
};

export const SecretScanningProjects = {
  GET_ACTIVE: {
    projectId:
      "The ID of the organization's active Secret Scanning project, which is the most recently created one. One is created if the organization has none."
  },
  GET_INSTANCE: {
    activeProjectId:
      "The ID of the organization's active Secret Scanning project, which is the most recently created one. Null if the organization has none.",
    projects: "Every Secret Scanning project in the organization, most recently created first.",
    id: "The ID of the Secret Scanning project.",
    name: "The name of the Secret Scanning project.",
    slug: "The slug of the Secret Scanning project.",
    createdAt: "When the Secret Scanning project was created.",
    isMultiInstance: "Whether the organization has more than one Secret Scanning project."
  }
};

export const OidcSSo = {
  GET_CONFIG: {
    organizationId: "The ID of the organization to get the OIDC config for."
  },
  UPDATE_CONFIG: {
    organizationId: "The ID of the organization to update the OIDC config for.",
    allowedEmailDomains:
      "A list of allowed email domains that users can use to authenticate with. This field is comma separated. Supports wildcards (e.g. *.example.com). Example: 'example.com, *.acme.com'",
    discoveryURL: "The URL of the OIDC discovery endpoint.",
    configurationType: "The configuration type to use for the OIDC configuration.",
    issuer:
      "The issuer for the OIDC configuration. This is only supported when the OIDC configuration type is set to 'custom'.",
    authorizationEndpoint:
      "The endpoint to use for OIDC authorization. This is only supported when the OIDC configuration type is set to 'custom'.",
    jwksUri: "The URL of the OIDC JWKS endpoint.",
    tokenEndpoint: "The token endpoint to use for OIDC token exchange.",
    userinfoEndpoint: "The userinfo endpoint to get user information from the OIDC provider.",
    clientId: "The client ID to use for OIDC authentication.",
    clientSecret: "The client secret to use for OIDC authentication.",
    isActive: "Whether to enable or disable this OIDC configuration.",
    manageGroupMemberships:
      "Whether to manage group memberships for the OIDC configuration. If enabled, users will automatically be assigned groups when they sign in, based on which groups they are a member of in the OIDC provider.",
    jwtSignatureAlgorithm: "The algorithm to use for JWT signature verification.",
    mfaClaimName: "The ID token claim that lists the authentication methods the user completed. Defaults to amr.",
    mfaAmrValues: "Additional MFA claim values, besides 'mfa', that prove the identity provider completed MFA."
  },
  CREATE_CONFIG: {
    organizationId: "The ID of the organization to create the OIDC config for.",
    allowedEmailDomains:
      "A list of allowed email domains that users can use to authenticate with. This field is comma separated. Supports wildcards (e.g. *.example.com).",
    discoveryURL: "The URL of the OIDC discovery endpoint.",
    configurationType: "The configuration type to use for the OIDC configuration.",
    issuer:
      "The issuer for the OIDC configuration. This is only supported when the OIDC configuration type is set to 'custom'.",
    authorizationEndpoint:
      "The authorization endpoint to use for OIDC authorization. This is only supported when the OIDC configuration type is set to 'custom'.",
    jwksUri: "The URL of the OIDC JWKS endpoint.",
    tokenEndpoint: "The token endpoint to use for OIDC token exchange.",
    userinfoEndpoint: "The userinfo endpoint to get user information from the OIDC provider.",
    clientId: "The client ID to use for OIDC authentication.",
    clientSecret: "The client secret to use for OIDC authentication.",
    isActive: "Whether to enable or disable this OIDC configuration.",
    manageGroupMemberships:
      "Whether to manage group memberships for the OIDC configuration. If enabled, users will automatically be assigned groups when they sign in, based on which groups they are a member of in the OIDC provider.",
    jwtSignatureAlgorithm: "The algorithm to use for JWT signature verification.",
    mfaClaimName: "The ID token claim that lists the authentication methods the user completed. Defaults to amr.",
    mfaAmrValues: "Additional MFA claim values, besides 'mfa', that prove the identity provider completed MFA."
  }
};

export const SamlSso = {
  GET_CONFIG: {
    organizationId: "The ID of the organization to get the SAML config for."
  },
  UPDATE_CONFIG: {
    organizationId: "The ID of the organization to update the SAML config for.",
    authProvider: "Authentication provider to use for SAML authentication.",
    isActive: "Whether to enable or disable this SAML configuration.",
    entryPoint:
      "The entry point for the SAML authentication. This is the URL that the user will be redirected to after they have authenticated with the SAML provider.",
    issuer: "The SAML provider issuer URL or entity ID.",
    cert: "The certificate to use for SAML authentication.",
    enableGroupSync:
      "Whether to enable automatic synchronization of group memberships from the SAML provider to Infisical groups.",
    mfaSignalAttribute:
      "The SAML attribute that lists the authentication methods the user completed, such as an Okta attribute with value session.amr. Set to null to use the provider's default: http://schemas.microsoft.com/claims/authnmethodsreferences for Azure / Entra ID, amr for every other provider.",
    mfaAuthnContexts:
      "Additional AuthnContextClassRef values, besides the built-in two-factor classes, that prove the identity provider completed MFA."
  },
  CREATE_CONFIG: {
    organizationId: "The ID of the organization to create the SAML config for.",
    authProvider: "Authentication provider to use for SAML authentication.",
    isActive: "Whether to enable or disable this SAML configuration.",
    entryPoint:
      "The entry point for the SAML authentication. This is the URL that the user will be redirected to after they have authenticated with the SAML provider.",
    issuer: "The SAML provider issuer URL or entity ID.",
    cert: "The certificate to use for SAML authentication.",
    enableGroupSync:
      "Whether to enable automatic synchronization of group memberships from the SAML provider to Infisical groups.",
    mfaSignalAttribute:
      "The SAML attribute that lists the authentication methods the user completed, such as an Okta attribute with value session.amr. Set to null to use the provider's default: http://schemas.microsoft.com/claims/authnmethodsreferences for Azure / Entra ID, amr for every other provider.",
    mfaAuthnContexts:
      "Additional AuthnContextClassRef values, besides the built-in two-factor classes, that prove the identity provider completed MFA."
  },
  ACS: {
    samlConfigId: "The ID of the SAML configuration the response is for.",
    SAMLResponse: "The base64-encoded SAML response the identity provider posted through the browser.",
    RelayState:
      "The RelayState Infisical sent with the authentication request, returned unchanged by the identity provider."
  }
};

export const LdapSso = {
  GET_CONFIG: {
    organizationId: "The ID of the organization to get the LDAP config for."
  },
  CREATE_CONFIG: {
    organizationId: "The ID of the organization to create the LDAP config for.",
    isActive: "Whether to enable or disable this LDAP configuration.",
    url: "The LDAP server to connect to such as `ldap://ldap.your-org.com`, `ldaps://ldap.myorg.com:636` (for connection over SSL/TLS), etc.",
    bindDN:
      "The distinguished name of the object to bind when performing the user search such as `cn=infisical,ou=Users,dc=acme,dc=com`",
    bindPass: "The password to use along with Bind DN when performing the user search.",
    searchBase: "The base DN to use for the user search such as `ou=Users,dc=acme,dc=com`",
    uniqueUserAttribute:
      "The attribute to use as the unique identifier of LDAP users such as `sAMAccountName`, `cn`, `uid`, `objectGUID`. If left blank, defaults to uidNumber",
    searchFilter:
      "The template used to construct the LDAP user search filter such as `(uid={{username}})` uses literal `{{username}}` to have the given username used in the search. The default is `(uid={{username}})` which is compatible with several common directory schemas.",
    groupSearchBase: "LDAP search base to use for group membership search such as `ou=Groups,dc=acme,dc=com`",
    groupSearchFilter:
      "The template used when constructing the group membership query such as `(&(objectClass=posixGroup)(memberUid={{.Username}}))`. The template can access the following context variables: `[UserDN, UserName]`. The default is `(|(memberUid={{.Username}})(member={{.UserDN}})(uniqueMember={{.UserDN}}))` which is compatible with several common directory schemas.",
    caCert: "The CA certificate to use when verifying the LDAP server certificate.",
    clientCertificate:
      "PEM-encoded client certificate presented during the TLS handshake for mutual TLS (mTLS). Must be provided together with clientKeyCertificate.",
    clientKeyCertificate:
      "PEM-encoded private key matching the client certificate, used during the TLS handshake for mutual TLS (mTLS). Must be provided together with clientCertificate."
  },
  UPDATE_CONFIG: {
    organizationId: "The ID of the organization to update the LDAP config for.",
    isActive: "Whether to enable or disable this LDAP configuration.",
    url: "The LDAP server to connect to such as `ldap://ldap.your-org.com`, `ldaps://ldap.myorg.com:636` (for connection over SSL/TLS), etc.",
    bindDN:
      "The distinguished name of object to bind when performing the user search such as `cn=infisical,ou=Users,dc=acme,dc=com`",
    bindPass: "The password to use along with Bind DN when performing the user search.",
    uniqueUserAttribute:
      "The attribute to use as the unique identifier of LDAP users such as `sAMAccountName`, `cn`, `uid`, `objectGUID`. If left blank, defaults to uidNumber",
    searchFilter:
      "The template used to construct the LDAP user search filter such as `(uid={{username}})` uses literal `{{username}}` to have the given username used in the search. The default is `(uid={{username}})` which is compatible with several common directory schemas.",
    searchBase: "The base DN to use for the user search such as `ou=Users,dc=acme,dc=com`",
    groupSearchBase: "LDAP search base to use for group membership search such as `ou=Groups,dc=acme,dc=com`",
    groupSearchFilter:
      "The template used when constructing the group membership query such as `(&(objectClass=posixGroup)(memberUid={{.Username}}))`. The template can access the following context variables: `[UserDN, UserName]`. The default is `(|(memberUid={{.Username}})(member={{.UserDN}})(uniqueMember={{.UserDN}}))` which is compatible with several common directory schemas.",
    caCert: "The CA certificate to use when verifying the LDAP server certificate.",
    clientCertificate:
      "PEM-encoded client certificate presented during the TLS handshake for mutual TLS (mTLS). Must be provided together with clientKeyCertificate.",
    clientKeyCertificate:
      "PEM-encoded private key matching the client certificate, used during the TLS handshake for mutual TLS (mTLS). Must be provided together with clientCertificate."
  }
};

export const Scim = {
  UPDATE_GROUP_ORG_ROLE_MAPPINGS: {
    groupName: "The name of the group in the SCIM provider.",
    roleSlug: "The slug of the role that group members should be assigned when provisioned."
  }
};

export const EventSubscriptions = {
  SUBSCRIBE_PROJECT_EVENTS: {
    projectId: "The ID of the project to subscribe to events for.",
    register: "List of events you want to subscribe to"
  }
};

export const SECRET_SHARING = {
  LIST: {
    offset: "The offset to start listing shared secrets from. Used for pagination.",
    limit: "The maximum number of shared secrets to return. Max is 100."
  },
  GET_BY_ID: {
    id: "The ID of the shared secret to retrieve."
  },
  ACCESS: {
    id: "The ID of the shared secret to access.",
    password:
      "The password for accessing a password-protected shared secret. Only required if the secret is password protected."
  },
  CREATE: {
    name: "An optional name for the shared secret for easier identification.",
    secretValue: "The secret value to share.",
    expiresIn:
      "The duration after which the shared secret will expire. Accepts formats like '30d', '24h', '1w'. Maximum is 30 days, minimum is 5 minutes.",
    password:
      "An optional password to protect the shared secret. Recipients will need to provide this password to access the secret.",
    maxViews:
      "The maximum number of times the shared secret can be viewed before it expires. If not provided, unlimited views are allowed.",
    accessType:
      "Determines who can access the shared secret. 'organization' restricts access to users within your organization. 'anyone' allows access to anyone with the link. Defaults to 'organization'.",
    authorizedEmails:
      "An optional array of email addresses to share the secret with. Maximum 100 emails. Organization members in the list get direct access. When allowExternalEmails is enabled, non-member emails are also accepted and recipients will receive the secret link via email, but must use the password to access it.",
    allowExternalEmails:
      "When true, allows sharing with email addresses that do not belong to Infisical. A password is required when this option is enabled. External recipients will receive the secret link via email and must enter the password to access it."
  },
  DELETE: {
    id: "The ID of the shared secret to delete."
  }
} as const;

export const GATEWAYS = {
  METRICS_REPORT: {
    activeChannels:
      "Number of channels the gateway is currently serving. Used to route new work to the least busy member of a gateway pool.",
    gatewayId: "ID of the gateway the report was recorded against."
  },
  CREATE: {
    name: "Name of the gateway.",
    authMethod:
      "Auth method to configure on the gateway. `aws` carries the AWS allowlists; `gcp` carries the GCP token type and service account/project/zone allowlists; `kubernetes` carries the cluster host and namespace/service account allowlists; `token` is configurationless and requires a separate POST /v3/gateways/:id/token call to mint the bootstrap token."
  },
  UPDATE: {
    name: "New name for the gateway. Renaming does not affect the gateway's ID, so resources referencing it keep working.",
    authMethod:
      "Replacement auth method. Same shape as in create: `aws` with allowlists, `gcp` with GCP allowlists, `kubernetes` with cluster config, or `token` with no config. Existing gateways keep working until they restart and re-authenticate via the new method."
  },
  AUTH_METHOD: {
    allowedPrincipalArns:
      "The comma-separated list of trusted IAM principal ARNs that are allowed to authenticate with Infisical.",
    allowedAccountIds:
      "The comma-separated list of trusted AWS account IDs that are allowed to authenticate with Infisical.",
    gcpAuthType:
      "How the gateway proves its GCP identity. 'gce' verifies an ID token from the instance metadata server, which covers Compute Engine VMs and GKE workload identity. 'iam' verifies a JWT the service account signed through the IAM Credentials API, for hosts outside Compute Engine.",
    allowedServiceAccounts:
      "The comma-separated list of GCP service account emails that are allowed to authenticate as this gateway.",
    allowedProjects:
      "The comma-separated list of GCP project IDs whose Compute Engine instances are allowed to authenticate as this gateway. Only applies to the 'gce' type, and requires a token carrying Compute Engine instance details.",
    allowedZones:
      "The comma-separated list of GCP zones whose Compute Engine instances are allowed to authenticate as this gateway. Only applies to the 'gce' type, and requires a token carrying Compute Engine instance details.",
    kubernetesHost:
      "The URL of the Kubernetes API server that Infisical reviews the gateway's service account token against (e.g. https://my-cluster.example.com:6443). Omit only when tokenReviewMode is 'gateway', where the reviewing gateway calls its own API server.",
    tokenReviewMode:
      "Who performs the TokenReview. 'api' means Infisical does, using the configured token reviewer JWT. 'gateway' means the selected gateway does, using its own in-cluster service account, which requires no Kubernetes host or reviewer token but requires that gateway to run as a pod in the cluster.",
    gatewayId:
      "The gateway to route TokenReview traffic through, for clusters whose API server Infisical cannot reach. Must be a different gateway that is already enrolled and connected. Mutually exclusive with gatewayPoolId.",
    gatewayPoolId:
      "The gateway pool to route TokenReview traffic through. Any healthy member performs the request, so this survives a single gateway going offline. Mutually exclusive with gatewayId.",
    caCertificate:
      "The PEM-encoded CA certificate that issued the Kubernetes API server's TLS certificate. Required when the API server uses a certificate the system trust store does not recognise, which is the usual case for a cluster CA.",
    tokenReviewerJwt:
      "A long-lived service account token with the system:auth-delegator ClusterRole used to submit TokenReview requests. Omit to have the gateway's own token act as the reviewer. Write-only: never returned by the API.",
    allowedNamespaces:
      "The comma-separated list of Kubernetes namespaces whose service accounts are allowed to authenticate as this gateway. Supports `*` wildcards.",
    allowedNames:
      "The comma-separated list of Kubernetes service account names that are allowed to authenticate as this gateway. Supports `*` wildcards.",
    allowedAudience:
      "The audience the gateway's service account token must carry. Leave empty to skip the audience check.",
    verifyTlsCertificate:
      "Whether to verify the Kubernetes API server's TLS certificate. Verified against the CA certificate when one is configured, otherwise against the system trust store."
  },
  LOGIN: {
    gatewayId: "The ID of the gateway logging in (AWS, GCP and Kubernetes methods only).",
    iamHttpRequestMethod: "The HTTP request method used in the signed STS request.",
    iamRequestBody: "The base64-encoded body of the signed STS request.",
    iamRequestHeaders: "The base64-encoded headers of the sts:GetCallerIdentity signed request.",
    jwt: "The projected Kubernetes service account token of the pod the gateway runs in (Kubernetes method only).",
    gcpJwt:
      "The GCP token proving the gateway's identity, carrying the gateway ID as its audience: a metadata server ID token for the 'gce' type, or a service-account-signed JWT for the 'iam' type (GCP method only).",
    token: "The one-time enrollment token previously issued for this gateway (token method only)."
  }
} as const;

export const RELAYS = {
  CREATE: {
    name: "Name of the relay.",
    host: "Host address where the relay is reachable.",
    authMethod:
      "Auth method to configure on the relay. `aws` carries the AWS allowlists; `token` is configurationless and requires a separate POST /v2/relays/:id/token-auth/generate-enrollment-token call to mint the bootstrap token."
  },
  UPDATE: {
    authMethod:
      "Replacement auth method. Same shape as in create — `aws` with allowlists or `token` with no config. Existing relays keep working until they restart and re-authenticate via the new method."
  },
  LOGIN: {
    relayId: "The ID of the relay logging in (AWS method only).",
    iamHttpRequestMethod: "The HTTP request method used in the signed STS request.",
    iamRequestBody: "The base64-encoded body of the signed STS request.",
    iamRequestHeaders: "The base64-encoded headers of the sts:GetCallerIdentity signed request.",
    token: "The one-time enrollment token previously issued for this relay (token method only)."
  }
} as const;

export const SecretValidationRules = {
  LIST: (type?: SecretValidationRuleType) => ({
    projectId: `The ID of the project to list ${
      type ? SECRET_VALIDATION_RULE_NAME_MAP[type] : "Secret"
    } Validation Rules from.`
  }),
  GET_BY_ID: (type: SecretValidationRuleType) => ({
    ruleId: `The ID of the ${SECRET_VALIDATION_RULE_NAME_MAP[type]} Validation Rule to retrieve.`
  }),
  CREATE: (type: SecretValidationRuleType) => {
    const name = SECRET_VALIDATION_RULE_NAME_MAP[type];
    return {
      name: `The name of the ${name} Validation Rule to create.`,
      projectId: `The ID of the project to create the ${name} Validation Rule in.`,
      description: `An optional description of the ${name} Validation Rule.`,
      environment: `The slug of the environment to scope this rule to. Omit to enforce the rule in every environment of the project.`,
      secretPath: `The secret path to scope this rule to. Supports glob patterns such as \`/apps/**\`.`,
      isActive: `Whether the rule is enforced. An inactive rule is kept but ignored.`
    };
  },
  UPDATE: (type: SecretValidationRuleType) => {
    const name = SECRET_VALIDATION_RULE_NAME_MAP[type];
    return {
      ruleId: `The ID of the ${name} Validation Rule to update.`,
      name: `The updated name of the ${name} Validation Rule.`,
      description: `The updated description of the ${name} Validation Rule.`,
      environment: `The slug of the environment to scope this rule to. Pass null to enforce the rule in every environment of the project.`,
      secretPath: `The secret path to scope this rule to. Supports glob patterns such as \`/apps/**\`.`,
      isActive: `Whether the rule is enforced. An inactive rule is kept but ignored.`
    };
  },
  DELETE: (type: SecretValidationRuleType) => ({
    ruleId: `The ID of the ${SECRET_VALIDATION_RULE_NAME_MAP[type]} Validation Rule to delete.`
  }),
  // Each constraint field reads the same way whichever target it sits on, so one template covers
  // the secret key, the secret value and a generated password.
  CONSTRAINTS: (target: string) => ({
    minLength: `The minimum number of characters the ${target} must contain.`,
    maxLength: `The maximum number of characters the ${target} may contain.`,
    regexPattern: `A regular expression the ${target} must match.`,
    requiredPrefix: `A string the ${target} must start with.`,
    requiredSuffix: `A string the ${target} must end with.`
  }),
  REUSE_PREVENTION: {
    uniqueAcrossLastVersions: `How many of the secret's own previous versions the new value must differ from. Between 1 and ${MAX_PREVENT_DUPLICATE_SECRET_VALUE_VERSIONS}. Omit to accept a value the secret has held before.`,
    uniqueWithinScope:
      "Set to true to reject a value that another secret in the rule's scope already holds. Requires blind indexing on the project."
  },
  STATIC_SECRETS: {
    keyConstraints:
      "Constraints enforced on the secret key when a secret is created or renamed. Omit to leave keys unconstrained.",
    valueConstraints:
      "Constraints enforced on the secret value when a secret is created or updated. Omit to leave values unconstrained."
  },
  GENERATED_CREDENTIALS: {
    passwordConstraints:
      "Constraints the generated password must satisfy. These replace any password requirements configured on the resource itself."
  },
  DYNAMIC_SECRETS: {
    providers:
      "The dynamic secret providers this rule applies to. A lease is only constrained when its provider is listed here."
  },
  SECRET_ROTATIONS: {
    providers:
      "The secret rotation providers this rule applies to. A rotation is only constrained when its provider is listed here."
  }
} as const;

export const ENCRYPTION_KEY_ROTATION = {
  ROOT_KEY: {
    description:
      "Report the state of the instance encryption key: which key is active, whether a replacement is staged, and whether the key it replaced is still accepted.",
    encryptionStrategy: "How the root key is wrapped. A key wrapped by an HSM has no environment variable to rotate.",
    active: {
      label:
        "Non-reversible label of the key this instance is running with. Record it next to the archived key so a backup can be matched later.",
      activatedAt: "When this key took effect, which is the first time an instance started with it."
    },
    staged: {
      description:
        "A generated key that has not been applied yet. Null until you generate one. Nothing changes until an instance starts with it.",
      label: "Label of the staged key, so you can confirm the value you are about to deploy is the one you copied.",
      createdAt: "When this key was generated."
    },
    expiring: {
      description:
        "The key this instance used before the current one. Null if none is still accepted. It still starts an instance so a fleet can finish rolling over, and is removed automatically once the retention window passes.",
      label: "Label of the previous key. Pass it when you remove that key.",
      supersededAt: "When the current key took effect.",
      expiresAt:
        "When this key becomes eligible for automatic removal. An instance starting on it restarts this clock, since that is evidence one still needs it. The weekly cleanup removes the key on its first run after this time, so the key may outlive it by a few days.",
      lastResolvedAt:
        "When an instance last started using the previous key. Recent means one is probably still running and would fail to restart if the key were removed. Null only means none has started since the rotation, not that none exists."
    }
  },
  ROTATIONS: {
    description:
      "List the rotations that have taken effect, newest first. A staged key appears here only once an instance has started with it. Kept after a key is removed, so a restored backup can be matched to an archived key.",
    offset: "How many rotations to skip before the first returned.",
    limit: "How many rotations to return.",
    label: "A non-reversible label derived from the key. Match it to the label you stored with an archived key.",
    activatedAt: "When this key took effect.",
    supersededAt: "When the next key took effect. Null on the key currently in use.",
    retiredAt: "When this key stopped being accepted and was removed. Null while it still starts an instance.",
    totalCount: "How many rotations this instance has recorded in total."
  },
  CREATE: {
    description:
      "Generate a new value for ENCRYPTION_KEY. The key is returned once and never stored, and nothing changes until an instance starts with it.",
    replaceStaged:
      "Replace an already-generated key that has not been applied yet. The replaced key stops working immediately.",
    label:
      "A non-reversible label derived from the new key. Record it alongside the key so a backup can be matched to it later.",
    key: "The new value for ENCRYPTION_KEY. Shown only in this response and never recoverable. Store it before closing.",
    removesExpiringKey:
      "Present when the previous rotation's key has not been removed yet. Applying this key removes it immediately, so any instance still running it will fail to restart."
  },
  DELETE_STAGED: {
    description:
      "Discard a generated key that has not been applied. Use this immediately if the key may have been exposed.",
    label:
      "Label of the staged key, which must match the key currently staged. It is a precondition, not an identifier: it fails the request rather than discarding a key another administrator staged after you loaded this page."
  },
  DELETE_EXPIRING: {
    description:
      "Remove the previous encryption key now that every instance is using the new one. This cannot be undone: after it, losing the new key means losing access to all stored secrets.",
    label:
      "Label of the previous key, which must match the key currently held. It is a precondition, not an identifier: it fails the request rather than removing a key you have not seen.",
    force:
      "Remove the key even though an instance started on it recently. This overrides only that check: a label that does not match the key currently held still fails. Any instance still using that key will fail its next restart until it is given the new one."
  }
};

const AGENT_VAULT_VARIABLE_REFERENCES = `Can use up to ${AGENT_VAULT_MAX_REFERENCES_PER_FIELD} references to Agent Vault's variables, written as \`{{KEY}}\`. A reference that repeats counts each time.`;

export const AGENT_VAULT = {
  ACCESS_BUNDLE: {
    accessBundleId: "The ID of the access bundle.",
    name: "The name of the access bundle.",
    description: "A description of what this access bundle is for.",
    serviceCount: "How many services the access bundle holds.",
    memberCount: "How many users, machine identities and groups can reach the access bundle.",
    orderBy: "What to sort access bundles by: name, serviceCount or createdAt.",
    orderDirection: "Which way to sort: asc or desc.",
    search: "Match access bundles by name or description.",
    limit: "The maximum number of access bundles to return.",
    offset: "How many access bundles to skip.",
    hostPatterns: "Every host pattern the access bundle's services cover.",
    requiresSetup:
      "true lists only the access bundles you can reach that have services still requiring your personal values. false lists the rest of them. Omit to list them all.",
    granted:
      "true lists only the access bundles granted to you, directly or through a group. false lists the ones you reach only as an admin. Omit to list them all.",
    servicesRequiringSetup: "The services in this access bundle that still require your personal values.",
    servicesRequiringSetupId: "The ID of the service, for setting your personal values on it.",
    onBehalfOfUserId:
      "List the access bundles a session on behalf of this user could use: those both the user and your machine identity can use. requiresSetup and servicesRequiringSetup then refer to the user's personal values. Only a machine identity whose delegation covers the user can do this, and granted can't be combined with it. Set this or onBehalfOfUserEmail, not both.",
    onBehalfOfUserEmail:
      "Like onBehalfOfUserId, naming the user by email address instead. Set this or onBehalfOfUserId, not both.",
    servicesRequiringSetupName: "The name of the service."
  },
  SERVICE: {
    serviceId: "The ID of the service.",
    name: "The name of the service.",
    type: "The service type: `http` for an HTTP API, or `mcp` for a remote MCP server. Can't be changed after the service is created.",
    updateType: "The service's type, `http` or `mcp`. Must match the type the service was created with.",
    serverUrlRead: "The MCP server's full URL. Null for an `http` service.",
    transportRead:
      "How the agent talks to the MCP server: `streamable-http`, or `sse` for the legacy HTTP+SSE transport. Null for an `http` service.",
    serverUrl:
      "The MCP server's URL, such as `https://mcp.example.com/mcp`. Must use `https`, with no username, password, query string or fragment.",
    transport: "How the agent talks to the MCP server: `streamable-http`, or `sse` for the legacy HTTP+SSE transport.",
    mcpCredential:
      "The credential the proxy attaches to requests to the MCP server, a bearer token. To use OAuth instead, connect the service in the Infisical UI.",
    authorizationId:
      "The ID of a completed OAuth authorization for this service's server URL, started by the same user. Each authorization can be used once.",
    updateAuthorizationId:
      "The ID of a completed OAuth authorization, to reauthorize the service or switch it to OAuth. To keep the stored tokens, leave `credential` out.",
    oauthStatus:
      "Whether the OAuth connection works: `connected`, `needs-reauthorization` (the tokens can no longer be refreshed), or `needs-additional-scopes` (the MCP server asked for scopes the connection lacks).",
    oauthIssuer: "The OAuth authorization server that issued the tokens.",
    oauthGrantedScopes: "The scopes the authorization server granted.",
    oauthRequiredScopes: "Scopes the MCP server asked for that the connection lacks. Reauthorize to request them.",
    oauthExpiresAt:
      "When the current access token expires, or null if the server didn't say. Not returned to Agent Vault members.",
    oauthAuthorizedAt: "When the connection was last authorized. Not returned to Agent Vault members.",
    oauthLastError: "The last refresh failure, if any. Never contains a token. Not returned to Agent Vault members.",
    hostPattern:
      "A comma-separated set of hosts this service covers, each optionally with a port (defaults to `443`). A leading `*.` wildcard matches exactly one label. Paths are not supported.",
    headerName: "The header the credential is written to. Defaults to `Authorization`.",
    headerPrefix:
      "Written before the credential value, separated by one space. Leave empty for a header that carries the value alone, such as DD-API-KEY. Can't contain `{{` or `}}`. On update a field left out keeps its stored value, so send an empty string to clear the prefix when changing the header.",
    username: `The username half of the basic credential. May be empty if a password is set. ${AGENT_VAULT_VARIABLE_REFERENCES} Never returned once saved, since some APIs put the whole key here.`,
    updateUsername: `The username half of the basic credential. ${AGENT_VAULT_VARIABLE_REFERENCES} Omit to keep the stored username; send an empty string to remove it, which requires a password.`,
    updateValue: `The secret. ${AGENT_VAULT_VARIABLE_REFERENCES} Omit to keep the stored secret.`,
    updatePassword: `The password half of the basic credential. ${AGENT_VAULT_VARIABLE_REFERENCES} Omit to keep the stored password; send an empty string to remove it, which requires a username.`,
    createdAt: "When the service was added to the access bundle.",
    updatedAt: "When the service was last changed.",
    value: `The secret. ${AGENT_VAULT_VARIABLE_REFERENCES} Never returned once saved.`,
    password: `The password half of the basic credential. May be empty if a username is set, for APIs that carry the whole key in the username. ${AGENT_VAULT_VARIABLE_REFERENCES} Never returned once saved.`,
    allowedMethods:
      "The HTTP methods this service allows. Null allows every method. Anything else is refused by the proxy with a 403.",
    allowedPathPrefixes:
      "The path prefixes this service allows, matched on whole segments, so `/repos` covers `/repos/octo` but not `/repositories`. `null` allows every path. A path-restricted service also refuses any request whose path would have to be normalised to judge.",
    allowedTools:
      "The MCP tools agents can call through this service, by exact, case-sensitive name. Each name is 1 to 128 letters, numbers, underscores (_), hyphens (-), or dots (.). `null` allows every tool. The proxy refuses a call to any other tool and leaves it out of the server's tool list. MCP services only.",
    mcpToolName: "The tool's name, as the MCP server reports it.",
    mcpToolDescription: "The server's description of the tool, or null if it gave none.",
    customHeaders:
      "Additional headers the proxy attaches to every request to this service, on top of the credential. Send the full list. A header you leave out is deleted. Send a header's `id` to change it in place and keep its stored value. Without an `id`, a header is matched by name.",
    customHeaderId: "The ID of the custom header. Send it to change that header in place. Omit it to match by name.",
    customHeaderName: "The name of the header, which must not be the credential's own header.",
    customHeaderPrefix:
      "Written before the header value, separated by one space. Leave empty to send the value alone. Can't contain `{{` or `}}`.",
    updateCustomHeaderPrefix:
      "Written before the header value, separated by one space. Can't contain `{{` or `}}`. Unlike the value, an omitted prefix is cleared rather than kept, since the stored prefix is returned and can be resent.",
    customHeaderValue: `The header value. ${AGENT_VAULT_VARIABLE_REFERENCES} Never returned once saved.`,
    updateCustomHeaderValue: `The header value. ${AGENT_VAULT_VARIABLE_REFERENCES} Omit to keep the value already stored for this header.`,
    substitutions:
      "Placeholders the proxy swaps for a real secret before forwarding. Send the full list. A substitution you leave out is deleted. Send a substitution's `id` to change it in place and keep its stored value. Without an `id`, it is matched by its placeholder.",
    substitutionId:
      "The ID of the substitution. Send it to change that substitution in place. Omit it to match by placeholder.",
    placeholder:
      "The fake value your agent already sends. The proxy replaces it with the real secret. Matched as a plain string, so a distinctive placeholder is worth choosing. Can't contain `{{` or `}}`.",
    surfaces: "Where in the request to look for the placeholder: path, query, header or body.",
    substitutionValue: `The real value the placeholder is replaced with. ${AGENT_VAULT_VARIABLE_REFERENCES} Never returned once saved.`,
    updateSubstitutionValue: `The real value the placeholder is replaced with. ${AGENT_VAULT_VARIABLE_REFERENCES} Omit to keep the value already stored.`,
    variableReferences:
      "The global variables this service's credential, custom header values and substitution values use. Not returned to Agent Vault members, since only admins can see global variables. A member's own personal variables are listed under personalValues.",
    referenceField:
      "Which value uses the variable: credential-value (a bearer token or a basic password), credential-username, custom-header or substitution.",
    referenceCustomHeaderId: "The custom header whose value uses the variable.",
    referenceSubstitutionId: "The substitution whose value uses the variable.",
    bearerMemberProvidedFields:
      "Leave the token to each member: send `credential-value` here and no `value`. Every member sets their own, and a session uses the token of the member who started it. A session a machine identity started on behalf of a user uses that user's token instead. Omit on update to keep the current setting; send an empty list to set the token yourself again, which then needs a `value`. Changing this clears every member's saved values for the service.",
    basicMemberProvidedFields:
      "The halves of the basic credential each member sets for themselves: `credential-username`, `credential-value` (the password) or both. Send no value for a half listed here. A session uses the values of the member who started it. A session a machine identity started on behalf of a user uses that user's values instead. Omit on update to keep the current setting. Adding a half keeps what members saved, and taking one back deletes only that half's values. Changing the credential type deletes every member's values for the service.",
    memberProvidedFields:
      "The credential fields each member sets for themselves: credential-value (a bearer token or a basic password) and credential-username. Empty when the admin sets the whole credential."
  },
  PERSONAL_VALUE: {
    credentialType:
      "The credential type you expect the service to have. If it no longer matches, the request fails with a 409.",
    personalValues:
      "Your personal values for the service, or null if the service leaves no fields to its members. Only you can see these, and a stored value never comes back.",
    isConfigured:
      "Whether you have set every value this service requires from you. Until you do, the proxy refuses this service's requests from your sessions.",
    fields: "Each value the service requires from you, and whether you have set it.",
    field:
      "Which value: credential-value (a bearer token or a basic password) or credential-username (a basic username).",
    isSet: "Whether you have set this value.",
    updatedAt: "When you last set this value, or null if you haven't.",
    variableReferences: "Your personal variables that this value uses.",
    values:
      "The values to set, at most one per field the service leaves to its members. A field you leave out keeps its saved value, so after a field becomes member provided you only need to send that one.",
    value: `The value. Can use up to ${AGENT_VAULT_MAX_REFERENCES_PER_FIELD} references to your personal variables, written as \`{{KEY}}\`. Never returned once saved.`
  },
  OAUTH: {
    authorization: "The OAuth authorization, or null when an OAuth client must be registered first.",
    authorizationId: "The ID of the OAuth authorization.",
    accessBundleId: "The access bundle the service is in, or will be created in.",
    serverUrl: "The MCP server's URL. Must match the server URL of the service the authorization is saved to.",
    serviceId:
      "The ID of the MCP service to reauthorize. Leave it out when connecting a new service. When set, the sign-in asks for the scopes the service already has, and can only be saved to that service.",
    clientId:
      "The client ID of your own OAuth app, for a server that doesn't support dynamic client registration. Register the app with the redirect URI `<your Infisical URL>/agent-vault/oauth/callback`.",
    clientSecret: "The client secret of your own OAuth app, if it has one.",
    registration:
      "Send `dynamic` to register a new client with the server, even when the service being reauthorized uses your own OAuth app.",
    registrationRequired:
      "True when the server can't register Infisical as a client by itself, or refused to. Send `clientId` (and `clientSecret`) of your own OAuth app.",
    redirectUri:
      "The redirect URI Infisical sends to the authorization server. Register your own OAuth app with this exact value.",
    oauthAdvertised:
      "False when the MCP server answered but sent no OAuth challenge and serves no OAuth metadata. The server URL may be wrong; a server that does use OAuth can still be connected with your own client ID and secret.",
    status: "`pending` until the authorization server redirects back, then `authorized` or `failed`.",
    error: "Why the authorization failed, when it did.",
    scopes: "The scopes requested, or once authorized, the scopes granted.",
    authorizeUrl: "Open this URL in the browser to sign in to the authorization server.",
    state: "The `state` value from the redirect.",
    code: "The `code` value from the redirect.",
    iss: "The `iss` value from the redirect, when the authorization server sends one.",
    callbackError: "The `error` value from the redirect, when the authorization server sends one instead of a code.",
    callbackErrorDescription: "The `error_description` value from the redirect."
  },
  CREDENTIAL_REFRESH: {
    hostPattern: "The host pattern cached by the proxy for this service. A changed pattern returns 409.",
    rejectedTokenHash: "The hex SHA-256 hash of the access token the MCP server rejected.",
    requiredScopes: "The scopes requested by an insufficient_scope challenge from the MCP server.",
    credential: "The current bearer credential for the service.",
    credentialType: "The credential shape the proxy injects into requests.",
    value: "The access token to attach to requests. Never expose it to the agent.",
    source: "Set to oauth when the proxy can request an OAuth token refresh."
  },
  VARIABLE: {
    variableId: "The ID of the variable.",
    scope:
      "global for a variable admins set up for services, or personal for one of your own, which only your personal values can use and only you can see. Personal keys are unique among your own variables.",
    listScope:
      "Which variables to list: global, which needs the admin role, or personal for your own. Omit to list everything you can see: your own personal variables, plus the global ones if you're an admin. Nobody can list another member's personal variables.",
    createScope:
      "global creates a variable services can use, which needs the admin role. personal creates one of your own, which only your personal values can use.",
    key: "The name values use to refer to the variable, as `{{KEY}}`. Starts with a letter and uses only upper case letters, numbers and underscores.",
    value: "The value the proxy puts in place of each `{{KEY}}`.",
    updateValue: "The value the proxy puts in place of each `{{KEY}}`. Omit to keep the stored value.",
    revealedValue: "The variable's value.",
    orderBy: "What to sort variables by: key, or serviceCount for how many services use each one.",
    orderDirection: "Which way to sort: asc or desc.",
    search: "Match variables whose key contains this text.",
    keys: "Return only the variables with these exact keys, comma-separated. Every one that exists is returned unless limit is set. Requires scope, since a key can name both a global variable and one of your own.",
    limit: "The maximum number of variables to return. Defaults to 20, or to the number of keys when keys is given.",
    offset: "How many variables to skip.",
    totalCount: "How many variables match the search, across every page.",
    usedByServices:
      "The services that use this variable, across every access bundle, ordered by access bundle name and then service name. For a personal variable, the services whose personal values, as you set them, use it. A variable in use can't be deleted.",
    usedByServiceId: "The ID of a service that uses this variable.",
    usedByServiceName: "The name of the service.",
    usedByServiceHostPattern: "The host pattern of the service.",
    usedByServiceAccessBundleId: "The ID of the access bundle the service belongs to.",
    usedByServiceAccessBundleName: "The name of the access bundle the service belongs to.",
    createdAt: "When the variable was added.",
    updatedAt: "When the variable was last changed."
  },
  SKILL: {
    skillId: "The ID of the skill.",
    name: "The name of the skill, taken from the `name` in the SKILL.md of its latest version. Lowercase letters, numbers and hyphens.",
    description: "What the skill is for, taken from the `description` in the SKILL.md of its latest version.",
    latestVersion: "The number of the skill's newest version.",
    accessBundles:
      "The access bundles the skill is in, ordered by name. A member sees only the bundles they have been granted.",
    accessBundleId: "The ID of an access bundle the skill is in.",
    accessBundleName: "The name of the access bundle.",
    createdAt: "When the skill was added.",
    updatedAt: "When the skill was last changed.",
    files:
      "Every file in the skill folder. One must be `SKILL.md` at the root, starting with a YAML header that sets `name` and `description`. At most 50 files, 256 KB per file and 1 MB in total.",
    filePath:
      "The file's path inside the skill folder, using `/` between folders. No leading `/`, and no `.` or `..` parts. At most 255 characters, and each file or folder name at most 255 bytes.",
    fileMode: "The file's permissions: `0644` for a regular file, `0755` for one that can be run.",
    fileContent: "The file's content, encoded as base64.",
    latestFiles: "The files of the latest version.",
    versionId: "The ID of the version.",
    version: "The version number. Versions count up from 1, and the newest 20 are kept.",
    sha256: "The SHA-256 digest of the version's files, as hex.",
    sizeBytes: "The total size of the version's files in bytes.",
    fileCount: "How many files the version has.",
    versionCreatedAt: "When the version was saved.",
    unchanged:
      "True if the files match the latest version, in which case no new version was made and that version is returned.",
    baseVersion:
      "The version these files were edited from. If a newer version has been saved since, nothing is saved and the request fails with 409. Omit it to update regardless.",
    restoreUnchanged:
      "True if the version being restored has the same files as the latest version, in which case no new version was made and the latest version is returned.",
    addSkillId: "The ID of the skill to add to the access bundle.",
    search: "Match skills whose name or description contains this text.",
    nameFilter: "Return only the skill with exactly this name.",
    limit: "The maximum number of skills to return. Defaults to 20.",
    offset: "How many skills to skip.",
    totalCount: "How many skills match the filters, across every page.",
    sessionSkills:
      "The latest version of each skill on the session's access bundles that the session's owner can still reach, ordered by name."
  },
  MEMBER: {
    grantedAt: "When the access bundle was granted.",
    userId: "The ID of the user whose Agent Vault membership this is.",
    identityId: "The ID of the machine identity whose Agent Vault membership this is.",
    groupId: "The ID of the group whose Agent Vault membership this is.",
    userIds: "The IDs of the users to grant the access bundle to.",
    machineIdentityIds: "The IDs of the machine identities to grant the access bundle to.",
    groupIds: "The IDs of the groups to grant the access bundle to.",
    actorType: "Whether this member is a user, a machine identity or a group.",
    actorId: "The ID of the user, machine identity or group.",
    username: "The username of the user.",
    email: "The email address of the user.",
    firstName: "The first name of the user.",
    lastName: "The last name of the user.",
    identityName: "The name of the machine identity.",
    groupName: "The name of the group.",
    isOrgMembershipPending: "Whether the user still has an unaccepted invitation to the organization.",
    isManagedByAgentVault:
      "Whether Agent Vault created the machine identity. One it owns is deleted rather than removed.",
    machineIdentityOrgId: "The ID of the organization the machine identity belongs to.",
    revokeUserIds: "The IDs of the users to revoke the access bundle from.",
    revokeMachineIdentityIds: "The IDs of the machine identities to revoke the access bundle from.",
    revokeGroupIds: "The IDs of the groups to revoke the access bundle from.",
    skipped: "The requested grantees who already had the access bundle and were left as they were.",
    revokeSkipped: "The requested grantees who did not have the access bundle, so nothing was revoked.",
    actorTypeFilter: "List only users, only groups or only machine identities.",
    search: "Match members by name, username or email address.",
    limit: "The maximum number of members to return.",
    offset: "How many members to skip."
  },
  MEMBERSHIP: {
    role: "The Agent Vault role: admin or member.",
    isActive: "Whether the member can currently reach Agent Vault.",
    addedAt: "When the member was added to Agent Vault.",
    userIds: "The IDs of the users to act on.",
    machineIdentityIds: "The IDs of the machine identities to act on.",
    groupIds: "The IDs of the groups to act on.",
    emails: "The email addresses of the users to give access to. Each must already be in the organization.",
    identifier: "The ID or email address the request named, echoed back so a reply can be matched to it.",
    addSkipped: "The requested members who already had access to Agent Vault and were left as they were.",
    revokeSkipped: "The requested members who did not have access to Agent Vault, so nothing was removed.",
    updateSkipped:
      "The requested members who did not have access to Agent Vault or already had the role, so nothing was changed.",
    actorTypeFilter: "List only users, only groups or only machine identities.",
    search: "Match members by name, username or email address.",
    limit: "The maximum number of members to return.",
    offset: "How many members to skip."
  },
  AVAILABLE_MEMBER: {
    actorTypeFilter: "List only users, only groups or only machine identities.",
    search: "Match candidates by name, username or email address.",
    limit: "The maximum number of candidates to return.",
    offset: "How many candidates to skip."
  },
  AVAILABLE_GRANTEE: {
    actorTypeFilter: "List only users, only groups or only machine identities.",
    search: "Match candidates by name, username or email address.",
    limit: "The maximum number of candidates to return.",
    offset: "How many candidates to skip."
  },
  PROXY: {
    proxyId: "The ID of the proxy.",
    name: "The name of the proxy.",
    description: "A description of what this proxy is for.",
    orderBy: "What to sort proxies by: name or createdAt.",
    orderDirection: "Which way to sort: asc or desc.",
    search: "Match proxies by name or description.",
    limit: "The maximum number of proxies to return.",
    offset: "How many proxies to skip.",
    heartbeat: "When the proxy last checked in, or `null` if it never has.",
    isHealthy: "Whether the proxy has checked in recently enough to be considered up.",
    proxyToken:
      "The token the proxy starts with, on as many machines as you need. Shown once, and works until it is rotated or the proxy's access is revoked.",
    rootCa:
      "The certificate authority Infisical keeps for this proxy: a PEM certificate and its PKCS#8 PEM private key.",
    rootCaCertificatePem: "The certificate authority's certificate, in PEM form.",
    ca: "The certificate authority the proxy serves, with its certificate in PEM form. Agents trust it to accept the proxy's certificates.",
    rootCaPrivateKey: "The certificate authority's private key, in PKCS#8 PEM form.",
    servedCaCertificate:
      "The certificate authority the proxy serves, in PEM form, when it uses its own instead of Infisical's. Infisical records its fingerprint and returns no `rootCa`.",
    rootCaFingerprint:
      "The SHA-256 fingerprint of the proxy's certificate authority. Pin this if you want to verify the proxy an agent connects to.",
    rootCaExpiresAt: "When the proxy's certificate authority expires.",
    trafficPolicy:
      "Which hosts an agent may reach through this proxy. `any-host` lets every request out; `service-hosts` allows only hosts that the session's services cover, from its access bundle or sent with the session, plus anything in `allowedHosts`, and refuses the rest with a 403. `bundle-hosts` is the old name of `service-hosts` and is still accepted.",
    trafficPolicyProxy:
      "Which hosts the proxy lets agents reach: `any-host` for every host, or `bundle-hosts` for only the hosts the session's services cover plus `allowedHosts`.",
    trafficPolicyRead:
      "Which hosts an agent may reach through this proxy. `any-host` lets every request out; `service-hosts` allows only hosts that the session's services cover, from its access bundle or sent with the session, plus anything in `allowedHosts`, and refuses the rest with a 403.",
    allowedHosts:
      "Hosts that stay reachable under the `service-hosts` traffic policy even though none of the session's services cover them. Still intercepted, and given no credential.",
    pollInterval: "How often, in seconds, the proxy refreshes its sessions and settings. Between 10 and 300.",
    sessionToken: "The session an agent is running with. A selector, not a second credential.",
    createdAt: "When the proxy was registered."
  },
  SESSION_LOGS: {
    chunkId: "The ID of the chunk.",
    proxyId: "The ID of the proxy that uploaded the chunk.",
    endedAt: "The time of the last record in the chunk.",
    ciphertextBytes: "The size of the encrypted chunk in bytes.",
    ciphertextSha256:
      "The SHA-256 digest of the encrypted chunk, including its IV, as base64 without padding. The bucket refuses an upload with a different digest.",
    recordCount: "The number of requests recorded in the chunk.",
    legacyIv:
      "Sent only by Infisical CLI versions that can't record session logs. A request that includes it is refused.",
    uploadUrl:
      "The URL to upload the encrypted chunk to with a PUT request. The body must be exactly `ciphertextBytes` bytes.",
    presignedGetUrl: "The URL to download the chunk from.",
    expiresInSeconds: "The number of seconds before the URL expires.",
    isRecordable: "False if this session's requests can't be recorded.",
    sessionKey: "The key that decrypts every chunk in this response, as base64. Null if the response has no chunks.",
    sessionLogs:
      "Whether session logs are on, whether this session can be recorded, and the key that decrypts the chunks.",
    historyCursor: "The `nextCursor` from the previous response. Leave it out to start from the newest logs.",
    historyNextCursor:
      "Pass this as `cursor` to get older logs. Null when there's nothing older. A page can have no chunks and still have a `nextCursor`.",
    tailCursor:
      "The `nextCursor` from your last call. Leave it out on the first call to start from the most recent chunks.",
    tailNextCursor: "Pass this as `cursor` on your next call, a few seconds later.",
    from: "Return only chunks with records at or after this time. A chunk can also hold earlier records, so filter records by `ts`.",
    to: "Return only chunks with records at or before this time. A chunk can also hold later records, so filter records by `ts`.",
    enabled: "Whether session logs are on.",
    configEnabled: "Whether session logs are on. Turning them off hides recorded logs.",
    disabledReason:
      "Why no logs are returned: `off` when session logs are off, `not-on-plan` when the plan doesn't include the storage they use. Null when logs are returned.",
    storageType: "Where this session's logs are read from: `default` or `external`. Null when session logs are off.",
    storage:
      "Where session logs are stored: `default`, stored by Infisical, or `external`, an S3 bucket you own. Required when turning session logs on.",
    defaultStorageConfigured: "Whether default storage is available. Using it also needs a plan that includes it.",
    appConnectionId: "The ID of the AWS connection Infisical uses to write to and read from the bucket.",
    bucket:
      "The name of the S3 bucket. 3 to 63 characters: lowercase letters, numbers, dots and hyphens, starting and ending with a letter or number.",
    region: "The AWS region of the bucket.",
    keyPrefix:
      "The folder in the bucket to store session logs in, such as `logs/agent-vault`. Up to 256 characters: letters, numbers and `! - _ . ' ( ) /`, with no slash at the start or end, no empty folder name, and no folder named `.` or `..`.",
    corsProbeUrl: "A URL that fails to load in a browser if the bucket's CORS rule doesn't allow Infisical.",
    connectionError:
      "The error Infisical got when it tried to use the AWS connection, for example because AWS refused to let it assume the role. Null if there's no error or no connection.",
    hasSessionLogKey: "Whether the proxy already has this session's log key. If true, the key isn't returned again.",
    proxySessionKey:
      "The session's log key, as base64, sent once. Null when session logs are off or the proxy already has it."
  },

  SESSION: {
    sessionId: "The ID of the session.",
    accessBundles:
      "The access bundle this session carries, by name. A list that accepts one name at most. Leave it out to start a session with services of its own only.",
    inlineServices:
      "Services this session carries itself, alongside its access bundle's or without one. Agent Vault admins only, up to 20. Each takes the same fields as a service in an access bundle, with three differences: the name is optional, every value is sent exactly as given because variables aren't available, and no field can be left to members. They belong to this session only and can't be edited. Their credentials, custom header values and substitution values are deleted when the session is revoked, or within an hour after it expires.",
    inlineServiceName:
      "A name for the service, shown in session logs and in the proxy's error messages. Lowercase letters, numbers and hyphens. Leave it out and the service goes by its first host. Either way, it can't match the name of another service in the session or in its access bundle.",
    inlineServiceValue:
      "The secret, sent exactly as given. Services sent with a session can't use variables, so it can't wrap text in double braces. Never returned.",
    inlineServiceUsername:
      "The username half of the basic credential, sent exactly as given. May be empty if a password is set. Services sent with a session can't use variables, so it can't wrap text in double braces. Never returned.",
    inlineServicePassword:
      "The password half of the basic credential, sent exactly as given. May be empty if a username is set. Services sent with a session can't use variables, so it can't wrap text in double braces. Never returned.",
    inlineMcpCredential: "The credential the proxy attaches to requests to the MCP server, a bearer token.",
    inlineCustomHeaders:
      "Additional headers the proxy attaches to every request to this service, on top of the credential. Up to 20.",
    inlineSubstitutions: "Placeholders the proxy swaps for a real secret before forwarding. Up to 20.",
    inlineCustomHeadersRead: "The headers the proxy attaches besides the credential, without their values.",
    inlineSubstitutionsRead: "The placeholders the proxy swaps for a real secret, without their values.",
    inlineCustomHeaderValue:
      "The header value, sent exactly as given. Services sent with a session can't use variables, so it can't wrap text in double braces. Never returned.",
    inlineSubstitutionValue:
      "The real value the placeholder is replaced with, sent exactly as given. Services sent with a session can't use variables, so it can't wrap text in double braces. Never returned.",
    inlineServicesRead:
      "The services sent with this session when it was created, without their secrets. Its access bundle's services aren't listed here. Empty when the session carries only an access bundle.",
    inlineServiceId: "The ID of the service sent with this session.",
    inlineServiceNameRead:
      "The name the service was sent with, or its first host if it was sent without one. Shown in session logs and in the proxy's error messages.",
    ttl: "How long the session lasts: a duration such as 30m, 8h or 7d (at least 1m), or never. Defaults to 7d, or to 1h for a session started on behalf of a user.",
    label:
      "A short description of what the session is for, such as `nightly deploy` or `support ticket triage`. Up to 128 characters, without line breaks, tabs, or invisible characters. Shown wherever the session is listed.",
    updateLabel:
      "The new label for the session, up to 128 characters, without line breaks, tabs, or invisible characters. Send null or an empty string to remove the label. You can't change the label once the session's owner, or the user it was started on behalf of, is deleted.",
    onBehalfOf:
      "Start the session on behalf of a user instead of yourself. Only a machine identity whose delegation covers the user can do this. The session can use only an access bundle that both the user and the machine identity can use, and it uses the user's personal values. The session still belongs to the machine identity, so only the machine identity and Agent Vault admins can see it and its session logs, not the user. Name the user by userId or by userEmail, not both.",
    onBehalfOfUserId: "The ID of the user to start the session on behalf of.",
    onBehalfOfUserEmail: "The email address of the user to start the session on behalf of.",
    token: "The session token. Returned once, at mint, and never again.",
    expiresAt: "When the session expires, or null when it never does.",
    scope: "Whose sessions to list: your own (mine) or everyone's (all, administrators only).",
    status:
      "Filter by session status: `active`, `revoked` or `expired`. Separate several with commas to match any of them.",
    search:
      "Match sessions by label, actor name, actor email, the name or email of the user a session was started on behalf of, or access bundle name.",
    limit: "The maximum number of sessions to return.",
    offset: "How many sessions to skip.",
    actorType: "Whether the session belongs to a user or a machine identity.",
    actorId: "The ID of the user or machine identity the session belongs to, or null if it was deleted.",
    username: "The username of the user. Once the user is deleted, the email recorded when the session was created.",
    email: "The email address of the user. Once the user is deleted, the email recorded when the session was created.",
    firstName:
      "The first name of the user. Once the user is deleted, the full name recorded when the session was created.",
    lastName: "The last name of the user, or null once the user is deleted.",
    identityName:
      "The name of the machine identity. Once the machine identity is deleted, the name recorded when the session was created.",
    onBehalfOfSession:
      "The user the machine identity in actor started this session on behalf of, or null when the session is the actor's own.",
    onBehalfOfType: "Always user: a machine identity starts sessions only on behalf of users.",
    onBehalfOfUserIdRead: "The ID of the user, or null once the user is deleted."
  },
  DELEGATION: {
    machineIdentityId: "The ID of the machine identity the delegation belongs to.",
    machineIdentityIds:
      "Return only the delegations of these machine identities. Separate several IDs with commas, up to 100.",
    machineIdentity: "The machine identity that can start sessions on behalf of users.",
    machineIdentityName: "The name of the machine identity.",
    scope:
      "Which users the machine identity can start sessions on behalf of: every Agent Vault member (all-members), or only the users and the members of the groups in the delegation (selected).",
    userIds:
      "The users the machine identity can act on behalf of, up to 100. Each must be a member of Agent Vault. Only allowed when the scope is selected.",
    groupIds:
      "The groups whose members the machine identity can act on behalf of, up to 100. Each must be a member of Agent Vault. Only allowed when the scope is selected.",
    users: "The users in the delegation.",
    groups: "The groups in the delegation. Their members are covered while they stay in the group.",
    userId: "The ID of the user.",
    username: "The username of the user.",
    email: "The email address of the user.",
    firstName: "The first name of the user.",
    lastName: "The last name of the user.",
    groupId: "The ID of the group.",
    groupName: "The name of the group.",
    addedAt: "When the user or group was added to the delegation.",
    missingAccessBundles:
      "The access bundles that users the delegation covers can use and the machine identity can't. A session on behalf of a user can use only an access bundle that both can use, so the machine identity can't start sessions over these. With all-members, this is every access bundle the machine identity can't use, since Agent Vault admins can use every bundle. Always empty when the machine identity reads its own delegation, unless it's an Agent Vault admin.",
    userMissingAccessBundles:
      "The access bundles this user can use and the machine identity can't, so the machine identity can't start sessions over them on the user's behalf. For an Agent Vault admin, this is every access bundle the machine identity can't use. Always empty when the machine identity reads its own delegation, unless it's an Agent Vault admin.",
    groupMissingAccessBundles:
      "The access bundles granted to this group, or every bundle if the group has the Admin role, that the machine identity can't use. Always empty when the machine identity reads its own delegation, unless it's an Agent Vault admin.",
    accessBundleId: "The ID of the access bundle.",
    accessBundleName: "The name of the access bundle.",
    createdAt: "When the delegation was set up.",
    updatedAt: "When the delegation was last saved.",
    limit: "The maximum number of delegations to return.",
    offset: "How many delegations to skip.",
    totalCount: "How many delegations match, across every page.",
    addUserIds:
      "The users to add, up to 100. Each must be a member of Agent Vault. Users the delegation already names are skipped.",
    addGroupIds:
      "The groups to add, up to 100. Each must be a member of Agent Vault. Groups the delegation already names are skipped.",
    removeUserIds: "The users to take out of the delegation, up to 100. Users it doesn't name are skipped.",
    removeGroupIds: "The groups to take out of the delegation, up to 100. Groups it doesn't name are skipped.",
    afterRemove:
      "The delegation after the change, or null if it no longer names anyone. A delegation that names no one is removed."
  },
  AVAILABLE_DELEGATION_SUBJECT: {
    actorTypeFilter: "List only users, or only groups.",
    search: "Match users by name, username or email address, and groups by name.",
    limit: "The maximum number of users and groups to return.",
    offset: "How many users and groups to skip.",
    totalCount: "How many users and groups match, across every page."
  }
};

export const IMPERVA_PKI_SYNC_DESTINATION_CONFIG = {
  siteId: "The numeric ID of the Imperva website that receives the certificate.",
  siteName: "The website's name, kept for display. Imperva's website ID is what the sync acts on."
};

export const PALO_ALTO_NETWORKS_PKI_SYNC_DESTINATION_CONFIG = {
  template:
    "The Panorama template to store certificates in. Required when the connection points to a Panorama, and not allowed for a firewall.",
  pushToDevices:
    "Whether to push every template stack that contains the template to its firewalls after a commit. Applies to Panorama only.",
  sslTlsServiceProfileName: "The name of the SSL/TLS service profile to point at the synced certificate.",
  sslTlsServiceProfileVsys:
    "The virtual system the SSL/TLS service profile belongs to. Leave it out for a shared profile.",
  replacementCertificateName:
    "The certificate on the device that the SSL/TLS service profile switches to before the synced certificate is deleted. Required when the removal would leave the profile without a certificate."
};

export const PKI_SYNC_FILTERS = {
  filters:
    "Which of the Application's certificates this sync holds. A certificate must match every field that is set, and a sync with no filters holds nothing.",
  updateFilters:
    "Replaces which of the Application's certificates this sync holds. Omit to leave them unchanged, or set to null to empty the sync.",
  profileIds: "Match certificates issued from any one of these certificate profiles.",
  certificateOrderIds:
    "Match any certificate belonging to any one of these certificate orders. An order groups a certificate with every renewal of it, so this keeps matching as the certificate is renewed.",
  metadata:
    "Match certificates carrying every one of these metadata pairs. Give a key on its own to match any value for that key.",
  metadataKey: "Metadata key the certificate must carry.",
  metadataValue: "Metadata value the key must have. Omit it to match any value.",
  previewPkiSyncId: "Preview the filters against this existing PKI Sync.",
  previewApplicationId: "Preview the filters against this Application, for a PKI Sync that does not exist yet.",
  previewOffset: "The offset to start from. If you enter 10, it will start from the 10th matching certificate.",
  previewLimit: "The number of matching certificates to return."
};

export const APPROVAL_POLICY_AUTO_APPROVAL = {
  autoApproval:
    "Rules that approve a request instantly when another system already vouches for it. Sending this replaces the policy's inputs and rules; omit it to leave them unchanged.",
  inputs:
    "Request form fields: records requesters can link when they submit, such as a Jira ticket. Each one adds an optional field to the request form.",
  inputConnectionId: "The ID of the App Connection the record is read through.",
  inputSubject:
    "What the requester links, from the connection's subjects in the auto-approval catalog (e.g. 'submitted-ticket').",
  rules: "The rules a request is checked against on submission. Any passing rule approves it; a rule never rejects.",
  ruleName: "A name that tells approvers why the rule approved a request.",
  conditions: "Every condition in a rule must pass for the rule to approve.",
  conditionConnectionId:
    "The ID of the App Connection the condition reads, matching one of the inputs, or any available connection when the subject is 'requester'.",
  conditionSubject:
    "What the condition checks: one of the inputs' subjects, or 'requester' for the requester's own account.",
  constraint: "Which check to run, from the subject's constraints in the auto-approval catalog (e.g. 'status').",
  values: "The values the check accepts. Several values mean any of them; checks that take no value use an empty list.",
  requestInputs:
    "Values for the policy's request form fields, such as a Jira ticket key or link. Malformed values are rejected.",
  requestInputValue: "The value the requester entered, such as 'PAY-123' or a link to the ticket.",
  outcome:
    "How the policy's auto-approval rules evaluated this request at submission. Null when the policy had no rules or the resource does not allow auto-approval.",
  catalogScope: "The scope of the policy the rules are for.",
  catalogScopeId: "The ID of the scope.",
  optionsConnectionId: "The ID of the App Connection to list values from.",
  optionsSubject: "The subject the condition checks.",
  optionsConstraint: "The check to list values for.",
  optionsSearch: "Filters the values by this text.",
  optionsSiblings:
    "A JSON object of the values already picked in the rule's other conditions, keyed by constraint, which narrows the values listed (e.g. statuses for the picked projects)."
};