@liquidmetal-ai/raindrop 0.7.0 → 0.8.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/README.md +408 -73
- package/bin/cjs-shims.js +7 -0
- package/bin/run.js +20 -2
- package/bundle/chunk-5GH4FS6C.js +12148 -0
- package/bundle/chunk-6B4I2CKP.js +231 -0
- package/bundle/chunk-6UE75KX2.js +4481 -0
- package/bundle/chunk-AU3EGGJP.js +44 -0
- package/bundle/chunk-CDQRD3JA.js +75 -0
- package/bundle/chunk-CMCEP64V.js +380 -0
- package/bundle/chunk-CW5ZHVPX.js +292 -0
- package/bundle/chunk-G6NE675D.js +238720 -0
- package/bundle/chunk-GLIYVKQA.js +48 -0
- package/bundle/chunk-KXEV6E63.js +133 -0
- package/bundle/chunk-MCRKUPJY.js +4515 -0
- package/bundle/chunk-MGM2L2T3.js +805 -0
- package/bundle/chunk-MVQYQJHI.js +502 -0
- package/bundle/chunk-NG7CZTTE.js +147 -0
- package/bundle/chunk-PU4RCSXF.js +22452 -0
- package/bundle/chunk-VXAZKB3J.js +292 -0
- package/bundle/chunk-W2L3MYN6.js +4480 -0
- package/bundle/chunk-XYJACVNA.js +231 -0
- package/bundle/commands/annotation/get.js +153 -0
- package/bundle/commands/annotation/list.js +226 -0
- package/bundle/commands/annotation/put.js +177 -0
- package/bundle/commands/auth/list.js +75 -0
- package/bundle/commands/auth/login.js +1654 -0
- package/bundle/commands/auth/logout.js +27 -0
- package/bundle/commands/auth/select.js +53 -0
- package/bundle/commands/bucket/create-credential.js +173 -0
- package/bundle/commands/bucket/delete-credential.js +140 -0
- package/bundle/commands/bucket/get-credential.js +151 -0
- package/bundle/commands/bucket/list-credentials.js +148 -0
- package/bundle/commands/build/branch.js +126 -0
- package/bundle/commands/build/checkout.js +198 -0
- package/bundle/commands/build/clone.js +153 -0
- package/bundle/commands/build/delete.js +227 -0
- package/bundle/commands/build/deploy.js +160 -0
- package/bundle/commands/build/env/get.js +105 -0
- package/bundle/commands/build/env/set.js +115 -0
- package/bundle/commands/build/find.js +333 -0
- package/bundle/commands/build/generate.js +75 -0
- package/bundle/commands/build/init.js +76 -0
- package/bundle/commands/build/list.js +11 -0
- package/bundle/commands/build/sandbox.js +65 -0
- package/bundle/commands/build/start.js +84 -0
- package/bundle/commands/build/status.js +1839 -0
- package/bundle/commands/build/stop.js +84 -0
- package/bundle/commands/build/tools/check.js +32 -0
- package/bundle/commands/build/tools/fmt.js +49 -0
- package/bundle/commands/build/unsandbox.js +65 -0
- package/bundle/commands/build/upload.js +83 -0
- package/bundle/commands/build/validate.js +71 -0
- package/bundle/commands/build/workos/delete.js +86 -0
- package/bundle/commands/build/workos/env/attach.js +134 -0
- package/bundle/commands/build/workos/env/create.js +176 -0
- package/bundle/commands/build/workos/env/delete.js +84 -0
- package/bundle/commands/build/workos/env/detach.js +115 -0
- package/bundle/commands/build/workos/env/get.js +117 -0
- package/bundle/commands/build/workos/env/list.js +139 -0
- package/bundle/commands/build/workos/env/set.js +138 -0
- package/bundle/commands/build/workos/invite.js +91 -0
- package/bundle/commands/build/workos/setup.js +124 -0
- package/bundle/commands/build/workos/status.js +93 -0
- package/bundle/commands/dns/create.js +128 -0
- package/bundle/commands/dns/delete.js +80 -0
- package/bundle/commands/dns/get.js +167 -0
- package/bundle/commands/dns/list.js +193 -0
- package/bundle/commands/dns/records/create.js +150 -0
- package/bundle/commands/dns/records/delete.js +76 -0
- package/bundle/commands/dns/records/get.js +118 -0
- package/bundle/commands/dns/records/list.js +153 -0
- package/bundle/commands/dns/records/update.js +146 -0
- package/bundle/commands/logs/query.js +237 -0
- package/bundle/commands/logs/tail.js +155 -0
- package/bundle/commands/mcp/install-claude.js +220 -0
- package/bundle/commands/mcp/install-gemini.js +220 -0
- package/bundle/commands/mcp/install-goose.js +232 -0
- package/bundle/commands/mcp/status.js +153 -0
- package/bundle/commands/object/delete.js +180 -0
- package/bundle/commands/object/get.js +209 -0
- package/bundle/commands/object/list.js +206 -0
- package/bundle/commands/object/put.js +211 -0
- package/bundle/commands/query/chunk-search.js +123 -0
- package/bundle/commands/query/document.js +126 -0
- package/bundle/commands/query/events.js +98 -0
- package/bundle/commands/query/reindex.js +147 -0
- package/bundle/commands/query/search.js +169 -0
- package/bundle/commands/tail.js +31 -0
- package/bundle/index.js +51 -0
- package/dist/base-command.d.ts +6 -0
- package/dist/base-command.d.ts.map +1 -1
- package/dist/base-command.js +14 -1
- package/dist/build.d.ts +2 -1
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +169 -51
- package/dist/codegen.d.ts +1 -1
- package/dist/codegen.d.ts.map +1 -1
- package/dist/codegen.js +17 -3
- package/dist/codegen.test.js +44 -0
- package/dist/commands/build/checkout.d.ts.map +1 -1
- package/dist/commands/build/checkout.js +4 -0
- package/dist/commands/build/delete.d.ts.map +1 -1
- package/dist/commands/build/delete.js +6 -3
- package/dist/commands/build/deploy.d.ts.map +1 -1
- package/dist/commands/build/deploy.js +10 -2
- package/dist/commands/build/find.d.ts +1 -0
- package/dist/commands/build/find.d.ts.map +1 -1
- package/dist/commands/build/find.js +33 -2
- package/dist/commands/build/validate.d.ts.map +1 -1
- package/dist/commands/build/validate.js +0 -1
- package/dist/commands/build/workos/delete.d.ts +18 -0
- package/dist/commands/build/workos/delete.d.ts.map +1 -0
- package/dist/commands/build/workos/delete.js +72 -0
- package/dist/commands/build/workos/env/attach.d.ts +24 -0
- package/dist/commands/build/workos/env/attach.d.ts.map +1 -0
- package/dist/commands/build/workos/env/attach.js +111 -0
- package/dist/commands/build/workos/env/create.d.ts +26 -0
- package/dist/commands/build/workos/env/create.d.ts.map +1 -0
- package/dist/commands/build/workos/env/create.js +156 -0
- package/dist/commands/build/workos/env/delete.d.ts +20 -0
- package/dist/commands/build/workos/env/delete.d.ts.map +1 -0
- package/dist/commands/build/workos/env/delete.js +61 -0
- package/dist/commands/build/workos/env/detach.d.ts +21 -0
- package/dist/commands/build/workos/env/detach.d.ts.map +1 -0
- package/dist/commands/build/workos/env/detach.js +94 -0
- package/dist/commands/build/workos/env/get.d.ts +20 -0
- package/dist/commands/build/workos/env/get.d.ts.map +1 -0
- package/dist/commands/build/workos/env/get.js +94 -0
- package/dist/commands/build/workos/env/list.d.ts +18 -0
- package/dist/commands/build/workos/env/list.d.ts.map +1 -0
- package/dist/commands/build/workos/env/list.js +114 -0
- package/dist/commands/build/workos/env/set.d.ts +27 -0
- package/dist/commands/build/workos/env/set.d.ts.map +1 -0
- package/dist/commands/build/workos/env/set.js +115 -0
- package/dist/commands/build/workos/invite.d.ts +21 -0
- package/dist/commands/build/workos/invite.d.ts.map +1 -0
- package/dist/commands/build/workos/invite.js +68 -0
- package/dist/commands/build/workos/setup.d.ts +20 -0
- package/dist/commands/build/workos/setup.d.ts.map +1 -0
- package/dist/commands/build/workos/setup.js +106 -0
- package/dist/commands/build/workos/status.d.ts +18 -0
- package/dist/commands/build/workos/status.d.ts.map +1 -0
- package/dist/commands/build/workos/status.js +70 -0
- package/dist/commands/mcp/install-claude.d.ts.map +1 -1
- package/dist/commands/mcp/install-claude.js +0 -2
- package/dist/commands/mcp/install-gemini.d.ts.map +1 -1
- package/dist/commands/mcp/install-gemini.js +0 -2
- package/dist/commands/mcp/install-goose.d.ts.map +1 -1
- package/dist/commands/mcp/install-goose.js +0 -2
- package/dist/deploy.d.ts.map +1 -1
- package/dist/deploy.js +2 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/oclif.manifest.json +4286 -2208
- package/package.json +8 -5
- package/templates/claude-code/debug-raindrop-app.md +89 -0
- package/templates/claude-code/new-raindrop-app.md +10 -6
- package/templates/claude-code/reattach-raindrop-session.md +50 -12
- package/templates/claude-code/update-raindrop-app.md +61 -9
- package/templates/db/node_modules/.bin/prisma +2 -2
- package/templates/db/node_modules/.bin/prisma-kysely +2 -2
- package/templates/db/node_modules/.bin/tsc +2 -2
- package/templates/db/node_modules/.bin/tsserver +2 -2
- package/templates/db/node_modules/.bin/zx +2 -2
- package/templates/gemini-code/debug-raindrop-app.toml +86 -0
- package/templates/gemini-code/new-raindrop-app.toml +9 -5
- package/templates/gemini-code/reattach-raindrop-session.toml +9 -11
- package/templates/gemini-code/update-raindrop-app.toml +55 -10
- package/templates/goose/debug-raindrop-app.yaml +91 -0
- package/templates/goose/new-raindrop-app.yaml +12 -7
- package/templates/goose/reattach-raindrop-session.yaml +11 -4
- package/templates/goose/update-raindrop-app.yaml +57 -5
- package/templates/init/src/_app/auth.ts +18 -0
- package/templates/init/src/_app/cors.ts +64 -0
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/templates/claude-code/raindrop-guidelines.md +0 -322
- package/templates/gemini-code/raindrop-guidelines.md +0 -322
|
@@ -0,0 +1,118 @@
|
|
|
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/get.ts
|
|
11
|
+
init_cjs_shims();
|
|
12
|
+
var import_core = __toESM(require_lib(), 1);
|
|
13
|
+
var Get = class extends BaseCommand {
|
|
14
|
+
static args = {
|
|
15
|
+
zoneId: import_core.Args.string({
|
|
16
|
+
description: "Zone ID containing the record",
|
|
17
|
+
required: true
|
|
18
|
+
}),
|
|
19
|
+
recordId: import_core.Args.string({
|
|
20
|
+
description: "Record ID to get details for",
|
|
21
|
+
required: true
|
|
22
|
+
})
|
|
23
|
+
};
|
|
24
|
+
static description = "Get details of a specific DNS record";
|
|
25
|
+
static examples = [
|
|
26
|
+
`<%= config.bin %> <%= command.id %> zone-123 record-456
|
|
27
|
+
Shows details for DNS record with ID record-456
|
|
28
|
+
`,
|
|
29
|
+
`<%= config.bin %> <%= command.id %> zone-123 record-789 --output json
|
|
30
|
+
Shows record details in JSON format
|
|
31
|
+
`
|
|
32
|
+
];
|
|
33
|
+
static flags = {
|
|
34
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
35
|
+
output: import_core.Flags.string({
|
|
36
|
+
char: "o",
|
|
37
|
+
description: "output format",
|
|
38
|
+
default: "text",
|
|
39
|
+
options: ["text", "json"]
|
|
40
|
+
})
|
|
41
|
+
};
|
|
42
|
+
async run() {
|
|
43
|
+
const { client: dnsService, userId, organizationId } = await this.dnsService();
|
|
44
|
+
try {
|
|
45
|
+
const response = await dnsService.getDNSRecord({
|
|
46
|
+
organizationId,
|
|
47
|
+
userId,
|
|
48
|
+
zoneId: this.args.zoneId,
|
|
49
|
+
recordId: this.args.recordId
|
|
50
|
+
});
|
|
51
|
+
if (!response.record) {
|
|
52
|
+
this.error(`DNS record ${this.args.recordId} not found`, { exit: 1 });
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
switch (this.flags.output) {
|
|
56
|
+
case "json":
|
|
57
|
+
console.log(JSON.stringify({
|
|
58
|
+
record: {
|
|
59
|
+
recordId: response.record.recordId,
|
|
60
|
+
zoneId: response.record.zoneId,
|
|
61
|
+
name: response.record.name,
|
|
62
|
+
type: response.record.type,
|
|
63
|
+
content: response.record.content,
|
|
64
|
+
ttl: response.record.ttl,
|
|
65
|
+
priority: response.record.priority,
|
|
66
|
+
proxied: response.record.proxied,
|
|
67
|
+
cloudflareRecordId: response.record.cloudflareRecordId,
|
|
68
|
+
comment: response.record.comment,
|
|
69
|
+
tags: response.record.tags,
|
|
70
|
+
createdAt: response.record.createdAt,
|
|
71
|
+
updatedAt: response.record.updatedAt
|
|
72
|
+
}
|
|
73
|
+
}, null, 2));
|
|
74
|
+
break;
|
|
75
|
+
case "text":
|
|
76
|
+
default:
|
|
77
|
+
this.log("DNS Record Details\n");
|
|
78
|
+
this.log(`Record ID: ${response.record.recordId}`);
|
|
79
|
+
this.log(`Zone ID: ${response.record.zoneId}`);
|
|
80
|
+
this.log(`Name: ${response.record.name}`);
|
|
81
|
+
this.log(`Type: ${response.record.type}`);
|
|
82
|
+
this.log(`Content: ${response.record.content}`);
|
|
83
|
+
this.log(`TTL: ${response.record.ttl === 1 ? "Auto" : `${response.record.ttl} seconds`}`);
|
|
84
|
+
if (response.record.priority !== void 0) {
|
|
85
|
+
this.log(`Priority: ${response.record.priority}`);
|
|
86
|
+
}
|
|
87
|
+
if (response.record.proxied !== void 0) {
|
|
88
|
+
this.log(`Proxied: ${response.record.proxied ? "Yes" : "No"}`);
|
|
89
|
+
}
|
|
90
|
+
if (response.record.comment) {
|
|
91
|
+
this.log(`
|
|
92
|
+
Comment: ${response.record.comment}`);
|
|
93
|
+
}
|
|
94
|
+
if (response.record.tags && response.record.tags.length > 0) {
|
|
95
|
+
this.log(`
|
|
96
|
+
Tags: ${response.record.tags.join(", ")}`);
|
|
97
|
+
}
|
|
98
|
+
if (response.record.cloudflareRecordId) {
|
|
99
|
+
this.log(`
|
|
100
|
+
CloudFlare Record ID: ${response.record.cloudflareRecordId}`);
|
|
101
|
+
}
|
|
102
|
+
if (response.record.createdAt) {
|
|
103
|
+
this.log(`
|
|
104
|
+
Created: ${response.record.createdAt}`);
|
|
105
|
+
}
|
|
106
|
+
if (response.record.updatedAt) {
|
|
107
|
+
this.log(`Updated: ${response.record.updatedAt}`);
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
} catch (error) {
|
|
112
|
+
this.error(`Failed to get DNS record: ${error}`, { exit: 1 });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
export {
|
|
117
|
+
Get as default
|
|
118
|
+
};
|
|
@@ -0,0 +1,153 @@
|
|
|
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/list.ts
|
|
11
|
+
init_cjs_shims();
|
|
12
|
+
var import_core = __toESM(require_lib(), 1);
|
|
13
|
+
var List = class extends BaseCommand {
|
|
14
|
+
static args = {
|
|
15
|
+
zoneId: import_core.Args.string({
|
|
16
|
+
description: "Zone ID to list records for",
|
|
17
|
+
required: true
|
|
18
|
+
})
|
|
19
|
+
};
|
|
20
|
+
static description = "List DNS records in a zone";
|
|
21
|
+
static examples = [
|
|
22
|
+
`<%= config.bin %> <%= command.id %> zone-123
|
|
23
|
+
Lists all DNS records in zone-123
|
|
24
|
+
`,
|
|
25
|
+
`<%= config.bin %> <%= command.id %> zone-123 --type A
|
|
26
|
+
Lists only A records in zone-123
|
|
27
|
+
`,
|
|
28
|
+
`<%= config.bin %> <%= command.id %> zone-123 --name www
|
|
29
|
+
Lists only records with name 'www'
|
|
30
|
+
`
|
|
31
|
+
];
|
|
32
|
+
static flags = {
|
|
33
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
34
|
+
output: import_core.Flags.string({
|
|
35
|
+
char: "o",
|
|
36
|
+
description: "output format",
|
|
37
|
+
default: "table",
|
|
38
|
+
options: ["text", "table", "json"]
|
|
39
|
+
}),
|
|
40
|
+
type: import_core.Flags.string({
|
|
41
|
+
char: "t",
|
|
42
|
+
description: "Filter by record type (A, AAAA, CNAME, MX, TXT, NS, etc.)"
|
|
43
|
+
}),
|
|
44
|
+
name: import_core.Flags.string({
|
|
45
|
+
char: "n",
|
|
46
|
+
description: "Filter by record name"
|
|
47
|
+
}),
|
|
48
|
+
pageSize: import_core.Flags.integer({
|
|
49
|
+
description: "number of records to return per page",
|
|
50
|
+
default: 20
|
|
51
|
+
}),
|
|
52
|
+
pageToken: import_core.Flags.string({
|
|
53
|
+
description: "page token for pagination"
|
|
54
|
+
})
|
|
55
|
+
};
|
|
56
|
+
async run() {
|
|
57
|
+
const { client: dnsService, userId, organizationId } = await this.dnsService();
|
|
58
|
+
try {
|
|
59
|
+
const response = await dnsService.listDNSRecords({
|
|
60
|
+
organizationId,
|
|
61
|
+
userId,
|
|
62
|
+
zoneId: this.args.zoneId,
|
|
63
|
+
type: this.flags.type,
|
|
64
|
+
name: this.flags.name,
|
|
65
|
+
pageSize: this.flags.pageSize,
|
|
66
|
+
pageToken: this.flags.pageToken
|
|
67
|
+
});
|
|
68
|
+
if (!response.records || response.records.length === 0) {
|
|
69
|
+
this.log("No DNS records found");
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
switch (this.flags.output) {
|
|
73
|
+
case "text":
|
|
74
|
+
for (const record of response.records) {
|
|
75
|
+
this.log(`${record.name} (${record.recordId})`);
|
|
76
|
+
this.log(` Type: ${record.type}`);
|
|
77
|
+
this.log(` Content: ${record.content}`);
|
|
78
|
+
this.log(` TTL: ${record.ttl || "Auto"}`);
|
|
79
|
+
if (record.priority !== void 0) {
|
|
80
|
+
this.log(` Priority: ${record.priority}`);
|
|
81
|
+
}
|
|
82
|
+
if (record.proxied !== void 0) {
|
|
83
|
+
this.log(` Proxied: ${record.proxied ? "Yes" : "No"}`);
|
|
84
|
+
}
|
|
85
|
+
if (record.comment) {
|
|
86
|
+
this.log(` Comment: ${record.comment}`);
|
|
87
|
+
}
|
|
88
|
+
this.log("");
|
|
89
|
+
}
|
|
90
|
+
if (response.nextPageToken) {
|
|
91
|
+
this.log(`Next page token: ${response.nextPageToken}`);
|
|
92
|
+
}
|
|
93
|
+
if (response.totalCount !== void 0) {
|
|
94
|
+
this.log(`Total records: ${response.totalCount}`);
|
|
95
|
+
}
|
|
96
|
+
break;
|
|
97
|
+
case "json":
|
|
98
|
+
console.log(
|
|
99
|
+
JSON.stringify(
|
|
100
|
+
{
|
|
101
|
+
records: response.records.map((record) => ({
|
|
102
|
+
recordId: record.recordId,
|
|
103
|
+
zoneId: record.zoneId,
|
|
104
|
+
name: record.name,
|
|
105
|
+
type: record.type,
|
|
106
|
+
content: record.content,
|
|
107
|
+
ttl: record.ttl,
|
|
108
|
+
priority: record.priority,
|
|
109
|
+
proxied: record.proxied,
|
|
110
|
+
cloudflareRecordId: record.cloudflareRecordId,
|
|
111
|
+
comment: record.comment,
|
|
112
|
+
tags: record.tags,
|
|
113
|
+
createdAt: record.createdAt,
|
|
114
|
+
updatedAt: record.updatedAt
|
|
115
|
+
})),
|
|
116
|
+
nextPageToken: response.nextPageToken,
|
|
117
|
+
totalCount: response.totalCount
|
|
118
|
+
},
|
|
119
|
+
null,
|
|
120
|
+
2
|
|
121
|
+
)
|
|
122
|
+
);
|
|
123
|
+
break;
|
|
124
|
+
case "table":
|
|
125
|
+
console.table(
|
|
126
|
+
response.records.map((record) => ({
|
|
127
|
+
"Record ID": record.recordId,
|
|
128
|
+
Name: record.name,
|
|
129
|
+
Type: record.type,
|
|
130
|
+
Content: record.content,
|
|
131
|
+
TTL: record.ttl || "Auto",
|
|
132
|
+
Priority: record.priority || "-",
|
|
133
|
+
Proxied: record.proxied ? "Yes" : "No",
|
|
134
|
+
Comment: record.comment || ""
|
|
135
|
+
}))
|
|
136
|
+
);
|
|
137
|
+
if (response.nextPageToken) {
|
|
138
|
+
this.log(`
|
|
139
|
+
Next page token: ${response.nextPageToken}`);
|
|
140
|
+
}
|
|
141
|
+
if (response.totalCount !== void 0) {
|
|
142
|
+
this.log(`Total records: ${response.totalCount}`);
|
|
143
|
+
}
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
} catch (error) {
|
|
147
|
+
this.error(`Failed to list DNS records: ${error}`, { exit: 1 });
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
export {
|
|
152
|
+
List as default
|
|
153
|
+
};
|
|
@@ -0,0 +1,146 @@
|
|
|
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/update.ts
|
|
11
|
+
init_cjs_shims();
|
|
12
|
+
var import_core = __toESM(require_lib(), 1);
|
|
13
|
+
var Update = class extends BaseCommand {
|
|
14
|
+
static args = {
|
|
15
|
+
zoneId: import_core.Args.string({
|
|
16
|
+
description: "Zone ID containing the record",
|
|
17
|
+
required: true
|
|
18
|
+
}),
|
|
19
|
+
recordId: import_core.Args.string({
|
|
20
|
+
description: "Record ID to update",
|
|
21
|
+
required: true
|
|
22
|
+
})
|
|
23
|
+
};
|
|
24
|
+
static description = "Update an existing DNS record";
|
|
25
|
+
static examples = [
|
|
26
|
+
`<%= config.bin %> <%= command.id %> zone-123 record-456 --content 192.0.2.2
|
|
27
|
+
Updates the content of a record
|
|
28
|
+
`,
|
|
29
|
+
`<%= config.bin %> <%= command.id %> zone-123 record-456 --ttl 3600 --proxied
|
|
30
|
+
Updates TTL and proxy settings
|
|
31
|
+
`
|
|
32
|
+
];
|
|
33
|
+
static flags = {
|
|
34
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
35
|
+
type: import_core.Flags.string({
|
|
36
|
+
char: "t",
|
|
37
|
+
description: "Record type (required if changing)"
|
|
38
|
+
}),
|
|
39
|
+
name: import_core.Flags.string({
|
|
40
|
+
char: "n",
|
|
41
|
+
description: "Record name"
|
|
42
|
+
}),
|
|
43
|
+
content: import_core.Flags.string({
|
|
44
|
+
char: "c",
|
|
45
|
+
description: "Record content"
|
|
46
|
+
}),
|
|
47
|
+
ttl: import_core.Flags.integer({
|
|
48
|
+
description: "Time to live in seconds (1 = automatic)"
|
|
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
|
+
allowNo: true
|
|
57
|
+
}),
|
|
58
|
+
comment: import_core.Flags.string({
|
|
59
|
+
description: "Comment for the record"
|
|
60
|
+
}),
|
|
61
|
+
tags: import_core.Flags.string({
|
|
62
|
+
description: "Comma-separated list of tags",
|
|
63
|
+
multiple: true
|
|
64
|
+
}),
|
|
65
|
+
output: import_core.Flags.string({
|
|
66
|
+
char: "o",
|
|
67
|
+
description: "output format",
|
|
68
|
+
default: "text",
|
|
69
|
+
options: ["text", "json"]
|
|
70
|
+
})
|
|
71
|
+
};
|
|
72
|
+
async run() {
|
|
73
|
+
const { client: dnsService, userId, organizationId } = await this.dnsService();
|
|
74
|
+
try {
|
|
75
|
+
if (!this.flags.type && !this.flags.name && !this.flags.content && this.flags.ttl === void 0 && this.flags.priority === void 0 && this.flags.proxied === void 0 && !this.flags.comment && !this.flags.tags) {
|
|
76
|
+
this.error("No fields to update. Specify at least one field to change.", { exit: 1 });
|
|
77
|
+
}
|
|
78
|
+
this.log(`Updating DNS record ${this.args.recordId}...`);
|
|
79
|
+
const response = await dnsService.updateDNSRecord({
|
|
80
|
+
organizationId,
|
|
81
|
+
userId,
|
|
82
|
+
zoneId: this.args.zoneId,
|
|
83
|
+
recordId: this.args.recordId,
|
|
84
|
+
type: this.flags.type,
|
|
85
|
+
name: this.flags.name,
|
|
86
|
+
content: this.flags.content,
|
|
87
|
+
ttl: this.flags.ttl,
|
|
88
|
+
priority: this.flags.priority,
|
|
89
|
+
proxied: this.flags.proxied,
|
|
90
|
+
comment: this.flags.comment,
|
|
91
|
+
tags: this.flags.tags || []
|
|
92
|
+
});
|
|
93
|
+
if (!response.record) {
|
|
94
|
+
this.error("Failed to update DNS record: No record returned", { exit: 1 });
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
switch (this.flags.output) {
|
|
98
|
+
case "json":
|
|
99
|
+
console.log(JSON.stringify({
|
|
100
|
+
record: {
|
|
101
|
+
recordId: response.record.recordId,
|
|
102
|
+
zoneId: response.record.zoneId,
|
|
103
|
+
name: response.record.name,
|
|
104
|
+
type: response.record.type,
|
|
105
|
+
content: response.record.content,
|
|
106
|
+
ttl: response.record.ttl,
|
|
107
|
+
priority: response.record.priority,
|
|
108
|
+
proxied: response.record.proxied,
|
|
109
|
+
cloudflareRecordId: response.record.cloudflareRecordId,
|
|
110
|
+
comment: response.record.comment,
|
|
111
|
+
tags: response.record.tags,
|
|
112
|
+
createdAt: response.record.createdAt,
|
|
113
|
+
updatedAt: response.record.updatedAt
|
|
114
|
+
}
|
|
115
|
+
}, null, 2));
|
|
116
|
+
break;
|
|
117
|
+
case "text":
|
|
118
|
+
default:
|
|
119
|
+
this.log("\n\u2705 DNS record updated successfully!\n");
|
|
120
|
+
this.log(`Record ID: ${response.record.recordId}`);
|
|
121
|
+
this.log(`Name: ${response.record.name}`);
|
|
122
|
+
this.log(`Type: ${response.record.type}`);
|
|
123
|
+
this.log(`Content: ${response.record.content}`);
|
|
124
|
+
this.log(`TTL: ${response.record.ttl === 1 ? "Auto" : `${response.record.ttl} seconds`}`);
|
|
125
|
+
if (response.record.priority !== void 0) {
|
|
126
|
+
this.log(`Priority: ${response.record.priority}`);
|
|
127
|
+
}
|
|
128
|
+
if (response.record.proxied !== void 0) {
|
|
129
|
+
this.log(`Proxied: ${response.record.proxied ? "Yes" : "No"}`);
|
|
130
|
+
}
|
|
131
|
+
if (response.record.comment) {
|
|
132
|
+
this.log(`Comment: ${response.record.comment}`);
|
|
133
|
+
}
|
|
134
|
+
if (response.record.tags && response.record.tags.length > 0) {
|
|
135
|
+
this.log(`Tags: ${response.record.tags.join(", ")}`);
|
|
136
|
+
}
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
} catch (error) {
|
|
140
|
+
this.error(`Failed to update DNS record: ${error}`, { exit: 1 });
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
export {
|
|
145
|
+
Update as default
|
|
146
|
+
};
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import {
|
|
2
|
+
displayTraceGroupedEvents
|
|
3
|
+
} from "../../chunk-KXEV6E63.js";
|
|
4
|
+
import {
|
|
5
|
+
BaseCommand
|
|
6
|
+
} from "../../chunk-MCRKUPJY.js";
|
|
7
|
+
import {
|
|
8
|
+
QueryLogsRequestSchema,
|
|
9
|
+
TimeQuerySchema,
|
|
10
|
+
__toESM,
|
|
11
|
+
create,
|
|
12
|
+
init_cjs_shims,
|
|
13
|
+
require_lib,
|
|
14
|
+
timestampFromDate,
|
|
15
|
+
valueOf
|
|
16
|
+
} from "../../chunk-G6NE675D.js";
|
|
17
|
+
|
|
18
|
+
// src/commands/logs/query.ts
|
|
19
|
+
init_cjs_shims();
|
|
20
|
+
var import_core = __toESM(require_lib(), 1);
|
|
21
|
+
var Query = class extends BaseCommand {
|
|
22
|
+
static args = {};
|
|
23
|
+
static description = "query logs of applications with time range filtering";
|
|
24
|
+
static examples = [
|
|
25
|
+
`<%= config.bin %> <%= command.id %>`,
|
|
26
|
+
`<%= config.bin %> <%= command.id %> --application my-app`,
|
|
27
|
+
`<%= config.bin %> <%= command.id %> --application my-app --version v1.2.3`,
|
|
28
|
+
`<%= config.bin %> <%= command.id %> --application my-app --start-time 1638360000000 --end-time 1638363600000`
|
|
29
|
+
];
|
|
30
|
+
static flags = {
|
|
31
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
32
|
+
output: import_core.Flags.string({
|
|
33
|
+
char: "o",
|
|
34
|
+
description: "output format",
|
|
35
|
+
default: "text",
|
|
36
|
+
options: ["text", "json"]
|
|
37
|
+
}),
|
|
38
|
+
impersonate: import_core.Flags.string({
|
|
39
|
+
char: "i",
|
|
40
|
+
description: "impersonate organization",
|
|
41
|
+
required: false,
|
|
42
|
+
hidden: true
|
|
43
|
+
}),
|
|
44
|
+
manifest: import_core.Flags.string({
|
|
45
|
+
char: "m",
|
|
46
|
+
description: "project manifest",
|
|
47
|
+
required: false,
|
|
48
|
+
default: "raindrop.manifest",
|
|
49
|
+
hidden: true
|
|
50
|
+
}),
|
|
51
|
+
application: import_core.Flags.string({
|
|
52
|
+
char: "a",
|
|
53
|
+
description: "application",
|
|
54
|
+
required: false
|
|
55
|
+
}),
|
|
56
|
+
version: import_core.Flags.string({
|
|
57
|
+
char: "v",
|
|
58
|
+
description: "application version",
|
|
59
|
+
required: false
|
|
60
|
+
}),
|
|
61
|
+
startTime: import_core.Flags.string({
|
|
62
|
+
char: "s",
|
|
63
|
+
description: "start time for query (Unix timestamp in milliseconds or ISO string)",
|
|
64
|
+
required: false
|
|
65
|
+
}),
|
|
66
|
+
endTime: import_core.Flags.string({
|
|
67
|
+
char: "e",
|
|
68
|
+
description: "end time for query (Unix timestamp in milliseconds or ISO string)",
|
|
69
|
+
required: false
|
|
70
|
+
}),
|
|
71
|
+
last: import_core.Flags.string({
|
|
72
|
+
char: "l",
|
|
73
|
+
description: 'query logs from last duration (e.g., "1h", "30m", "2d")',
|
|
74
|
+
required: false
|
|
75
|
+
}),
|
|
76
|
+
limit: import_core.Flags.integer({
|
|
77
|
+
char: "n",
|
|
78
|
+
description: "maximum number of log events to return",
|
|
79
|
+
required: false,
|
|
80
|
+
default: 100
|
|
81
|
+
}),
|
|
82
|
+
traceId: import_core.Flags.string({
|
|
83
|
+
description: "filter logs by trace ID",
|
|
84
|
+
required: false
|
|
85
|
+
}),
|
|
86
|
+
status: import_core.Flags.string({
|
|
87
|
+
description: "filter logs by status (ok, error)",
|
|
88
|
+
required: false,
|
|
89
|
+
options: ["ok", "error"]
|
|
90
|
+
}),
|
|
91
|
+
rainbowAuthService: import_core.Flags.string({
|
|
92
|
+
default: "https://liquidmetal.run/api/connect",
|
|
93
|
+
hidden: true,
|
|
94
|
+
env: "LIQUIDMETAL_RAINBOW_AUTH_SERVICE"
|
|
95
|
+
}),
|
|
96
|
+
raindropCatalogService: import_core.Flags.string({
|
|
97
|
+
env: "RAINDROP_CATALOG_SERVICE",
|
|
98
|
+
description: "URL of the catalog service",
|
|
99
|
+
hidden: true
|
|
100
|
+
})
|
|
101
|
+
};
|
|
102
|
+
parseTimeToMillis(timeStr) {
|
|
103
|
+
const timestamp = Number(timeStr);
|
|
104
|
+
if (!isNaN(timestamp)) {
|
|
105
|
+
if (timestamp > 1e12) {
|
|
106
|
+
return timestamp;
|
|
107
|
+
}
|
|
108
|
+
return timestamp * 1e3;
|
|
109
|
+
}
|
|
110
|
+
const date = new Date(timeStr);
|
|
111
|
+
if (!isNaN(date.getTime())) {
|
|
112
|
+
return date.getTime();
|
|
113
|
+
}
|
|
114
|
+
throw new Error(`Invalid time format: ${timeStr}. Use Unix timestamp (ms) or ISO string.`);
|
|
115
|
+
}
|
|
116
|
+
parseDurationToMillis(duration) {
|
|
117
|
+
const match = duration.match(/^(\d+)([smhd])$/);
|
|
118
|
+
if (!match) {
|
|
119
|
+
throw new Error(`Invalid duration format: ${duration}. Use format like "1h", "30m", "2d".`);
|
|
120
|
+
}
|
|
121
|
+
const value = parseInt(match[1], 10);
|
|
122
|
+
const unit = match[2];
|
|
123
|
+
switch (unit) {
|
|
124
|
+
case "s":
|
|
125
|
+
return value * 1e3;
|
|
126
|
+
case "m":
|
|
127
|
+
return value * 60 * 1e3;
|
|
128
|
+
case "h":
|
|
129
|
+
return value * 60 * 60 * 1e3;
|
|
130
|
+
case "d":
|
|
131
|
+
return value * 24 * 60 * 60 * 1e3;
|
|
132
|
+
default:
|
|
133
|
+
throw new Error(`Unsupported duration unit: ${unit}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
async run() {
|
|
137
|
+
const apps = await this.loadManifest();
|
|
138
|
+
const config = await this.loadConfig();
|
|
139
|
+
if (!this.flags.version) {
|
|
140
|
+
if (!config.versionId) {
|
|
141
|
+
this.error("No version provided or found in config", { exit: 1 });
|
|
142
|
+
}
|
|
143
|
+
this.flags.version = config.versionId;
|
|
144
|
+
}
|
|
145
|
+
if (!this.flags.application) {
|
|
146
|
+
const app = apps[0];
|
|
147
|
+
if (app === void 0) {
|
|
148
|
+
this.error("No application provided or found in manifest", { exit: 1 });
|
|
149
|
+
}
|
|
150
|
+
this.flags.application = valueOf(app.name);
|
|
151
|
+
}
|
|
152
|
+
const {
|
|
153
|
+
userId,
|
|
154
|
+
client: riverjackService,
|
|
155
|
+
organizationId: defaultOrganizationId
|
|
156
|
+
} = await this.tenantRiverjackService();
|
|
157
|
+
const organizationId = this.flags.impersonate ?? defaultOrganizationId;
|
|
158
|
+
let startTimeMs;
|
|
159
|
+
let endTimeMs;
|
|
160
|
+
const now = Date.now();
|
|
161
|
+
if (this.flags.last) {
|
|
162
|
+
try {
|
|
163
|
+
const durationMs = this.parseDurationToMillis(this.flags.last);
|
|
164
|
+
startTimeMs = now - durationMs;
|
|
165
|
+
endTimeMs = now;
|
|
166
|
+
} catch (error) {
|
|
167
|
+
this.error(`Invalid duration: ${error instanceof Error ? error.message : String(error)}`, { exit: 1 });
|
|
168
|
+
}
|
|
169
|
+
} else if (this.flags.startTime || this.flags.endTime) {
|
|
170
|
+
try {
|
|
171
|
+
startTimeMs = this.flags.startTime ? this.parseTimeToMillis(this.flags.startTime) : now - 60 * 60 * 1e3;
|
|
172
|
+
endTimeMs = this.flags.endTime ? this.parseTimeToMillis(this.flags.endTime) : now;
|
|
173
|
+
} catch (error) {
|
|
174
|
+
this.error(`Invalid time format: ${error instanceof Error ? error.message : String(error)}`, { exit: 1 });
|
|
175
|
+
}
|
|
176
|
+
} else {
|
|
177
|
+
startTimeMs = now - 60 * 60 * 1e3;
|
|
178
|
+
endTimeMs = now;
|
|
179
|
+
}
|
|
180
|
+
this.log(`Using organization: ${organizationId}`);
|
|
181
|
+
this.log(`Using user: ${userId}`);
|
|
182
|
+
this.log(`Querying logs for ${this.flags.application}@${this.flags.version}`);
|
|
183
|
+
this.log(`Time range: ${new Date(startTimeMs).toLocaleString()} - ${new Date(endTimeMs).toLocaleString()}`);
|
|
184
|
+
this.log("");
|
|
185
|
+
try {
|
|
186
|
+
const timeQuery = create(TimeQuerySchema, {
|
|
187
|
+
startTime: timestampFromDate(new Date(startTimeMs)),
|
|
188
|
+
endTime: timestampFromDate(new Date(endTimeMs))
|
|
189
|
+
});
|
|
190
|
+
const request = create(QueryLogsRequestSchema, {
|
|
191
|
+
organizationId,
|
|
192
|
+
userId,
|
|
193
|
+
applicationName: this.flags.application,
|
|
194
|
+
applicationVersionId: this.flags.version,
|
|
195
|
+
timeQuery,
|
|
196
|
+
limit: this.flags.limit,
|
|
197
|
+
...this.flags.traceId && { traceId: this.flags.traceId },
|
|
198
|
+
...this.flags.status && { status: this.flags.status }
|
|
199
|
+
});
|
|
200
|
+
const response = await riverjackService.queryLogs(request);
|
|
201
|
+
if (this.flags.output === "json") {
|
|
202
|
+
this.log(
|
|
203
|
+
JSON.stringify(
|
|
204
|
+
response,
|
|
205
|
+
(key, value) => {
|
|
206
|
+
if (typeof value === "bigint") {
|
|
207
|
+
return value.toString();
|
|
208
|
+
}
|
|
209
|
+
return value;
|
|
210
|
+
},
|
|
211
|
+
2
|
|
212
|
+
)
|
|
213
|
+
);
|
|
214
|
+
} else {
|
|
215
|
+
if (response.events.length === 0) {
|
|
216
|
+
this.log("No log events found for the specified criteria.");
|
|
217
|
+
} else {
|
|
218
|
+
this.log(`Found ${response.events.length} log events (total: ${response.totalCount}):
|
|
219
|
+
`);
|
|
220
|
+
displayTraceGroupedEvents(response.events, { log: (message) => this.log(message) });
|
|
221
|
+
if (response.hasMore) {
|
|
222
|
+
this.log("\u2139\uFE0F More results available. Use --limit to increase the number of results.");
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
} catch (error) {
|
|
227
|
+
if (error instanceof Error) {
|
|
228
|
+
this.error(`Failed to query logs: ${error.message}`, { exit: 1 });
|
|
229
|
+
} else {
|
|
230
|
+
this.error("Failed to query logs: Unknown error", { exit: 1 });
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
export {
|
|
236
|
+
Query as default
|
|
237
|
+
};
|