@startanaicompany/saac_dns 1.1.0 → 1.2.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.
Files changed (2) hide show
  1. package/package.json +7 -12
  2. package/index.d.ts +0 -414
package/package.json CHANGED
@@ -1,18 +1,14 @@
1
1
  {
2
2
  "name": "@startanaicompany/saac_dns",
3
- "version": "1.1.0",
4
- "description": "Programmatic Domain Registration, DNS Management & CLI Toolkit by Start An AI Company (SAAC)",
5
- "main": "index.js",
6
- "types": "index.d.ts",
3
+ "version": "1.2.0",
4
+ "description": "CLI tool for programmatic domain registration and DNS management — by Start An AI Company (SAAC)",
7
5
  "bin": {
8
6
  "saac_dns": "./bin/saac_dns.js"
9
7
  },
10
8
  "scripts": {
11
- "test": "node test/basic.js",
12
- "prepublishOnly": "node --check index.js && node --check lib/client.js && node --check bin/saac_dns.js",
13
- "lint": "node --check index.js && node --check lib/client.js && node --check bin/saac_dns.js"
9
+ "prepublishOnly": "node --check bin/saac_dns.js && node --check lib/client.js"
14
10
  },
15
- "keywords": ["dns", "domain", "registration", "cli", "namesilo", "saac"],
11
+ "keywords": ["dns", "domain", "registration", "cli", "saac"],
16
12
  "author": "Start An AI Company (SAAC)",
17
13
  "license": "MIT",
18
14
  "dependencies": {
@@ -23,10 +19,9 @@
23
19
  "node": ">=18.0.0"
24
20
  },
25
21
  "files": [
26
- "index.js",
27
- "index.d.ts",
28
22
  "bin/",
29
23
  "lib/",
30
- "README.md"
31
- ]
24
+ "index.js"
25
+ ],
26
+ "preferGlobal": true
32
27
  }
