@distilled.cloud/acme 0.0.0-placeholder → 1.0.0-rc.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +73 -0
- package/lib/credentials.d.ts +50 -0
- package/lib/credentials.d.ts.map +1 -0
- package/lib/credentials.js +57 -0
- package/lib/credentials.js.map +1 -0
- package/lib/errors.d.ts +73 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +50 -0
- package/lib/errors.js.map +1 -0
- package/lib/index.d.ts +30 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +30 -0
- package/lib/index.js.map +1 -0
- package/lib/jose.d.ts +66 -0
- package/lib/jose.d.ts.map +1 -0
- package/lib/jose.js +128 -0
- package/lib/jose.js.map +1 -0
- package/lib/protocol.d.ts +27 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/protocol.js +410 -0
- package/lib/protocol.js.map +1 -0
- package/lib/response-validation.test.d.ts +4 -0
- package/lib/response-validation.test.d.ts.map +1 -0
- package/lib/response-validation.test.js +51 -0
- package/lib/response-validation.test.js.map +1 -0
- package/lib/retry.d.ts +33 -0
- package/lib/retry.d.ts.map +1 -0
- package/lib/retry.js +33 -0
- package/lib/retry.js.map +1 -0
- package/lib/services/acme.d.ts +446 -0
- package/lib/services/acme.d.ts.map +1 -0
- package/lib/services/acme.js +597 -0
- package/lib/services/acme.js.map +1 -0
- package/lib/services/index.d.ts +2 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +3 -0
- package/lib/services/index.js.map +1 -0
- package/lib/traits.d.ts +13 -0
- package/lib/traits.d.ts.map +1 -0
- package/lib/traits.js +13 -0
- package/lib/traits.js.map +1 -0
- package/package.json +75 -7
- package/src/credentials.ts +106 -0
- package/src/errors.ts +101 -0
- package/src/index.ts +33 -0
- package/src/jose.ts +234 -0
- package/src/protocol.ts +582 -0
- package/src/response-validation.test.ts +65 -0
- package/src/retry.ts +55 -0
- package/src/services/acme.ts +1140 -0
- package/src/services/index.ts +2 -0
- package/src/traits.ts +46 -0
|
@@ -0,0 +1,1140 @@
|
|
|
1
|
+
// AUTO-GENERATED by scripts/generate.ts from manual-specs/acme.json (hand-authored Smithy, RFC 8555). Do not edit.
|
|
2
|
+
import * as S from "@distilled.cloud/core/schema";
|
|
3
|
+
import * as API from "@distilled.cloud/core/api";
|
|
4
|
+
import * as C from "@distilled.cloud/core/category";
|
|
5
|
+
import * as T from "../traits.ts";
|
|
6
|
+
import {
|
|
7
|
+
AcmeProtocol,
|
|
8
|
+
type AcmeOpError,
|
|
9
|
+
type AcmeOpContext,
|
|
10
|
+
} from "../protocol.ts";
|
|
11
|
+
import * as Retry from "../retry.ts";
|
|
12
|
+
|
|
13
|
+
export type { AcmeOpError, AcmeOpContext };
|
|
14
|
+
|
|
15
|
+
/** onlyReturnExisting was set and no account matches this key. */
|
|
16
|
+
export class AcmeAccountDoesNotExist
|
|
17
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
18
|
+
/*@__PURE__*/ S.TaggedError<AcmeAccountDoesNotExist>()(
|
|
19
|
+
"AcmeAccountDoesNotExist",
|
|
20
|
+
{
|
|
21
|
+
code: S.Number,
|
|
22
|
+
message: S.String,
|
|
23
|
+
type: S.String,
|
|
24
|
+
detail: S.String,
|
|
25
|
+
},
|
|
26
|
+
),
|
|
27
|
+
[
|
|
28
|
+
{
|
|
29
|
+
message: {
|
|
30
|
+
matches: "^urn:ietf:params:acme:error:accountDoesNotExist$",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
) {}
|
|
35
|
+
|
|
36
|
+
export class AcmeAlreadyRevoked
|
|
37
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
38
|
+
/*@__PURE__*/ S.TaggedError<AcmeAlreadyRevoked>()("AcmeAlreadyRevoked", {
|
|
39
|
+
code: S.Number,
|
|
40
|
+
message: S.String,
|
|
41
|
+
type: S.String,
|
|
42
|
+
detail: S.String,
|
|
43
|
+
}),
|
|
44
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:alreadyRevoked$" } }],
|
|
45
|
+
) {}
|
|
46
|
+
|
|
47
|
+
export class AcmeBadCsr
|
|
48
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
49
|
+
/*@__PURE__*/ S.TaggedError<AcmeBadCsr>()("AcmeBadCsr", {
|
|
50
|
+
code: S.Number,
|
|
51
|
+
message: S.String,
|
|
52
|
+
type: S.String,
|
|
53
|
+
detail: S.String,
|
|
54
|
+
}),
|
|
55
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:badCSR$" } }],
|
|
56
|
+
) {}
|
|
57
|
+
|
|
58
|
+
/** The anti-replay nonce was rejected. The protocol retries at most twice using the rejection's nonce before surfacing this error. */
|
|
59
|
+
export class AcmeBadNonce
|
|
60
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
61
|
+
/*@__PURE__*/ S.TaggedError<AcmeBadNonce>()("AcmeBadNonce", {
|
|
62
|
+
code: S.Number,
|
|
63
|
+
message: S.String,
|
|
64
|
+
type: S.String,
|
|
65
|
+
detail: S.String,
|
|
66
|
+
}),
|
|
67
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:badNonce$" } }],
|
|
68
|
+
) {}
|
|
69
|
+
|
|
70
|
+
export class AcmeBadPublicKey
|
|
71
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
72
|
+
/*@__PURE__*/ S.TaggedError<AcmeBadPublicKey>()("AcmeBadPublicKey", {
|
|
73
|
+
code: S.Number,
|
|
74
|
+
message: S.String,
|
|
75
|
+
type: S.String,
|
|
76
|
+
detail: S.String,
|
|
77
|
+
}),
|
|
78
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:badPublicKey$" } }],
|
|
79
|
+
) {}
|
|
80
|
+
|
|
81
|
+
export class AcmeBadRevocationReason
|
|
82
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
83
|
+
/*@__PURE__*/ S.TaggedError<AcmeBadRevocationReason>()(
|
|
84
|
+
"AcmeBadRevocationReason",
|
|
85
|
+
{
|
|
86
|
+
code: S.Number,
|
|
87
|
+
message: S.String,
|
|
88
|
+
type: S.String,
|
|
89
|
+
detail: S.String,
|
|
90
|
+
},
|
|
91
|
+
),
|
|
92
|
+
[
|
|
93
|
+
{
|
|
94
|
+
message: {
|
|
95
|
+
matches: "^urn:ietf:params:acme:error:badRevocationReason$",
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
) {}
|
|
100
|
+
|
|
101
|
+
export class AcmeBadSignatureAlgorithm
|
|
102
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
103
|
+
/*@__PURE__*/ S.TaggedError<AcmeBadSignatureAlgorithm>()(
|
|
104
|
+
"AcmeBadSignatureAlgorithm",
|
|
105
|
+
{
|
|
106
|
+
code: S.Number,
|
|
107
|
+
message: S.String,
|
|
108
|
+
type: S.String,
|
|
109
|
+
detail: S.String,
|
|
110
|
+
},
|
|
111
|
+
),
|
|
112
|
+
[
|
|
113
|
+
{
|
|
114
|
+
message: {
|
|
115
|
+
matches: "^urn:ietf:params:acme:error:badSignatureAlgorithm$",
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
) {}
|
|
120
|
+
|
|
121
|
+
/** A CAA record forbids this CA from issuing for the identifier. */
|
|
122
|
+
export class AcmeCaa
|
|
123
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
124
|
+
/*@__PURE__*/ S.TaggedError<AcmeCaa>()("AcmeCaa", {
|
|
125
|
+
code: S.Number,
|
|
126
|
+
message: S.String,
|
|
127
|
+
type: S.String,
|
|
128
|
+
detail: S.String,
|
|
129
|
+
}),
|
|
130
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:caa$" } }],
|
|
131
|
+
) {}
|
|
132
|
+
|
|
133
|
+
export class AcmeConnection
|
|
134
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
135
|
+
/*@__PURE__*/ S.TaggedError<AcmeConnection>()("AcmeConnection", {
|
|
136
|
+
code: S.Number,
|
|
137
|
+
message: S.String,
|
|
138
|
+
type: S.String,
|
|
139
|
+
detail: S.String,
|
|
140
|
+
}),
|
|
141
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:connection$" } }],
|
|
142
|
+
) {}
|
|
143
|
+
|
|
144
|
+
/** The CA could not resolve the identifier (DNS-01 record missing or not propagated). */
|
|
145
|
+
export class AcmeDns
|
|
146
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
147
|
+
/*@__PURE__*/ S.TaggedError<AcmeDns>()("AcmeDns", {
|
|
148
|
+
code: S.Number,
|
|
149
|
+
message: S.String,
|
|
150
|
+
type: S.String,
|
|
151
|
+
detail: S.String,
|
|
152
|
+
}),
|
|
153
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:dns$" } }],
|
|
154
|
+
) {}
|
|
155
|
+
|
|
156
|
+
/** This CA needs an External Account Binding on newAccount (ZeroSSL, Google Trust Services). */
|
|
157
|
+
export class AcmeExternalAccountRequired
|
|
158
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
159
|
+
/*@__PURE__*/ S.TaggedError<AcmeExternalAccountRequired>()(
|
|
160
|
+
"AcmeExternalAccountRequired",
|
|
161
|
+
{
|
|
162
|
+
code: S.Number,
|
|
163
|
+
message: S.String,
|
|
164
|
+
type: S.String,
|
|
165
|
+
detail: S.String,
|
|
166
|
+
},
|
|
167
|
+
),
|
|
168
|
+
[
|
|
169
|
+
{
|
|
170
|
+
message: {
|
|
171
|
+
matches: "^urn:ietf:params:acme:error:externalAccountRequired$",
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
) {}
|
|
176
|
+
|
|
177
|
+
export class AcmeIncorrectResponse
|
|
178
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
179
|
+
/*@__PURE__*/ S.TaggedError<AcmeIncorrectResponse>()(
|
|
180
|
+
"AcmeIncorrectResponse",
|
|
181
|
+
{
|
|
182
|
+
code: S.Number,
|
|
183
|
+
message: S.String,
|
|
184
|
+
type: S.String,
|
|
185
|
+
detail: S.String,
|
|
186
|
+
},
|
|
187
|
+
),
|
|
188
|
+
[
|
|
189
|
+
{
|
|
190
|
+
message: { matches: "^urn:ietf:params:acme:error:incorrectResponse$" },
|
|
191
|
+
},
|
|
192
|
+
],
|
|
193
|
+
) {}
|
|
194
|
+
|
|
195
|
+
export class AcmeInvalidContact
|
|
196
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
197
|
+
/*@__PURE__*/ S.TaggedError<AcmeInvalidContact>()("AcmeInvalidContact", {
|
|
198
|
+
code: S.Number,
|
|
199
|
+
message: S.String,
|
|
200
|
+
type: S.String,
|
|
201
|
+
detail: S.String,
|
|
202
|
+
}),
|
|
203
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:invalidContact$" } }],
|
|
204
|
+
) {}
|
|
205
|
+
|
|
206
|
+
export class AcmeMalformed
|
|
207
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
208
|
+
/*@__PURE__*/ S.TaggedError<AcmeMalformed>()("AcmeMalformed", {
|
|
209
|
+
code: S.Number,
|
|
210
|
+
message: S.String,
|
|
211
|
+
type: S.String,
|
|
212
|
+
detail: S.String,
|
|
213
|
+
}),
|
|
214
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:malformed$" } }],
|
|
215
|
+
) {}
|
|
216
|
+
|
|
217
|
+
/** finalize was called before every authorization was valid. */
|
|
218
|
+
export class AcmeOrderNotReady
|
|
219
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
220
|
+
/*@__PURE__*/ S.TaggedError<AcmeOrderNotReady>()("AcmeOrderNotReady", {
|
|
221
|
+
code: S.Number,
|
|
222
|
+
message: S.String,
|
|
223
|
+
type: S.String,
|
|
224
|
+
detail: S.String,
|
|
225
|
+
}),
|
|
226
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:orderNotReady$" } }],
|
|
227
|
+
) {}
|
|
228
|
+
|
|
229
|
+
/** The CA's rate limit was hit; `retryAfter` carries its hint when the CA sends one. */
|
|
230
|
+
export class AcmeRateLimited
|
|
231
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
232
|
+
/*@__PURE__*/ S.TaggedError<AcmeRateLimited>()("AcmeRateLimited", {
|
|
233
|
+
retryAfter: S.optional(S.Duration),
|
|
234
|
+
code: S.Number,
|
|
235
|
+
message: S.String,
|
|
236
|
+
type: S.String,
|
|
237
|
+
detail: S.String,
|
|
238
|
+
}).pipe(C.withThrottlingError, C.withRetryableError),
|
|
239
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:rateLimited$" } }],
|
|
240
|
+
) {}
|
|
241
|
+
|
|
242
|
+
/** The CA will not issue for this identifier (policy, blocklist). */
|
|
243
|
+
export class AcmeRejectedIdentifier
|
|
244
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
245
|
+
/*@__PURE__*/ S.TaggedError<AcmeRejectedIdentifier>()(
|
|
246
|
+
"AcmeRejectedIdentifier",
|
|
247
|
+
{
|
|
248
|
+
code: S.Number,
|
|
249
|
+
message: S.String,
|
|
250
|
+
type: S.String,
|
|
251
|
+
detail: S.String,
|
|
252
|
+
},
|
|
253
|
+
),
|
|
254
|
+
[
|
|
255
|
+
{
|
|
256
|
+
message: { matches: "^urn:ietf:params:acme:error:rejectedIdentifier$" },
|
|
257
|
+
},
|
|
258
|
+
],
|
|
259
|
+
) {}
|
|
260
|
+
|
|
261
|
+
export class AcmeServerInternal
|
|
262
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
263
|
+
/*@__PURE__*/ S.TaggedError<AcmeServerInternal>()("AcmeServerInternal", {
|
|
264
|
+
code: S.Number,
|
|
265
|
+
message: S.String,
|
|
266
|
+
type: S.String,
|
|
267
|
+
detail: S.String,
|
|
268
|
+
}).pipe(C.withRetryableError),
|
|
269
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:serverInternal$" } }],
|
|
270
|
+
) {}
|
|
271
|
+
|
|
272
|
+
export class AcmeTls
|
|
273
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
274
|
+
/*@__PURE__*/ S.TaggedError<AcmeTls>()("AcmeTls", {
|
|
275
|
+
code: S.Number,
|
|
276
|
+
message: S.String,
|
|
277
|
+
type: S.String,
|
|
278
|
+
detail: S.String,
|
|
279
|
+
}),
|
|
280
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:tls$" } }],
|
|
281
|
+
) {}
|
|
282
|
+
|
|
283
|
+
export class AcmeUnauthorized
|
|
284
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
285
|
+
/*@__PURE__*/ S.TaggedError<AcmeUnauthorized>()("AcmeUnauthorized", {
|
|
286
|
+
code: S.Number,
|
|
287
|
+
message: S.String,
|
|
288
|
+
type: S.String,
|
|
289
|
+
detail: S.String,
|
|
290
|
+
}),
|
|
291
|
+
[{ message: { matches: "^urn:ietf:params:acme:error:unauthorized$" } }],
|
|
292
|
+
) {}
|
|
293
|
+
|
|
294
|
+
export class AcmeUnsupportedContact
|
|
295
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
296
|
+
/*@__PURE__*/ S.TaggedError<AcmeUnsupportedContact>()(
|
|
297
|
+
"AcmeUnsupportedContact",
|
|
298
|
+
{
|
|
299
|
+
code: S.Number,
|
|
300
|
+
message: S.String,
|
|
301
|
+
type: S.String,
|
|
302
|
+
detail: S.String,
|
|
303
|
+
},
|
|
304
|
+
),
|
|
305
|
+
[
|
|
306
|
+
{
|
|
307
|
+
message: { matches: "^urn:ietf:params:acme:error:unsupportedContact$" },
|
|
308
|
+
},
|
|
309
|
+
],
|
|
310
|
+
) {}
|
|
311
|
+
|
|
312
|
+
export class AcmeUnsupportedIdentifier
|
|
313
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
314
|
+
/*@__PURE__*/ S.TaggedError<AcmeUnsupportedIdentifier>()(
|
|
315
|
+
"AcmeUnsupportedIdentifier",
|
|
316
|
+
{
|
|
317
|
+
code: S.Number,
|
|
318
|
+
message: S.String,
|
|
319
|
+
type: S.String,
|
|
320
|
+
detail: S.String,
|
|
321
|
+
},
|
|
322
|
+
),
|
|
323
|
+
[
|
|
324
|
+
{
|
|
325
|
+
message: {
|
|
326
|
+
matches: "^urn:ietf:params:acme:error:unsupportedIdentifier$",
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
],
|
|
330
|
+
) {}
|
|
331
|
+
|
|
332
|
+
/** The CA needs a human step (new terms of service, a subscriber agreement); `detail` says what. */
|
|
333
|
+
export class AcmeUserActionRequired
|
|
334
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
335
|
+
/*@__PURE__*/ S.TaggedError<AcmeUserActionRequired>()(
|
|
336
|
+
"AcmeUserActionRequired",
|
|
337
|
+
{
|
|
338
|
+
code: S.Number,
|
|
339
|
+
message: S.String,
|
|
340
|
+
type: S.String,
|
|
341
|
+
detail: S.String,
|
|
342
|
+
},
|
|
343
|
+
),
|
|
344
|
+
[
|
|
345
|
+
{
|
|
346
|
+
message: { matches: "^urn:ietf:params:acme:error:userActionRequired$" },
|
|
347
|
+
},
|
|
348
|
+
],
|
|
349
|
+
) {}
|
|
350
|
+
|
|
351
|
+
export interface DeactivateAuthorizationRequest {
|
|
352
|
+
/** Absolute URL of the resource, as returned by the CA. */
|
|
353
|
+
url: string;
|
|
354
|
+
/** Always `deactivated`. */
|
|
355
|
+
status: string;
|
|
356
|
+
}
|
|
357
|
+
export const DeactivateAuthorizationRequest = /*@__PURE__*/ S.suspend(() =>
|
|
358
|
+
S.Struct({
|
|
359
|
+
url: S.String.pipe(T.Label()),
|
|
360
|
+
status: S.String,
|
|
361
|
+
}).pipe(
|
|
362
|
+
T.Http({ method: "POST", uri: "/authz/{url}/deactivate", code: 200 }),
|
|
363
|
+
),
|
|
364
|
+
).annotate({
|
|
365
|
+
identifier: "DeactivateAuthorizationRequest",
|
|
366
|
+
}) as any as S.Schema<DeactivateAuthorizationRequest>;
|
|
367
|
+
|
|
368
|
+
export interface Identifier {
|
|
369
|
+
/** `dns` (RFC 8555) or `ip` (RFC 8738). */
|
|
370
|
+
type: string;
|
|
371
|
+
value: string;
|
|
372
|
+
}
|
|
373
|
+
export const Identifier = /*@__PURE__*/ S.suspend(() =>
|
|
374
|
+
S.Struct({
|
|
375
|
+
type: S.String,
|
|
376
|
+
value: S.String,
|
|
377
|
+
}),
|
|
378
|
+
).annotate({ identifier: "Identifier" }) as any as S.Schema<Identifier>;
|
|
379
|
+
|
|
380
|
+
export interface Subproblem {
|
|
381
|
+
type?: string;
|
|
382
|
+
detail?: string;
|
|
383
|
+
identifier?: Identifier;
|
|
384
|
+
}
|
|
385
|
+
export const Subproblem = /*@__PURE__*/ S.suspend(() =>
|
|
386
|
+
S.Struct({
|
|
387
|
+
type: S.optional(S.String),
|
|
388
|
+
detail: S.optional(S.String),
|
|
389
|
+
identifier: S.optional(Identifier),
|
|
390
|
+
}),
|
|
391
|
+
).annotate({ identifier: "Subproblem" }) as any as S.Schema<Subproblem>;
|
|
392
|
+
|
|
393
|
+
export type ProblemSubproblemsList = Array<Subproblem>;
|
|
394
|
+
export const ProblemSubproblemsList = /*@__PURE__*/ S.Array(
|
|
395
|
+
Subproblem,
|
|
396
|
+
) as any as S.Schema<ProblemSubproblemsList>;
|
|
397
|
+
|
|
398
|
+
/** RFC 7807 problem document (RFC 8555 §6.7). */
|
|
399
|
+
export interface Problem {
|
|
400
|
+
type?: string;
|
|
401
|
+
detail?: string;
|
|
402
|
+
status?: number;
|
|
403
|
+
instance?: string;
|
|
404
|
+
identifier?: Identifier;
|
|
405
|
+
subproblems?: ProblemSubproblemsList;
|
|
406
|
+
}
|
|
407
|
+
export const Problem = /*@__PURE__*/ S.suspend(() =>
|
|
408
|
+
S.Struct({
|
|
409
|
+
type: S.optional(S.String),
|
|
410
|
+
detail: S.optional(S.String),
|
|
411
|
+
status: S.optional(S.Number),
|
|
412
|
+
instance: S.optional(S.String),
|
|
413
|
+
identifier: S.optional(Identifier),
|
|
414
|
+
subproblems: S.optional(ProblemSubproblemsList),
|
|
415
|
+
}),
|
|
416
|
+
).annotate({ identifier: "Problem" }) as any as S.Schema<Problem>;
|
|
417
|
+
|
|
418
|
+
/** RFC 8555 §8 */
|
|
419
|
+
export interface Challenge {
|
|
420
|
+
/** dns-01 | http-01 | tls-alpn-01 */
|
|
421
|
+
type: string;
|
|
422
|
+
url: string;
|
|
423
|
+
/** pending | processing | valid | invalid */
|
|
424
|
+
status: string;
|
|
425
|
+
validated?: string;
|
|
426
|
+
token?: string;
|
|
427
|
+
error?: Problem;
|
|
428
|
+
}
|
|
429
|
+
export const Challenge = /*@__PURE__*/ S.suspend(() =>
|
|
430
|
+
S.Struct({
|
|
431
|
+
type: S.String,
|
|
432
|
+
url: S.String,
|
|
433
|
+
status: S.String,
|
|
434
|
+
validated: S.optional(S.String),
|
|
435
|
+
token: S.optional(S.String),
|
|
436
|
+
error: S.optional(Problem),
|
|
437
|
+
}),
|
|
438
|
+
).annotate({ identifier: "Challenge" }) as any as S.Schema<Challenge>;
|
|
439
|
+
|
|
440
|
+
export type AuthorizationChallengesList = Array<Challenge>;
|
|
441
|
+
export const AuthorizationChallengesList = /*@__PURE__*/ S.Array(
|
|
442
|
+
Challenge,
|
|
443
|
+
) as any as S.Schema<AuthorizationChallengesList>;
|
|
444
|
+
|
|
445
|
+
/** RFC 8555 §7.1.4 */
|
|
446
|
+
export interface Authorization {
|
|
447
|
+
identifier: Identifier;
|
|
448
|
+
/** pending | valid | invalid | deactivated | expired | revoked */
|
|
449
|
+
status: string;
|
|
450
|
+
expires?: string;
|
|
451
|
+
challenges: AuthorizationChallengesList;
|
|
452
|
+
wildcard?: boolean;
|
|
453
|
+
}
|
|
454
|
+
export const Authorization = /*@__PURE__*/ S.suspend(() =>
|
|
455
|
+
S.Struct({
|
|
456
|
+
identifier: Identifier,
|
|
457
|
+
status: S.String,
|
|
458
|
+
expires: S.optional(S.String),
|
|
459
|
+
challenges: AuthorizationChallengesList,
|
|
460
|
+
wildcard: S.optional(S.Boolean),
|
|
461
|
+
}),
|
|
462
|
+
).annotate({ identifier: "Authorization" }) as any as S.Schema<Authorization>;
|
|
463
|
+
|
|
464
|
+
export interface DownloadCertificateRequest {
|
|
465
|
+
/** Absolute URL of the resource, as returned by the CA. */
|
|
466
|
+
url: string;
|
|
467
|
+
}
|
|
468
|
+
export const DownloadCertificateRequest = /*@__PURE__*/ S.suspend(() =>
|
|
469
|
+
S.Struct({
|
|
470
|
+
url: S.String.pipe(T.Label()),
|
|
471
|
+
}).pipe(T.Http({ method: "POST", uri: "/cert/{url}", code: 200 })),
|
|
472
|
+
).annotate({
|
|
473
|
+
identifier: "DownloadCertificateRequest",
|
|
474
|
+
}) as any as S.Schema<DownloadCertificateRequest>;
|
|
475
|
+
|
|
476
|
+
/** Alternate chain URLs from `Link: <url>;rel="alternate"` headers. */
|
|
477
|
+
export type CertificateChainAlternatesList = Array<string>;
|
|
478
|
+
export const CertificateChainAlternatesList = /*@__PURE__*/ S.Array(
|
|
479
|
+
S.String,
|
|
480
|
+
) as any as S.Schema<CertificateChainAlternatesList>;
|
|
481
|
+
|
|
482
|
+
export interface CertificateChain {
|
|
483
|
+
/** PEM certificate chain (`application/pem-certificate-chain`), leaf first. */
|
|
484
|
+
chain: string;
|
|
485
|
+
/** Alternate chain URLs from `Link: <url>;rel="alternate"` headers. */
|
|
486
|
+
alternates?: CertificateChainAlternatesList;
|
|
487
|
+
}
|
|
488
|
+
export const CertificateChain = /*@__PURE__*/ S.suspend(() =>
|
|
489
|
+
S.Struct({
|
|
490
|
+
chain: S.String,
|
|
491
|
+
alternates: S.optional(CertificateChainAlternatesList),
|
|
492
|
+
}),
|
|
493
|
+
).annotate({
|
|
494
|
+
identifier: "CertificateChain",
|
|
495
|
+
}) as any as S.Schema<CertificateChain>;
|
|
496
|
+
|
|
497
|
+
export interface FinalizeOrderRequest {
|
|
498
|
+
/** Absolute URL of the resource, as returned by the CA. */
|
|
499
|
+
url: string;
|
|
500
|
+
/** base64url DER PKCS#10 CSR. */
|
|
501
|
+
csr: string;
|
|
502
|
+
}
|
|
503
|
+
export const FinalizeOrderRequest = /*@__PURE__*/ S.suspend(() =>
|
|
504
|
+
S.Struct({
|
|
505
|
+
url: S.String.pipe(T.Label()),
|
|
506
|
+
csr: S.String,
|
|
507
|
+
}).pipe(T.Http({ method: "POST", uri: "/finalize/{url}", code: 200 })),
|
|
508
|
+
).annotate({
|
|
509
|
+
identifier: "FinalizeOrderRequest",
|
|
510
|
+
}) as any as S.Schema<FinalizeOrderRequest>;
|
|
511
|
+
|
|
512
|
+
export type OrderResponseIdentifiersList = Array<Identifier>;
|
|
513
|
+
export const OrderResponseIdentifiersList = /*@__PURE__*/ S.Array(
|
|
514
|
+
Identifier,
|
|
515
|
+
) as any as S.Schema<OrderResponseIdentifiersList>;
|
|
516
|
+
|
|
517
|
+
export type OrderResponseAuthorizationsList = Array<string>;
|
|
518
|
+
export const OrderResponseAuthorizationsList = /*@__PURE__*/ S.Array(
|
|
519
|
+
S.String,
|
|
520
|
+
) as any as S.Schema<OrderResponseAuthorizationsList>;
|
|
521
|
+
|
|
522
|
+
/** RFC 8555 §7.1.3, plus the `Location` header as `location`. */
|
|
523
|
+
export interface OrderResponse {
|
|
524
|
+
/** pending | ready | processing | valid | invalid */
|
|
525
|
+
status: string;
|
|
526
|
+
expires?: string;
|
|
527
|
+
identifiers: OrderResponseIdentifiersList;
|
|
528
|
+
notBefore?: string;
|
|
529
|
+
notAfter?: string;
|
|
530
|
+
error?: Problem;
|
|
531
|
+
authorizations: OrderResponseAuthorizationsList;
|
|
532
|
+
finalize: string;
|
|
533
|
+
certificate?: string;
|
|
534
|
+
/** The order URL (`Location` header). */
|
|
535
|
+
location?: string;
|
|
536
|
+
}
|
|
537
|
+
export const OrderResponse = /*@__PURE__*/ S.suspend(() =>
|
|
538
|
+
S.Struct({
|
|
539
|
+
status: S.String,
|
|
540
|
+
expires: S.optional(S.String),
|
|
541
|
+
identifiers: OrderResponseIdentifiersList,
|
|
542
|
+
notBefore: S.optional(S.String),
|
|
543
|
+
notAfter: S.optional(S.String),
|
|
544
|
+
error: S.optional(Problem),
|
|
545
|
+
authorizations: OrderResponseAuthorizationsList,
|
|
546
|
+
finalize: S.String,
|
|
547
|
+
certificate: S.optional(S.String),
|
|
548
|
+
location: S.optional(S.String),
|
|
549
|
+
}),
|
|
550
|
+
).annotate({ identifier: "OrderResponse" }) as any as S.Schema<OrderResponse>;
|
|
551
|
+
|
|
552
|
+
export interface GetAuthorizationRequest {
|
|
553
|
+
/** Absolute URL of the resource, as returned by the CA. */
|
|
554
|
+
url: string;
|
|
555
|
+
}
|
|
556
|
+
export const GetAuthorizationRequest = /*@__PURE__*/ S.suspend(() =>
|
|
557
|
+
S.Struct({
|
|
558
|
+
url: S.String.pipe(T.Label()),
|
|
559
|
+
}).pipe(T.Http({ method: "POST", uri: "/authz/{url}", code: 200 })),
|
|
560
|
+
).annotate({
|
|
561
|
+
identifier: "GetAuthorizationRequest",
|
|
562
|
+
}) as any as S.Schema<GetAuthorizationRequest>;
|
|
563
|
+
|
|
564
|
+
export interface GetDirectoryRequest {}
|
|
565
|
+
export const GetDirectoryRequest = /*@__PURE__*/ S.suspend(() =>
|
|
566
|
+
S.Struct({}).pipe(T.Http({ method: "GET", uri: "/directory", code: 200 })),
|
|
567
|
+
).annotate({
|
|
568
|
+
identifier: "GetDirectoryRequest",
|
|
569
|
+
}) as any as S.Schema<GetDirectoryRequest>;
|
|
570
|
+
|
|
571
|
+
export type DirectoryMetaCaaIdentitiesList = Array<string>;
|
|
572
|
+
export const DirectoryMetaCaaIdentitiesList = /*@__PURE__*/ S.Array(
|
|
573
|
+
S.String,
|
|
574
|
+
) as any as S.Schema<DirectoryMetaCaaIdentitiesList>;
|
|
575
|
+
|
|
576
|
+
export interface DirectoryMeta {
|
|
577
|
+
termsOfService?: string;
|
|
578
|
+
website?: string;
|
|
579
|
+
caaIdentities?: DirectoryMetaCaaIdentitiesList;
|
|
580
|
+
externalAccountRequired?: boolean;
|
|
581
|
+
}
|
|
582
|
+
export const DirectoryMeta = /*@__PURE__*/ S.suspend(() =>
|
|
583
|
+
S.Struct({
|
|
584
|
+
termsOfService: S.optional(S.String),
|
|
585
|
+
website: S.optional(S.String),
|
|
586
|
+
caaIdentities: S.optional(DirectoryMetaCaaIdentitiesList),
|
|
587
|
+
externalAccountRequired: S.optional(S.Boolean),
|
|
588
|
+
}),
|
|
589
|
+
).annotate({ identifier: "DirectoryMeta" }) as any as S.Schema<DirectoryMeta>;
|
|
590
|
+
|
|
591
|
+
/** RFC 8555 §7.1.1 */
|
|
592
|
+
export interface Directory {
|
|
593
|
+
newNonce: string;
|
|
594
|
+
newAccount: string;
|
|
595
|
+
newOrder: string;
|
|
596
|
+
newAuthz?: string;
|
|
597
|
+
revokeCert: string;
|
|
598
|
+
keyChange?: string;
|
|
599
|
+
meta?: DirectoryMeta;
|
|
600
|
+
}
|
|
601
|
+
export const Directory = /*@__PURE__*/ S.suspend(() =>
|
|
602
|
+
S.Struct({
|
|
603
|
+
newNonce: S.String,
|
|
604
|
+
newAccount: S.String,
|
|
605
|
+
newOrder: S.String,
|
|
606
|
+
newAuthz: S.optional(S.String),
|
|
607
|
+
revokeCert: S.String,
|
|
608
|
+
keyChange: S.optional(S.String),
|
|
609
|
+
meta: S.optional(DirectoryMeta),
|
|
610
|
+
}),
|
|
611
|
+
).annotate({ identifier: "Directory" }) as any as S.Schema<Directory>;
|
|
612
|
+
|
|
613
|
+
export interface GetOrderRequest {
|
|
614
|
+
/** Absolute URL of the resource, as returned by the CA. */
|
|
615
|
+
url: string;
|
|
616
|
+
}
|
|
617
|
+
export const GetOrderRequest = /*@__PURE__*/ S.suspend(() =>
|
|
618
|
+
S.Struct({
|
|
619
|
+
url: S.String.pipe(T.Label()),
|
|
620
|
+
}).pipe(T.Http({ method: "POST", uri: "/order/{url}", code: 200 })),
|
|
621
|
+
).annotate({
|
|
622
|
+
identifier: "GetOrderRequest",
|
|
623
|
+
}) as any as S.Schema<GetOrderRequest>;
|
|
624
|
+
|
|
625
|
+
export type NewAccountRequestContactList = Array<string>;
|
|
626
|
+
export const NewAccountRequestContactList = /*@__PURE__*/ S.Array(
|
|
627
|
+
S.String,
|
|
628
|
+
) as any as S.Schema<NewAccountRequestContactList>;
|
|
629
|
+
|
|
630
|
+
/** A JWS binding this account to an existing CA account (RFC 8555 §7.3.4). The protocol builds it from the credentials' EAB key when the CA requires one. */
|
|
631
|
+
export interface ExternalAccountBinding {
|
|
632
|
+
protected: string;
|
|
633
|
+
payload: string;
|
|
634
|
+
signature: string;
|
|
635
|
+
}
|
|
636
|
+
export const ExternalAccountBinding = /*@__PURE__*/ S.suspend(() =>
|
|
637
|
+
S.Struct({
|
|
638
|
+
protected: S.String,
|
|
639
|
+
payload: S.String,
|
|
640
|
+
signature: S.String,
|
|
641
|
+
}),
|
|
642
|
+
).annotate({
|
|
643
|
+
identifier: "ExternalAccountBinding",
|
|
644
|
+
}) as any as S.Schema<ExternalAccountBinding>;
|
|
645
|
+
|
|
646
|
+
export interface NewAccountRequest {
|
|
647
|
+
contact?: NewAccountRequestContactList;
|
|
648
|
+
termsOfServiceAgreed?: boolean;
|
|
649
|
+
onlyReturnExisting?: boolean;
|
|
650
|
+
externalAccountBinding?: ExternalAccountBinding;
|
|
651
|
+
}
|
|
652
|
+
export const NewAccountRequest = /*@__PURE__*/ S.suspend(() =>
|
|
653
|
+
S.Struct({
|
|
654
|
+
contact: S.optional(NewAccountRequestContactList),
|
|
655
|
+
termsOfServiceAgreed: S.optional(S.Boolean),
|
|
656
|
+
onlyReturnExisting: S.optional(S.Boolean),
|
|
657
|
+
externalAccountBinding: S.optional(ExternalAccountBinding),
|
|
658
|
+
}).pipe(T.Http({ method: "POST", uri: "/newAccount", code: 200 })),
|
|
659
|
+
).annotate({
|
|
660
|
+
identifier: "NewAccountRequest",
|
|
661
|
+
}) as any as S.Schema<NewAccountRequest>;
|
|
662
|
+
|
|
663
|
+
export type AccountResponseContactList = Array<string>;
|
|
664
|
+
export const AccountResponseContactList = /*@__PURE__*/ S.Array(
|
|
665
|
+
S.String,
|
|
666
|
+
) as any as S.Schema<AccountResponseContactList>;
|
|
667
|
+
|
|
668
|
+
/** RFC 8555 §7.1.2, plus the `Location` header as `location`. */
|
|
669
|
+
export interface AccountResponse {
|
|
670
|
+
status: string;
|
|
671
|
+
contact?: AccountResponseContactList;
|
|
672
|
+
termsOfServiceAgreed?: boolean;
|
|
673
|
+
orders?: string;
|
|
674
|
+
/** The account URL (`Location` header); the `kid` for every later request. */
|
|
675
|
+
location?: string;
|
|
676
|
+
}
|
|
677
|
+
export const AccountResponse = /*@__PURE__*/ S.suspend(() =>
|
|
678
|
+
S.Struct({
|
|
679
|
+
status: S.String,
|
|
680
|
+
contact: S.optional(AccountResponseContactList),
|
|
681
|
+
termsOfServiceAgreed: S.optional(S.Boolean),
|
|
682
|
+
orders: S.optional(S.String),
|
|
683
|
+
location: S.optional(S.String),
|
|
684
|
+
}),
|
|
685
|
+
).annotate({
|
|
686
|
+
identifier: "AccountResponse",
|
|
687
|
+
}) as any as S.Schema<AccountResponse>;
|
|
688
|
+
|
|
689
|
+
export interface NewNonceRequest {}
|
|
690
|
+
export const NewNonceRequest = /*@__PURE__*/ S.suspend(() =>
|
|
691
|
+
S.Struct({}).pipe(T.Http({ method: "GET", uri: "/newNonce", code: 200 })),
|
|
692
|
+
).annotate({
|
|
693
|
+
identifier: "NewNonceRequest",
|
|
694
|
+
}) as any as S.Schema<NewNonceRequest>;
|
|
695
|
+
|
|
696
|
+
export interface NonceResponse {
|
|
697
|
+
/** The `Replay-Nonce` header. */
|
|
698
|
+
replayNonce: string;
|
|
699
|
+
}
|
|
700
|
+
export const NonceResponse = /*@__PURE__*/ S.suspend(() =>
|
|
701
|
+
S.Struct({
|
|
702
|
+
replayNonce: S.String,
|
|
703
|
+
}),
|
|
704
|
+
).annotate({ identifier: "NonceResponse" }) as any as S.Schema<NonceResponse>;
|
|
705
|
+
|
|
706
|
+
export type NewOrderRequestIdentifiersList = Array<Identifier>;
|
|
707
|
+
export const NewOrderRequestIdentifiersList = /*@__PURE__*/ S.Array(
|
|
708
|
+
Identifier,
|
|
709
|
+
) as any as S.Schema<NewOrderRequestIdentifiersList>;
|
|
710
|
+
|
|
711
|
+
export interface NewOrderRequest {
|
|
712
|
+
identifiers: NewOrderRequestIdentifiersList;
|
|
713
|
+
notBefore?: string;
|
|
714
|
+
notAfter?: string;
|
|
715
|
+
}
|
|
716
|
+
export const NewOrderRequest = /*@__PURE__*/ S.suspend(() =>
|
|
717
|
+
S.Struct({
|
|
718
|
+
identifiers: NewOrderRequestIdentifiersList,
|
|
719
|
+
notBefore: S.optional(S.String),
|
|
720
|
+
notAfter: S.optional(S.String),
|
|
721
|
+
}).pipe(T.Http({ method: "POST", uri: "/newOrder", code: 200 })),
|
|
722
|
+
).annotate({
|
|
723
|
+
identifier: "NewOrderRequest",
|
|
724
|
+
}) as any as S.Schema<NewOrderRequest>;
|
|
725
|
+
|
|
726
|
+
export interface RespondChallengeRequest {
|
|
727
|
+
/** Absolute URL of the resource, as returned by the CA. */
|
|
728
|
+
url: string;
|
|
729
|
+
}
|
|
730
|
+
export const RespondChallengeRequest = /*@__PURE__*/ S.suspend(() =>
|
|
731
|
+
S.Struct({
|
|
732
|
+
url: S.String.pipe(T.Label()),
|
|
733
|
+
}).pipe(T.Http({ method: "POST", uri: "/challenge/{url}", code: 200 })),
|
|
734
|
+
).annotate({
|
|
735
|
+
identifier: "RespondChallengeRequest",
|
|
736
|
+
}) as any as S.Schema<RespondChallengeRequest>;
|
|
737
|
+
|
|
738
|
+
export interface RevokeCertificateRequest {
|
|
739
|
+
/** base64url DER of the certificate to revoke. */
|
|
740
|
+
certificate: string;
|
|
741
|
+
/** RFC 5280 CRLReason code. */
|
|
742
|
+
reason?: number;
|
|
743
|
+
}
|
|
744
|
+
export const RevokeCertificateRequest = /*@__PURE__*/ S.suspend(() =>
|
|
745
|
+
S.Struct({
|
|
746
|
+
certificate: S.String,
|
|
747
|
+
reason: S.optional(S.Number),
|
|
748
|
+
}).pipe(T.Http({ method: "POST", uri: "/revokeCert", code: 200 })),
|
|
749
|
+
).annotate({
|
|
750
|
+
identifier: "RevokeCertificateRequest",
|
|
751
|
+
}) as any as S.Schema<RevokeCertificateRequest>;
|
|
752
|
+
|
|
753
|
+
export interface RevokeCertificateResponse {}
|
|
754
|
+
export const RevokeCertificateResponse = /*@__PURE__*/ S.suspend(() =>
|
|
755
|
+
S.Struct({}),
|
|
756
|
+
).annotate({
|
|
757
|
+
identifier: "RevokeCertificateResponse",
|
|
758
|
+
}) as any as S.Schema<RevokeCertificateResponse>;
|
|
759
|
+
|
|
760
|
+
export type UpdateAccountRequestContactList = Array<string>;
|
|
761
|
+
export const UpdateAccountRequestContactList = /*@__PURE__*/ S.Array(
|
|
762
|
+
S.String,
|
|
763
|
+
) as any as S.Schema<UpdateAccountRequestContactList>;
|
|
764
|
+
|
|
765
|
+
export interface UpdateAccountRequest {
|
|
766
|
+
/** Absolute URL of the resource, as returned by the CA. */
|
|
767
|
+
url: string;
|
|
768
|
+
contact?: UpdateAccountRequestContactList;
|
|
769
|
+
/** `deactivated` to deactivate the account. */
|
|
770
|
+
status?: string;
|
|
771
|
+
}
|
|
772
|
+
export const UpdateAccountRequest = /*@__PURE__*/ S.suspend(() =>
|
|
773
|
+
S.Struct({
|
|
774
|
+
url: S.String.pipe(T.Label()),
|
|
775
|
+
contact: S.optional(UpdateAccountRequestContactList),
|
|
776
|
+
status: S.optional(S.String),
|
|
777
|
+
}).pipe(T.Http({ method: "POST", uri: "/account/{url}", code: 200 })),
|
|
778
|
+
).annotate({
|
|
779
|
+
identifier: "UpdateAccountRequest",
|
|
780
|
+
}) as any as S.Schema<UpdateAccountRequest>;
|
|
781
|
+
|
|
782
|
+
export type DeactivateAuthorizationError =
|
|
783
|
+
| AcmeAccountDoesNotExist
|
|
784
|
+
| AcmeBadNonce
|
|
785
|
+
| AcmeMalformed
|
|
786
|
+
| AcmeRateLimited
|
|
787
|
+
| AcmeServerInternal
|
|
788
|
+
| AcmeUnauthorized
|
|
789
|
+
| AcmeOpError;
|
|
790
|
+
/** Deactivate the authorization at `url` */
|
|
791
|
+
export const deactivateAuthorization: API.OperationMethod<
|
|
792
|
+
DeactivateAuthorizationRequest,
|
|
793
|
+
Authorization,
|
|
794
|
+
DeactivateAuthorizationError,
|
|
795
|
+
AcmeOpContext
|
|
796
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
797
|
+
input: DeactivateAuthorizationRequest,
|
|
798
|
+
output: Authorization,
|
|
799
|
+
errors: [
|
|
800
|
+
AcmeAccountDoesNotExist,
|
|
801
|
+
AcmeBadNonce,
|
|
802
|
+
AcmeMalformed,
|
|
803
|
+
AcmeRateLimited,
|
|
804
|
+
AcmeServerInternal,
|
|
805
|
+
AcmeUnauthorized,
|
|
806
|
+
],
|
|
807
|
+
protocol: AcmeProtocol,
|
|
808
|
+
retry: Retry.Retry,
|
|
809
|
+
}));
|
|
810
|
+
|
|
811
|
+
export type DownloadCertificateError =
|
|
812
|
+
| AcmeAccountDoesNotExist
|
|
813
|
+
| AcmeBadNonce
|
|
814
|
+
| AcmeMalformed
|
|
815
|
+
| AcmeRateLimited
|
|
816
|
+
| AcmeServerInternal
|
|
817
|
+
| AcmeUnauthorized
|
|
818
|
+
| AcmeOpError;
|
|
819
|
+
/** Download the PEM certificate chain at `url` (POST-as-GET) */
|
|
820
|
+
export const downloadCertificate: API.OperationMethod<
|
|
821
|
+
DownloadCertificateRequest,
|
|
822
|
+
CertificateChain,
|
|
823
|
+
DownloadCertificateError,
|
|
824
|
+
AcmeOpContext
|
|
825
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
826
|
+
input: DownloadCertificateRequest,
|
|
827
|
+
output: CertificateChain,
|
|
828
|
+
errors: [
|
|
829
|
+
AcmeAccountDoesNotExist,
|
|
830
|
+
AcmeBadNonce,
|
|
831
|
+
AcmeMalformed,
|
|
832
|
+
AcmeRateLimited,
|
|
833
|
+
AcmeServerInternal,
|
|
834
|
+
AcmeUnauthorized,
|
|
835
|
+
],
|
|
836
|
+
protocol: AcmeProtocol,
|
|
837
|
+
retry: Retry.Retry,
|
|
838
|
+
}));
|
|
839
|
+
|
|
840
|
+
export type FinalizeOrderError =
|
|
841
|
+
| AcmeAccountDoesNotExist
|
|
842
|
+
| AcmeBadCsr
|
|
843
|
+
| AcmeBadNonce
|
|
844
|
+
| AcmeMalformed
|
|
845
|
+
| AcmeOrderNotReady
|
|
846
|
+
| AcmeRateLimited
|
|
847
|
+
| AcmeServerInternal
|
|
848
|
+
| AcmeUnauthorized
|
|
849
|
+
| AcmeOpError;
|
|
850
|
+
/** Submit the CSR to the order's finalize URL */
|
|
851
|
+
export const finalizeOrder: API.OperationMethod<
|
|
852
|
+
FinalizeOrderRequest,
|
|
853
|
+
OrderResponse,
|
|
854
|
+
FinalizeOrderError,
|
|
855
|
+
AcmeOpContext
|
|
856
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
857
|
+
input: FinalizeOrderRequest,
|
|
858
|
+
output: OrderResponse,
|
|
859
|
+
errors: [
|
|
860
|
+
AcmeAccountDoesNotExist,
|
|
861
|
+
AcmeBadCsr,
|
|
862
|
+
AcmeBadNonce,
|
|
863
|
+
AcmeMalformed,
|
|
864
|
+
AcmeOrderNotReady,
|
|
865
|
+
AcmeRateLimited,
|
|
866
|
+
AcmeServerInternal,
|
|
867
|
+
AcmeUnauthorized,
|
|
868
|
+
],
|
|
869
|
+
protocol: AcmeProtocol,
|
|
870
|
+
retry: Retry.Retry,
|
|
871
|
+
}));
|
|
872
|
+
|
|
873
|
+
export type GetAuthorizationError =
|
|
874
|
+
| AcmeAccountDoesNotExist
|
|
875
|
+
| AcmeBadNonce
|
|
876
|
+
| AcmeMalformed
|
|
877
|
+
| AcmeRateLimited
|
|
878
|
+
| AcmeServerInternal
|
|
879
|
+
| AcmeUnauthorized
|
|
880
|
+
| AcmeOpError;
|
|
881
|
+
/** Fetch the authorization at `url` (POST-as-GET) */
|
|
882
|
+
export const getAuthorization: API.OperationMethod<
|
|
883
|
+
GetAuthorizationRequest,
|
|
884
|
+
Authorization,
|
|
885
|
+
GetAuthorizationError,
|
|
886
|
+
AcmeOpContext
|
|
887
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
888
|
+
input: GetAuthorizationRequest,
|
|
889
|
+
output: Authorization,
|
|
890
|
+
errors: [
|
|
891
|
+
AcmeAccountDoesNotExist,
|
|
892
|
+
AcmeBadNonce,
|
|
893
|
+
AcmeMalformed,
|
|
894
|
+
AcmeRateLimited,
|
|
895
|
+
AcmeServerInternal,
|
|
896
|
+
AcmeUnauthorized,
|
|
897
|
+
],
|
|
898
|
+
protocol: AcmeProtocol,
|
|
899
|
+
retry: Retry.Retry,
|
|
900
|
+
}));
|
|
901
|
+
|
|
902
|
+
export type GetDirectoryError = AcmeOpError;
|
|
903
|
+
/** Fetch the CA's directory of resource URLs */
|
|
904
|
+
export const getDirectory: API.OperationMethod<
|
|
905
|
+
GetDirectoryRequest,
|
|
906
|
+
Directory,
|
|
907
|
+
GetDirectoryError,
|
|
908
|
+
AcmeOpContext
|
|
909
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
910
|
+
input: GetDirectoryRequest,
|
|
911
|
+
output: Directory,
|
|
912
|
+
errors: [],
|
|
913
|
+
protocol: AcmeProtocol,
|
|
914
|
+
retry: Retry.Retry,
|
|
915
|
+
}));
|
|
916
|
+
|
|
917
|
+
export type GetOrderError =
|
|
918
|
+
| AcmeAccountDoesNotExist
|
|
919
|
+
| AcmeBadNonce
|
|
920
|
+
| AcmeMalformed
|
|
921
|
+
| AcmeRateLimited
|
|
922
|
+
| AcmeServerInternal
|
|
923
|
+
| AcmeUnauthorized
|
|
924
|
+
| AcmeOpError;
|
|
925
|
+
/** Fetch the order at `url` (POST-as-GET) */
|
|
926
|
+
export const getOrder: API.OperationMethod<
|
|
927
|
+
GetOrderRequest,
|
|
928
|
+
OrderResponse,
|
|
929
|
+
GetOrderError,
|
|
930
|
+
AcmeOpContext
|
|
931
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
932
|
+
input: GetOrderRequest,
|
|
933
|
+
output: OrderResponse,
|
|
934
|
+
errors: [
|
|
935
|
+
AcmeAccountDoesNotExist,
|
|
936
|
+
AcmeBadNonce,
|
|
937
|
+
AcmeMalformed,
|
|
938
|
+
AcmeRateLimited,
|
|
939
|
+
AcmeServerInternal,
|
|
940
|
+
AcmeUnauthorized,
|
|
941
|
+
],
|
|
942
|
+
protocol: AcmeProtocol,
|
|
943
|
+
retry: Retry.Retry,
|
|
944
|
+
}));
|
|
945
|
+
|
|
946
|
+
export type NewAccountError =
|
|
947
|
+
| AcmeAccountDoesNotExist
|
|
948
|
+
| AcmeBadNonce
|
|
949
|
+
| AcmeBadPublicKey
|
|
950
|
+
| AcmeBadSignatureAlgorithm
|
|
951
|
+
| AcmeExternalAccountRequired
|
|
952
|
+
| AcmeInvalidContact
|
|
953
|
+
| AcmeMalformed
|
|
954
|
+
| AcmeRateLimited
|
|
955
|
+
| AcmeServerInternal
|
|
956
|
+
| AcmeUnauthorized
|
|
957
|
+
| AcmeUnsupportedContact
|
|
958
|
+
| AcmeUserActionRequired
|
|
959
|
+
| AcmeOpError;
|
|
960
|
+
/** Create an account, or find the existing account for this key */
|
|
961
|
+
export const newAccount: API.OperationMethod<
|
|
962
|
+
NewAccountRequest,
|
|
963
|
+
AccountResponse,
|
|
964
|
+
NewAccountError,
|
|
965
|
+
AcmeOpContext
|
|
966
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
967
|
+
input: NewAccountRequest,
|
|
968
|
+
output: AccountResponse,
|
|
969
|
+
errors: [
|
|
970
|
+
AcmeAccountDoesNotExist,
|
|
971
|
+
AcmeBadNonce,
|
|
972
|
+
AcmeBadPublicKey,
|
|
973
|
+
AcmeBadSignatureAlgorithm,
|
|
974
|
+
AcmeExternalAccountRequired,
|
|
975
|
+
AcmeInvalidContact,
|
|
976
|
+
AcmeMalformed,
|
|
977
|
+
AcmeRateLimited,
|
|
978
|
+
AcmeServerInternal,
|
|
979
|
+
AcmeUnauthorized,
|
|
980
|
+
AcmeUnsupportedContact,
|
|
981
|
+
AcmeUserActionRequired,
|
|
982
|
+
],
|
|
983
|
+
protocol: AcmeProtocol,
|
|
984
|
+
retry: Retry.Retry,
|
|
985
|
+
}));
|
|
986
|
+
|
|
987
|
+
export type NewNonceError = AcmeOpError;
|
|
988
|
+
/** Get a fresh anti-replay nonce (the `Replay-Nonce` header) */
|
|
989
|
+
export const newNonce: API.OperationMethod<
|
|
990
|
+
NewNonceRequest,
|
|
991
|
+
NonceResponse,
|
|
992
|
+
NewNonceError,
|
|
993
|
+
AcmeOpContext
|
|
994
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
995
|
+
input: NewNonceRequest,
|
|
996
|
+
output: NonceResponse,
|
|
997
|
+
errors: [],
|
|
998
|
+
protocol: AcmeProtocol,
|
|
999
|
+
retry: Retry.Retry,
|
|
1000
|
+
}));
|
|
1001
|
+
|
|
1002
|
+
export type NewOrderError =
|
|
1003
|
+
| AcmeAccountDoesNotExist
|
|
1004
|
+
| AcmeBadNonce
|
|
1005
|
+
| AcmeMalformed
|
|
1006
|
+
| AcmeRateLimited
|
|
1007
|
+
| AcmeRejectedIdentifier
|
|
1008
|
+
| AcmeServerInternal
|
|
1009
|
+
| AcmeUnauthorized
|
|
1010
|
+
| AcmeUnsupportedIdentifier
|
|
1011
|
+
| AcmeUserActionRequired
|
|
1012
|
+
| AcmeOpError;
|
|
1013
|
+
/** Create an order for a set of identifiers */
|
|
1014
|
+
export const newOrder: API.OperationMethod<
|
|
1015
|
+
NewOrderRequest,
|
|
1016
|
+
OrderResponse,
|
|
1017
|
+
NewOrderError,
|
|
1018
|
+
AcmeOpContext
|
|
1019
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
1020
|
+
input: NewOrderRequest,
|
|
1021
|
+
output: OrderResponse,
|
|
1022
|
+
errors: [
|
|
1023
|
+
AcmeAccountDoesNotExist,
|
|
1024
|
+
AcmeBadNonce,
|
|
1025
|
+
AcmeMalformed,
|
|
1026
|
+
AcmeRateLimited,
|
|
1027
|
+
AcmeRejectedIdentifier,
|
|
1028
|
+
AcmeServerInternal,
|
|
1029
|
+
AcmeUnauthorized,
|
|
1030
|
+
AcmeUnsupportedIdentifier,
|
|
1031
|
+
AcmeUserActionRequired,
|
|
1032
|
+
],
|
|
1033
|
+
protocol: AcmeProtocol,
|
|
1034
|
+
retry: Retry.Retry,
|
|
1035
|
+
}));
|
|
1036
|
+
|
|
1037
|
+
export type RespondChallengeError =
|
|
1038
|
+
| AcmeAccountDoesNotExist
|
|
1039
|
+
| AcmeBadNonce
|
|
1040
|
+
| AcmeCaa
|
|
1041
|
+
| AcmeConnection
|
|
1042
|
+
| AcmeDns
|
|
1043
|
+
| AcmeIncorrectResponse
|
|
1044
|
+
| AcmeMalformed
|
|
1045
|
+
| AcmeRateLimited
|
|
1046
|
+
| AcmeServerInternal
|
|
1047
|
+
| AcmeTls
|
|
1048
|
+
| AcmeUnauthorized
|
|
1049
|
+
| AcmeOpError;
|
|
1050
|
+
/** Tell the CA the challenge at `url` is ready to be validated */
|
|
1051
|
+
export const respondChallenge: API.OperationMethod<
|
|
1052
|
+
RespondChallengeRequest,
|
|
1053
|
+
Challenge,
|
|
1054
|
+
RespondChallengeError,
|
|
1055
|
+
AcmeOpContext
|
|
1056
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
1057
|
+
input: RespondChallengeRequest,
|
|
1058
|
+
output: Challenge,
|
|
1059
|
+
errors: [
|
|
1060
|
+
AcmeAccountDoesNotExist,
|
|
1061
|
+
AcmeBadNonce,
|
|
1062
|
+
AcmeCaa,
|
|
1063
|
+
AcmeConnection,
|
|
1064
|
+
AcmeDns,
|
|
1065
|
+
AcmeIncorrectResponse,
|
|
1066
|
+
AcmeMalformed,
|
|
1067
|
+
AcmeRateLimited,
|
|
1068
|
+
AcmeServerInternal,
|
|
1069
|
+
AcmeTls,
|
|
1070
|
+
AcmeUnauthorized,
|
|
1071
|
+
],
|
|
1072
|
+
protocol: AcmeProtocol,
|
|
1073
|
+
retry: Retry.Retry,
|
|
1074
|
+
}));
|
|
1075
|
+
|
|
1076
|
+
export type RevokeCertificateError =
|
|
1077
|
+
| AcmeAccountDoesNotExist
|
|
1078
|
+
| AcmeAlreadyRevoked
|
|
1079
|
+
| AcmeBadNonce
|
|
1080
|
+
| AcmeBadRevocationReason
|
|
1081
|
+
| AcmeMalformed
|
|
1082
|
+
| AcmeRateLimited
|
|
1083
|
+
| AcmeServerInternal
|
|
1084
|
+
| AcmeUnauthorized
|
|
1085
|
+
| AcmeOpError;
|
|
1086
|
+
/** Revoke a certificate */
|
|
1087
|
+
export const revokeCertificate: API.OperationMethod<
|
|
1088
|
+
RevokeCertificateRequest,
|
|
1089
|
+
RevokeCertificateResponse,
|
|
1090
|
+
RevokeCertificateError,
|
|
1091
|
+
AcmeOpContext
|
|
1092
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
1093
|
+
input: RevokeCertificateRequest,
|
|
1094
|
+
output: RevokeCertificateResponse,
|
|
1095
|
+
errors: [
|
|
1096
|
+
AcmeAccountDoesNotExist,
|
|
1097
|
+
AcmeAlreadyRevoked,
|
|
1098
|
+
AcmeBadNonce,
|
|
1099
|
+
AcmeBadRevocationReason,
|
|
1100
|
+
AcmeMalformed,
|
|
1101
|
+
AcmeRateLimited,
|
|
1102
|
+
AcmeServerInternal,
|
|
1103
|
+
AcmeUnauthorized,
|
|
1104
|
+
],
|
|
1105
|
+
protocol: AcmeProtocol,
|
|
1106
|
+
retry: Retry.Retry,
|
|
1107
|
+
}));
|
|
1108
|
+
|
|
1109
|
+
export type UpdateAccountError =
|
|
1110
|
+
| AcmeAccountDoesNotExist
|
|
1111
|
+
| AcmeBadNonce
|
|
1112
|
+
| AcmeInvalidContact
|
|
1113
|
+
| AcmeMalformed
|
|
1114
|
+
| AcmeRateLimited
|
|
1115
|
+
| AcmeServerInternal
|
|
1116
|
+
| AcmeUnauthorized
|
|
1117
|
+
| AcmeUnsupportedContact
|
|
1118
|
+
| AcmeOpError;
|
|
1119
|
+
/** Update (or deactivate) the account at `url` */
|
|
1120
|
+
export const updateAccount: API.OperationMethod<
|
|
1121
|
+
UpdateAccountRequest,
|
|
1122
|
+
AccountResponse,
|
|
1123
|
+
UpdateAccountError,
|
|
1124
|
+
AcmeOpContext
|
|
1125
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
1126
|
+
input: UpdateAccountRequest,
|
|
1127
|
+
output: AccountResponse,
|
|
1128
|
+
errors: [
|
|
1129
|
+
AcmeAccountDoesNotExist,
|
|
1130
|
+
AcmeBadNonce,
|
|
1131
|
+
AcmeInvalidContact,
|
|
1132
|
+
AcmeMalformed,
|
|
1133
|
+
AcmeRateLimited,
|
|
1134
|
+
AcmeServerInternal,
|
|
1135
|
+
AcmeUnauthorized,
|
|
1136
|
+
AcmeUnsupportedContact,
|
|
1137
|
+
],
|
|
1138
|
+
protocol: AcmeProtocol,
|
|
1139
|
+
retry: Retry.Retry,
|
|
1140
|
+
}));
|