@nodeart/cloudflare-provisioning 1.0.7 → 1.0.8
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/cloudflare.js +8 -0
- package/package.json +1 -1
package/cloudflare.js
CHANGED
|
@@ -829,9 +829,13 @@ class CloudFlare {
|
|
|
829
829
|
}
|
|
830
830
|
|
|
831
831
|
async clearCustomCerts () {
|
|
832
|
+
console.log('Initiating certificate clear...')
|
|
832
833
|
const clientCertIds = await this.getClientCerts()
|
|
833
834
|
const caCertIds = await this.getCaCerts()
|
|
834
835
|
|
|
836
|
+
console.log(`Client certificates found: ${clientCertIds?.join(', ')}`)
|
|
837
|
+
console.log(`CA certificates found: ${caCertIds?.join(', ')}`)
|
|
838
|
+
|
|
835
839
|
for (const cert of clientCertIds) {
|
|
836
840
|
try {
|
|
837
841
|
await this.deleteClientCert(cert)
|
|
@@ -899,6 +903,8 @@ class CloudFlare {
|
|
|
899
903
|
if (statusCode !== 200) {
|
|
900
904
|
throw new Error(`Could not delete client certificate ID ${certId}: ${statusCode}, error: ${JSON.stringify(response)}`)
|
|
901
905
|
}
|
|
906
|
+
|
|
907
|
+
console.log(`Deleted client certificate ID ${certId}`)
|
|
902
908
|
}
|
|
903
909
|
|
|
904
910
|
async deleteCaCert (certId) {
|
|
@@ -915,6 +921,8 @@ class CloudFlare {
|
|
|
915
921
|
if (statusCode !== 200) {
|
|
916
922
|
throw new Error(`Could not delete CA certificate ID ${certId}: ${statusCode}, error: ${JSON.stringify(response)}`)
|
|
917
923
|
}
|
|
924
|
+
|
|
925
|
+
console.log(`Deleted CA certificate ID ${certId}`)
|
|
918
926
|
}
|
|
919
927
|
|
|
920
928
|
async uploadCertAndKey (clientCert, clientKey) {
|