Skip to content

Commit 19fa195

Browse files
committed
[FIX] Support file URLS and file paths in a single prop input deployment
1 parent 3afd891 commit 19fa195

File tree

3 files changed

+64
-28
lines changed

3 files changed

+64
-28
lines changed

components/cloudflare_api_key/actions/change-zone-development-mode/change-zone-development-mode.mjs

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,48 @@
11
import cloudflare from "../../cloudflare_api_key.app.mjs";
2-
import constants from "../../common/constants.mjs";
32

43
export default {
54
key: "cloudflare_api_key-change-zone-development-mode",
65
name: "Change Development Mode",
7-
description: "Development Mode temporarily allows you to enter development mode for your websites if you need to make changes to your site. This will bypass Cloudflare's accelerated cache and slow down your site. [See the docs here](https://api.cloudflare.com/#zone-settings-change-development-mode-setting)",
8-
version: "0.0.4",
6+
description: "Development Mode temporarily allows you to enter development mode for your websites if you need to make changes to your site. This will bypass Cloudflare's accelerated cache and slow down your site. [See the documentation](https://developers.cloudflare.com/api/node/resources/zones/subresources/settings/methods/edit/)",
7+
version: "0.0.5",
98
type: "action",
109
props: {
1110
cloudflare,
12-
zoneIdentifier: {
11+
zoneId: {
1312
propDefinition: [
1413
cloudflare,
1514
"zoneIdentifier",
1615
],
1716
},
18-
developmentMode: {
17+
value: {
1918
type: "string",
2019
label: "Development Mode",
21-
description: "Development mode value",
22-
options: constants.DEVELOPMENT_MODE_OPTIONS,
20+
description: "Turn development mode on or off for the zone",
21+
options: [
22+
{
23+
label: "On",
24+
value: "on",
25+
},
26+
{
27+
label: "Off",
28+
value: "off",
29+
},
30+
],
31+
default: "off",
2332
},
2433
},
2534
async run({ $ }) {
26-
const zoneId = this.zoneIdentifier;
27-
const developmentMode = this.developmentMode;
35+
const {
36+
zoneId,
37+
value,
38+
} = this;
2839

2940
const response = await this.cloudflare.editZoneSetting({
3041
settingId: "development_mode",
3142
zone_id: zoneId,
32-
value: developmentMode,
43+
value,
3344
});
34-
$.export("$summary", `Turned ${developmentMode} development mode for #${zoneId}`);
45+
$.export("$summary", "Successfully changed zone to development mode");
3546

3647
return response;
3748
},

components/cloudflare_api_key/actions/update-zone-security-level/update-zone-security-level.mjs

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,64 @@
11
import cloudflare from "../../cloudflare_api_key.app.mjs";
2-
import constants from "../../common/constants.mjs";
32

43
export default {
54
key: "cloudflare_api_key-update-zone-security-level",
65
name: "Update Zone Security Level",
7-
description: "Choose the appropriate security profile for your website, which will automatically adjust each of the security settings. [See the docs here](https://api.cloudflare.com/#zone-settings-change-security-level-setting)",
8-
version: "0.0.4",
6+
description: "Choose the appropriate security profile for your website, which will automatically adjust each of the security settings. [See the documentation](https://developers.cloudflare.com/api/node/resources/zones/subresources/settings/methods/edit/)",
7+
version: "0.0.5",
98
type: "action",
109
props: {
1110
cloudflare,
12-
zoneIdentifier: {
11+
zoneId: {
1312
propDefinition: [
1413
cloudflare,
1514
"zoneIdentifier",
1615
],
1716
},
18-
securityLevel: {
17+
value: {
1918
type: "string",
2019
label: "Security Level",
21-
description: "Security level value",
22-
options: constants.ZONE_SECURITY_LEVEL_OPTIONS,
20+
description: "Choose the appropriate security profile for your website",
21+
options: [
22+
{
23+
label: "Off",
24+
value: "off",
25+
},
26+
{
27+
label: "Essentially Off",
28+
value: "essentially_off",
29+
},
30+
{
31+
label: "Low",
32+
value: "low",
33+
},
34+
{
35+
label: "Medium",
36+
value: "medium",
37+
},
38+
{
39+
label: "High",
40+
value: "high",
41+
},
42+
{
43+
label: "Under Attack",
44+
value: "under_attack",
45+
},
46+
],
47+
default: "medium",
2348
},
2449
},
2550
async run({ $ }) {
26-
const zoneId = this.zoneIdentifier;
27-
const securityLevel = this.securityLevel;
51+
const {
52+
zoneId,
53+
value,
54+
} = this;
2855

2956
const response = await this.cloudflare.editZoneSetting({
3057
settingId: "security_level",
3158
zone_id: zoneId,
32-
value: securityLevel,
59+
value,
3360
});
34-
$.export("$summary", `Successfully updated zone #${zoneId} security level to '${securityLevel}'`);
61+
$.export("$summary", "Successfully updated zone with security level");
3562

3663
return response;
3764
},

pnpm-lock.yaml

Lines changed: 4 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)