-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f4cde7b
commit acecf70
Showing
20 changed files
with
230 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,20 @@ | ||
#!/usr/bin/env node | ||
try{new(await import("commander")).Command().name("DeploymentDelete").version("0.1.13").description("Deletes old deployments in your Cloudflare account.").option("-e, --Email <Email>","Cloudflare Account E-mail.").option("-i, --ID <ID>","Cloudflare Account ID.").option("-k, --Key <Key>","Cloudflare API key.").action(async({Email:e,ID:o,Key:a})=>console.log(await(await import("../Function/Delete.js")).default({Email:e,ID:o,Key:a}))).parse()}catch{} | ||
try { | ||
new (await import("commander")).Command() | ||
.name("DeploymentDelete") | ||
.version("0.1.13") | ||
.description("Deletes old deployments in your Cloudflare account.") | ||
.option("-e, --Email <Email>", "Cloudflare Account E-mail.") | ||
.option("-i, --ID <ID>", "Cloudflare Account ID.") | ||
.option("-k, --Key <Key>", "Cloudflare API key.") | ||
.action(async ({ Email: e, ID: o, Key: a }) => | ||
console.log( | ||
await (await import("../Function/Delete.js")).default({ | ||
Email: e, | ||
ID: o, | ||
Key: a, | ||
}), | ||
), | ||
) | ||
.parse(); | ||
} catch {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,31 @@ | ||
var f=async(...[{Email:a,ID:e,Key:o}=p.parse(process.env)])=>{const t={"content-type":"application/json;charset=UTF-8","X-Auth-Email":a,"X-Auth-Key":o};t["X-Auth-Email"]=a??t["X-Auth-Email"],t["X-Auth-Key"]=o??t["X-Auth-Key"];const r=[];for(const{name:s}of await(await import("./Project.js")).default(e,t)??[])for(const{id:n,created_on:c}of(await(async i=>(await(await import("./Deployment.js")).default(e,i,t)).splice(0,500)??[])(s)).reverse())if((Date.now()-new Date(c))/864e5>7){try{await fetch(`${`https://api.cloudflare.com/client/v4/accounts/${e}/pages/projects/${s}/deployments`}/${n}`,{method:"DELETE",headers:t})}catch{}r.push(n)}return r};const{default:p}=await import("../Variable/Environment.js");export{p as Environment,f as default}; | ||
var f = async (...[{ Email: a, ID: e, Key: o } = p.parse(process.env)]) => { | ||
const t = { | ||
"content-type": "application/json;charset=UTF-8", | ||
"X-Auth-Email": a, | ||
"X-Auth-Key": o, | ||
}; | ||
(t["X-Auth-Email"] = a ?? t["X-Auth-Email"]), | ||
(t["X-Auth-Key"] = o ?? t["X-Auth-Key"]); | ||
const r = []; | ||
for (const { name: s } of (await ( | ||
await import("./Project.js") | ||
).default(e, t)) ?? []) | ||
for (const { id: n, created_on: c } of ( | ||
await (async (i) => | ||
( | ||
await (await import("./Deployment.js")).default(e, i, t) | ||
).splice(0, 500) ?? [])(s) | ||
).reverse()) | ||
if ((Date.now() - new Date(c)) / 864e5 > 7) { | ||
try { | ||
await fetch( | ||
`${`https://api.cloudflare.com/client/v4/accounts/${e}/pages/projects/${s}/deployments`}/${n}`, | ||
{ method: "DELETE", headers: t }, | ||
); | ||
} catch {} | ||
r.push(n); | ||
} | ||
return r; | ||
}; | ||
const { default: p } = await import("../Variable/Environment.js"); | ||
export { p as Environment, f as default }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
var n=async(e,t,r)=>(await(await fetch(`https://api.cloudflare.com/client/v4/accounts/${e}/pages/projects/${t}/deployments`,{headers:r})).json())?.result;export{n as default}; | ||
var n = async (e, t, r) => | ||
( | ||
await ( | ||
await fetch( | ||
`https://api.cloudflare.com/client/v4/accounts/${e}/pages/projects/${t}/deployments`, | ||
{ headers: r }, | ||
) | ||
).json() | ||
)?.result; | ||
export { n as default }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
var r=async(e,t)=>(await(await fetch(`https://api.cloudflare.com/client/v4/accounts/${e}/pages/projects`,{headers:t})).json())?.result;export{r as default}; | ||
var r = async (e, t) => | ||
( | ||
await ( | ||
await fetch( | ||
`https://api.cloudflare.com/client/v4/accounts/${e}/pages/projects`, | ||
{ headers: t }, | ||
) | ||
).json() | ||
)?.result; | ||
export { r as default }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
var n=async(e=null,s=200)=>new Response(JSON.stringify(e),{status:s,headers:{"Content-Type":"application/json;charset=utf-8"}});export{n as default}; | ||
var n = async (e = null, s = 200) => | ||
new Response(JSON.stringify(e), { | ||
status: s, | ||
headers: { "Content-Type": "application/json;charset=utf-8" }, | ||
}); | ||
export { n as default }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
const{default:t}=await import("./Delete.js");var r={fetch:async(n,e,o)=>await(await import("./Response.js")).default(await t(e)),scheduled:async(n,e,o)=>console.log(await t(e))};export{t as Delete,r as default}; | ||
const { default: t } = await import("./Delete.js"); | ||
var r = { | ||
fetch: async (n, e, o) => | ||
await (await import("./Response.js")).default(await t(e)), | ||
scheduled: async (n, e, o) => console.log(await t(e)), | ||
}; | ||
export { t as Delete, r as default }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
const{default:t}=await import("../Variable/Environment.js"); | ||
const { default: t } = await import("../Variable/Environment.js"); |
Oops, something went wrong.