@theholocron/holocron-plugin-cloudflare 3.34.6 → 3.36.0

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/dist/index.d.mts CHANGED
@@ -26,6 +26,8 @@ declare class CloudflareDeployment implements Deployment {
26
26
  target?: DeploymentTrigger;
27
27
  }): Promise<DeploymentRecord>;
28
28
  getDeployment(deploymentId: string): Promise<DeploymentRecord>;
29
+ listPreviewDeployments(projectId: string, branch: string): Promise<DeploymentRecord[]>;
30
+ deletePreviewDeployments(projectId: string, deploymentIds: string[]): Promise<number>;
29
31
  ensureCustomDomain(projectId: string, hostname: string): Promise<void>;
30
32
  private getProjectByName;
31
33
  }
package/dist/index.mjs CHANGED
@@ -63,6 +63,16 @@ var CloudflareDeployment = class {
63
63
  const raw = await this.client.pages.getDeployment(this.accountId, projectName, cfDeployId);
64
64
  return mapDeployment(raw, projectName, raw.deployment_trigger.metadata.branch, void 0);
65
65
  }
66
+ async listPreviewDeployments(projectId, branch) {
67
+ return (await this.client.pages.listDeployments(this.accountId, projectId)).filter((d) => d.deployment_trigger.metadata.branch === branch).map((d) => mapDeployment(d, projectId, d.deployment_trigger.metadata.branch, void 0));
68
+ }
69
+ async deletePreviewDeployments(projectId, deploymentIds) {
70
+ await Promise.all(deploymentIds.map((id) => {
71
+ const cfId = id.includes(":") ? id.slice(id.indexOf(":") + 1) : id;
72
+ return this.client.pages.deleteDeployment(this.accountId, projectId, cfId);
73
+ }));
74
+ return deploymentIds.length;
75
+ }
66
76
  async ensureCustomDomain(projectId, hostname) {
67
77
  if ((await this.client.pages.listDomains(this.accountId, projectId)).some((d) => d.name === hostname)) return;
68
78
  await this.client.pages.addDomain(this.accountId, projectId, hostname);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-cloudflare",
3
- "version": "3.34.6",
3
+ "version": "3.36.0",
4
4
  "description": "Holocron plugin for Cloudflare. Implements the dns capability against Cloudflare's REST API — zone resolution, DNS record management.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -30,7 +30,7 @@
30
30
  "dist"
31
31
  ],
32
32
  "devDependencies": {
33
- "@theholocron/cloudflare-client": "^1.11.2",
33
+ "@theholocron/cloudflare-client": "^1.12.0",
34
34
  "@theholocron/eslint-config": "^7.25.3",
35
35
  "@theholocron/tsconfig": "^7.20.0",
36
36
  "@theholocron/tsdown-config": "^7.20.0",
@@ -46,11 +46,11 @@
46
46
  "tsx": "4.23.12",
47
47
  "typescript": "^5.9.3",
48
48
  "vitest": "^4.1.10",
49
- "@theholocron/cli": "3.34.6"
49
+ "@theholocron/cli": "3.36.0"
50
50
  },
51
51
  "peerDependencies": {
52
- "@theholocron/cloudflare-client": "^1.11.2",
53
- "@theholocron/cli": "3.34.6"
52
+ "@theholocron/cloudflare-client": "^1.12.0",
53
+ "@theholocron/cli": "3.36.0"
54
54
  },
55
55
  "peerDependenciesMeta": {
56
56
  "@theholocron/cloudflare-client": {}