@liquidmetal-ai/raindrop 0.7.0 → 0.8.1

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.
Files changed (178) hide show
  1. package/README.md +408 -73
  2. package/bin/cjs-shims.js +7 -0
  3. package/bin/run.js +20 -2
  4. package/bundle/chunk-5GH4FS6C.js +12148 -0
  5. package/bundle/chunk-6B4I2CKP.js +231 -0
  6. package/bundle/chunk-6UE75KX2.js +4481 -0
  7. package/bundle/chunk-AU3EGGJP.js +44 -0
  8. package/bundle/chunk-CDQRD3JA.js +75 -0
  9. package/bundle/chunk-CMCEP64V.js +380 -0
  10. package/bundle/chunk-CW5ZHVPX.js +292 -0
  11. package/bundle/chunk-G6NE675D.js +238720 -0
  12. package/bundle/chunk-GLIYVKQA.js +48 -0
  13. package/bundle/chunk-KXEV6E63.js +133 -0
  14. package/bundle/chunk-MCRKUPJY.js +4515 -0
  15. package/bundle/chunk-MGM2L2T3.js +805 -0
  16. package/bundle/chunk-MVQYQJHI.js +502 -0
  17. package/bundle/chunk-NG7CZTTE.js +147 -0
  18. package/bundle/chunk-PU4RCSXF.js +22452 -0
  19. package/bundle/chunk-VXAZKB3J.js +292 -0
  20. package/bundle/chunk-W2L3MYN6.js +4480 -0
  21. package/bundle/chunk-XYJACVNA.js +231 -0
  22. package/bundle/commands/annotation/get.js +153 -0
  23. package/bundle/commands/annotation/list.js +226 -0
  24. package/bundle/commands/annotation/put.js +177 -0
  25. package/bundle/commands/auth/list.js +75 -0
  26. package/bundle/commands/auth/login.js +1654 -0
  27. package/bundle/commands/auth/logout.js +27 -0
  28. package/bundle/commands/auth/select.js +53 -0
  29. package/bundle/commands/bucket/create-credential.js +173 -0
  30. package/bundle/commands/bucket/delete-credential.js +140 -0
  31. package/bundle/commands/bucket/get-credential.js +151 -0
  32. package/bundle/commands/bucket/list-credentials.js +148 -0
  33. package/bundle/commands/build/branch.js +126 -0
  34. package/bundle/commands/build/checkout.js +198 -0
  35. package/bundle/commands/build/clone.js +153 -0
  36. package/bundle/commands/build/delete.js +227 -0
  37. package/bundle/commands/build/deploy.js +160 -0
  38. package/bundle/commands/build/env/get.js +105 -0
  39. package/bundle/commands/build/env/set.js +115 -0
  40. package/bundle/commands/build/find.js +333 -0
  41. package/bundle/commands/build/generate.js +75 -0
  42. package/bundle/commands/build/init.js +76 -0
  43. package/bundle/commands/build/list.js +11 -0
  44. package/bundle/commands/build/sandbox.js +65 -0
  45. package/bundle/commands/build/start.js +84 -0
  46. package/bundle/commands/build/status.js +1839 -0
  47. package/bundle/commands/build/stop.js +84 -0
  48. package/bundle/commands/build/tools/check.js +32 -0
  49. package/bundle/commands/build/tools/fmt.js +49 -0
  50. package/bundle/commands/build/unsandbox.js +65 -0
  51. package/bundle/commands/build/upload.js +83 -0
  52. package/bundle/commands/build/validate.js +71 -0
  53. package/bundle/commands/build/workos/delete.js +86 -0
  54. package/bundle/commands/build/workos/env/attach.js +134 -0
  55. package/bundle/commands/build/workos/env/create.js +176 -0
  56. package/bundle/commands/build/workos/env/delete.js +84 -0
  57. package/bundle/commands/build/workos/env/detach.js +115 -0
  58. package/bundle/commands/build/workos/env/get.js +117 -0
  59. package/bundle/commands/build/workos/env/list.js +139 -0
  60. package/bundle/commands/build/workos/env/set.js +138 -0
  61. package/bundle/commands/build/workos/invite.js +91 -0
  62. package/bundle/commands/build/workos/setup.js +124 -0
  63. package/bundle/commands/build/workos/status.js +93 -0
  64. package/bundle/commands/dns/create.js +128 -0
  65. package/bundle/commands/dns/delete.js +80 -0
  66. package/bundle/commands/dns/get.js +167 -0
  67. package/bundle/commands/dns/list.js +193 -0
  68. package/bundle/commands/dns/records/create.js +150 -0
  69. package/bundle/commands/dns/records/delete.js +76 -0
  70. package/bundle/commands/dns/records/get.js +118 -0
  71. package/bundle/commands/dns/records/list.js +153 -0
  72. package/bundle/commands/dns/records/update.js +146 -0
  73. package/bundle/commands/logs/query.js +237 -0
  74. package/bundle/commands/logs/tail.js +155 -0
  75. package/bundle/commands/mcp/install-claude.js +220 -0
  76. package/bundle/commands/mcp/install-gemini.js +220 -0
  77. package/bundle/commands/mcp/install-goose.js +232 -0
  78. package/bundle/commands/mcp/status.js +153 -0
  79. package/bundle/commands/object/delete.js +180 -0
  80. package/bundle/commands/object/get.js +209 -0
  81. package/bundle/commands/object/list.js +206 -0
  82. package/bundle/commands/object/put.js +211 -0
  83. package/bundle/commands/query/chunk-search.js +123 -0
  84. package/bundle/commands/query/document.js +126 -0
  85. package/bundle/commands/query/events.js +98 -0
  86. package/bundle/commands/query/reindex.js +147 -0
  87. package/bundle/commands/query/search.js +169 -0
  88. package/bundle/commands/tail.js +31 -0
  89. package/bundle/index.js +51 -0
  90. package/dist/base-command.d.ts +6 -0
  91. package/dist/base-command.d.ts.map +1 -1
  92. package/dist/base-command.js +14 -1
  93. package/dist/build.d.ts +2 -1
  94. package/dist/build.d.ts.map +1 -1
  95. package/dist/build.js +169 -51
  96. package/dist/codegen.d.ts +1 -1
  97. package/dist/codegen.d.ts.map +1 -1
  98. package/dist/codegen.js +17 -3
  99. package/dist/codegen.test.js +44 -0
  100. package/dist/commands/build/checkout.d.ts.map +1 -1
  101. package/dist/commands/build/checkout.js +4 -0
  102. package/dist/commands/build/delete.d.ts.map +1 -1
  103. package/dist/commands/build/delete.js +6 -3
  104. package/dist/commands/build/deploy.d.ts.map +1 -1
  105. package/dist/commands/build/deploy.js +10 -2
  106. package/dist/commands/build/find.d.ts +1 -0
  107. package/dist/commands/build/find.d.ts.map +1 -1
  108. package/dist/commands/build/find.js +33 -2
  109. package/dist/commands/build/validate.d.ts.map +1 -1
  110. package/dist/commands/build/validate.js +0 -1
  111. package/dist/commands/build/workos/delete.d.ts +18 -0
  112. package/dist/commands/build/workos/delete.d.ts.map +1 -0
  113. package/dist/commands/build/workos/delete.js +72 -0
  114. package/dist/commands/build/workos/env/attach.d.ts +24 -0
  115. package/dist/commands/build/workos/env/attach.d.ts.map +1 -0
  116. package/dist/commands/build/workos/env/attach.js +111 -0
  117. package/dist/commands/build/workos/env/create.d.ts +26 -0
  118. package/dist/commands/build/workos/env/create.d.ts.map +1 -0
  119. package/dist/commands/build/workos/env/create.js +156 -0
  120. package/dist/commands/build/workos/env/delete.d.ts +20 -0
  121. package/dist/commands/build/workos/env/delete.d.ts.map +1 -0
  122. package/dist/commands/build/workos/env/delete.js +61 -0
  123. package/dist/commands/build/workos/env/detach.d.ts +21 -0
  124. package/dist/commands/build/workos/env/detach.d.ts.map +1 -0
  125. package/dist/commands/build/workos/env/detach.js +94 -0
  126. package/dist/commands/build/workos/env/get.d.ts +20 -0
  127. package/dist/commands/build/workos/env/get.d.ts.map +1 -0
  128. package/dist/commands/build/workos/env/get.js +94 -0
  129. package/dist/commands/build/workos/env/list.d.ts +18 -0
  130. package/dist/commands/build/workos/env/list.d.ts.map +1 -0
  131. package/dist/commands/build/workos/env/list.js +114 -0
  132. package/dist/commands/build/workos/env/set.d.ts +27 -0
  133. package/dist/commands/build/workos/env/set.d.ts.map +1 -0
  134. package/dist/commands/build/workos/env/set.js +115 -0
  135. package/dist/commands/build/workos/invite.d.ts +21 -0
  136. package/dist/commands/build/workos/invite.d.ts.map +1 -0
  137. package/dist/commands/build/workos/invite.js +68 -0
  138. package/dist/commands/build/workos/setup.d.ts +20 -0
  139. package/dist/commands/build/workos/setup.d.ts.map +1 -0
  140. package/dist/commands/build/workos/setup.js +106 -0
  141. package/dist/commands/build/workos/status.d.ts +18 -0
  142. package/dist/commands/build/workos/status.d.ts.map +1 -0
  143. package/dist/commands/build/workos/status.js +70 -0
  144. package/dist/commands/mcp/install-claude.d.ts.map +1 -1
  145. package/dist/commands/mcp/install-claude.js +0 -2
  146. package/dist/commands/mcp/install-gemini.d.ts.map +1 -1
  147. package/dist/commands/mcp/install-gemini.js +0 -2
  148. package/dist/commands/mcp/install-goose.d.ts.map +1 -1
  149. package/dist/commands/mcp/install-goose.js +0 -2
  150. package/dist/deploy.d.ts.map +1 -1
  151. package/dist/deploy.js +2 -2
  152. package/dist/index.d.ts +2 -0
  153. package/dist/index.d.ts.map +1 -1
  154. package/dist/index.js +4 -0
  155. package/oclif.manifest.json +4544 -2466
  156. package/package.json +8 -5
  157. package/templates/claude-code/debug-raindrop-app.md +89 -0
  158. package/templates/claude-code/new-raindrop-app.md +10 -6
  159. package/templates/claude-code/reattach-raindrop-session.md +50 -12
  160. package/templates/claude-code/update-raindrop-app.md +61 -9
  161. package/templates/db/node_modules/.bin/prisma +2 -2
  162. package/templates/db/node_modules/.bin/prisma-kysely +2 -2
  163. package/templates/db/node_modules/.bin/tsc +2 -2
  164. package/templates/db/node_modules/.bin/tsserver +2 -2
  165. package/templates/db/node_modules/.bin/zx +2 -2
  166. package/templates/gemini-code/debug-raindrop-app.toml +86 -0
  167. package/templates/gemini-code/new-raindrop-app.toml +9 -5
  168. package/templates/gemini-code/reattach-raindrop-session.toml +9 -11
  169. package/templates/gemini-code/update-raindrop-app.toml +55 -10
  170. package/templates/goose/debug-raindrop-app.yaml +91 -0
  171. package/templates/goose/new-raindrop-app.yaml +12 -7
  172. package/templates/goose/reattach-raindrop-session.yaml +11 -4
  173. package/templates/goose/update-raindrop-app.yaml +57 -5
  174. package/templates/init/src/_app/auth.ts +18 -0
  175. package/templates/init/src/_app/cors.ts +64 -0
  176. package/dist/tsconfig.tsbuildinfo +0 -1
  177. package/templates/claude-code/raindrop-guidelines.md +0 -322
  178. package/templates/gemini-code/raindrop-guidelines.md +0 -322
