@hasna/domains 0.0.33 → 0.0.34

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.
@@ -1,3 +1,17 @@
1
1
  import type { Command } from "commander";
2
+ /** Record types the store (local sqlite CHECK + cloud API) accepts on write. */
3
+ export declare const SUPPORTED_DNS_TYPES: Set<string>;
4
+ /**
5
+ * Split provider-returned records into persistable ones and skipped ones.
6
+ * Real zones always carry provider-managed records (SOA, and often CAA) whose
7
+ * types are outside the supported set; persisting them fails the local CHECK
8
+ * constraint and makes the cloud API return 400. `dns pull` must skip them.
9
+ */
10
+ export declare function partitionPullableRecords<T extends {
11
+ type: string;
12
+ }>(records: T[]): {
13
+ keep: T[];
14
+ skipped: Map<string, number>;
15
+ };
2
16
  export declare function registerDnsCommands(program: Command): void;
3
17
  //# sourceMappingURL=dns.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dns.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/dns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsCzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA4X1D"}
1
+ {"version":3,"file":"dns.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/dns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBzC,gFAAgF;AAChF,eAAO,MAAM,mBAAmB,aAA4D,CAAC;AAE7F;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,EACjE,OAAO,EAAE,CAAC,EAAE,GACX;IAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAW7C;AAoBD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkY1D"}
package/dist/cli/index.js CHANGED
@@ -69701,6 +69701,19 @@ function getDnsApplyBlockReason(plan, opts) {
69701
69701
  }
69702
69702
 
69703
69703
  // src/cli/commands/dns.ts
69704
+ var SUPPORTED_DNS_TYPES = new Set(["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SRV"]);
69705
+ function partitionPullableRecords(records) {
69706
+ const keep = [];
69707
+ const skipped = new Map;
69708
+ for (const r5 of records) {
69709
+ if (SUPPORTED_DNS_TYPES.has(r5.type)) {
69710
+ keep.push(r5);
69711
+ } else {
69712
+ skipped.set(r5.type, (skipped.get(r5.type) ?? 0) + 1);
69713
+ }
69714
+ }
69715
+ return { keep, skipped };
69716
+ }
69704
69717
  function printDnsPlan(plan) {
69705
69718
  console.log(`DNS plan for ${plan.domain}: ${plan.creates} create, ${plan.updates} update, ${plan.deletes} delete, ${plan.unchanged} unchanged`);
69706
69719
  for (const op of plan.operations) {
@@ -69975,12 +69988,17 @@ ${compactHint(page, "subdomain(s)", "Use --all for every discovered name or --js
69975
69988
  console.error(`Domain '${domain}' not found in local DB. Add it first: domains domain add --name ${domain}`);
69976
69989
  process.exit(1);
69977
69990
  }
69991
+ const { keep, skipped } = partitionPullableRecords(records);
69978
69992
  let count = 0;
69979
- for (const r5 of records) {
69993
+ for (const r5 of keep) {
69980
69994
  await createDnsRecord2({ domain_id: dbDomain.id, type: r5.type, name: r5.name, value: r5.value, ttl: r5.ttl, priority: r5.priority });
69981
69995
  count++;
69982
69996
  }
69983
69997
  console.log(`\u2713 Pulled ${count} record(s) from ${providerName} into local DB for ${domain}`);
69998
+ if (skipped.size > 0) {
69999
+ const summary = Array.from(skipped.entries()).map(([t2, n2]) => `${n2} ${t2}`).join(", ");
70000
+ console.log(` Skipped ${summary} record(s) (unsupported/provider-managed type).`);
70001
+ }
69984
70002
  } catch (e5) {
69985
70003
  console.error(`Error: ${e5 instanceof Error ? e5.message : String(e5)}`);
69986
70004
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/domains",
3
- "version": "0.0.33",
3
+ "version": "0.0.34",
4
4
  "description": "Domain portfolio, registrar, marketplace, and DNS management for AI agents — CLI + MCP + HTTP API + SDK, local SQLite or cloud Postgres",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",