@liquidmetal-ai/raindrop 0.5.2 → 0.6.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.
- package/README.md +427 -45
- package/dist/commands/dns/create.d.ts +25 -0
- package/dist/commands/dns/create.d.ts.map +1 -0
- package/dist/commands/dns/create.js +120 -0
- package/dist/commands/dns/delete.d.ts +20 -0
- package/dist/commands/dns/delete.d.ts.map +1 -0
- package/dist/commands/dns/delete.js +59 -0
- package/dist/commands/dns/get.d.ts +20 -0
- package/dist/commands/dns/get.d.ts.map +1 -0
- package/dist/commands/dns/get.js +101 -0
- package/dist/commands/dns/list.d.ts +21 -0
- package/dist/commands/dns/list.d.ts.map +1 -0
- package/dist/commands/dns/list.js +112 -0
- package/dist/commands/dns/records/create.d.ts +28 -0
- package/dist/commands/dns/records/create.d.ts.map +1 -0
- package/dist/commands/dns/records/create.js +140 -0
- package/dist/commands/dns/records/delete.d.ts +21 -0
- package/dist/commands/dns/records/delete.d.ts.map +1 -0
- package/dist/commands/dns/records/delete.js +64 -0
- package/dist/commands/dns/records/get.d.ts +21 -0
- package/dist/commands/dns/records/get.d.ts.map +1 -0
- package/dist/commands/dns/records/get.js +102 -0
- package/dist/commands/dns/records/list.d.ts +24 -0
- package/dist/commands/dns/records/list.d.ts.map +1 -0
- package/dist/commands/dns/records/list.js +132 -0
- package/dist/commands/dns/records/update.d.ts +29 -0
- package/dist/commands/dns/records/update.d.ts.map +1 -0
- package/dist/commands/dns/records/update.js +137 -0
- package/dist/commands/mcp/install-claude.d.ts +22 -0
- package/dist/commands/mcp/install-claude.d.ts.map +1 -0
- package/dist/commands/mcp/install-claude.js +233 -0
- package/dist/commands/mcp/status.d.ts +21 -0
- package/dist/commands/mcp/status.d.ts.map +1 -0
- package/dist/commands/mcp/status.js +150 -0
- package/dist/commands/query/chunk-search.d.ts.map +1 -1
- package/dist/commands/query/chunk-search.js +5 -1
- package/dist/commands/query/document.d.ts.map +1 -1
- package/dist/commands/query/document.js +5 -1
- package/dist/commands/query/reindex.d.ts +21 -0
- package/dist/commands/query/reindex.d.ts.map +1 -0
- package/dist/commands/query/reindex.js +145 -0
- package/dist/commands/query/search.d.ts.map +1 -1
- package/dist/commands/query/search.js +5 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/oclif.manifest.json +3279 -1004
- package/package.json +6 -3
- package/templates/claude-code/new-raindrop-app.md +5 -0
- package/templates/claude-code/raindrop-guidelines.md +127 -0
- package/templates/claude-code/reattach-raindrop-session.md +12 -0
- package/templates/claude-code/update-raindrop-app.md +11 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
3
|
+
export default class Create extends BaseCommand {
|
|
4
|
+
static args = {
|
|
5
|
+
zoneId: Args.string({
|
|
6
|
+
description: 'Zone ID to create record in',
|
|
7
|
+
required: true,
|
|
8
|
+
}),
|
|
9
|
+
type: Args.string({
|
|
10
|
+
description: 'Record type (A, AAAA, CNAME, MX, TXT, NS, etc.)',
|
|
11
|
+
required: true,
|
|
12
|
+
}),
|
|
13
|
+
name: Args.string({
|
|
14
|
+
description: 'Record name (e.g., www, @, subdomain)',
|
|
15
|
+
required: true,
|
|
16
|
+
}),
|
|
17
|
+
content: Args.string({
|
|
18
|
+
description: 'Record content (IP address, domain, text value, etc.)',
|
|
19
|
+
required: true,
|
|
20
|
+
}),
|
|
21
|
+
};
|
|
22
|
+
static description = 'Create a new DNS record';
|
|
23
|
+
static examples = [
|
|
24
|
+
`<%= config.bin %> <%= command.id %> zone-123 A www 192.0.2.1
|
|
25
|
+
Creates an A record for www pointing to 192.0.2.1
|
|
26
|
+
`,
|
|
27
|
+
`<%= config.bin %> <%= command.id %> zone-123 MX @ mail.example.com --priority 10
|
|
28
|
+
Creates an MX record with priority 10
|
|
29
|
+
`,
|
|
30
|
+
`<%= config.bin %> <%= command.id %> zone-123 TXT @ "v=spf1 include:_spf.google.com ~all"
|
|
31
|
+
Creates a TXT record for SPF
|
|
32
|
+
`,
|
|
33
|
+
];
|
|
34
|
+
static flags = {
|
|
35
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
36
|
+
ttl: Flags.integer({
|
|
37
|
+
description: 'Time to live in seconds (1 = automatic)',
|
|
38
|
+
default: 1,
|
|
39
|
+
}),
|
|
40
|
+
priority: Flags.integer({
|
|
41
|
+
char: 'p',
|
|
42
|
+
description: 'Priority (for MX and SRV records)',
|
|
43
|
+
}),
|
|
44
|
+
proxied: Flags.boolean({
|
|
45
|
+
description: 'Whether the record should be proxied through CloudFlare',
|
|
46
|
+
default: false,
|
|
47
|
+
}),
|
|
48
|
+
comment: Flags.string({
|
|
49
|
+
char: 'c',
|
|
50
|
+
description: 'Comment for the record',
|
|
51
|
+
}),
|
|
52
|
+
tags: Flags.string({
|
|
53
|
+
description: 'Comma-separated list of tags',
|
|
54
|
+
multiple: true,
|
|
55
|
+
}),
|
|
56
|
+
output: Flags.string({
|
|
57
|
+
char: 'o',
|
|
58
|
+
description: 'output format',
|
|
59
|
+
default: 'text',
|
|
60
|
+
options: ['text', 'json'],
|
|
61
|
+
}),
|
|
62
|
+
};
|
|
63
|
+
async run() {
|
|
64
|
+
const { client: dnsService, userId, organizationId } = await this.dnsService();
|
|
65
|
+
try {
|
|
66
|
+
// Validate record type
|
|
67
|
+
const validTypes = ['A', 'AAAA', 'CNAME', 'MX', 'TXT', 'NS', 'SOA', 'SRV', 'CAA', 'PTR'];
|
|
68
|
+
if (!validTypes.includes(this.args.type.toUpperCase())) {
|
|
69
|
+
this.warn(`Record type ${this.args.type} may not be supported`);
|
|
70
|
+
}
|
|
71
|
+
// Validate priority for MX records
|
|
72
|
+
if (this.args.type.toUpperCase() === 'MX' && this.flags.priority === undefined) {
|
|
73
|
+
this.error('MX records require a priority value', { exit: 1 });
|
|
74
|
+
}
|
|
75
|
+
this.log(`Creating ${this.args.type} record...`);
|
|
76
|
+
const response = await dnsService.createDNSRecord({
|
|
77
|
+
organizationId,
|
|
78
|
+
userId,
|
|
79
|
+
zoneId: this.args.zoneId,
|
|
80
|
+
type: this.args.type.toUpperCase(),
|
|
81
|
+
name: this.args.name,
|
|
82
|
+
content: this.args.content,
|
|
83
|
+
ttl: this.flags.ttl,
|
|
84
|
+
priority: this.flags.priority,
|
|
85
|
+
proxied: this.flags.proxied,
|
|
86
|
+
comment: this.flags.comment,
|
|
87
|
+
tags: this.flags.tags || [],
|
|
88
|
+
});
|
|
89
|
+
if (!response.record) {
|
|
90
|
+
this.error('Failed to create DNS record: No record returned', { exit: 1 });
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
switch (this.flags.output) {
|
|
94
|
+
case 'json':
|
|
95
|
+
console.log(JSON.stringify({
|
|
96
|
+
record: {
|
|
97
|
+
recordId: response.record.recordId,
|
|
98
|
+
zoneId: response.record.zoneId,
|
|
99
|
+
name: response.record.name,
|
|
100
|
+
type: response.record.type,
|
|
101
|
+
content: response.record.content,
|
|
102
|
+
ttl: response.record.ttl,
|
|
103
|
+
priority: response.record.priority,
|
|
104
|
+
proxied: response.record.proxied,
|
|
105
|
+
cloudflareRecordId: response.record.cloudflareRecordId,
|
|
106
|
+
comment: response.record.comment,
|
|
107
|
+
tags: response.record.tags,
|
|
108
|
+
createdAt: response.record.createdAt,
|
|
109
|
+
updatedAt: response.record.updatedAt,
|
|
110
|
+
}
|
|
111
|
+
}, null, 2));
|
|
112
|
+
break;
|
|
113
|
+
case 'text':
|
|
114
|
+
default:
|
|
115
|
+
this.log('\n✅ DNS record created successfully!\n');
|
|
116
|
+
this.log(`Record ID: ${response.record.recordId}`);
|
|
117
|
+
this.log(`Name: ${response.record.name}`);
|
|
118
|
+
this.log(`Type: ${response.record.type}`);
|
|
119
|
+
this.log(`Content: ${response.record.content}`);
|
|
120
|
+
this.log(`TTL: ${response.record.ttl === 1 ? 'Auto' : `${response.record.ttl} seconds`}`);
|
|
121
|
+
if (response.record.priority !== undefined) {
|
|
122
|
+
this.log(`Priority: ${response.record.priority}`);
|
|
123
|
+
}
|
|
124
|
+
if (response.record.proxied !== undefined) {
|
|
125
|
+
this.log(`Proxied: ${response.record.proxied ? 'Yes' : 'No'}`);
|
|
126
|
+
}
|
|
127
|
+
if (response.record.comment) {
|
|
128
|
+
this.log(`Comment: ${response.record.comment}`);
|
|
129
|
+
}
|
|
130
|
+
if (response.record.tags && response.record.tags.length > 0) {
|
|
131
|
+
this.log(`Tags: ${response.record.tags.join(', ')}`);
|
|
132
|
+
}
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
this.error(`Failed to create DNS record: ${error}`, { exit: 1 });
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
2
|
+
export default class Delete extends BaseCommand<typeof Delete> {
|
|
3
|
+
static args: {
|
|
4
|
+
zoneId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
recordId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static flags: {
|
|
10
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
config: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
rainbowAuthService: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
raindropCatalogService: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
rainbowAuthToken: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
rainbowOrganizationId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
rainbowUserId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
sendVersionMetadata: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
};
|
|
19
|
+
run(): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/commands/dns/records/delete.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAW,CAAC,OAAO,MAAM,CAAC;IAC5D,MAAM,CAAC,IAAI;;;MAST;IAEF,MAAM,CAAC,WAAW,SAAyB;IAE3C,MAAM,CAAC,QAAQ,WAOb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;MAOV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAmC3B"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { confirm } from '@inquirer/prompts';
|
|
3
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
4
|
+
export default class Delete extends BaseCommand {
|
|
5
|
+
static args = {
|
|
6
|
+
zoneId: Args.string({
|
|
7
|
+
description: 'Zone ID containing the record',
|
|
8
|
+
required: true,
|
|
9
|
+
}),
|
|
10
|
+
recordId: Args.string({
|
|
11
|
+
description: 'Record ID to delete',
|
|
12
|
+
required: true,
|
|
13
|
+
}),
|
|
14
|
+
};
|
|
15
|
+
static description = 'Delete a DNS record';
|
|
16
|
+
static examples = [
|
|
17
|
+
`<%= config.bin %> <%= command.id %> zone-123 record-456
|
|
18
|
+
Deletes the DNS record with ID record-456 from zone-123
|
|
19
|
+
`,
|
|
20
|
+
`<%= config.bin %> <%= command.id %> zone-123 record-789 --force
|
|
21
|
+
Deletes the DNS record without confirmation prompt
|
|
22
|
+
`,
|
|
23
|
+
];
|
|
24
|
+
static flags = {
|
|
25
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
26
|
+
force: Flags.boolean({
|
|
27
|
+
char: 'f',
|
|
28
|
+
description: 'Skip confirmation prompt',
|
|
29
|
+
default: false,
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
32
|
+
async run() {
|
|
33
|
+
const { client: dnsService, userId, organizationId } = await this.dnsService();
|
|
34
|
+
try {
|
|
35
|
+
// Unless forced, ask for confirmation
|
|
36
|
+
if (!this.flags.force) {
|
|
37
|
+
const shouldDelete = await confirm({
|
|
38
|
+
message: `Are you sure you want to delete record ${this.args.recordId}? This action cannot be undone.`,
|
|
39
|
+
default: false,
|
|
40
|
+
});
|
|
41
|
+
if (!shouldDelete) {
|
|
42
|
+
this.log('Deletion cancelled');
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
this.log(`Deleting DNS record ${this.args.recordId}...`);
|
|
47
|
+
const response = await dnsService.deleteDNSRecord({
|
|
48
|
+
organizationId,
|
|
49
|
+
userId,
|
|
50
|
+
zoneId: this.args.zoneId,
|
|
51
|
+
recordId: this.args.recordId,
|
|
52
|
+
});
|
|
53
|
+
if (response.success) {
|
|
54
|
+
this.log(`✅ DNS record ${this.args.recordId} deleted successfully`);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
this.error('Failed to delete DNS record', { exit: 1 });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
this.error(`Failed to delete DNS record: ${error}`, { exit: 1 });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
2
|
+
export default class Get extends BaseCommand<typeof Get> {
|
|
3
|
+
static args: {
|
|
4
|
+
zoneId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
recordId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static flags: {
|
|
10
|
+
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
config: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
rainbowAuthService: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
raindropCatalogService: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
rainbowAuthToken: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
rainbowOrganizationId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
rainbowUserId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
sendVersionMetadata: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
};
|
|
19
|
+
run(): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/commands/dns/records/get.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,MAAM,CAAC,OAAO,OAAO,GAAI,SAAQ,WAAW,CAAC,OAAO,GAAG,CAAC;IACtD,MAAM,CAAC,IAAI;;;MAST;IAEF,MAAM,CAAC,WAAW,SAA0C;IAE5D,MAAM,CAAC,QAAQ,WAOb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;MAQV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAgF3B"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
3
|
+
export default class Get extends BaseCommand {
|
|
4
|
+
static args = {
|
|
5
|
+
zoneId: Args.string({
|
|
6
|
+
description: 'Zone ID containing the record',
|
|
7
|
+
required: true,
|
|
8
|
+
}),
|
|
9
|
+
recordId: Args.string({
|
|
10
|
+
description: 'Record ID to get details for',
|
|
11
|
+
required: true,
|
|
12
|
+
}),
|
|
13
|
+
};
|
|
14
|
+
static description = 'Get details of a specific DNS record';
|
|
15
|
+
static examples = [
|
|
16
|
+
`<%= config.bin %> <%= command.id %> zone-123 record-456
|
|
17
|
+
Shows details for DNS record with ID record-456
|
|
18
|
+
`,
|
|
19
|
+
`<%= config.bin %> <%= command.id %> zone-123 record-789 --output json
|
|
20
|
+
Shows record details in JSON format
|
|
21
|
+
`,
|
|
22
|
+
];
|
|
23
|
+
static flags = {
|
|
24
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
25
|
+
output: Flags.string({
|
|
26
|
+
char: 'o',
|
|
27
|
+
description: 'output format',
|
|
28
|
+
default: 'text',
|
|
29
|
+
options: ['text', 'json'],
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
32
|
+
async run() {
|
|
33
|
+
const { client: dnsService, userId, organizationId } = await this.dnsService();
|
|
34
|
+
try {
|
|
35
|
+
const response = await dnsService.getDNSRecord({
|
|
36
|
+
organizationId,
|
|
37
|
+
userId,
|
|
38
|
+
zoneId: this.args.zoneId,
|
|
39
|
+
recordId: this.args.recordId,
|
|
40
|
+
});
|
|
41
|
+
if (!response.record) {
|
|
42
|
+
this.error(`DNS record ${this.args.recordId} not found`, { exit: 1 });
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
switch (this.flags.output) {
|
|
46
|
+
case 'json':
|
|
47
|
+
console.log(JSON.stringify({
|
|
48
|
+
record: {
|
|
49
|
+
recordId: response.record.recordId,
|
|
50
|
+
zoneId: response.record.zoneId,
|
|
51
|
+
name: response.record.name,
|
|
52
|
+
type: response.record.type,
|
|
53
|
+
content: response.record.content,
|
|
54
|
+
ttl: response.record.ttl,
|
|
55
|
+
priority: response.record.priority,
|
|
56
|
+
proxied: response.record.proxied,
|
|
57
|
+
cloudflareRecordId: response.record.cloudflareRecordId,
|
|
58
|
+
comment: response.record.comment,
|
|
59
|
+
tags: response.record.tags,
|
|
60
|
+
createdAt: response.record.createdAt,
|
|
61
|
+
updatedAt: response.record.updatedAt,
|
|
62
|
+
}
|
|
63
|
+
}, null, 2));
|
|
64
|
+
break;
|
|
65
|
+
case 'text':
|
|
66
|
+
default:
|
|
67
|
+
this.log('DNS Record Details\n');
|
|
68
|
+
this.log(`Record ID: ${response.record.recordId}`);
|
|
69
|
+
this.log(`Zone ID: ${response.record.zoneId}`);
|
|
70
|
+
this.log(`Name: ${response.record.name}`);
|
|
71
|
+
this.log(`Type: ${response.record.type}`);
|
|
72
|
+
this.log(`Content: ${response.record.content}`);
|
|
73
|
+
this.log(`TTL: ${response.record.ttl === 1 ? 'Auto' : `${response.record.ttl} seconds`}`);
|
|
74
|
+
if (response.record.priority !== undefined) {
|
|
75
|
+
this.log(`Priority: ${response.record.priority}`);
|
|
76
|
+
}
|
|
77
|
+
if (response.record.proxied !== undefined) {
|
|
78
|
+
this.log(`Proxied: ${response.record.proxied ? 'Yes' : 'No'}`);
|
|
79
|
+
}
|
|
80
|
+
if (response.record.comment) {
|
|
81
|
+
this.log(`\nComment: ${response.record.comment}`);
|
|
82
|
+
}
|
|
83
|
+
if (response.record.tags && response.record.tags.length > 0) {
|
|
84
|
+
this.log(`\nTags: ${response.record.tags.join(', ')}`);
|
|
85
|
+
}
|
|
86
|
+
if (response.record.cloudflareRecordId) {
|
|
87
|
+
this.log(`\nCloudFlare Record ID: ${response.record.cloudflareRecordId}`);
|
|
88
|
+
}
|
|
89
|
+
if (response.record.createdAt) {
|
|
90
|
+
this.log(`\nCreated: ${response.record.createdAt}`);
|
|
91
|
+
}
|
|
92
|
+
if (response.record.updatedAt) {
|
|
93
|
+
this.log(`Updated: ${response.record.updatedAt}`);
|
|
94
|
+
}
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
this.error(`Failed to get DNS record: ${error}`, { exit: 1 });
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
2
|
+
export default class List extends BaseCommand<typeof List> {
|
|
3
|
+
static args: {
|
|
4
|
+
zoneId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
type: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
pageSize: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
pageToken: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
config: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
rainbowAuthService: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
raindropCatalogService: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
rainbowAuthToken: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
rainbowOrganizationId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
rainbowUserId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
sendVersionMetadata: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
};
|
|
22
|
+
run(): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/commands/dns/records/list.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW,CAAC,OAAO,IAAI,CAAC;IACxD,MAAM,CAAC,IAAI;;MAKT;IAEF,MAAM,CAAC,WAAW,SAAgC;IAElD,MAAM,CAAC,QAAQ,WAUb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;;;;MAuBV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAkG3B"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { Args, Flags } from '@oclif/core';
|
|
2
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
3
|
+
export default class List extends BaseCommand {
|
|
4
|
+
static args = {
|
|
5
|
+
zoneId: Args.string({
|
|
6
|
+
description: 'Zone ID to list records for',
|
|
7
|
+
required: true,
|
|
8
|
+
}),
|
|
9
|
+
};
|
|
10
|
+
static description = 'List DNS records in a zone';
|
|
11
|
+
static examples = [
|
|
12
|
+
`<%= config.bin %> <%= command.id %> zone-123
|
|
13
|
+
Lists all DNS records in zone-123
|
|
14
|
+
`,
|
|
15
|
+
`<%= config.bin %> <%= command.id %> zone-123 --type A
|
|
16
|
+
Lists only A records in zone-123
|
|
17
|
+
`,
|
|
18
|
+
`<%= config.bin %> <%= command.id %> zone-123 --name www
|
|
19
|
+
Lists only records with name 'www'
|
|
20
|
+
`,
|
|
21
|
+
];
|
|
22
|
+
static flags = {
|
|
23
|
+
...BaseCommand.HIDDEN_FLAGS,
|
|
24
|
+
output: Flags.string({
|
|
25
|
+
char: 'o',
|
|
26
|
+
description: 'output format',
|
|
27
|
+
default: 'table',
|
|
28
|
+
options: ['text', 'table', 'json'],
|
|
29
|
+
}),
|
|
30
|
+
type: Flags.string({
|
|
31
|
+
char: 't',
|
|
32
|
+
description: 'Filter by record type (A, AAAA, CNAME, MX, TXT, NS, etc.)',
|
|
33
|
+
}),
|
|
34
|
+
name: Flags.string({
|
|
35
|
+
char: 'n',
|
|
36
|
+
description: 'Filter by record name',
|
|
37
|
+
}),
|
|
38
|
+
pageSize: Flags.integer({
|
|
39
|
+
description: 'number of records to return per page',
|
|
40
|
+
default: 20,
|
|
41
|
+
}),
|
|
42
|
+
pageToken: Flags.string({
|
|
43
|
+
description: 'page token for pagination',
|
|
44
|
+
}),
|
|
45
|
+
};
|
|
46
|
+
async run() {
|
|
47
|
+
const { client: dnsService, userId, organizationId } = await this.dnsService();
|
|
48
|
+
try {
|
|
49
|
+
const response = await dnsService.listDNSRecords({
|
|
50
|
+
organizationId,
|
|
51
|
+
userId,
|
|
52
|
+
zoneId: this.args.zoneId,
|
|
53
|
+
type: this.flags.type,
|
|
54
|
+
name: this.flags.name,
|
|
55
|
+
pageSize: this.flags.pageSize,
|
|
56
|
+
pageToken: this.flags.pageToken,
|
|
57
|
+
});
|
|
58
|
+
if (!response.records || response.records.length === 0) {
|
|
59
|
+
this.log('No DNS records found');
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
switch (this.flags.output) {
|
|
63
|
+
case 'text':
|
|
64
|
+
for (const record of response.records) {
|
|
65
|
+
this.log(`${record.name} (${record.recordId})`);
|
|
66
|
+
this.log(` Type: ${record.type}`);
|
|
67
|
+
this.log(` Content: ${record.content}`);
|
|
68
|
+
this.log(` TTL: ${record.ttl || 'Auto'}`);
|
|
69
|
+
if (record.priority !== undefined) {
|
|
70
|
+
this.log(` Priority: ${record.priority}`);
|
|
71
|
+
}
|
|
72
|
+
if (record.proxied !== undefined) {
|
|
73
|
+
this.log(` Proxied: ${record.proxied ? 'Yes' : 'No'}`);
|
|
74
|
+
}
|
|
75
|
+
if (record.comment) {
|
|
76
|
+
this.log(` Comment: ${record.comment}`);
|
|
77
|
+
}
|
|
78
|
+
this.log('');
|
|
79
|
+
}
|
|
80
|
+
if (response.nextPageToken) {
|
|
81
|
+
this.log(`Next page token: ${response.nextPageToken}`);
|
|
82
|
+
}
|
|
83
|
+
if (response.totalCount !== undefined) {
|
|
84
|
+
this.log(`Total records: ${response.totalCount}`);
|
|
85
|
+
}
|
|
86
|
+
break;
|
|
87
|
+
case 'json':
|
|
88
|
+
console.log(JSON.stringify({
|
|
89
|
+
records: response.records.map((record) => ({
|
|
90
|
+
recordId: record.recordId,
|
|
91
|
+
zoneId: record.zoneId,
|
|
92
|
+
name: record.name,
|
|
93
|
+
type: record.type,
|
|
94
|
+
content: record.content,
|
|
95
|
+
ttl: record.ttl,
|
|
96
|
+
priority: record.priority,
|
|
97
|
+
proxied: record.proxied,
|
|
98
|
+
cloudflareRecordId: record.cloudflareRecordId,
|
|
99
|
+
comment: record.comment,
|
|
100
|
+
tags: record.tags,
|
|
101
|
+
createdAt: record.createdAt,
|
|
102
|
+
updatedAt: record.updatedAt,
|
|
103
|
+
})),
|
|
104
|
+
nextPageToken: response.nextPageToken,
|
|
105
|
+
totalCount: response.totalCount,
|
|
106
|
+
}, null, 2));
|
|
107
|
+
break;
|
|
108
|
+
case 'table':
|
|
109
|
+
console.table(response.records.map((record) => ({
|
|
110
|
+
'Record ID': record.recordId,
|
|
111
|
+
Name: record.name,
|
|
112
|
+
Type: record.type,
|
|
113
|
+
Content: record.content,
|
|
114
|
+
TTL: record.ttl || 'Auto',
|
|
115
|
+
Priority: record.priority || '-',
|
|
116
|
+
Proxied: record.proxied ? 'Yes' : 'No',
|
|
117
|
+
Comment: record.comment || '',
|
|
118
|
+
})));
|
|
119
|
+
if (response.nextPageToken) {
|
|
120
|
+
this.log(`\nNext page token: ${response.nextPageToken}`);
|
|
121
|
+
}
|
|
122
|
+
if (response.totalCount !== undefined) {
|
|
123
|
+
this.log(`Total records: ${response.totalCount}`);
|
|
124
|
+
}
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
this.error(`Failed to list DNS records: ${error}`, { exit: 1 });
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../base-command.js';
|
|
2
|
+
export default class Update extends BaseCommand<typeof Update> {
|
|
3
|
+
static args: {
|
|
4
|
+
zoneId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
recordId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static flags: {
|
|
10
|
+
type: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
content: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
ttl: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
priority: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
proxied: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
16
|
+
comment: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
tags: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
output: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
config: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
rainbowAuthService: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
raindropCatalogService: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
rainbowAuthToken: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
rainbowOrganizationId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
rainbowUserId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
25
|
+
sendVersionMetadata: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
26
|
+
};
|
|
27
|
+
run(): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../src/commands/dns/records/update.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAW,CAAC,OAAO,MAAM,CAAC;IAC5D,MAAM,CAAC,IAAI;;;MAST;IAEF,MAAM,CAAC,WAAW,SAAmC;IAErD,MAAM,CAAC,QAAQ,WAOb;IAEF,MAAM,CAAC,KAAK;;;;;;;;;;;;;;;;;MAsCV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAoF3B"}
|