cert.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import type { AutoCertChallengeMethod } from './auto_cert'
  2. import type { AcmeUser } from '@/api/acme_user'
  3. import type { ModelBase } from '@/api/curd'
  4. import type { DnsCredential } from '@/api/dns_credential'
  5. import type { PrivateKeyType } from '@/constants'
  6. import { useCurdApi } from '@uozi-admin/request'
  7. export interface Cert extends ModelBase {
  8. name: string
  9. domains: string[]
  10. filename: string
  11. ssl_certificate_path: string
  12. ssl_certificate: string
  13. ssl_certificate_key_path: string
  14. ssl_certificate_key: string
  15. auto_cert: number
  16. challenge_method: keyof typeof AutoCertChallengeMethod
  17. dns_credential_id: number
  18. dns_credential?: DnsCredential
  19. acme_user_id: number
  20. acme_user?: AcmeUser
  21. key_type: string
  22. log: string
  23. certificate_info: CertificateInfo
  24. sync_node_ids: number[]
  25. revoke_old: boolean
  26. }
  27. export interface CertificateInfo {
  28. subject_name: string
  29. issuer_name: string
  30. not_after: string
  31. not_before: string
  32. }
  33. export interface CertificateResult {
  34. ssl_certificate: string
  35. ssl_certificate_key: string
  36. key_type: PrivateKeyType
  37. }
  38. const cert = useCurdApi<Cert>('/certs')
  39. export default cert