@@ -0,0 +1,167 @@
1
+ import {
2
+ resolveDnsNameToZoneId
3
+ } from "../../chunk-GLIYVKQA.js";
4
+ import {
5
+ source_default
6
+ } from "../../chunk-MVQYQJHI.js";
7
+ import {
8
+ BaseCommand
9
+ } from "../../chunk-MCRKUPJY.js";
10
+ import {
11
+ __toESM,
12
+ init_cjs_shims,
13
+ require_lib
14
+ } from "../../chunk-G6NE675D.js";
15
+
16
+ // src/commands/dns/get.ts
17
+ init_cjs_shims();
18
+ var import_core = __toESM(require_lib(), 1);
19
+ var Get = class extends BaseCommand {
20
+ static args = {
21
+ dnsName: import_core.Args.string({
22
+ description: "DNS name to get details for (e.g., example.com)",
23
+ required: true
24
+ })
25
+ };
26
+ static description = "Get details of a specific DNS zone";
27
+ static examples = [
28
+ `<%= config.bin %> <%= command.id %> example.com
29
+ Shows details for DNS zone for example.com
30
+ `,
31
+ `<%= config.bin %> <%= command.id %> subdomain.example.com --output json
32
+ Shows zone details in JSON format
33
+ `
34
+ ];
35
+ static flags = {
36
+ ...BaseCommand.HIDDEN_FLAGS,
37
+ output: import_core.Flags.string({
38
+ char: "o",
39
+ description: "output format",
40
+ default: "text",
41
+ options: ["text", "json"]
42
+ })
43
+ };
44
+ async run() {
45
+ const { client: dnsService, userId, organizationId } = await this.dnsService();
46
+ try {
47
+ const zoneId = await resolveDnsNameToZoneId(
48
+ dnsService,
49
+ organizationId,
50
+ userId,
51
+ this.args.dnsName
52
+ );
53
+ const response = await dnsService.getDNSZone({
54
+ organizationId,
55
+ userId,
56
+ zoneId
57
+ });
58
+ if (!response.zone) {
59
+ this.error(`DNS zone for ${this.args.dnsName} not found`, { exit: 1 });
60
+ return;
61
+ }
62
+ switch (this.flags.output) {
63
+ case "json":
64
+ console.log(
65
+ JSON.stringify(
66
+ {
67
+ zone: {
68
+ organizationId: response.zone.organizationId,
69
+ fullyQualifiedDomainName: response.zone.fullyQualifiedDomainName,
70
+ zoneType: response.zone.zoneType,
71
+ status: response.zone.status,
72
+ nameServers: response.zone.nameServers,
73
+ description: response.zone.description,
74
+ createdAt: response.zone.createdAt,
75
+ updatedAt: response.zone.updatedAt,
76
+ tags: response.zone.tags,
77
+ verificationKey: response.zone.verificationKey
78
+ }
79
+ },
80
+ null,
81
+ 2
82
+ )
83
+ );
84
+ break;
85
+ case "text":
86
+ default: {
87
+ console.log(`
88
+ ${source_default.bold.underline(`DNS Zone: ${response.zone.fullyQualifiedDomainName}`)}
89
+ `);
90
+ let statusColor;
91
+ if (response.zone.status === "active") {
92
+ statusColor = source_default.green;
93
+ } else if (response.zone.status === "pending") {
94
+ statusColor = source_default.yellow;
95
+ } else if (response.zone.status === "error") {
96
+ statusColor = source_default.red;
97
+ } else {
98
+ statusColor = source_default.gray;
99
+ }
100
+ console.log(`${source_default.bold("Status:")} ${statusColor(response.zone.status || "unknown")}`);
101
+ console.log(`${source_default.bold("Type:")} ${source_default.cyan(response.zone.zoneType || "custom")}`);
102
+ if (response.zone.nameServers && response.zone.nameServers.length > 0) {
103
+ console.log(`
104
+ ${source_default.bold("Nameservers:")}`);
105
+ for (const ns of response.zone.nameServers) {
106
+ console.log(` ${source_default.green("\u2022")} ${ns}`);
107
+ }
108
+ }
109
+ if (response.zone.verificationKey) {
110
+ console.log(`
111
+ ${source_default.bold("Verification Key:")}`);
112
+ console.log(` ${source_default.yellow(response.zone.verificationKey)}`);
113
+ }
114
+ if (response.zone.description) {
115
+ console.log(`
116
+ ${source_default.bold("Description:")}`);
117
+ console.log(` ${response.zone.description}`);
118
+ }
119
+ if (response.zone.tags && response.zone.tags.length > 0) {
120
+ console.log(`
121
+ ${source_default.bold("Tags:")}`);
122
+ console.log(` ${response.zone.tags.map((tag) => source_default.magenta(tag)).join(", ")}`);
123
+ }
124
+ if (response.zone.createdAt || response.zone.updatedAt) {
125
+ console.log(`
126
+ ${source_default.bold("Timestamps:")}`);
127
+ if (response.zone.createdAt) {
128
+ const createdDate = new Date(response.zone.createdAt);
129
+ const formattedCreated = createdDate.toLocaleString("en-US", {
130
+ weekday: "short",
131
+ year: "numeric",
132
+ month: "short",
133
+ day: "numeric",
134
+ hour: "2-digit",
135
+ minute: "2-digit",
136
+ second: "2-digit",
137
+ timeZoneName: "short"
138
+ });
139
+ console.log(` ${source_default.dim("Created:")} ${formattedCreated}`);
140
+ }
141
+ if (response.zone.updatedAt) {
142
+ const updatedDate = new Date(response.zone.updatedAt);
143
+ const formattedUpdated = updatedDate.toLocaleString("en-US", {
144
+ weekday: "short",
145
+ year: "numeric",
146
+ month: "short",
147
+ day: "numeric",
148
+ hour: "2-digit",
149
+ minute: "2-digit",
150
+ second: "2-digit",
151
+ timeZoneName: "short"
152
+ });
153
+ console.log(` ${source_default.dim("Updated:")} ${formattedUpdated}`);
154
+ }
155
+ }
156
+ console.log("");
157
+ break;
158
+ }
159
+ }
160
+ } catch (error) {
161
+ this.error(`Failed to get DNS zone: ${error}`, { exit: 1 });
162
+ }
163
+ }
164
+ };
165
+ export {
166
+ Get as default
167
+ };
@@ -0,0 +1,193 @@
1
+ import {
2
+ source_default
3
+ } from "../../chunk-MVQYQJHI.js";
4
+ import {
5
+ BaseCommand
6
+ } from "../../chunk-MCRKUPJY.js";
7
+ import {
8
+ __toESM,
9
+ init_cjs_shims,
10
+ require_lib
11
+ } from "../../chunk-G6NE675D.js";
12
+
13
+ // src/commands/dns/list.ts
14
+ init_cjs_shims();
15
+ var import_core = __toESM(require_lib(), 1);
16
+ var List = class extends BaseCommand {
17
+ static args = {};
18
+ static description = "List DNS zones for your organization";
19
+ static examples = [
20
+ `<%= config.bin %> <%= command.id %>
21
+ Lists all DNS zones in compact format (default)
22
+
23
+ <%= config.bin %> <%= command.id %> --output table
24
+ Lists all DNS zones in table format
25
+
26
+ <%= config.bin %> <%= command.id %> --output text
27
+ Lists all DNS zones with detailed information
28
+
29
+ <%= config.bin %> <%= command.id %> --output json
30
+ Lists all DNS zones in JSON format
31
+
32
+ <%= config.bin %> <%= command.id %> --zone-type custom
33
+ Lists only custom DNS zones
34
+
35
+ <%= config.bin %> <%= command.id %> --page-size 10
36
+ Lists DNS zones with pagination (10 per page)
37
+ `
38
+ ];
39
+ static flags = {
40
+ ...BaseCommand.HIDDEN_FLAGS,
41
+ output: import_core.Flags.string({
42
+ char: "o",
43
+ description: "output format",
44
+ default: "compact",
45
+ options: ["text", "table", "json", "compact"]
46
+ }),
47
+ pageSize: import_core.Flags.integer({
48
+ description: "number of zones to return per page",
49
+ default: 20
50
+ }),
51
+ pageToken: import_core.Flags.string({
52
+ description: "page token for pagination"
53
+ }),
54
+ zoneType: import_core.Flags.string({
55
+ description: "filter by zone type",
56
+ options: ["custom", "tenant"]
57
+ })
58
+ };
59
+ async run() {
60
+ const { client: dnsService, userId, organizationId } = await this.dnsService();
61
+ try {
62
+ const response = await dnsService.listDNSZones({
63
+ organizationId,
64
+ userId,
65
+ pageSize: this.flags.pageSize,
66
+ pageToken: this.flags.pageToken,
67
+ zoneType: this.flags.zoneType
68
+ });
69
+ if (!response.zones || response.zones.length === 0) {
70
+ this.log(source_default.dim("No DNS zones found in this organization"));
71
+ this.log(source_default.dim("Create a new DNS zone with: raindrop dns create <domain>"));
72
+ return;
73
+ }
74
+ switch (this.flags.output) {
75
+ case "compact":
76
+ for (const zone of response.zones) {
77
+ let statusColor;
78
+ if (zone.status === "active") {
79
+ statusColor = source_default.green;
80
+ } else if (zone.status === "pending") {
81
+ statusColor = source_default.yellow;
82
+ } else if (zone.status === "error") {
83
+ statusColor = source_default.red;
84
+ } else {
85
+ statusColor = source_default.gray;
86
+ }
87
+ const createdAt = zone.createdAt ? new Date(zone.createdAt).toLocaleDateString() : "N/A";
88
+ const typeInfo = zone.zoneType && zone.zoneType !== "custom" ? source_default.dim(` (${zone.zoneType})`) : "";
89
+ console.log(`
90
+ ${source_default.bold(zone.fullyQualifiedDomainName)}${typeInfo}`);
91
+ console.log(` \u2514\u2500 ${statusColor(zone.status || "unknown")} - ${source_default.dim(createdAt)}`);
92
+ if (zone.nameServers && zone.nameServers.length > 0) {
93
+ const nsDisplay = zone.nameServers.length > 2 ? `${zone.nameServers.slice(0, 2).join(", ")} (+${zone.nameServers.length - 2} more)` : zone.nameServers.join(", ");
94
+ console.log(` ${source_default.dim(`NS: ${nsDisplay}`)}`);
95
+ }
96
+ if (zone.description) {
97
+ const desc = zone.description.length > 60 ? zone.description.substring(0, 57) + "..." : zone.description;
98
+ console.log(` ${source_default.dim(desc)}`);
99
+ }
100
+ }
101
+ console.log("");
102
+ console.log(source_default.dim("\u2500".repeat(50)));
103
+ console.log(source_default.dim(`Total: ${response.zones.length} DNS zones`));
104
+ break;
105
+ case "text":
106
+ for (const zone of response.zones) {
107
+ let statusColor;
108
+ if (zone.status === "active") {
109
+ statusColor = source_default.green;
110
+ } else if (zone.status === "pending") {
111
+ statusColor = source_default.yellow;
112
+ } else if (zone.status === "error") {
113
+ statusColor = source_default.red;
114
+ } else {
115
+ statusColor = source_default.gray;
116
+ }
117
+ const createdAt = zone.createdAt ? new Date(zone.createdAt).toLocaleDateString() : "N/A";
118
+ console.log(`Domain: ${source_default.bold(zone.fullyQualifiedDomainName)}`);
119
+ console.log(` Status: ${statusColor(zone.status || "unknown")}`);
120
+ console.log(` Type: ${source_default.cyan(zone.zoneType || "custom")}`);
121
+ console.log(` Created: ${source_default.dim(createdAt)}`);
122
+ if (zone.nameServers && zone.nameServers.length > 0) {
123
+ console.log(` Nameservers:`);
124
+ for (const ns of zone.nameServers) {
125
+ console.log(` - ${source_default.dim(ns)}`);
126
+ }
127
+ }
128
+ if (zone.description) {
129
+ console.log(` Description: ${zone.description}`);
130
+ }
131
+ if (zone.tags && zone.tags.length > 0) {
132
+ console.log(` Tags: ${source_default.magenta(zone.tags.join(", "))}`);
133
+ }
134
+ console.log(source_default.dim("\u2500".repeat(50)));
135
+ }
136
+ if (response.nextPageToken) {
137
+ this.log(source_default.dim(`
138
+ Next page token: ${response.nextPageToken}`));
139
+ }
140
+ this.log(source_default.bold(`
141
+ Total DNS zones: ${response.zones.length}`));
142
+ break;
143
+ case "json":
144
+ console.log(
145
+ JSON.stringify(
146
+ {
147
+ zones: response.zones.map((zone) => ({
148
+ organizationId: zone.organizationId,
149
+ fullyQualifiedDomainName: zone.fullyQualifiedDomainName,
150
+ verificationKey: zone.verificationKey,
151
+ zoneType: zone.zoneType,
152
+ status: zone.status,
153
+ nameServers: zone.nameServers,
154
+ description: zone.description,
155
+ createdAt: zone.createdAt,
156
+ updatedAt: zone.updatedAt,
157
+ tags: zone.tags
158
+ })),
159
+ nextPageToken: response.nextPageToken,
160
+ totalCount: response.totalCount
161
+ },
162
+ null,
163
+ 2
164
+ )
165
+ );
166
+ break;
167
+ case "table":
168
+ console.table(
169
+ response.zones.map((zone) => ({
170
+ Domain: zone.fullyQualifiedDomainName,
171
+ Type: zone.zoneType || "custom",
172
+ Status: zone.status || "unknown",
173
+ Created: zone.createdAt ? new Date(zone.createdAt).toLocaleDateString() : "N/A",
174
+ Nameservers: zone.nameServers?.slice(0, 2).join(", ") + (zone.nameServers && zone.nameServers.length > 2 ? "..." : "") || "",
175
+ Description: zone.description ? zone.description.substring(0, 30) + (zone.description.length > 30 ? "..." : "") : ""
176
+ }))
177
+ );
178
+ if (response.nextPageToken) {
179
+ this.log(source_default.dim(`
180
+ Next page token: ${response.nextPageToken}`));
181
+ }
182
+ this.log(source_default.bold(`
183
+ Total DNS zones: ${response.zones.length}`));
184
+ break;
185
+ }
186
+ } catch (error) {
187
+ this.error(`Failed to list DNS zones: ${error}`, { exit: 1 });
188
+ }
189
+ }
190
+ };
191
+ export {
192
+ List as default
193
+ };
@@ -0,0 +1,150 @@
1
+ import {
2
+ BaseCommand
3
+ } from "../../../chunk-MCRKUPJY.js";
4
+ import {
5
+ __toESM,
6
+ init_cjs_shims,
7
+ require_lib
8
+ } from "../../../chunk-G6NE675D.js";
9
+
10
+ // src/commands/dns/records/create.ts
11
+ init_cjs_shims();
12
+ var import_core = __toESM(require_lib(), 1);
13
+ var Create = class extends BaseCommand {
14
+ static args = {
15
+ zoneId: import_core.Args.string({
16
+ description: "Zone ID to create record in",
17
+ required: true
18
+ }),
19
+ type: import_core.Args.string({
20
+ description: "Record type (A, AAAA, CNAME, MX, TXT, NS, etc.)",
21
+ required: true
22
+ }),
23
+ name: import_core.Args.string({
24
+ description: "Record name (e.g., www, @, subdomain)",
25
+ required: true
26
+ }),
27
+ content: import_core.Args.string({
28
+ description: "Record content (IP address, domain, text value, etc.)",
29
+ required: true
30
+ })
31
+ };
32
+ static description = "Create a new DNS record";
33
+ static examples = [
34
+ `<%= config.bin %> <%= command.id %> zone-123 A www 192.0.2.1
35
+ Creates an A record for www pointing to 192.0.2.1
36
+ `,
37
+ `<%= config.bin %> <%= command.id %> zone-123 MX @ mail.example.com --priority 10
38
+ Creates an MX record with priority 10
39
+ `,
40
+ `<%= config.bin %> <%= command.id %> zone-123 TXT @ "v=spf1 include:_spf.google.com ~all"
41
+ Creates a TXT record for SPF
42
+ `
43
+ ];
44
+ static flags = {
45
+ ...BaseCommand.HIDDEN_FLAGS,
46
+ ttl: import_core.Flags.integer({
47
+ description: "Time to live in seconds (1 = automatic)",
48
+ default: 1
49
+ }),
50
+ priority: import_core.Flags.integer({
51
+ char: "p",
52
+ description: "Priority (for MX and SRV records)"
53
+ }),
54
+ proxied: import_core.Flags.boolean({
55
+ description: "Whether the record should be proxied through CloudFlare",
56
+ default: false
57
+ }),
58
+ comment: import_core.Flags.string({
59
+ char: "c",
60
+ description: "Comment for the record"
61
+ }),
62
+ tags: import_core.Flags.string({
63
+ description: "Comma-separated list of tags",
64
+ multiple: true
65
+ }),
66
+ output: import_core.Flags.string({
67
+ char: "o",
68
+ description: "output format",
69
+ default: "text",
70
+ options: ["text", "json"]
71
+ })
72
+ };
73
+ async run() {
74
+ const { client: dnsService, userId, organizationId } = await this.dnsService();
75
+ try {
76
+ const validTypes = ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "SRV", "CAA", "PTR"];
77
+ if (!validTypes.includes(this.args.type.toUpperCase())) {
78
+ this.warn(`Record type ${this.args.type} may not be supported`);
79
+ }
80
+ if (this.args.type.toUpperCase() === "MX" && this.flags.priority === void 0) {
81
+ this.error("MX records require a priority value", { exit: 1 });
82
+ }
83
+ this.log(`Creating ${this.args.type} record...`);
84
+ const response = await dnsService.createDNSRecord({
85
+ organizationId,
86
+ userId,
87
+ zoneId: this.args.zoneId,
88
+ type: this.args.type.toUpperCase(),
89
+ name: this.args.name,
90
+ content: this.args.content,
91
+ ttl: this.flags.ttl,
92
+ priority: this.flags.priority,
93
+ proxied: this.flags.proxied,
94
+ comment: this.flags.comment,
95
+ tags: this.flags.tags || []
96
+ });
97
+ if (!response.record) {
98
+ this.error("Failed to create DNS record: No record returned", { exit: 1 });
99
+ return;
100
+ }
101
+ switch (this.flags.output) {
102
+ case "json":
103
+ console.log(JSON.stringify({
104
+ record: {
105
+ recordId: response.record.recordId,
106
+ zoneId: response.record.zoneId,
107
+ name: response.record.name,
108
+ type: response.record.type,
109
+ content: response.record.content,
110
+ ttl: response.record.ttl,
111
+ priority: response.record.priority,
112
+ proxied: response.record.proxied,
113
+ cloudflareRecordId: response.record.cloudflareRecordId,
114
+ comment: response.record.comment,
115
+ tags: response.record.tags,
116
+ createdAt: response.record.createdAt,
117
+ updatedAt: response.record.updatedAt
118
+ }
119
+ }, null, 2));
120
+ break;
121
+ case "text":
122
+ default:
123
+ this.log("\n\u2705 DNS record created successfully!\n");
124
+ this.log(`Record ID: ${response.record.recordId}`);
125
+ this.log(`Name: ${response.record.name}`);
126
+ this.log(`Type: ${response.record.type}`);
127
+ this.log(`Content: ${response.record.content}`);
128
+ this.log(`TTL: ${response.record.ttl === 1 ? "Auto" : `${response.record.ttl} seconds`}`);
129
+ if (response.record.priority !== void 0) {
130
+ this.log(`Priority: ${response.record.priority}`);
131
+ }
132
+ if (response.record.proxied !== void 0) {
133
+ this.log(`Proxied: ${response.record.proxied ? "Yes" : "No"}`);
134
+ }
135
+ if (response.record.comment) {
136
+ this.log(`Comment: ${response.record.comment}`);
137
+ }
138
+ if (response.record.tags && response.record.tags.length > 0) {
139
+ this.log(`Tags: ${response.record.tags.join(", ")}`);
140
+ }
141
+ break;
142
+ }
143
+ } catch (error) {
144
+ this.error(`Failed to create DNS record: ${error}`, { exit: 1 });
145
+ }
146
+ }
147
+ };
148
+ export {
149
+ Create as default
150
+ };
@@ -0,0 +1,76 @@
1
+ import {
2
+ esm_default
3
+ } from "../../../chunk-5GH4FS6C.js";
4
+ import {
5
+ BaseCommand
6
+ } from "../../../chunk-MCRKUPJY.js";
7
+ import {
8
+ __toESM,
9
+ init_cjs_shims,
10
+ require_lib
11
+ } from "../../../chunk-G6NE675D.js";
12
+
13
+ // src/commands/dns/records/delete.ts
14
+ init_cjs_shims();
15
+ var import_core = __toESM(require_lib(), 1);
16
+ var Delete = class extends BaseCommand {
17
+ static args = {
18
+ zoneId: import_core.Args.string({
19
+ description: "Zone ID containing the record",
20
+ required: true
21
+ }),
22
+ recordId: import_core.Args.string({
23
+ description: "Record ID to delete",
24
+ required: true
25
+ })
26
+ };
27
+ static description = "Delete a DNS record";
28
+ static examples = [
29
+ `<%= config.bin %> <%= command.id %> zone-123 record-456
30
+ Deletes the DNS record with ID record-456 from zone-123
31
+ `,
32
+ `<%= config.bin %> <%= command.id %> zone-123 record-789 --force
33
+ Deletes the DNS record without confirmation prompt
34
+ `
35
+ ];
36
+ static flags = {
37
+ ...BaseCommand.HIDDEN_FLAGS,
38
+ force: import_core.Flags.boolean({
39
+ char: "f",
40
+ description: "Skip confirmation prompt",
41
+ default: false
42
+ })
43
+ };
44
+ async run() {
45
+ const { client: dnsService, userId, organizationId } = await this.dnsService();
46
+ try {
47
+ if (!this.flags.force) {
48
+ const shouldDelete = await esm_default({
49
+ message: `Are you sure you want to delete record ${this.args.recordId}? This action cannot be undone.`,
50
+ default: false
51
+ });
52
+ if (!shouldDelete) {
53
+ this.log("Deletion cancelled");
54
+ return;
55
+ }
56
+ }
57
+ this.log(`Deleting DNS record ${this.args.recordId}...`);
58
+ const response = await dnsService.deleteDNSRecord({
59
+ organizationId,
60
+ userId,
61
+ zoneId: this.args.zoneId,
62
+ recordId: this.args.recordId
63
+ });
64
+ if (response.success) {
65
+ this.log(`\u2705 DNS record ${this.args.recordId} deleted successfully`);
66
+ } else {
67
+ this.error("Failed to delete DNS record", { exit: 1 });
68
+ }
69
+ } catch (error) {
70
+ this.error(`Failed to delete DNS record: ${error}`, { exit: 1 });
71
+ }
72
+ }
73
+ };
74
+ export {
75
+ Delete as default
76
+ };