groundmail-cli 0.30.0 → 0.30.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 (2) hide show
  1. package/dist/cli.js +18 -11
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -737,18 +737,25 @@ async function createDomainsClient(apiKey, baseUrl) {
737
737
  const { Groundmail } = await import("groundmail");
738
738
  return new Groundmail(apiKey, baseUrl ? { baseUrl } : void 0);
739
739
  }
740
+ function pushRecord(lines, record) {
741
+ lines.push(` ${record.type.padEnd(6)} ${record.host}`);
742
+ if (record.type === "MX" && record.priority != null) {
743
+ lines.push(` priority: ${record.priority}`);
744
+ lines.push(` mail server: ${record.value}`);
745
+ } else {
746
+ lines.push(` ${record.value}`);
747
+ }
748
+ lines.push(` (${record.purpose})`);
749
+ lines.push("");
750
+ }
740
751
  function formatDnsRecords(records) {
752
+ const toAdd = records.filter((record) => !record.already_set);
753
+ const alreadySet = records.filter((record) => record.already_set);
741
754
  const lines = ["DNS records to add:", ""];
742
- for (const record of records) {
743
- lines.push(` ${record.type.padEnd(6)} ${record.host}`);
744
- if (record.type === "MX" && record.priority != null) {
745
- lines.push(` priority: ${record.priority}`);
746
- lines.push(` mail server: ${record.value}`);
747
- } else {
748
- lines.push(` ${record.value}`);
749
- }
750
- lines.push(` (${record.purpose})`);
751
- lines.push("");
755
+ for (const record of toAdd) pushRecord(lines, record);
756
+ if (alreadySet.length) {
757
+ lines.push("Already set, nothing to change:", "");
758
+ for (const record of alreadySet) pushRecord(lines, record);
752
759
  }
753
760
  return lines.join("\n").trimEnd();
754
761
  }
@@ -1466,7 +1473,7 @@ function trimUrl(value) {
1466
1473
  }
1467
1474
 
1468
1475
  // package.json
1469
- var version = "0.30.0";
1476
+ var version = "0.30.1";
1470
1477
 
1471
1478
  // src/user-agent.ts
1472
1479
  function buildUserAgent(own) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "groundmail-cli",
3
- "version": "0.30.0",
3
+ "version": "0.30.1",
4
4
  "description": "Groundmail CLI — send transactional email from the terminal",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -38,7 +38,7 @@
38
38
  "prepublishOnly": "npm run build"
39
39
  },
40
40
  "dependencies": {
41
- "groundmail": "0.29.0"
41
+ "groundmail": "0.29.1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "tsup": "^8.5.0",