-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtypes.ts
137 lines (120 loc) · 2.92 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// Copyright 2022 Adam K Dean <adamkdean@googlemail.com>
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
/* eslint-disable @typescript-eslint/no-explicit-any */
export type Certificate = {
'certificate.crt': string
'ca_bundle.crt': string
}
export type CertificateList = {
total_count: number
result_count: number
page: number
limit: number
results: CertificateRecord[]
}
export type CertificateRecord = {
id: string
type: string
common_name: string
additional_domains: string
created: string
expires: string
status: string
validation_type: string
validation_emails: string
replacement_for: string
validation: {
email_validation: { [domain: string]: string[] }
other_methods: {
[domain: string]: {
file_validation_url_http: string
file_validation_url_https: string
file_validation_content: string[]
cname_validation_p1: string
cname_validation_p2: string
}
}
}
}
export interface StatusResponse {
success: 1 | 0;
}
export type CertificateSigningRequestOptions = {
country: string
state: string
locality: string
organization: string
organizationUnit: string
email?: string
commonName: string
}
export type CertificateSigningRequestValidationResult = {
valid: boolean
error?: ZeroSSLErrorData
}
export type CreateCertificateOptions = {
csr: string
domains: string[]
validityDays: 90 | 365
strictDomains: boolean
}
export type KeyPair = {
publicKey: string
privateKey: string
}
export type ListCertificateOptions = {
page?: number
limit?: number
search?: string
certificate_status?: 'draft' | 'pending_validation' | 'issued' | 'cancelled' | 'expiring_soon' | 'expire'
}
export type VerificationStatus = {
validation_completed: number
details: {
[domain: string]: {
method: string
status: string
}
}
}
export type VerifyDomainOptions = {
validation_method: 'EMAIL' | 'CNAME_CSR_HASH' | 'HTTP_CSR_HASH' | 'HTTPS_CSR_HASH'
validation_email?: string
}
export type ZeroSSLOptions = {
accessKey: string
apiUrl?: string
}
export type ZeroSSLErrorData = {
code?: number
type?: string
message?: string
details?: ZeroSSLErrorDetail
}
export type ZeroSSLErrorDetail = ZeroSSLVerifyDomainsCNAMEErrorDetail | ZeroSSLVerifyDomainsHTTPFileUploadErrorDetail
export type ZeroSSLVerifyDomainsCNAMEErrorDetail = {
[domain: string]: {
[domain: string]: {
cname_found: number
record_correct: number
target_host: string
target_record: string
actual_record: string
}
}
}
export type ZeroSSLVerifyDomainsHTTPFileUploadErrorDetail = {
[domain: string]: {
[path: string]: {
validation_successful: false | undefined
file_found: number
error: boolean
error_slug: string
error_info: string
} | {
validation_successful: true
}
}
}