package/index.d.ts DELETED
@@ -1,414 +0,0 @@
1
- /**
2
- * @startanaicompany/saac_dns
3
- * TypeScript type definitions for the SAAC DNS SDK
4
- * Programmatic Domain Registration, DNS Management & CLI Toolkit
5
- * Version 1.0.0 — February 2026
6
- */
7
-
8
- // ─── Core Types ───────────────────────────────────────────────────────────────
9
-
10
- export interface SearchResult {
11
- fqdn: string;
12
- available: boolean;
13
- price: number | null;
14
- currency: string;
15
- tld: string;
16
- }
17
-
18
- export interface Domain {
19
- id: string;
20
- fqdn: string;
21
- name: string;
22
- tld: string;
23
- status: string;
24
- registered_at: string | null;
25
- expires_at: string | null;
26
- auto_renew: boolean;
27
- locked: boolean;
28
- privacy: boolean;
29
- nameservers: string[];
30
- contact_id?: string;
31
- created_at?: string;
32
- }
33
-
34
- export interface DnsRecord {
35
- id: string;
36
- domain: string;
37
- type: string;
38
- name: string;
39
- value: string;
40
- ttl: number;
41
- priority?: number;
42
- created_at?: string;
43
- updated_at?: string;
44
- }
45
-
46
- export interface Contact {
47
- id: string;
48
- first_name: string;
49
- last_name: string;
50
- email: string;
51
- org?: string;
52
- address?: string;
53
- city?: string;
54
- state?: string;
55
- zip?: string;
56
- country?: string;
57
- phone?: string;
58
- }
59
-
60
- export interface User {
61
- id: string;
62
- email: string;
63
- name?: string;
64
- api_key?: string;
65
- created_at?: string;
66
- stats?: {
67
- domains: number;
68
- dns_records: number;
69
- };
70
- low_balance_warning?: {
71
- message: string;
72
- balance: number;
73
- threshold: number;
74
- } | null;
75
- }
76
-
77
- export interface UserPreferences {
78
- default_privacy?: boolean;
79
- default_auto_renew?: boolean;
80
- default_ttl?: number;
81
- default_nameservers?: string[];
82
- balance_warning_threshold?: number;
83
- }
84
-
85
- export interface BuyOptions {
86
- years?: number;
87
- privacy?: boolean;
88
- autoRenew?: boolean;
89
- }
90
-
91
- export interface AddRecordInput {
92
- type: string;
93
- host?: string;
94
- name?: string;
95
- value: string;
96
- ttl?: number;
97
- priority?: number;
98
- }
99
-
100
- export interface DeleteResult {
101
- message: string;
102
- id?: string;
103
- }
104
-
105
- export interface WhoisResult {
106
- registrar?: string;
107
- status?: string;
108
- created?: string;
109
- updated?: string;
110
- expires?: string;
111
- nameservers?: string[];
112
- [key: string]: any;
113
- }
114
-
115
- export interface TransferResult {
116
- message: string;
117
- domain?: string;
118
- status?: string;
119
- }
120
-
121
- export interface BalanceResult {
122
- balance: number;
123
- currency: string;
124
- _cached?: boolean;
125
- }
126
-
127
- export interface IpAllowlistResult {
128
- ip_allowlist: string[];
129
- }
130
-
131
- // ─── Domain Operations ────────────────────────────────────────────────────────
132
-
133
- /**
134
- * Search domain availability and pricing.
135
- * @param domains - Array of fully qualified domain names to search.
136
- */
137
- export function search(domains: string[]): Promise<SearchResult[]>;
138
-
139
- /**
140
- * Register a domain.
141
- * @param domain - FQDN to register (e.g. 'mycompany.io')
142
- * @param opts - Registration options.
143
- */
144
- export function buy(domain: string, opts?: BuyOptions): Promise<any>;
145
-
146
- /**
147
- * List all domains for the authenticated user.
148
- */
149
- export function list(): Promise<Domain[]>;
150
-
151
- /**
152
- * Get full details for a specific domain.
153
- * @param domain - FQDN to look up.
154
- */
155
- export function info(domain: string): Promise<Domain>;
156
-
157
- /**
158
- * Get domain registration prices.
159
- * @param tlds - Optional array of TLDs to filter (e.g. ['.com', '.io']).
160
- */
161
- export function prices(tlds?: string[]): Promise<Record<string, number>>;
162
-
163
- /**
164
- * Renew a domain registration.
165
- * @param domain - FQDN to renew.
166
- * @param years - Number of years to renew for (default: 1).
167
- */
168
- export function renew(domain: string, years?: number): Promise<any>;
169
-
170
- /**
171
- * Lock a domain to prevent unauthorized transfers.
172
- * @param domain - FQDN to lock.
173
- */
174
- export function lock(domain: string): Promise<any>;
175
-
176
- /**
177
- * Unlock a domain (required before initiating a transfer).
178
- * @param domain - FQDN to unlock.
179
- */
180
- export function unlock(domain: string): Promise<any>;
181
-
182
- /**
183
- * Toggle WHOIS privacy for a domain.
184
- * @param domain - FQDN to update.
185
- * @param enabled - true to enable privacy, false to disable.
186
- */
187
- export function privacy(domain: string, enabled: boolean): Promise<any>;
188
-
189
- /**
190
- * Toggle auto-renewal for a domain.
191
- * @param domain - FQDN to update.
192
- * @param enabled - true to enable auto-renewal, false to disable.
193
- */
194
- export function autoRenew(domain: string, enabled: boolean): Promise<any>;
195
-
196
- /**
197
- * Initiate an inbound domain transfer.
198
- * @param domain - FQDN to transfer in.
199
- * @param authCode - EPP/authorization code from the current registrar.
200
- * @param opts - Transfer options (years).
201
- */
202
- export function transfer(domain: string, authCode: string, opts?: { years?: number }): Promise<TransferResult>;
203
-
204
- /**
205
- * Check if a domain is eligible for transfer.
206
- * @param domain - FQDN to check.
207
- */
208
- export function transferCheck(domain: string): Promise<any>;
209
-
210
- /**
211
- * Get the current status of an in-progress domain transfer.
212
- * @param domain - FQDN to check.
213
- */
214
- export function transferStatus(domain: string): Promise<any>;
215
-
216
- /**
217
- * Retrieve the EPP auth code for an outbound transfer.
218
- * @param domain - FQDN to get auth code for.
219
- */
220
- export function authCode(domain: string): Promise<{ auth_code: string }>;
221
-
222
- /**
223
- * List domains expiring within N days.
224
- * @param days - Days ahead to check (default: 30).
225
- */
226
- export function expiring(days?: number): Promise<Domain[]>;
227
-
228
- /**
229
- * Perform a WHOIS lookup for a domain.
230
- * @param domain - FQDN to look up.
231
- */
232
- export function whois(domain: string): Promise<WhoisResult>;
233
-
234
- // ─── Convenience Methods ──────────────────────────────────────────────────────
235
-
236
- /**
237
- * Search and buy in a single call — registers the domain only if available.
238
- * @param domain - FQDN to search and register.
239
- * @param opts - Registration options.
240
- */
241
- export function quickBuy(domain: string, opts?: BuyOptions): Promise<any>;
242
-
243
- /** Supported hosting providers for setupWeb */
244
- export type HostingProvider = 'vercel' | 'netlify' | 'cloudflare' | 'railway' | 'render';
245
-
246
- /** Supported email providers for setupEmail */
247
- export type EmailProvider = 'gmail' | 'office365' | 'zoho' | 'titan';
248
-
249
- /**
250
- * Set up standard web DNS records (A @ + CNAME www) for a domain.
251
- * @param domain - FQDN to configure.
252
- * @param ipOrProvider - IP address OR hosting provider name (vercel, netlify, cloudflare, railway, render).
253
- */
254
- export function setupWeb(domain: string, ipOrProvider: string | HostingProvider): Promise<{ message: string; records: DnsRecord[]; note?: string }>;
255
-
256
- /**
257
- * Set up email DNS records (MX + SPF + DMARC) for a domain.
258
- * @param domain - FQDN to configure.
259
- * @param provider - Email provider: gmail, office365, zoho, titan (default: gmail).
260
- */
261
- export function setupEmail(domain: string, provider?: EmailProvider | string): Promise<{ message: string; records: DnsRecord[]; note: string }>;
262
-
263
- /**
264
- * Clone all DNS records from one domain to another.
265
- * @param source - Source domain FQDN.
266
- * @param target - Target domain FQDN.
267
- */
268
- export function cloneDns(source: string, target: string): Promise<{ cloned: number; failed: number; message: string; results: any[] }>;
269
-
270
- /**
271
- * Export all DNS records for a domain as an array.
272
- * @param domain - FQDN whose records to export.
273
- */
274
- export function exportRecords(domain: string): Promise<DnsRecord[]>;
275
-
276
- /**
277
- * Import DNS records for a domain from an array.
278
- * @param domain - FQDN to import records into.
279
- * @param records - Array of record objects to create.
280
- */
281
- export function importRecords(domain: string, records: Partial<DnsRecord>[]): Promise<DnsRecord[]>;
282
-
283
- // ─── DNS Records Namespace ────────────────────────────────────────────────────
284
-
285
- export namespace records {
286
- function list(domain: string): Promise<DnsRecord[]>;
287
- function add(domain: string, record: AddRecordInput): Promise<DnsRecord>;
288
- function update(domain: string, id: string, record: Partial<DnsRecord>): Promise<DnsRecord>;
289
- function delete(domain: string, id: string): Promise<DeleteResult>;
290
- }
291
-
292
- // ─── Nameservers Namespace ────────────────────────────────────────────────────
293
-
294
- export namespace nameservers {
295
- /** Set nameservers for a domain (2–13 nameservers). */
296
- function set(domain: string, ns: string[]): Promise<any>;
297
- /** List current nameservers for a domain. */
298
- function list(domain: string): Promise<string[]>;
299
- }
300
-
301
- // ─── Forwarding Namespace ─────────────────────────────────────────────────────
302
-
303
- export namespace forwarding {
304
- /** Set up domain-level URL forwarding. */
305
- function set(domain: string, url: string): Promise<any>;
306
- /** Set up subdomain-level URL forwarding. */
307
- function setSub(domain: string, subdomain: string, url: string): Promise<any>;
308
- /** Remove subdomain forwarding. */
309
- function deleteSub(domain: string, subdomain: string): Promise<any>;
310
- }
311
-
312
- // ─── Email Forwarding Namespace ───────────────────────────────────────────────
313
-
314
- export interface EmailForward {
315
- from_email?: string;
316
- email2?: string;
317
- to_email?: string;
318
- forward2?: string;
319
- }
320
-
321
- export namespace email {
322
- /** List email forwards for a domain. */
323
- function list(domain: string): Promise<EmailForward[]>;
324
- /** Configure an email forward: <from>@domain → toEmail. */
325
- function forward(domain: string, fromEmail: string, toEmail: string): Promise<any>;
326
- /** Delete an email forward. */
327
- function deleteForward(domain: string, fromEmail: string): Promise<any>;
328
- }
329
-
330
- // ─── DNSSEC Namespace ─────────────────────────────────────────────────────────
331
-
332
- export interface DnssecRecord {
333
- algorithm?: number | string;
334
- key_tag?: number | string;
335
- digest_type?: number | string;
336
- digest?: string;
337
- }
338
-
339
- export namespace dnssec {
340
- /** List DNSSEC DS records for a domain. */
341
- function list(domain: string): Promise<DnssecRecord[]>;
342
- /** Add a DNSSEC DS record. */
343
- function add(domain: string, record: DnssecRecord): Promise<any>;
344
- /** Delete a DNSSEC DS record. */
345
- function delete(domain: string, record: DnssecRecord): Promise<any>;
346
- }
347
-
348
- // ─── Contacts Namespace ───────────────────────────────────────────────────────
349
-
350
- export namespace contacts {
351
- function list(): Promise<Contact[]>;
352
- function add(contact: Omit<Contact, 'id'>): Promise<Contact>;
353
- function update(id: string, contact: Partial<Contact>): Promise<Contact>;
354
- function delete(id: string): Promise<DeleteResult>;
355
- function associate(id: string, domain: string): Promise<any>;
356
- }
357
-
358
- // ─── Account Namespace ────────────────────────────────────────────────────────
359
-
360
- export namespace account {
361
- /** Get current authenticated user's profile. */
362
- function me(): Promise<User>;
363
-
364
- /** Update user preferences. */
365
- function preferences(prefs: UserPreferences): Promise<UserPreferences>;
366
-
367
- /** Retrieve the audit log for the current user. */
368
- function audit(page?: number, limit?: number): Promise<{ audit: any[]; total: number; page: number }>;
369
-
370
- /** Get the current account balance (cached 30s). */
371
- function balance(): Promise<BalanceResult>;
372
-
373
- /** Rotate the current API key. */
374
- function rotateKey(): Promise<{ api_key: string }>;
375
-
376
- /** IP allowlist management. */
377
- namespace allowlist {
378
- function list(): Promise<IpAllowlistResult>;
379
- function add(ip: string): Promise<IpAllowlistResult>;
380
- function remove(ip: string): Promise<IpAllowlistResult>;
381
- }
382
- }
383
-
384
- // ─── Error Classes ────────────────────────────────────────────────────────────
385
-
386
- export class AuthenticationError extends Error {
387
- name: 'AuthenticationError';
388
- code: 110;
389
- }
390
-
391
- export class DomainNotFoundError extends Error {
392
- name: 'DomainNotFoundError';
393
- code: 200;
394
- }
395
-
396
- export class DomainUnavailableError extends Error {
397
- name: 'DomainUnavailableError';
398
- code: 261;
399
- }
400
-
401
- export class ValidationError extends Error {
402
- name: 'ValidationError';
403
- code: 108;
404
- }
405
-
406
- export class InsufficientFundsError extends Error {
407
- name: 'InsufficientFundsError';
408
- code: 280;
409
- }
410
-
411
- export class SaacDnsError extends Error {
412
- name: 'SaacDnsError';
413
- code: number;
414
- }