@cloud-cli/le 1.0.3 → 1.0.4
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.
|
@@ -13,7 +13,7 @@ export interface CreateCertificateOptions extends CertificateOptions {
|
|
|
13
13
|
export declare class CertificateManager {
|
|
14
14
|
private readonly domainPattern;
|
|
15
15
|
certificateExists({ domain }: CertificateOptions): boolean;
|
|
16
|
-
createCertificate({ domain, useWildcard, additionalOptions }: CreateCertificateOptions):
|
|
16
|
+
createCertificate({ domain, useWildcard, additionalOptions }: CreateCertificateOptions): true | Promise<string>;
|
|
17
17
|
removeCertificate({ domain }: CertificateOptions): void;
|
|
18
18
|
getCertificateList(): string[];
|
|
19
19
|
private isValidDomain;
|
|
@@ -18,12 +18,11 @@ export class CertificateManager {
|
|
|
18
18
|
}
|
|
19
19
|
const path = join(certificatesFolder, domain);
|
|
20
20
|
if (existsSync(path)) {
|
|
21
|
-
return
|
|
21
|
+
return true;
|
|
22
22
|
}
|
|
23
23
|
const domains = [domain, useWildcard ? '*.' + domain : ''].filter(Boolean);
|
|
24
24
|
const domainsWithPrefix = domains.map((domain) => `-d${domain}`);
|
|
25
|
-
|
|
26
|
-
const out = sh('certbot', ['certonly', ...additionalOptions, ...domainsWithPrefix]);
|
|
25
|
+
const out = sh('certbot', ['certonly', ...(additionalOptions || []), ...domainsWithPrefix]);
|
|
27
26
|
const stdout = String(out.stdout || '');
|
|
28
27
|
const stderr = String(out.stderr || '').split('\n').map(s => '! ' + s).join('\n');
|
|
29
28
|
const logs = stdout + '\n\n' + stderr;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CertificateOptions, CreateCertificateOptions } from './certificate-manager.js';
|
|
2
2
|
declare const _default: {
|
|
3
|
-
add(certificate: CreateCertificateOptions):
|
|
3
|
+
add(certificate: CreateCertificateOptions): true | Promise<string>;
|
|
4
4
|
remove(options: CertificateOptions): void;
|
|
5
5
|
list(): string[];
|
|
6
6
|
exists(options: CertificateOptions): boolean;
|