quidproquo-webserver 0.0.149 → 0.0.151
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/commonjs/services/cloudflare/logic/askCloudflareAddDNSRecord.js +3 -0
- package/lib/commonjs/services/cloudflare/logic/askCloudflareDeleteDNSRecord.js +1 -1
- package/lib/commonjs/services/cloudflare/logic/askCloudflareGetDNSRecordId.js +3 -0
- package/lib/commonjs/services/cloudflare/logic/askCloudflareGetZoneId.js +3 -0
- package/package.json +1 -1
|
@@ -20,6 +20,9 @@ function* askCloudflareAddDNSRecord(apiKey, zoneId, cnameName, dnsEntryValue) {
|
|
|
20
20
|
},
|
|
21
21
|
body: requestBody,
|
|
22
22
|
});
|
|
23
|
+
if (response.status < 200 || response.status >= 300) {
|
|
24
|
+
yield* (0, quidproquo_core_1.askThrowError)(quidproquo_core_1.ErrorTypeEnum.GenericError, `Error adding DNS records`);
|
|
25
|
+
}
|
|
23
26
|
console.log(JSON.stringify(response.data, null, 2));
|
|
24
27
|
if (!response.data.success) {
|
|
25
28
|
yield* (0, quidproquo_core_1.askThrowError)(quidproquo_core_1.ErrorTypeEnum.GenericError, `Failed to add CNAME record: ${response.data.errors.map((e) => e.message).join(', ')}`);
|
|
@@ -9,7 +9,7 @@ function* askCloudflareDeleteDNSRecord(apiKey, zoneId, recordId) {
|
|
|
9
9
|
'Content-Type': 'application/json',
|
|
10
10
|
},
|
|
11
11
|
});
|
|
12
|
-
if (!response.data.success) {
|
|
12
|
+
if (response.status < 200 || response.status >= 300 || !response.data.success) {
|
|
13
13
|
yield* (0, quidproquo_core_1.askThrowError)(quidproquo_core_1.ErrorTypeEnum.GenericError, `Failed to delete DNS record: ${response.data.errors.join(', ')}`);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -10,6 +10,9 @@ function* askCloudflareGetDNSRecordId(apiKey, zoneId, cnameName) {
|
|
|
10
10
|
'Content-Type': 'application/json',
|
|
11
11
|
},
|
|
12
12
|
});
|
|
13
|
+
if (response.status < 200 || response.status >= 300) {
|
|
14
|
+
yield* (0, quidproquo_core_1.askThrowError)(quidproquo_core_1.ErrorTypeEnum.GenericError, `Error getting DNS record for [${cnameName}]`);
|
|
15
|
+
}
|
|
13
16
|
console.log('exists', JSON.stringify(response.data, null, 2));
|
|
14
17
|
return (_a = response.data.result[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
15
18
|
}
|
|
@@ -10,6 +10,9 @@ function* askCloudflareGetZoneId(apiKey, siteDomainName) {
|
|
|
10
10
|
'Content-Type': 'application/json',
|
|
11
11
|
},
|
|
12
12
|
});
|
|
13
|
+
if (response.status < 200 || response.status >= 300) {
|
|
14
|
+
yield* (0, quidproquo_core_1.askThrowError)(quidproquo_core_1.ErrorTypeEnum.GenericError, `Error getting zoneId for [${siteDomainName}]`);
|
|
15
|
+
}
|
|
13
16
|
const zoneId = (_a = response.data.result[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
14
17
|
if (!zoneId) {
|
|
15
18
|
yield* (0, quidproquo_core_1.askThrowError)(quidproquo_core_1.ErrorTypeEnum.GenericError, `No zoneId found for [${siteDomainName}]`);
|