@distilled.cloud/acme 1.0.0-rc.14 → 1.0.0-rc.16
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/lib/credentials.d.ts +4 -4
- package/lib/credentials.d.ts.map +1 -1
- package/lib/credentials.js +39 -33
- package/lib/credentials.js.map +1 -1
- package/lib/errors.d.ts +26 -26
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +33 -33
- package/lib/errors.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +22 -22
- package/lib/jose.d.ts +2 -2
- package/lib/jose.d.ts.map +1 -1
- package/lib/jose.js +22 -22
- package/lib/jose.js.map +1 -1
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +61 -58
- package/lib/protocol.js.map +1 -1
- package/lib/retry.d.ts +1 -1
- package/lib/retry.d.ts.map +1 -1
- package/lib/retry.js +26 -25
- package/lib/retry.js.map +1 -1
- package/lib/services/acme.d.ts +47 -82
- package/lib/services/acme.d.ts.map +1 -1
- package/lib/services/acme.js +151 -530
- package/lib/traits.d.ts +2 -2
- package/lib/traits.js +10 -10
- package/package.json +7 -7
- package/src/credentials.ts +31 -26
- package/src/errors.ts +25 -24
- package/src/index.ts +1 -1
- package/src/jose.ts +3 -3
- package/src/protocol.ts +25 -20
- package/src/retry.ts +6 -4
- package/src/services/acme.ts +332 -289
- package/src/traits.ts +2 -2
- package/lib/protocol.test.d.ts +0 -2
- package/lib/protocol.test.d.ts.map +0 -1
- package/lib/protocol.test.js +0 -533
- package/lib/protocol.test.js.map +0 -1
- package/lib/services/acme.js.map +0 -1
- package/src/protocol.test.ts +0 -806
package/src/services/acme.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import * as API from "@distilled.cloud/core/api";
|
|
2
2
|
import * as C from "@distilled.cloud/core/category";
|
|
3
3
|
// AUTO-GENERATED by scripts/generate.ts from .generated-specs/acme.json (from RFC 8555). Do not edit.
|
|
4
|
-
import * as S from "@distilled.cloud/core/schema";
|
|
4
|
+
import * as S from "@distilled.cloud/core/schema-lite";
|
|
5
|
+
import * as __L from "@distilled.cloud/core/schema-lite";
|
|
5
6
|
import { AcmeProtocol, type AcmeOpError, type AcmeOpContext } from "../protocol.ts";
|
|
6
7
|
import * as Retry from "../retry.ts";
|
|
7
8
|
import * as T from "../traits.ts";
|
|
9
|
+
// Schema table, filled on first reach (see __S at the end).
|
|
10
|
+
const __s: any[] = [];
|
|
8
11
|
|
|
9
12
|
export type { AcmeOpError, AcmeOpContext };
|
|
10
13
|
|
|
@@ -15,7 +18,7 @@ export class AcmeAccountDoesNotExist
|
|
|
15
18
|
code: S.Number,
|
|
16
19
|
message: S.String,
|
|
17
20
|
type: S.String,
|
|
18
|
-
detail: S.optional(S.String),
|
|
21
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
19
22
|
}),
|
|
20
23
|
[{ message: { matches: "^urn:ietf:params:acme:error:accountDoesNotExist$" } }],
|
|
21
24
|
) {}
|
|
@@ -27,7 +30,7 @@ export class AcmeAlreadyRevoked
|
|
|
27
30
|
code: S.Number,
|
|
28
31
|
message: S.String,
|
|
29
32
|
type: S.String,
|
|
30
|
-
detail: S.optional(S.String),
|
|
33
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
31
34
|
}),
|
|
32
35
|
[{ message: { matches: "^urn:ietf:params:acme:error:alreadyRevoked$" } }],
|
|
33
36
|
) {}
|
|
@@ -39,7 +42,7 @@ export class AcmeBadCsr
|
|
|
39
42
|
code: S.Number,
|
|
40
43
|
message: S.String,
|
|
41
44
|
type: S.String,
|
|
42
|
-
detail: S.optional(S.String),
|
|
45
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
43
46
|
}),
|
|
44
47
|
[{ message: { matches: "^urn:ietf:params:acme:error:badCSR$" } }],
|
|
45
48
|
) {}
|
|
@@ -51,7 +54,7 @@ export class AcmeBadNonce
|
|
|
51
54
|
code: S.Number,
|
|
52
55
|
message: S.String,
|
|
53
56
|
type: S.String,
|
|
54
|
-
detail: S.optional(S.String),
|
|
57
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
55
58
|
}),
|
|
56
59
|
[{ message: { matches: "^urn:ietf:params:acme:error:badNonce$" } }],
|
|
57
60
|
) {}
|
|
@@ -63,7 +66,7 @@ export class AcmeBadPublicKey
|
|
|
63
66
|
code: S.Number,
|
|
64
67
|
message: S.String,
|
|
65
68
|
type: S.String,
|
|
66
|
-
detail: S.optional(S.String),
|
|
69
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
67
70
|
}),
|
|
68
71
|
[{ message: { matches: "^urn:ietf:params:acme:error:badPublicKey$" } }],
|
|
69
72
|
) {}
|
|
@@ -75,7 +78,7 @@ export class AcmeBadRevocationReason
|
|
|
75
78
|
code: S.Number,
|
|
76
79
|
message: S.String,
|
|
77
80
|
type: S.String,
|
|
78
|
-
detail: S.optional(S.String),
|
|
81
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
79
82
|
}),
|
|
80
83
|
[{ message: { matches: "^urn:ietf:params:acme:error:badRevocationReason$" } }],
|
|
81
84
|
) {}
|
|
@@ -87,7 +90,7 @@ export class AcmeBadSignatureAlgorithm
|
|
|
87
90
|
code: S.Number,
|
|
88
91
|
message: S.String,
|
|
89
92
|
type: S.String,
|
|
90
|
-
detail: S.optional(S.String),
|
|
93
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
91
94
|
}),
|
|
92
95
|
[{ message: { matches: "^urn:ietf:params:acme:error:badSignatureAlgorithm$" } }],
|
|
93
96
|
) {}
|
|
@@ -99,7 +102,7 @@ export class AcmeCaa
|
|
|
99
102
|
code: S.Number,
|
|
100
103
|
message: S.String,
|
|
101
104
|
type: S.String,
|
|
102
|
-
detail: S.optional(S.String),
|
|
105
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
103
106
|
}),
|
|
104
107
|
[{ message: { matches: "^urn:ietf:params:acme:error:caa$" } }],
|
|
105
108
|
) {}
|
|
@@ -111,7 +114,7 @@ export class AcmeConnection
|
|
|
111
114
|
code: S.Number,
|
|
112
115
|
message: S.String,
|
|
113
116
|
type: S.String,
|
|
114
|
-
detail: S.optional(S.String),
|
|
117
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
115
118
|
}),
|
|
116
119
|
[{ message: { matches: "^urn:ietf:params:acme:error:connection$" } }],
|
|
117
120
|
) {}
|
|
@@ -123,7 +126,7 @@ export class AcmeDns
|
|
|
123
126
|
code: S.Number,
|
|
124
127
|
message: S.String,
|
|
125
128
|
type: S.String,
|
|
126
|
-
detail: S.optional(S.String),
|
|
129
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
127
130
|
}),
|
|
128
131
|
[{ message: { matches: "^urn:ietf:params:acme:error:dns$" } }],
|
|
129
132
|
) {}
|
|
@@ -135,7 +138,7 @@ export class AcmeExternalAccountRequired
|
|
|
135
138
|
code: S.Number,
|
|
136
139
|
message: S.String,
|
|
137
140
|
type: S.String,
|
|
138
|
-
detail: S.optional(S.String),
|
|
141
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
139
142
|
}),
|
|
140
143
|
[{ message: { matches: "^urn:ietf:params:acme:error:externalAccountRequired$" } }],
|
|
141
144
|
) {}
|
|
@@ -147,7 +150,7 @@ export class AcmeIncorrectResponse
|
|
|
147
150
|
code: S.Number,
|
|
148
151
|
message: S.String,
|
|
149
152
|
type: S.String,
|
|
150
|
-
detail: S.optional(S.String),
|
|
153
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
151
154
|
}),
|
|
152
155
|
[{ message: { matches: "^urn:ietf:params:acme:error:incorrectResponse$" } }],
|
|
153
156
|
) {}
|
|
@@ -159,7 +162,7 @@ export class AcmeInvalidContact
|
|
|
159
162
|
code: S.Number,
|
|
160
163
|
message: S.String,
|
|
161
164
|
type: S.String,
|
|
162
|
-
detail: S.optional(S.String),
|
|
165
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
163
166
|
}),
|
|
164
167
|
[{ message: { matches: "^urn:ietf:params:acme:error:invalidContact$" } }],
|
|
165
168
|
) {}
|
|
@@ -171,7 +174,7 @@ export class AcmeMalformed
|
|
|
171
174
|
code: S.Number,
|
|
172
175
|
message: S.String,
|
|
173
176
|
type: S.String,
|
|
174
|
-
detail: S.optional(S.String),
|
|
177
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
175
178
|
}),
|
|
176
179
|
[{ message: { matches: "^urn:ietf:params:acme:error:malformed$" } }],
|
|
177
180
|
) {}
|
|
@@ -183,7 +186,7 @@ export class AcmeOrderNotReady
|
|
|
183
186
|
code: S.Number,
|
|
184
187
|
message: S.String,
|
|
185
188
|
type: S.String,
|
|
186
|
-
detail: S.optional(S.String),
|
|
189
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
187
190
|
}),
|
|
188
191
|
[{ message: { matches: "^urn:ietf:params:acme:error:orderNotReady$" } }],
|
|
189
192
|
) {}
|
|
@@ -192,11 +195,11 @@ export class AcmeOrderNotReady
|
|
|
192
195
|
export class AcmeRateLimited
|
|
193
196
|
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
194
197
|
/*@__PURE__*/ S.TaggedError<AcmeRateLimited>()("AcmeRateLimited", {
|
|
195
|
-
retryAfter: S.optional(S.Duration),
|
|
198
|
+
retryAfter: /*@__PURE__*/ S.optional(S.Duration),
|
|
196
199
|
code: S.Number,
|
|
197
200
|
message: S.String,
|
|
198
201
|
type: S.String,
|
|
199
|
-
detail: S.optional(S.String),
|
|
202
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
200
203
|
}).pipe(C.withThrottlingError, C.withRetryableError),
|
|
201
204
|
[{ message: { matches: "^urn:ietf:params:acme:error:rateLimited$" } }],
|
|
202
205
|
) {}
|
|
@@ -208,7 +211,7 @@ export class AcmeRejectedIdentifier
|
|
|
208
211
|
code: S.Number,
|
|
209
212
|
message: S.String,
|
|
210
213
|
type: S.String,
|
|
211
|
-
detail: S.optional(S.String),
|
|
214
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
212
215
|
}),
|
|
213
216
|
[{ message: { matches: "^urn:ietf:params:acme:error:rejectedIdentifier$" } }],
|
|
214
217
|
) {}
|
|
@@ -220,7 +223,7 @@ export class AcmeServerInternal
|
|
|
220
223
|
code: S.Number,
|
|
221
224
|
message: S.String,
|
|
222
225
|
type: S.String,
|
|
223
|
-
detail: S.optional(S.String),
|
|
226
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
224
227
|
}).pipe(C.withRetryableError),
|
|
225
228
|
[{ message: { matches: "^urn:ietf:params:acme:error:serverInternal$" } }],
|
|
226
229
|
) {}
|
|
@@ -232,7 +235,7 @@ export class AcmeTls
|
|
|
232
235
|
code: S.Number,
|
|
233
236
|
message: S.String,
|
|
234
237
|
type: S.String,
|
|
235
|
-
detail: S.optional(S.String),
|
|
238
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
236
239
|
}),
|
|
237
240
|
[{ message: { matches: "^urn:ietf:params:acme:error:tls$" } }],
|
|
238
241
|
) {}
|
|
@@ -244,7 +247,7 @@ export class AcmeUnauthorized
|
|
|
244
247
|
code: S.Number,
|
|
245
248
|
message: S.String,
|
|
246
249
|
type: S.String,
|
|
247
|
-
detail: S.optional(S.String),
|
|
250
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
248
251
|
}),
|
|
249
252
|
[{ message: { matches: "^urn:ietf:params:acme:error:unauthorized$" } }],
|
|
250
253
|
) {}
|
|
@@ -256,7 +259,7 @@ export class AcmeUnsupportedContact
|
|
|
256
259
|
code: S.Number,
|
|
257
260
|
message: S.String,
|
|
258
261
|
type: S.String,
|
|
259
|
-
detail: S.optional(S.String),
|
|
262
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
260
263
|
}),
|
|
261
264
|
[{ message: { matches: "^urn:ietf:params:acme:error:unsupportedContact$" } }],
|
|
262
265
|
) {}
|
|
@@ -268,7 +271,7 @@ export class AcmeUnsupportedIdentifier
|
|
|
268
271
|
code: S.Number,
|
|
269
272
|
message: S.String,
|
|
270
273
|
type: S.String,
|
|
271
|
-
detail: S.optional(S.String),
|
|
274
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
272
275
|
}),
|
|
273
276
|
[{ message: { matches: "^urn:ietf:params:acme:error:unsupportedIdentifier$" } }],
|
|
274
277
|
) {}
|
|
@@ -280,7 +283,7 @@ export class AcmeUserActionRequired
|
|
|
280
283
|
code: S.Number,
|
|
281
284
|
message: S.String,
|
|
282
285
|
type: S.String,
|
|
283
|
-
detail: S.optional(S.String),
|
|
286
|
+
detail: /*@__PURE__*/ S.optional(S.String),
|
|
284
287
|
}),
|
|
285
288
|
[{ message: { matches: "^urn:ietf:params:acme:error:userActionRequired$" } }],
|
|
286
289
|
) {}
|
|
@@ -291,28 +294,12 @@ export interface DeactivateAuthorizationRequest {
|
|
|
291
294
|
/** Always `deactivated`. */
|
|
292
295
|
status: string;
|
|
293
296
|
}
|
|
294
|
-
export const DeactivateAuthorizationRequest = /*@__PURE__*/ S.suspend(() =>
|
|
295
|
-
S.Struct({
|
|
296
|
-
url: S.String.pipe(T.Label()),
|
|
297
|
-
status: S.String,
|
|
298
|
-
}).pipe(T.Http({ method: "POST", uri: "/authz/{url}/deactivate", code: 200 })),
|
|
299
|
-
).annotate({
|
|
300
|
-
identifier: "DeactivateAuthorizationRequest",
|
|
301
|
-
}) as any as S.Schema<DeactivateAuthorizationRequest>;
|
|
302
|
-
|
|
303
297
|
export interface Identifier {
|
|
304
298
|
/** The type of identifier. This document defines the "dns" identifier type. See the registry defined in Section 9.7.7 for any others. */
|
|
305
299
|
type: string;
|
|
306
300
|
/** The identifier itself. */
|
|
307
301
|
value: string;
|
|
308
302
|
}
|
|
309
|
-
export const Identifier = /*@__PURE__*/ S.suspend(() =>
|
|
310
|
-
S.Struct({
|
|
311
|
-
type: S.String,
|
|
312
|
-
value: S.String,
|
|
313
|
-
}),
|
|
314
|
-
).annotate({ identifier: "Identifier" }) as any as S.Schema<Identifier>;
|
|
315
|
-
|
|
316
303
|
export interface Subproblem {
|
|
317
304
|
/** The error type URI. */
|
|
318
305
|
type?: string;
|
|
@@ -321,19 +308,7 @@ export interface Subproblem {
|
|
|
321
308
|
/** The identifier this subproblem is about. */
|
|
322
309
|
identifier?: Identifier;
|
|
323
310
|
}
|
|
324
|
-
export const Subproblem = /*@__PURE__*/ S.suspend(() =>
|
|
325
|
-
S.Struct({
|
|
326
|
-
type: S.optional(S.String),
|
|
327
|
-
detail: S.optional(S.String),
|
|
328
|
-
identifier: S.optional(Identifier),
|
|
329
|
-
}),
|
|
330
|
-
).annotate({ identifier: "Subproblem" }) as any as S.Schema<Subproblem>;
|
|
331
|
-
|
|
332
311
|
export type ProblemSubproblemsList = Array<Subproblem>;
|
|
333
|
-
export const ProblemSubproblemsList = /*@__PURE__*/ S.Array(
|
|
334
|
-
Subproblem,
|
|
335
|
-
) as any as S.Schema<ProblemSubproblemsList>;
|
|
336
|
-
|
|
337
312
|
/** RFC 7807 problem document (RFC 8555 §6.7). */
|
|
338
313
|
export interface Problem {
|
|
339
314
|
/** The error type URI, e.g. `urn:ietf:params:acme:error:malformed`. */
|
|
@@ -349,17 +324,6 @@ export interface Problem {
|
|
|
349
324
|
/** Errors for individual identifiers (RFC 8555 §6.7.1). */
|
|
350
325
|
subproblems?: ProblemSubproblemsList;
|
|
351
326
|
}
|
|
352
|
-
export const Problem = /*@__PURE__*/ S.suspend(() =>
|
|
353
|
-
S.Struct({
|
|
354
|
-
type: S.optional(S.String),
|
|
355
|
-
detail: S.optional(S.String),
|
|
356
|
-
status: S.optional(S.Number),
|
|
357
|
-
instance: S.optional(S.String),
|
|
358
|
-
identifier: S.optional(Identifier),
|
|
359
|
-
subproblems: S.optional(ProblemSubproblemsList),
|
|
360
|
-
}),
|
|
361
|
-
).annotate({ identifier: "Problem" }) as any as S.Schema<Problem>;
|
|
362
|
-
|
|
363
327
|
/** RFC 8555 §8 */
|
|
364
328
|
export interface Challenge {
|
|
365
329
|
/** The type of challenge encoded in the object. */
|
|
@@ -375,22 +339,7 @@ export interface Challenge {
|
|
|
375
339
|
/** Error that occurred while the server was validating the challenge, if any, structured as a problem document [RFC7807]. Multiple errors can be indicated by using subproblems Section 6.7.1. A challenge object with an error MUST have status equal to "invalid". */
|
|
376
340
|
error?: Problem;
|
|
377
341
|
}
|
|
378
|
-
export const Challenge = /*@__PURE__*/ S.suspend(() =>
|
|
379
|
-
S.Struct({
|
|
380
|
-
type: S.String,
|
|
381
|
-
url: S.String,
|
|
382
|
-
status: S.String,
|
|
383
|
-
validated: S.optional(S.String),
|
|
384
|
-
token: S.optional(S.String),
|
|
385
|
-
error: S.optional(Problem),
|
|
386
|
-
}),
|
|
387
|
-
).annotate({ identifier: "Challenge" }) as any as S.Schema<Challenge>;
|
|
388
|
-
|
|
389
342
|
export type AuthorizationChallengesList = Array<Challenge>;
|
|
390
|
-
export const AuthorizationChallengesList = /*@__PURE__*/ S.Array(
|
|
391
|
-
Challenge,
|
|
392
|
-
) as any as S.Schema<AuthorizationChallengesList>;
|
|
393
|
-
|
|
394
343
|
/** RFC 8555 §7.1.4 */
|
|
395
344
|
export interface Authorization {
|
|
396
345
|
/** The identifier that the account is authorized to represent. */
|
|
@@ -404,70 +353,26 @@ export interface Authorization {
|
|
|
404
353
|
/** This field MUST be present and true for authorizations created as a result of a newOrder request containing a DNS identifier with a value that was a wildcard domain name. For other authorizations, it MUST be absent. Wildcard domain names are described in Section 7.1.3. */
|
|
405
354
|
wildcard?: boolean;
|
|
406
355
|
}
|
|
407
|
-
export const Authorization = /*@__PURE__*/ S.suspend(() =>
|
|
408
|
-
S.Struct({
|
|
409
|
-
identifier: Identifier,
|
|
410
|
-
status: S.String,
|
|
411
|
-
expires: S.optional(S.String),
|
|
412
|
-
challenges: AuthorizationChallengesList,
|
|
413
|
-
wildcard: S.optional(S.Boolean),
|
|
414
|
-
}),
|
|
415
|
-
).annotate({ identifier: "Authorization" }) as any as S.Schema<Authorization>;
|
|
416
|
-
|
|
417
356
|
export interface DownloadCertificateRequest {
|
|
418
357
|
/** Absolute URL of the resource, as returned by the CA. */
|
|
419
358
|
url: string;
|
|
420
359
|
}
|
|
421
|
-
export const DownloadCertificateRequest = /*@__PURE__*/ S.suspend(() =>
|
|
422
|
-
S.Struct({
|
|
423
|
-
url: S.String.pipe(T.Label()),
|
|
424
|
-
}).pipe(T.Http({ method: "POST", uri: "/cert/{url}", code: 200 })),
|
|
425
|
-
).annotate({
|
|
426
|
-
identifier: "DownloadCertificateRequest",
|
|
427
|
-
}) as any as S.Schema<DownloadCertificateRequest>;
|
|
428
|
-
|
|
429
360
|
/** Alternate chain URLs from `Link: <url>;rel="alternate"` headers. */
|
|
430
361
|
export type CertificateChainAlternatesList = Array<string>;
|
|
431
|
-
export const CertificateChainAlternatesList = /*@__PURE__*/ S.Array(
|
|
432
|
-
S.String,
|
|
433
|
-
) as any as S.Schema<CertificateChainAlternatesList>;
|
|
434
|
-
|
|
435
362
|
export interface CertificateChain {
|
|
436
363
|
/** PEM certificate chain (`application/pem-certificate-chain`), leaf first. */
|
|
437
364
|
chain: string;
|
|
438
365
|
/** Alternate chain URLs from `Link: <url>;rel="alternate"` headers. */
|
|
439
366
|
alternates?: CertificateChainAlternatesList;
|
|
440
367
|
}
|
|
441
|
-
export const CertificateChain = /*@__PURE__*/ S.suspend(() =>
|
|
442
|
-
S.Struct({
|
|
443
|
-
chain: S.String,
|
|
444
|
-
alternates: S.optional(CertificateChainAlternatesList),
|
|
445
|
-
}),
|
|
446
|
-
).annotate({ identifier: "CertificateChain" }) as any as S.Schema<CertificateChain>;
|
|
447
|
-
|
|
448
368
|
export interface FinalizeOrderRequest {
|
|
449
369
|
/** Absolute URL of the resource, as returned by the CA. */
|
|
450
370
|
url: string;
|
|
451
371
|
/** A CSR encoding the parameters for the certificate being requested [RFC2986]. The CSR is sent in the base64url-encoded version of the DER format. (Note: Because this field uses base64url, and does not include headers, it is different from PEM.) */
|
|
452
372
|
csr: string;
|
|
453
373
|
}
|
|
454
|
-
export const FinalizeOrderRequest = /*@__PURE__*/ S.suspend(() =>
|
|
455
|
-
S.Struct({
|
|
456
|
-
url: S.String.pipe(T.Label()),
|
|
457
|
-
csr: S.String,
|
|
458
|
-
}).pipe(T.Http({ method: "POST", uri: "/finalize/{url}", code: 200 })),
|
|
459
|
-
).annotate({ identifier: "FinalizeOrderRequest" }) as any as S.Schema<FinalizeOrderRequest>;
|
|
460
|
-
|
|
461
374
|
export type OrderResponseIdentifiersList = Array<Identifier>;
|
|
462
|
-
export const OrderResponseIdentifiersList = /*@__PURE__*/ S.Array(
|
|
463
|
-
Identifier,
|
|
464
|
-
) as any as S.Schema<OrderResponseIdentifiersList>;
|
|
465
|
-
|
|
466
375
|
export type OrderResponseAuthorizationsList = Array<string>;
|
|
467
|
-
export const OrderResponseAuthorizationsList = /*@__PURE__*/ S.Array(
|
|
468
|
-
S.String,
|
|
469
|
-
) as any as S.Schema<OrderResponseAuthorizationsList>;
|
|
470
|
-
|
|
471
376
|
/** RFC 8555 §7.1.3, plus the `Location` header as `location`. */
|
|
472
377
|
export interface OrderResponse {
|
|
473
378
|
/** The status of this order. Possible values are "pending", "ready", "processing", "valid", and "invalid". See Section 7.1.6. */
|
|
@@ -491,41 +396,12 @@ export interface OrderResponse {
|
|
|
491
396
|
/** The order URL (`Location` header). */
|
|
492
397
|
location?: string;
|
|
493
398
|
}
|
|
494
|
-
export const OrderResponse = /*@__PURE__*/ S.suspend(() =>
|
|
495
|
-
S.Struct({
|
|
496
|
-
status: S.String,
|
|
497
|
-
expires: S.optional(S.String),
|
|
498
|
-
identifiers: OrderResponseIdentifiersList,
|
|
499
|
-
notBefore: S.optional(S.String),
|
|
500
|
-
notAfter: S.optional(S.String),
|
|
501
|
-
error: S.optional(Problem),
|
|
502
|
-
authorizations: OrderResponseAuthorizationsList,
|
|
503
|
-
finalize: S.String,
|
|
504
|
-
certificate: S.optional(S.String),
|
|
505
|
-
location: S.optional(S.String),
|
|
506
|
-
}),
|
|
507
|
-
).annotate({ identifier: "OrderResponse" }) as any as S.Schema<OrderResponse>;
|
|
508
|
-
|
|
509
399
|
export interface GetAuthorizationRequest {
|
|
510
400
|
/** Absolute URL of the resource, as returned by the CA. */
|
|
511
401
|
url: string;
|
|
512
402
|
}
|
|
513
|
-
export const GetAuthorizationRequest = /*@__PURE__*/ S.suspend(() =>
|
|
514
|
-
S.Struct({
|
|
515
|
-
url: S.String.pipe(T.Label()),
|
|
516
|
-
}).pipe(T.Http({ method: "POST", uri: "/authz/{url}", code: 200 })),
|
|
517
|
-
).annotate({ identifier: "GetAuthorizationRequest" }) as any as S.Schema<GetAuthorizationRequest>;
|
|
518
|
-
|
|
519
403
|
export interface GetDirectoryRequest {}
|
|
520
|
-
export const GetDirectoryRequest = /*@__PURE__*/ S.suspend(() =>
|
|
521
|
-
S.Struct({}).pipe(T.Http({ method: "GET", uri: "/directory", code: 200 })),
|
|
522
|
-
).annotate({ identifier: "GetDirectoryRequest" }) as any as S.Schema<GetDirectoryRequest>;
|
|
523
|
-
|
|
524
404
|
export type DirectoryMetaCaaIdentitiesList = Array<string>;
|
|
525
|
-
export const DirectoryMetaCaaIdentitiesList = /*@__PURE__*/ S.Array(
|
|
526
|
-
S.String,
|
|
527
|
-
) as any as S.Schema<DirectoryMetaCaaIdentitiesList>;
|
|
528
|
-
|
|
529
405
|
export interface DirectoryMeta {
|
|
530
406
|
/** A URL identifying the current terms of service. */
|
|
531
407
|
termsOfService?: string;
|
|
@@ -536,15 +412,6 @@ export interface DirectoryMeta {
|
|
|
536
412
|
/** If this field is present and set to "true", then the CA requires that all newAccount requests include an "externalAccountBinding" field associating the new account with an external account. */
|
|
537
413
|
externalAccountRequired?: boolean;
|
|
538
414
|
}
|
|
539
|
-
export const DirectoryMeta = /*@__PURE__*/ S.suspend(() =>
|
|
540
|
-
S.Struct({
|
|
541
|
-
termsOfService: S.optional(S.String),
|
|
542
|
-
website: S.optional(S.String),
|
|
543
|
-
caaIdentities: S.optional(DirectoryMetaCaaIdentitiesList),
|
|
544
|
-
externalAccountRequired: S.optional(S.Boolean),
|
|
545
|
-
}),
|
|
546
|
-
).annotate({ identifier: "DirectoryMeta" }) as any as S.Schema<DirectoryMeta>;
|
|
547
|
-
|
|
548
415
|
/** RFC 8555 §7.1.1 */
|
|
549
416
|
export interface Directory {
|
|
550
417
|
/** URL of the new nonce resource. */
|
|
@@ -562,47 +429,17 @@ export interface Directory {
|
|
|
562
429
|
/** Metadata relating to the service provided by the ACME server. */
|
|
563
430
|
meta?: DirectoryMeta;
|
|
564
431
|
}
|
|
565
|
-
export const Directory = /*@__PURE__*/ S.suspend(() =>
|
|
566
|
-
S.Struct({
|
|
567
|
-
newNonce: S.String,
|
|
568
|
-
newAccount: S.String,
|
|
569
|
-
newOrder: S.String,
|
|
570
|
-
newAuthz: S.optional(S.String),
|
|
571
|
-
revokeCert: S.String,
|
|
572
|
-
keyChange: S.optional(S.String),
|
|
573
|
-
meta: S.optional(DirectoryMeta),
|
|
574
|
-
}),
|
|
575
|
-
).annotate({ identifier: "Directory" }) as any as S.Schema<Directory>;
|
|
576
|
-
|
|
577
432
|
export interface GetOrderRequest {
|
|
578
433
|
/** Absolute URL of the resource, as returned by the CA. */
|
|
579
434
|
url: string;
|
|
580
435
|
}
|
|
581
|
-
export const GetOrderRequest = /*@__PURE__*/ S.suspend(() =>
|
|
582
|
-
S.Struct({
|
|
583
|
-
url: S.String.pipe(T.Label()),
|
|
584
|
-
}).pipe(T.Http({ method: "POST", uri: "/order/{url}", code: 200 })),
|
|
585
|
-
).annotate({ identifier: "GetOrderRequest" }) as any as S.Schema<GetOrderRequest>;
|
|
586
|
-
|
|
587
436
|
export type NewAccountRequestContactList = Array<string>;
|
|
588
|
-
export const NewAccountRequestContactList = /*@__PURE__*/ S.Array(
|
|
589
|
-
S.String,
|
|
590
|
-
) as any as S.Schema<NewAccountRequestContactList>;
|
|
591
|
-
|
|
592
437
|
/** A JWS binding this account to an existing CA account (RFC 8555 §7.3.4). The protocol builds it from the credentials' EAB key id and HMAC key. */
|
|
593
438
|
export interface ExternalAccountBinding {
|
|
594
439
|
protected: string;
|
|
595
440
|
payload: string;
|
|
596
441
|
signature: string;
|
|
597
442
|
}
|
|
598
|
-
export const ExternalAccountBinding = /*@__PURE__*/ S.suspend(() =>
|
|
599
|
-
S.Struct({
|
|
600
|
-
protected: S.String,
|
|
601
|
-
payload: S.String,
|
|
602
|
-
signature: S.String,
|
|
603
|
-
}),
|
|
604
|
-
).annotate({ identifier: "ExternalAccountBinding" }) as any as S.Schema<ExternalAccountBinding>;
|
|
605
|
-
|
|
606
443
|
export interface NewAccountRequest {
|
|
607
444
|
/** Same meaning as the corresponding server field defined in Section 7.1.2. */
|
|
608
445
|
contact?: NewAccountRequestContactList;
|
|
@@ -613,20 +450,7 @@ export interface NewAccountRequest {
|
|
|
613
450
|
/** Same meaning as the corresponding server field defined in Section 7.1.2 */
|
|
614
451
|
externalAccountBinding?: ExternalAccountBinding;
|
|
615
452
|
}
|
|
616
|
-
export const NewAccountRequest = /*@__PURE__*/ S.suspend(() =>
|
|
617
|
-
S.Struct({
|
|
618
|
-
contact: S.optional(NewAccountRequestContactList),
|
|
619
|
-
termsOfServiceAgreed: S.optional(S.Boolean),
|
|
620
|
-
onlyReturnExisting: S.optional(S.Boolean),
|
|
621
|
-
externalAccountBinding: S.optional(ExternalAccountBinding),
|
|
622
|
-
}).pipe(T.Http({ method: "POST", uri: "/newAccount", code: 200 })),
|
|
623
|
-
).annotate({ identifier: "NewAccountRequest" }) as any as S.Schema<NewAccountRequest>;
|
|
624
|
-
|
|
625
453
|
export type AccountResponseContactList = Array<string>;
|
|
626
|
-
export const AccountResponseContactList = /*@__PURE__*/ S.Array(
|
|
627
|
-
S.String,
|
|
628
|
-
) as any as S.Schema<AccountResponseContactList>;
|
|
629
|
-
|
|
630
454
|
/** RFC 8555 §7.1.2, plus the `Location` header as `location`. */
|
|
631
455
|
export interface AccountResponse {
|
|
632
456
|
/** The status of this account. Possible values are "valid", "deactivated", and "revoked". The value "deactivated" should be used to indicate client-initiated deactivation whereas "revoked" should be used to indicate server- initiated deactivation. See Section 7.1.6. */
|
|
@@ -640,36 +464,12 @@ export interface AccountResponse {
|
|
|
640
464
|
/** The account URL (`Location` header); the `kid` for every later request. */
|
|
641
465
|
location?: string;
|
|
642
466
|
}
|
|
643
|
-
export const AccountResponse = /*@__PURE__*/ S.suspend(() =>
|
|
644
|
-
S.Struct({
|
|
645
|
-
status: S.String,
|
|
646
|
-
contact: S.optional(AccountResponseContactList),
|
|
647
|
-
termsOfServiceAgreed: S.optional(S.Boolean),
|
|
648
|
-
orders: S.optional(S.String),
|
|
649
|
-
location: S.optional(S.String),
|
|
650
|
-
}),
|
|
651
|
-
).annotate({ identifier: "AccountResponse" }) as any as S.Schema<AccountResponse>;
|
|
652
|
-
|
|
653
467
|
export interface NewNonceRequest {}
|
|
654
|
-
export const NewNonceRequest = /*@__PURE__*/ S.suspend(() =>
|
|
655
|
-
S.Struct({}).pipe(T.Http({ method: "GET", uri: "/newNonce", code: 200 })),
|
|
656
|
-
).annotate({ identifier: "NewNonceRequest" }) as any as S.Schema<NewNonceRequest>;
|
|
657
|
-
|
|
658
468
|
export interface NonceResponse {
|
|
659
469
|
/** The `Replay-Nonce` header. */
|
|
660
470
|
replayNonce: string;
|
|
661
471
|
}
|
|
662
|
-
export const NonceResponse = /*@__PURE__*/ S.suspend(() =>
|
|
663
|
-
S.Struct({
|
|
664
|
-
replayNonce: S.String,
|
|
665
|
-
}),
|
|
666
|
-
).annotate({ identifier: "NonceResponse" }) as any as S.Schema<NonceResponse>;
|
|
667
|
-
|
|
668
472
|
export type NewOrderRequestIdentifiersList = Array<Identifier>;
|
|
669
|
-
export const NewOrderRequestIdentifiersList = /*@__PURE__*/ S.Array(
|
|
670
|
-
Identifier,
|
|
671
|
-
) as any as S.Schema<NewOrderRequestIdentifiersList>;
|
|
672
|
-
|
|
673
473
|
export interface NewOrderRequest {
|
|
674
474
|
/** An array of identifier objects that the client wishes to submit an order for. */
|
|
675
475
|
identifiers: NewOrderRequestIdentifiersList;
|
|
@@ -678,47 +478,18 @@ export interface NewOrderRequest {
|
|
|
678
478
|
/** The requested value of the notAfter field in the certificate, in the date format defined in [RFC3339]. */
|
|
679
479
|
notAfter?: string;
|
|
680
480
|
}
|
|
681
|
-
export const NewOrderRequest = /*@__PURE__*/ S.suspend(() =>
|
|
682
|
-
S.Struct({
|
|
683
|
-
identifiers: NewOrderRequestIdentifiersList,
|
|
684
|
-
notBefore: S.optional(S.String),
|
|
685
|
-
notAfter: S.optional(S.String),
|
|
686
|
-
}).pipe(T.Http({ method: "POST", uri: "/newOrder", code: 200 })),
|
|
687
|
-
).annotate({ identifier: "NewOrderRequest" }) as any as S.Schema<NewOrderRequest>;
|
|
688
|
-
|
|
689
481
|
export interface RespondChallengeRequest {
|
|
690
482
|
/** Absolute URL of the resource, as returned by the CA. */
|
|
691
483
|
url: string;
|
|
692
484
|
}
|
|
693
|
-
export const RespondChallengeRequest = /*@__PURE__*/ S.suspend(() =>
|
|
694
|
-
S.Struct({
|
|
695
|
-
url: S.String.pipe(T.Label()),
|
|
696
|
-
}).pipe(T.Http({ method: "POST", uri: "/challenge/{url}", code: 200 })),
|
|
697
|
-
).annotate({ identifier: "RespondChallengeRequest" }) as any as S.Schema<RespondChallengeRequest>;
|
|
698
|
-
|
|
699
485
|
export interface RevokeCertificateRequest {
|
|
700
486
|
/** The certificate to be revoked, in the base64url-encoded version of the DER format. (Note: Because this field uses base64url, and does not include headers, it is different from PEM.) */
|
|
701
487
|
certificate: string;
|
|
702
488
|
/** One of the revocation reasonCodes defined in Section 5.3.1 of [RFC5280] to be used when generating OCSP responses and CRLs. If this field is not set, the server SHOULD omit the reasonCode CRL entry extension when generating OCSP responses and CRLs. The server MAY disallow a subset of reasonCodes from being used by the user. If a request contains a disallowed reasonCode, then the server MUST reject it with the error type "urn:ietf:params:acme:error:badRevocationReason". The problem document detail SHOULD indicate which reasonCodes are allowed. */
|
|
703
489
|
reason?: number;
|
|
704
490
|
}
|
|
705
|
-
export const RevokeCertificateRequest = /*@__PURE__*/ S.suspend(() =>
|
|
706
|
-
S.Struct({
|
|
707
|
-
certificate: S.String,
|
|
708
|
-
reason: S.optional(S.Number),
|
|
709
|
-
}).pipe(T.Http({ method: "POST", uri: "/revokeCert", code: 200 })),
|
|
710
|
-
).annotate({ identifier: "RevokeCertificateRequest" }) as any as S.Schema<RevokeCertificateRequest>;
|
|
711
|
-
|
|
712
491
|
export interface RevokeCertificateResponse {}
|
|
713
|
-
export const RevokeCertificateResponse = /*@__PURE__*/ S.suspend(() => S.Struct({})).annotate({
|
|
714
|
-
identifier: "RevokeCertificateResponse",
|
|
715
|
-
}) as any as S.Schema<RevokeCertificateResponse>;
|
|
716
|
-
|
|
717
492
|
export type UpdateAccountRequestContactList = Array<string>;
|
|
718
|
-
export const UpdateAccountRequestContactList = /*@__PURE__*/ S.Array(
|
|
719
|
-
S.String,
|
|
720
|
-
) as any as S.Schema<UpdateAccountRequestContactList>;
|
|
721
|
-
|
|
722
493
|
export interface UpdateAccountRequest {
|
|
723
494
|
/** Absolute URL of the resource, as returned by the CA. */
|
|
724
495
|
url: string;
|
|
@@ -727,14 +498,6 @@ export interface UpdateAccountRequest {
|
|
|
727
498
|
/** `deactivated` to deactivate the account (RFC 8555 §7.3.6). */
|
|
728
499
|
status?: string;
|
|
729
500
|
}
|
|
730
|
-
export const UpdateAccountRequest = /*@__PURE__*/ S.suspend(() =>
|
|
731
|
-
S.Struct({
|
|
732
|
-
url: S.String.pipe(T.Label()),
|
|
733
|
-
contact: S.optional(UpdateAccountRequestContactList),
|
|
734
|
-
status: S.optional(S.String),
|
|
735
|
-
}).pipe(T.Http({ method: "POST", uri: "/account/{url}", code: 200 })),
|
|
736
|
-
).annotate({ identifier: "UpdateAccountRequest" }) as any as S.Schema<UpdateAccountRequest>;
|
|
737
|
-
|
|
738
501
|
export type DeactivateAuthorizationError =
|
|
739
502
|
| AcmeAccountDoesNotExist
|
|
740
503
|
| AcmeBadNonce
|
|
@@ -750,8 +513,8 @@ export const deactivateAuthorization: API.OperationMethod<
|
|
|
750
513
|
DeactivateAuthorizationError,
|
|
751
514
|
AcmeOpContext
|
|
752
515
|
> = /*@__PURE__*/ API.make(() => ({
|
|
753
|
-
input: DeactivateAuthorizationRequest
|
|
754
|
-
output: Authorization
|
|
516
|
+
input: __S(0, __c0, 0) as any as S.Schema<DeactivateAuthorizationRequest>,
|
|
517
|
+
output: __S(9, __c2, 1) as any as S.Schema<Authorization>,
|
|
755
518
|
errors: [
|
|
756
519
|
AcmeAccountDoesNotExist,
|
|
757
520
|
AcmeBadNonce,
|
|
@@ -779,8 +542,8 @@ export const downloadCertificate: API.OperationMethod<
|
|
|
779
542
|
DownloadCertificateError,
|
|
780
543
|
AcmeOpContext
|
|
781
544
|
> = /*@__PURE__*/ API.make(() => ({
|
|
782
|
-
input: DownloadCertificateRequest
|
|
783
|
-
output: CertificateChain
|
|
545
|
+
input: __S(16, __c4, 0) as any as S.Schema<DownloadCertificateRequest>,
|
|
546
|
+
output: __S(17, __c4, 1) as any as S.Schema<CertificateChain>,
|
|
784
547
|
errors: [
|
|
785
548
|
AcmeAccountDoesNotExist,
|
|
786
549
|
AcmeBadNonce,
|
|
@@ -810,8 +573,8 @@ export const finalizeOrder: API.OperationMethod<
|
|
|
810
573
|
FinalizeOrderError,
|
|
811
574
|
AcmeOpContext
|
|
812
575
|
> = /*@__PURE__*/ API.make(() => ({
|
|
813
|
-
input: FinalizeOrderRequest
|
|
814
|
-
output: OrderResponse
|
|
576
|
+
input: __S(24, __c6, 0) as any as S.Schema<FinalizeOrderRequest>,
|
|
577
|
+
output: __S(29, __c7, 1) as any as S.Schema<OrderResponse>,
|
|
815
578
|
errors: [
|
|
816
579
|
AcmeAccountDoesNotExist,
|
|
817
580
|
AcmeBadCsr,
|
|
@@ -841,8 +604,8 @@ export const getAuthorization: API.OperationMethod<
|
|
|
841
604
|
GetAuthorizationError,
|
|
842
605
|
AcmeOpContext
|
|
843
606
|
> = /*@__PURE__*/ API.make(() => ({
|
|
844
|
-
input: GetAuthorizationRequest
|
|
845
|
-
output: Authorization
|
|
607
|
+
input: __S(32, __c8, 0) as any as S.Schema<GetAuthorizationRequest>,
|
|
608
|
+
output: __S(9, __c2, 1) as any as S.Schema<Authorization>,
|
|
846
609
|
errors: [
|
|
847
610
|
AcmeAccountDoesNotExist,
|
|
848
611
|
AcmeBadNonce,
|
|
@@ -863,8 +626,8 @@ export const getDirectory: API.OperationMethod<
|
|
|
863
626
|
GetDirectoryError,
|
|
864
627
|
AcmeOpContext
|
|
865
628
|
> = /*@__PURE__*/ API.make(() => ({
|
|
866
|
-
input: GetDirectoryRequest
|
|
867
|
-
output: Directory
|
|
629
|
+
input: __S(36, __c9, 0) as any as S.Schema<GetDirectoryRequest>,
|
|
630
|
+
output: __S(38, __c9, 2) as any as S.Schema<Directory>,
|
|
868
631
|
errors: [],
|
|
869
632
|
protocol: AcmeProtocol,
|
|
870
633
|
retry: Retry.Retry,
|
|
@@ -885,8 +648,8 @@ export const getOrder: API.OperationMethod<
|
|
|
885
648
|
GetOrderError,
|
|
886
649
|
AcmeOpContext
|
|
887
650
|
> = /*@__PURE__*/ API.make(() => ({
|
|
888
|
-
input: GetOrderRequest
|
|
889
|
-
output: OrderResponse
|
|
651
|
+
input: __S(40, __c10, 0) as any as S.Schema<GetOrderRequest>,
|
|
652
|
+
output: __S(29, __c7, 1) as any as S.Schema<OrderResponse>,
|
|
890
653
|
errors: [
|
|
891
654
|
AcmeAccountDoesNotExist,
|
|
892
655
|
AcmeBadNonce,
|
|
@@ -920,8 +683,8 @@ export const newAccount: API.OperationMethod<
|
|
|
920
683
|
NewAccountError,
|
|
921
684
|
AcmeOpContext
|
|
922
685
|
> = /*@__PURE__*/ API.make(() => ({
|
|
923
|
-
input: NewAccountRequest
|
|
924
|
-
output: AccountResponse
|
|
686
|
+
input: __S(45, __c11, 1) as any as S.Schema<NewAccountRequest>,
|
|
687
|
+
output: __S(48, __c12, 0) as any as S.Schema<AccountResponse>,
|
|
925
688
|
errors: [
|
|
926
689
|
AcmeAccountDoesNotExist,
|
|
927
690
|
AcmeBadNonce,
|
|
@@ -948,8 +711,8 @@ export const newNonce: API.OperationMethod<
|
|
|
948
711
|
NewNonceError,
|
|
949
712
|
AcmeOpContext
|
|
950
713
|
> = /*@__PURE__*/ API.make(() => ({
|
|
951
|
-
input: NewNonceRequest
|
|
952
|
-
output: NonceResponse
|
|
714
|
+
input: __S(52, __c13, 0) as any as S.Schema<NewNonceRequest>,
|
|
715
|
+
output: __S(53, __c13, 1) as any as S.Schema<NonceResponse>,
|
|
953
716
|
errors: [],
|
|
954
717
|
protocol: AcmeProtocol,
|
|
955
718
|
retry: Retry.Retry,
|
|
@@ -973,8 +736,8 @@ export const newOrder: API.OperationMethod<
|
|
|
973
736
|
NewOrderError,
|
|
974
737
|
AcmeOpContext
|
|
975
738
|
> = /*@__PURE__*/ API.make(() => ({
|
|
976
|
-
input: NewOrderRequest
|
|
977
|
-
output: OrderResponse
|
|
739
|
+
input: __S(56, __c14, 0) as any as S.Schema<NewOrderRequest>,
|
|
740
|
+
output: __S(29, __c7, 1) as any as S.Schema<OrderResponse>,
|
|
978
741
|
errors: [
|
|
979
742
|
AcmeAccountDoesNotExist,
|
|
980
743
|
AcmeBadNonce,
|
|
@@ -1010,8 +773,8 @@ export const respondChallenge: API.OperationMethod<
|
|
|
1010
773
|
RespondChallengeError,
|
|
1011
774
|
AcmeOpContext
|
|
1012
775
|
> = /*@__PURE__*/ API.make(() => ({
|
|
1013
|
-
input: RespondChallengeRequest
|
|
1014
|
-
output: Challenge
|
|
776
|
+
input: __S(60, __c15, 0) as any as S.Schema<RespondChallengeRequest>,
|
|
777
|
+
output: __S(12, __c3, 0) as any as S.Schema<Challenge>,
|
|
1015
778
|
errors: [
|
|
1016
779
|
AcmeAccountDoesNotExist,
|
|
1017
780
|
AcmeBadNonce,
|
|
@@ -1046,8 +809,8 @@ export const revokeCertificate: API.OperationMethod<
|
|
|
1046
809
|
RevokeCertificateError,
|
|
1047
810
|
AcmeOpContext
|
|
1048
811
|
> = /*@__PURE__*/ API.make(() => ({
|
|
1049
|
-
input: RevokeCertificateRequest
|
|
1050
|
-
output: RevokeCertificateResponse
|
|
812
|
+
input: __S(64, __c16, 0) as any as S.Schema<RevokeCertificateRequest>,
|
|
813
|
+
output: __S(65, __c16, 1) as any as S.Schema<RevokeCertificateResponse>,
|
|
1051
814
|
errors: [
|
|
1052
815
|
AcmeAccountDoesNotExist,
|
|
1053
816
|
AcmeAlreadyRevoked,
|
|
@@ -1079,8 +842,8 @@ export const updateAccount: API.OperationMethod<
|
|
|
1079
842
|
UpdateAccountError,
|
|
1080
843
|
AcmeOpContext
|
|
1081
844
|
> = /*@__PURE__*/ API.make(() => ({
|
|
1082
|
-
input: UpdateAccountRequest
|
|
1083
|
-
output: AccountResponse
|
|
845
|
+
input: __S(68, __c17, 0) as any as S.Schema<UpdateAccountRequest>,
|
|
846
|
+
output: __S(48, __c12, 0) as any as S.Schema<AccountResponse>,
|
|
1084
847
|
errors: [
|
|
1085
848
|
AcmeAccountDoesNotExist,
|
|
1086
849
|
AcmeBadNonce,
|
|
@@ -1094,3 +857,283 @@ export const updateAccount: API.OperationMethod<
|
|
|
1094
857
|
protocol: AcmeProtocol,
|
|
1095
858
|
retry: Retry.Retry,
|
|
1096
859
|
}));
|
|
860
|
+
|
|
861
|
+
// Schema builders: each runs one schema initializer, on that schema's first use.
|
|
862
|
+
function __c0(j: number): any {
|
|
863
|
+
switch (j) {
|
|
864
|
+
case 0:
|
|
865
|
+
return S.suspend(() =>
|
|
866
|
+
S.Struct({
|
|
867
|
+
url: S.String.pipe(T.Label()),
|
|
868
|
+
status: S.String,
|
|
869
|
+
}).pipe(T.Http({ method: "POST", uri: "/authz/{url}/deactivate", code: 200 })),
|
|
870
|
+
).annotate({ identifier: "DeactivateAuthorizationRequest" });
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
function __c1(j: number): any {
|
|
874
|
+
switch (j) {
|
|
875
|
+
case 0:
|
|
876
|
+
return S.suspend(() =>
|
|
877
|
+
S.Struct({
|
|
878
|
+
type: S.String,
|
|
879
|
+
value: S.String,
|
|
880
|
+
}),
|
|
881
|
+
).annotate({ identifier: "Identifier" });
|
|
882
|
+
case 1:
|
|
883
|
+
return S.suspend(() =>
|
|
884
|
+
S.Struct({
|
|
885
|
+
type: S.optional(S.String),
|
|
886
|
+
detail: S.optional(S.String),
|
|
887
|
+
identifier: S.optional(__S(4, __c1, 0)),
|
|
888
|
+
}),
|
|
889
|
+
).annotate({ identifier: "Subproblem" });
|
|
890
|
+
case 2:
|
|
891
|
+
return S.Array(__S(5, __c1, 1));
|
|
892
|
+
case 3:
|
|
893
|
+
return S.suspend(() =>
|
|
894
|
+
S.Struct({
|
|
895
|
+
type: S.optional(S.String),
|
|
896
|
+
detail: S.optional(S.String),
|
|
897
|
+
status: S.optional(S.Number),
|
|
898
|
+
instance: S.optional(S.String),
|
|
899
|
+
identifier: S.optional(__S(4, __c1, 0)),
|
|
900
|
+
subproblems: S.optional(__S(6, __c1, 2)),
|
|
901
|
+
}),
|
|
902
|
+
).annotate({ identifier: "Problem" });
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
function __c2(j: number): any {
|
|
906
|
+
switch (j) {
|
|
907
|
+
case 0:
|
|
908
|
+
return S.Array(__S(12, __c3, 0));
|
|
909
|
+
case 1:
|
|
910
|
+
return S.suspend(() =>
|
|
911
|
+
S.Struct({
|
|
912
|
+
identifier: __S(4, __c1, 0),
|
|
913
|
+
status: S.String,
|
|
914
|
+
expires: S.optional(S.String),
|
|
915
|
+
challenges: __S(8, __c2, 0),
|
|
916
|
+
wildcard: S.optional(S.Boolean),
|
|
917
|
+
}),
|
|
918
|
+
).annotate({ identifier: "Authorization" });
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
function __c3(j: number): any {
|
|
922
|
+
switch (j) {
|
|
923
|
+
case 0:
|
|
924
|
+
return S.suspend(() =>
|
|
925
|
+
S.Struct({
|
|
926
|
+
type: S.String,
|
|
927
|
+
url: S.String,
|
|
928
|
+
status: S.String,
|
|
929
|
+
validated: S.optional(S.String),
|
|
930
|
+
token: S.optional(S.String),
|
|
931
|
+
error: S.optional(__S(7, __c1, 3)),
|
|
932
|
+
}),
|
|
933
|
+
).annotate({ identifier: "Challenge" });
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
function __c4(j: number): any {
|
|
937
|
+
switch (j) {
|
|
938
|
+
case 0:
|
|
939
|
+
return S.suspend(() =>
|
|
940
|
+
S.Struct({
|
|
941
|
+
url: S.String.pipe(T.Label()),
|
|
942
|
+
}).pipe(T.Http({ method: "POST", uri: "/cert/{url}", code: 200 })),
|
|
943
|
+
).annotate({ identifier: "DownloadCertificateRequest" });
|
|
944
|
+
case 1:
|
|
945
|
+
return S.suspend(() =>
|
|
946
|
+
S.Struct({
|
|
947
|
+
chain: S.String,
|
|
948
|
+
alternates: S.optional(__S(20, __c5, 0)),
|
|
949
|
+
}),
|
|
950
|
+
).annotate({ identifier: "CertificateChain" });
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
function __c5(j: number): any {
|
|
954
|
+
switch (j) {
|
|
955
|
+
case 0:
|
|
956
|
+
return S.Array(S.String);
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
function __c6(j: number): any {
|
|
960
|
+
switch (j) {
|
|
961
|
+
case 0:
|
|
962
|
+
return S.suspend(() =>
|
|
963
|
+
S.Struct({
|
|
964
|
+
url: S.String.pipe(T.Label()),
|
|
965
|
+
csr: S.String,
|
|
966
|
+
}).pipe(T.Http({ method: "POST", uri: "/finalize/{url}", code: 200 })),
|
|
967
|
+
).annotate({ identifier: "FinalizeOrderRequest" });
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
function __c7(j: number): any {
|
|
971
|
+
switch (j) {
|
|
972
|
+
case 0:
|
|
973
|
+
return S.Array(__S(4, __c1, 0));
|
|
974
|
+
case 1:
|
|
975
|
+
return S.suspend(() =>
|
|
976
|
+
S.Struct({
|
|
977
|
+
status: S.String,
|
|
978
|
+
expires: S.optional(S.String),
|
|
979
|
+
identifiers: __S(28, __c7, 0),
|
|
980
|
+
notBefore: S.optional(S.String),
|
|
981
|
+
notAfter: S.optional(S.String),
|
|
982
|
+
error: S.optional(__S(7, __c1, 3)),
|
|
983
|
+
authorizations: __S(20, __c5, 0),
|
|
984
|
+
finalize: S.String,
|
|
985
|
+
certificate: S.optional(S.String),
|
|
986
|
+
location: S.optional(S.String),
|
|
987
|
+
}),
|
|
988
|
+
).annotate({ identifier: "OrderResponse" });
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
function __c8(j: number): any {
|
|
992
|
+
switch (j) {
|
|
993
|
+
case 0:
|
|
994
|
+
return S.suspend(() =>
|
|
995
|
+
S.Struct({
|
|
996
|
+
url: S.String.pipe(T.Label()),
|
|
997
|
+
}).pipe(T.Http({ method: "POST", uri: "/authz/{url}", code: 200 })),
|
|
998
|
+
).annotate({ identifier: "GetAuthorizationRequest" });
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
function __c9(j: number): any {
|
|
1002
|
+
switch (j) {
|
|
1003
|
+
case 0:
|
|
1004
|
+
return S.suspend(() =>
|
|
1005
|
+
S.Struct({}).pipe(T.Http({ method: "GET", uri: "/directory", code: 200 })),
|
|
1006
|
+
).annotate({ identifier: "GetDirectoryRequest" });
|
|
1007
|
+
case 1:
|
|
1008
|
+
return S.suspend(() =>
|
|
1009
|
+
S.Struct({
|
|
1010
|
+
termsOfService: S.optional(S.String),
|
|
1011
|
+
website: S.optional(S.String),
|
|
1012
|
+
caaIdentities: S.optional(__S(20, __c5, 0)),
|
|
1013
|
+
externalAccountRequired: S.optional(S.Boolean),
|
|
1014
|
+
}),
|
|
1015
|
+
).annotate({ identifier: "DirectoryMeta" });
|
|
1016
|
+
case 2:
|
|
1017
|
+
return S.suspend(() =>
|
|
1018
|
+
S.Struct({
|
|
1019
|
+
newNonce: S.String,
|
|
1020
|
+
newAccount: S.String,
|
|
1021
|
+
newOrder: S.String,
|
|
1022
|
+
newAuthz: S.optional(S.String),
|
|
1023
|
+
revokeCert: S.String,
|
|
1024
|
+
keyChange: S.optional(S.String),
|
|
1025
|
+
meta: S.optional(__S(37, __c9, 1)),
|
|
1026
|
+
}),
|
|
1027
|
+
).annotate({ identifier: "Directory" });
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
function __c10(j: number): any {
|
|
1031
|
+
switch (j) {
|
|
1032
|
+
case 0:
|
|
1033
|
+
return S.suspend(() =>
|
|
1034
|
+
S.Struct({
|
|
1035
|
+
url: S.String.pipe(T.Label()),
|
|
1036
|
+
}).pipe(T.Http({ method: "POST", uri: "/order/{url}", code: 200 })),
|
|
1037
|
+
).annotate({ identifier: "GetOrderRequest" });
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
function __c11(j: number): any {
|
|
1041
|
+
switch (j) {
|
|
1042
|
+
case 0:
|
|
1043
|
+
return S.suspend(() =>
|
|
1044
|
+
S.Struct({
|
|
1045
|
+
protected: S.String,
|
|
1046
|
+
payload: S.String,
|
|
1047
|
+
signature: S.String,
|
|
1048
|
+
}),
|
|
1049
|
+
).annotate({ identifier: "ExternalAccountBinding" });
|
|
1050
|
+
case 1:
|
|
1051
|
+
return S.suspend(() =>
|
|
1052
|
+
S.Struct({
|
|
1053
|
+
contact: S.optional(__S(20, __c5, 0)),
|
|
1054
|
+
termsOfServiceAgreed: S.optional(S.Boolean),
|
|
1055
|
+
onlyReturnExisting: S.optional(S.Boolean),
|
|
1056
|
+
externalAccountBinding: S.optional(__S(44, __c11, 0)),
|
|
1057
|
+
}).pipe(T.Http({ method: "POST", uri: "/newAccount", code: 200 })),
|
|
1058
|
+
).annotate({ identifier: "NewAccountRequest" });
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
function __c12(j: number): any {
|
|
1062
|
+
switch (j) {
|
|
1063
|
+
case 0:
|
|
1064
|
+
return S.suspend(() =>
|
|
1065
|
+
S.Struct({
|
|
1066
|
+
status: S.String,
|
|
1067
|
+
contact: S.optional(__S(20, __c5, 0)),
|
|
1068
|
+
termsOfServiceAgreed: S.optional(S.Boolean),
|
|
1069
|
+
orders: S.optional(S.String),
|
|
1070
|
+
location: S.optional(S.String),
|
|
1071
|
+
}),
|
|
1072
|
+
).annotate({ identifier: "AccountResponse" });
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
function __c13(j: number): any {
|
|
1076
|
+
switch (j) {
|
|
1077
|
+
case 0:
|
|
1078
|
+
return S.suspend(() =>
|
|
1079
|
+
S.Struct({}).pipe(T.Http({ method: "GET", uri: "/newNonce", code: 200 })),
|
|
1080
|
+
).annotate({ identifier: "NewNonceRequest" });
|
|
1081
|
+
case 1:
|
|
1082
|
+
return S.suspend(() =>
|
|
1083
|
+
S.Struct({
|
|
1084
|
+
replayNonce: S.String,
|
|
1085
|
+
}),
|
|
1086
|
+
).annotate({ identifier: "NonceResponse" });
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
function __c14(j: number): any {
|
|
1090
|
+
switch (j) {
|
|
1091
|
+
case 0:
|
|
1092
|
+
return S.suspend(() =>
|
|
1093
|
+
S.Struct({
|
|
1094
|
+
identifiers: __S(28, __c7, 0),
|
|
1095
|
+
notBefore: S.optional(S.String),
|
|
1096
|
+
notAfter: S.optional(S.String),
|
|
1097
|
+
}).pipe(T.Http({ method: "POST", uri: "/newOrder", code: 200 })),
|
|
1098
|
+
).annotate({ identifier: "NewOrderRequest" });
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
function __c15(j: number): any {
|
|
1102
|
+
switch (j) {
|
|
1103
|
+
case 0:
|
|
1104
|
+
return S.suspend(() =>
|
|
1105
|
+
S.Struct({
|
|
1106
|
+
url: S.String.pipe(T.Label()),
|
|
1107
|
+
}).pipe(T.Http({ method: "POST", uri: "/challenge/{url}", code: 200 })),
|
|
1108
|
+
).annotate({ identifier: "RespondChallengeRequest" });
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
function __c16(j: number): any {
|
|
1112
|
+
switch (j) {
|
|
1113
|
+
case 0:
|
|
1114
|
+
return S.suspend(() =>
|
|
1115
|
+
S.Struct({
|
|
1116
|
+
certificate: S.String,
|
|
1117
|
+
reason: S.optional(S.Number),
|
|
1118
|
+
}).pipe(T.Http({ method: "POST", uri: "/revokeCert", code: 200 })),
|
|
1119
|
+
).annotate({ identifier: "RevokeCertificateRequest" });
|
|
1120
|
+
case 1:
|
|
1121
|
+
return S.suspend(() => S.Struct({})).annotate({ identifier: "RevokeCertificateResponse" });
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
function __c17(j: number): any {
|
|
1125
|
+
switch (j) {
|
|
1126
|
+
case 0:
|
|
1127
|
+
return S.suspend(() =>
|
|
1128
|
+
S.Struct({
|
|
1129
|
+
url: S.String.pipe(T.Label()),
|
|
1130
|
+
contact: S.optional(__S(20, __c5, 0)),
|
|
1131
|
+
status: S.optional(S.String),
|
|
1132
|
+
}).pipe(T.Http({ method: "POST", uri: "/account/{url}", code: 200 })),
|
|
1133
|
+
).annotate({ identifier: "UpdateAccountRequest" });
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
// Schema table: entry i is schema j of builder f, made on first reach.
|
|
1137
|
+
function __S(i: number, f: (j: number) => unknown, j: number): any {
|
|
1138
|
+
return (__s[i] ??= __L.at(f, j));
|
|
1139
|
+
}
|