@deepdynamic/cli 0.1.0 → 0.1.2

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 (58) hide show
  1. package/dist/agents/content.js +1 -1
  2. package/dist/agents/install.js +28 -12
  3. package/dist/agents/refresh.js +20 -0
  4. package/dist/agents/setup.js +7 -7
  5. package/dist/cli.js +8 -8
  6. package/dist/commands/account.js +19 -19
  7. package/dist/commands/activity.js +13 -13
  8. package/dist/commands/blocked.js +16 -16
  9. package/dist/commands/deploy/index.js +16 -16
  10. package/dist/commands/deploy/ship.js +8 -8
  11. package/dist/commands/deployments.js +8 -7
  12. package/dist/commands/dns.js +229 -243
  13. package/dist/commands/domains.js +188 -260
  14. package/dist/commands/emails.js +64 -26
  15. package/dist/commands/env.js +38 -38
  16. package/dist/commands/help.js +18 -19
  17. package/dist/commands/keys.js +84 -90
  18. package/dist/commands/login/flow.js +11 -11
  19. package/dist/commands/login/index.js +3 -3
  20. package/dist/commands/logout.js +11 -11
  21. package/dist/commands/mail.js +82 -69
  22. package/dist/commands/notifications.js +30 -29
  23. package/dist/commands/plan.js +109 -125
  24. package/dist/commands/projects.js +159 -157
  25. package/dist/commands/reference.js +139 -112
  26. package/dist/commands/search.js +29 -18
  27. package/dist/commands/server.js +100 -112
  28. package/dist/commands/sessions.js +38 -44
  29. package/dist/commands/sites.js +16 -16
  30. package/dist/commands/sms.js +31 -17
  31. package/dist/commands/status.js +9 -9
  32. package/dist/commands/support.js +19 -19
  33. package/dist/commands/update.js +18 -16
  34. package/dist/commands/usage.js +12 -12
  35. package/dist/commands/verify.js +16 -16
  36. package/dist/guide.js +9 -48
  37. package/dist/http/request.js +3 -3
  38. package/dist/pretty.js +4 -4
  39. package/dist/refresh-skills.js +5 -0
  40. package/dist/registry.js +74 -146
  41. package/dist/runtime/card-request.js +6 -6
  42. package/dist/runtime/confirm.js +1 -1
  43. package/dist/runtime/development.js +1 -1
  44. package/dist/runtime/dry-run.js +2 -2
  45. package/dist/runtime/env-file.js +6 -9
  46. package/dist/runtime/flags.js +11 -13
  47. package/dist/runtime/login-screen.js +5 -5
  48. package/dist/runtime/page.js +4 -4
  49. package/dist/runtime/server-options.js +4 -8
  50. package/dist/runtime/spinner.js +3 -1
  51. package/dist/runtime/support.js +2 -3
  52. package/dist/runtime/text-file.js +5 -5
  53. package/dist/runtime/timeout.js +2 -2
  54. package/dist/runtime/update-check.js +48 -14
  55. package/dist/runtime/update-install.js +40 -5
  56. package/dist/runtime/usage-error.js +2 -2
  57. package/dist/setup-agents.js +9 -2
  58. package/package.json +1 -1
@@ -11,13 +11,13 @@ import { plannedChange, plannedRequest, rehearse, splitDryRun } from "../runtime
11
11
  import { parseFlags, unknownArgument } from "../runtime/flags.js";
12
12
  import { PROJECT } from "../runtime/project-name.js";
13
13
  export const DNS_PATH = '/api/v1/dns';
14
- export const DNS_SITE_DOMAIN = 'deepdynamic.dev';
14
+ export const DNS_SITE_DOMAIN = 'deepdynamic.space';
15
15
  const RECORD_TYPES = {
16
- A: 'IPv4 주소', AAAA: 'IPv6 주소', CNAME: '다른 도메인', MX: '메일 서버', TXT: '확인용 문구', CAA: '인증서 발급 허용',
17
- NS: '네임서버 위임', PTR: '역방향 조회', SRV: '서비스 위치'
16
+ A: 'IPv4 address', AAAA: 'IPv6 address', CNAME: 'alias target', MX: 'mail server', TXT: 'verification text', CAA: 'allowed certificate authorities',
17
+ NS: 'nameserver delegation', PTR: 'reverse lookup', SRV: 'service location'
18
18
  };
19
19
  export const DNS_RECORD_TYPES = Object.keys(RECORD_TYPES);
20
- const TTLS = [['auto', 1, '자동'], ['300', 300, '5분'], ['3600', 3600, '1시간'], ['86400', 86400, '1일']];
20
+ const TTLS = [['auto', 1, 'auto'], ['300', 300, '5 minutes'], ['3600', 3600, '1 hour'], ['86400', 86400, '1 day']];
21
21
  const HOST_TYPES = ['CNAME', 'MX', 'NS', 'PTR'];
22
22
  const LABEL = '[a-z0-9_]([a-z0-9_-]*[a-z0-9])?';
23
23
  const NAME = new RegExp(`^(@|(\\*\\.)?${LABEL}(\\.${LABEL})*|\\*)$`);
@@ -26,50 +26,40 @@ const RECORD_ID = /^[a-z0-9]([a-z0-9-]{0,62}[a-z0-9])?$/;
26
26
  const PRIORITY = /^\d{1,5}$/;
27
27
  const RECORD_FLAGS = ['--type', '--name', '--value', '--ttl', '--priority'];
28
28
  const RESTORE_FLAGS = ['--project', '--name'];
29
- const PROPAGATION = '적용하면 보통 몇 분 안에 전 세계로 퍼지고, 길게는 TTL 만큼 이전 값이 남아 있을 수 있습니다.';
30
- const APPLIED_PROPAGATION = '보통 몇 분 안에 전 세계로 퍼지고, 길게는 TTL 만큼 이전 값이 남아 있을 수 있습니다.';
31
- const PENDING = 'DNS를 준비하고 있습니다. 보통 몇 분 안에 끝납니다.';
32
- const PENDING_APPLY = 'DNS를 준비하고 있습니다. 준비가 끝나면 저장한 레코드가 함께 적용됩니다.';
33
- const NO_PROJECT = '연결한 프로젝트 없음';
34
- const SYNC_EFFECT = '저장한 레코드를 기준으로 DNS 서버를 맞춥니다. 존을 아직 준비하고 있으면 존 생성·레코드 반영·네임서버 교체를 지금 바로 시도합니다.';
35
- const SYNC_WARNING = 'DNS 서버에서만 직접 바꾼 레코드는 저장한 레코드에 없으므로 사라집니다.';
36
- const DNSSEC_STATES = { on: '사용 중', enabling: '적용 중', disabling: '해제 중(2일 뒤 서명 해제)', off: '꺼짐', unsupported: '미지원' };
29
+ const PROPAGATION = 'Once applied, changes usually reach DNS resolvers worldwide within a few minutes, but the previous value can stay cached for up to the TTL.';
30
+ const APPLIED_PROPAGATION = 'Changes usually reach DNS resolvers worldwide within a few minutes, but the previous value can stay cached for up to the TTL.';
31
+ const PENDING = 'DNS is being set up. This usually finishes within a few minutes.';
32
+ const PENDING_APPLY = 'DNS is being set up. The saved records are applied once setup finishes.';
33
+ const NO_PROJECT = 'No connected project';
34
+ const SYNC_EFFECT = 'Makes the DNS servers match the saved records. If the zone is still being set up, tries to create the zone, apply the records and switch the nameservers right now.';
35
+ const SYNC_WARNING = 'Records changed only on the DNS servers are not in the saved records and will be removed.';
36
+ const DNSSEC_STATES = { on: 'on', enabling: 'enabling', disabling: 'disabling (signing stops in 2 days)', off: 'off', unsupported: 'not supported' };
37
37
  const DNSSEC_NOTES = {
38
- on: '존 서명과 도메인을 산 곳(등록처)의 DS 레코드 등록을 마쳤습니다.',
39
- enabling: '존 서명과 도메인을 산 곳(등록처)의 DS 레코드 등록을 진행하고 있습니다. 보통 몇 분 안에 끝납니다.',
40
- disabling: '도메인을 산 곳(등록처)의 DS 레코드를 지우고, 이미 퍼진 DS 레코드가 만료되도록 2일 뒤 존 서명을 해제합니다.',
41
- off: 'DNS 서버가 존에 서명하지 않습니다.',
42
- unsupported: '도메인을 산 곳(등록처)이 이 도메인의 DS 레코드 등록을 거절했습니다. 이 TLD 는 DNSSEC 을 지원하지 않는 것 같아 켤 수 없습니다.'
43
- };
44
- const DNSSEC_AFTER_ZONE = 'DNS 준비가 끝나면 존 서명과 도메인을 산 곳(등록처)의 DS 레코드 등록을 시작합니다.';
45
- const DNSSEC_ON_EFFECT = 'DNS 서버의 존에 서명하고 도메인을 산 곳(등록처)에 DS 레코드를 등록합니다. 요청 안에서 서명이 끝나기를 30초쯤 기다려 등록까지 마치고, 더 걸리면 몇 분 안에 이어서 끝냅니다. DNS를 아직 준비하고 있으면 준비가 끝난 뒤 시작합니다.';
46
- const DNSSEC_SCOPE = '딥다이나믹에서 구입한 도메인만 DNSSEC 을 켜고 끌 수 있습니다.';
47
- const CHECK_DOMAIN = { stage: 'check_domain', message: '도메인 형식을 확인하고 있습니다.' };
48
- const CHECK_RECORD_ID = { stage: 'check_record_id', message: '레코드 ID 형식을 확인하고 있습니다.' };
49
- const CHECK_RECORD = { stage: 'check_record', message: '레코드 종류·이름·값 형식을 확인하고 있습니다.' };
50
- const DESCRIBE_RECORD = { stage: 'describe_record', message: '레코드가 어떻게 동작할지 정리하고 있습니다.' };
51
- const PREPARE_REQUEST = { stage: 'prepare_request', message: '보낼 요청을 준비하고 있습니다.' };
52
- export const DOMAIN_NOT_FOUND = {
53
- code: 'domain_not_found',
54
- message: 'The domain is not among the domains you manage. Check it with deepdynamic dns.',
55
- display: '내 도메인 목록에 없는 도메인입니다.'
56
- };
57
- const RECORD_NOT_FOUND = {
58
- code: 'record_not_found',
59
- message: 'The domain has no record with that ID. Check it with deepdynamic dns records <domain>.',
60
- display: '그 ID의 레코드를 찾을 수 없습니다.'
61
- };
62
- const PROJECT_NOT_FOUND = {
63
- code: 'project_not_found',
64
- message: 'You have no active project with that name. Check it with deepdynamic projects.',
65
- display: '그 이름의 내 프로젝트를 찾을 수 없습니다.'
38
+ on: 'The zone is signed and the DS record is registered at the registrar.',
39
+ enabling: 'Signing the zone and registering the DS record at the registrar. This usually finishes within a few minutes.',
40
+ disabling: 'Removes the DS record at the registrar and stops signing the zone 2 days later, so that cached DS records expire first.',
41
+ off: 'The DNS servers do not sign the zone.',
42
+ unsupported: 'The registrar rejected the DS record for this domain. Its TLD most likely does not support DNSSEC, so DNSSEC cannot be turned on.'
66
43
  };
44
+ const DNSSEC_AFTER_ZONE = 'Zone signing and DS record registration at the registrar start once DNS setup finishes.';
45
+ const DNSSEC_ON_EFFECT = 'Signs the zone on the DNS servers and registers a DS record at the registrar. The request waits about 30 seconds for signing and finishes the registration; if signing takes longer, it completes within a few minutes. If DNS is still being set up, this starts once setup finishes.';
46
+ const DNSSEC_SCOPE = 'DNSSEC can be turned on or off only for domains bought through DeepDynamic.';
47
+ const CONFIRM_NEXT = 'Confirm with the user, then run it with --yes.';
48
+ const CHECK_DOMAIN = { stage: 'check_domain', message: 'Checking the domain format.' };
49
+ const CHECK_RECORD_ID = { stage: 'check_record_id', message: 'Checking the record ID format.' };
50
+ const CHECK_RECORD = { stage: 'check_record', message: 'Checking the record type, name and value.' };
51
+ const DESCRIBE_RECORD = { stage: 'describe_record', message: 'Describing how the record will work.' };
52
+ const PREPARE_REQUEST = { stage: 'prepare_request', message: 'Preparing the request.' };
53
+ const plainFailure = (code, message) => ({ code, message, display: message });
54
+ export const DOMAIN_NOT_FOUND = plainFailure('domain_not_found', 'The domain is not among the domains you manage. Check it with deepdynamic dns.');
55
+ const RECORD_NOT_FOUND = plainFailure('record_not_found', 'The domain has no record with that ID. Check it with deepdynamic dns records <domain>.');
56
+ const PROJECT_NOT_FOUND = plainFailure('project_not_found', 'You have no active project with that name. Check it with deepdynamic projects.');
67
57
  const NOT_FOUND = { domain_not_found: DOMAIN_NOT_FOUND, record_not_found: RECORD_NOT_FOUND, project_not_found: PROJECT_NOT_FOUND };
68
58
  const DNSSEC_FAILURES = {
69
59
  external_domain: {
70
60
  code: 'external_domain',
71
61
  message: 'The domain was bought elsewhere, and DNSSEC can be turned on or off only for domains bought through DeepDynamic. Nothing changed; tell the user DNSSEC is not available for this domain here.',
72
- display: '다른 곳에서 산 도메인입니다. DNSSEC 은 딥다이나믹에서 구입한 도메인만 켜고 끌 수 있습니다.'
62
+ display: `The domain was bought elsewhere. ${DNSSEC_SCOPE}`
73
63
  },
74
64
  dnssec_unsupported: {
75
65
  code: 'dnssec_unsupported',
@@ -78,19 +68,20 @@ const DNSSEC_FAILURES = {
78
68
  }
79
69
  };
80
70
  export const fail = (pretty, message, display) => ({ error: pretty ? display : message });
71
+ const count = (total, noun) => `${total.toLocaleString('en-US')} ${noun}${total === 1 ? '' : 's'}`;
81
72
  const hostName = (name, domain) => name === '@' ? domain : `${name}.${domain}`;
82
- const ttlLabel = (seconds) => TTLS.find(([, value]) => value === seconds)?.[2] ?? `${seconds}초`;
73
+ const ttlLabel = (seconds) => TTLS.find(([, value]) => value === seconds)?.[2] ?? `${seconds.toLocaleString('en-US')} seconds`;
83
74
  const recordsUrl = (siteUrl, domain, suffix = '') => new URL(`${DNS_PATH}/${encodeURIComponent(domain)}/records${suffix}`, siteUrl).href;
84
- const zoneState = (zone) => zone.status === 'pending' ? PENDING : zone.connected ? '사이트 연결됨' : '연결 필요';
85
- const pendingRows = (zone) => zone.status === 'pending' ? [['적용', PENDING_APPLY]] : [];
86
- const analyticsState = (zone) => zone.analytics ? `Google Analytics ${zone.analytics.measurementId} · ${zone.analytics.connectedAt.slice(0, 10)} 등록` : 'Google Analytics 등록 전';
75
+ const zoneState = (zone) => zone.status === 'pending' ? PENDING : zone.connected ? 'Site connected' : 'Not connected';
76
+ const pendingRows = (zone) => zone.status === 'pending' ? [['Pending', PENDING_APPLY]] : [];
77
+ const analyticsState = (zone) => zone.analytics ? `Google Analytics ${zone.analytics.measurementId} · registered ${zone.analytics.connectedAt.slice(0, 10)}` : 'Google Analytics not registered';
87
78
  function dnssecRows(zone, explain = false) {
88
79
  if (!zone.dnssec)
89
80
  return [];
90
81
  const state = ['DNSSEC', DNSSEC_STATES[zone.dnssec]];
91
82
  if (!explain)
92
83
  return [state];
93
- return [state, ['안내', zone.dnssec === 'enabling' && zone.status === 'pending' ? DNSSEC_AFTER_ZONE : DNSSEC_NOTES[zone.dnssec]]];
84
+ return [state, ['Notice', zone.dnssec === 'enabling' && zone.status === 'pending' ? DNSSEC_AFTER_ZONE : DNSSEC_NOTES[zone.dnssec]]];
94
85
  }
95
86
  function normalizeName(input, domain) {
96
87
  const name = input.trim().toLowerCase().replace(/\.$/, '');
@@ -120,54 +111,54 @@ function isIpv6(value) {
120
111
  function describeRecord(record, domain) {
121
112
  const host = hostName(record.name, domain);
122
113
  if (record.type === 'A' || record.type === 'AAAA')
123
- return `${host} 방문자를 ${record.value} 서버로 안내합니다.`;
114
+ return `Points ${host} to the server at ${record.value}.`;
124
115
  if (record.type === 'CNAME')
125
- return `${host} 방문자를 ${record.value} 주소로 안내합니다.`;
116
+ return `Points ${host} to ${record.value}.`;
126
117
  if (record.type === 'MX')
127
- return `${host} 앞으로 온 메일은 ${record.value} 서버가 받습니다.`;
118
+ return `Mail for ${host} is delivered to the server ${record.value}.`;
128
119
  if (record.type === 'TXT')
129
- return `${host}의 소유 확인이나 메일 보안 설정에 쓰는 문구입니다.`;
130
- return `${host}의 ${RECORD_TYPES[record.type]} 레코드입니다.`;
120
+ return `Text for ${host}, used for ownership verification or mail security settings.`;
121
+ return `Sets the ${RECORD_TYPES[record.type]} for ${host}.`;
131
122
  }
132
123
  function recordRows(record, domain, propagation = PROPAGATION) {
133
124
  return [
134
- ['레코드', `${record.type} ${hostName(record.name, domain)} → ${record.value}`],
125
+ ['Record', `${record.type} ${hostName(record.name, domain)} → ${record.value}`],
135
126
  ['TTL', ttlLabel(record.ttl)],
136
- ...(record.priority === undefined ? [] : [['우선순위', `${record.priority} (숫자가 작을수록 먼저 메일을 받습니다)`]]),
137
- ['설명', describeRecord(record, domain)],
138
- ['전파', propagation]
127
+ ...(record.priority === undefined ? [] : [['Priority', `${record.priority} (lower values receive mail first)`]]),
128
+ ['Description', describeRecord(record, domain)],
129
+ ['Propagation', propagation]
139
130
  ];
140
131
  }
141
- function readFlags(args, flags, pretty) {
142
- const parsed = parseFlags(args, flags, pretty);
132
+ function readFlags(args, flags) {
133
+ const parsed = parseFlags(args, flags);
143
134
  if ('error' in parsed)
144
135
  return parsed;
145
136
  const values = {};
146
137
  for (const [flag, value] of parsed.entries) {
147
138
  if (values[flag] !== undefined)
148
- return fail(pretty, `Give ${flag} only once.`, `${flag} 는 한 번만 지정하세요.`);
139
+ return { error: `Give ${flag} only once.` };
149
140
  values[flag] = value;
150
141
  }
151
142
  return values;
152
143
  }
153
144
  export function parseDomain(input, pretty) {
154
145
  if (input === undefined || input.startsWith('-'))
155
- return fail(pretty, 'Specify the domain first.', '도메인을 먼저 지정하세요.');
146
+ return { error: 'Specify the domain first.' };
156
147
  const domain = cleanDomain(input);
157
- return isDomain(domain) ? domain : fail(pretty, `Not a valid domain: ${input}`, `도메인 형식이 올바르지 않습니다: ${input}`);
148
+ return isDomain(domain) ? domain : { error: `Not a valid domain: ${input}` };
158
149
  }
159
- function parseRecordId(input, pretty) {
150
+ function parseRecordId(input) {
160
151
  if (input === undefined || input.startsWith('-'))
161
- return fail(pretty, 'Specify the record ID after the domain.', '도메인 뒤에 레코드 ID 를 지정하세요.');
152
+ return { error: 'Specify the record ID after the domain.' };
162
153
  return RECORD_ID.test(input)
163
154
  ? input
164
- : fail(pretty, `Record IDs are 1-64 lowercase letters, digits or hyphens that start and end with a letter or digit, as listed by deepdynamic dns records: ${input}`, `레코드 ID 는 deepdynamic dns records 에 나온 1~64자의 영문 소문자·숫자·하이픈입니다: ${input}`);
155
+ : { error: `Record IDs are 1-64 lowercase letters, digits or hyphens that start and end with a letter or digit, as listed by deepdynamic dns records: ${input}` };
165
156
  }
166
- function parseName(input, domain, pretty) {
157
+ function parseName(input, domain) {
167
158
  const name = normalizeName(input, domain);
168
159
  return NAME.test(name)
169
160
  ? name
170
- : fail(pretty, `--name must be @ for the domain itself or a label such as www made of lowercase letters, digits, hyphens and underscores: ${input}`, `--name 에는 @ 또는 www 처럼 영문 소문자·숫자·하이픈으로 된 앞부분을 지정하세요: ${input}`);
161
+ : { error: `--name must be @ for the domain itself or a label such as www made of lowercase letters, digits, hyphens and underscores: ${input}` };
171
162
  }
172
163
  const CONTROL = /[\u0000-\u001f\u007f]/;
173
164
  const TARGET = /^(_?[a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,}$/i;
@@ -185,50 +176,50 @@ const VALUE_CHECKS = {
185
176
  CAA: (value) => { const match = CAA.exec(value); return !!match && Number(match[1]) <= 255; },
186
177
  SRV: (value) => { const parts = value.split(' '); return parts.length === 4 && parts.slice(0, 3).every((part) => inRange(part, 65535)) && hostOrRoot(parts[3]); }
187
178
  };
179
+ const HOST_RULE = 'a host name such as mail.example.com';
188
180
  const VALUE_RULES = {
189
- A: ['an IPv4 address such as 198.51.100.24', 'IPv4 주소 형식이어야 합니다. 예: 198.51.100.24'],
190
- AAAA: ['an IPv6 address such as 2001:db8::1', 'IPv6 주소 형식이어야 합니다. 예: 2001:db8::1'],
191
- CNAME: ['a host name such as mail.example.com', '도메인 형식이어야 합니다. https:// 나 경로, IP 주소는 쓸 수 없습니다. 예: mail.example.com'],
192
- MX: ['a host name such as mail.example.com', '도메인 형식이어야 합니다. https:// 나 경로, IP 주소는 쓸 수 없습니다. 예: mail.example.com'],
193
- NS: ['a host name such as mail.example.com', '도메인 형식이어야 합니다. https:// 나 경로, IP 주소는 쓸 수 없습니다. 예: mail.example.com'],
194
- PTR: ['a host name such as mail.example.com', '도메인 형식이어야 합니다. https:// 나 경로, IP 주소는 쓸 수 없습니다. 예: mail.example.com'],
195
- TXT: ['1-4000 characters without control characters', '1자 이상 4000자 이하이고 제어 문자를 담을 수 없습니다.'],
196
- CAA: ['flags tag "value" with tag issue, issuewild, iodef, contactemail or contactphone, such as 0 issue "letsencrypt.org"', '"플래그 태그 "값"" 순서입니다. 태그는 issue·issuewild·iodef·contactemail·contactphone 중 하나입니다. 예: 0 issue "letsencrypt.org"'],
197
- SRV: ['priority weight port target, such as 10 5 5060 sip.example.com', '"우선순위 가중치 포트 대상" 순서입니다. 예: 10 5 5060 sip.example.com']
181
+ A: 'an IPv4 address such as 198.51.100.24',
182
+ AAAA: 'an IPv6 address such as 2001:db8::1',
183
+ CNAME: HOST_RULE,
184
+ MX: HOST_RULE,
185
+ NS: HOST_RULE,
186
+ PTR: HOST_RULE,
187
+ TXT: '1-4000 characters without control characters',
188
+ CAA: 'flags tag "value" with tag issue, issuewild, iodef, contactemail or contactphone, such as 0 issue "letsencrypt.org"',
189
+ SRV: 'priority weight port target, such as 10 5 5060 sip.example.com'
198
190
  };
199
191
  function valueError(type, value, pretty) {
200
192
  if (VALUE_CHECKS[type](value))
201
193
  return null;
202
- const [rule, prettyRule] = VALUE_RULES[type];
203
- return fail(pretty, `--value for ${type} records must be ${rule}.`, `${type} 레코드의 --value 는 ${prettyRule}`);
194
+ const message = `--value for ${type} records must be ${VALUE_RULES[type]}.`;
195
+ return fail(pretty, message, HOST_TYPES.includes(type) ? `${message} Do not include https://, a path or an IP address.` : message);
204
196
  }
205
- function apexError(type, name, pretty) {
197
+ function apexError(type, name) {
206
198
  if (name !== '@')
207
199
  return null;
208
200
  if (type === 'CNAME')
209
- return fail(pretty, 'A CNAME cannot be on the domain itself (@). Use a name such as www.', '도메인 자체(@)에는 CNAME 을 쓸 수 없습니다. www 같은 이름을 지정하세요.');
201
+ return { error: 'A CNAME cannot be on the domain itself (@). Use a name such as www.' };
210
202
  if (type === 'NS')
211
- return fail(pretty, 'The NS records of the domain itself (@) cannot be changed.', '도메인 자체(@)의 NS 레코드는 바꿀 수 없습니다.');
203
+ return { error: 'The NS records of the domain itself (@) cannot be changed.' };
212
204
  return null;
213
205
  }
214
206
  function parseRecord(args, domain, pretty) {
215
- const values = readFlags(args, RECORD_FLAGS, pretty);
207
+ const values = readFlags(args, RECORD_FLAGS);
216
208
  if ('error' in values)
217
209
  return values;
218
210
  const { '--type': rawType, '--name': rawName, '--value': rawValue, '--ttl': rawTtl, '--priority': rawPriority } = values;
219
211
  if (rawType === undefined || rawName === undefined || rawValue === undefined) {
220
212
  const missing = RECORD_FLAGS.find((flag) => values[flag] === undefined);
221
- return fail(pretty, `${missing} is required.`, `${missing} 를 지정하세요.`);
213
+ return { error: `${missing} is required.` };
222
214
  }
223
215
  const type = rawType.trim().toUpperCase();
224
- if (!Object.hasOwn(RECORD_TYPES, type)) {
225
- return fail(pretty, `--type must be one of ${DNS_RECORD_TYPES.join(', ')}: ${rawType}`, `--type 에는 레코드 종류(${DNS_RECORD_TYPES.join(', ')})를 지정하세요: ${rawType}`);
226
- }
216
+ if (!Object.hasOwn(RECORD_TYPES, type))
217
+ return { error: `--type must be one of ${DNS_RECORD_TYPES.join(', ')}: ${rawType}` };
227
218
  const recordType = type;
228
- const name = parseName(rawName, domain, pretty);
219
+ const name = parseName(rawName, domain);
229
220
  if (typeof name !== 'string')
230
221
  return name;
231
- const apex = apexError(recordType, name, pretty);
222
+ const apex = apexError(recordType, name);
232
223
  if (apex)
233
224
  return apex;
234
225
  const value = normalizeValue(recordType, rawValue);
@@ -237,17 +228,16 @@ function parseRecord(args, domain, pretty) {
237
228
  return invalidValue;
238
229
  const ttl = rawTtl === undefined ? 1 : TTLS.find(([input]) => input === rawTtl)?.[1];
239
230
  if (ttl === undefined)
240
- return fail(pretty, `--ttl must be auto, 300, 3600 or 86400: ${rawTtl}`, `--ttl 에는 auto·300·3600·86400 중 하나를 지정하세요: ${rawTtl}`);
231
+ return { error: `--ttl must be auto, 300, 3600 or 86400: ${rawTtl}` };
241
232
  if (recordType !== 'MX') {
242
233
  return rawPriority === undefined
243
234
  ? { type: recordType, name, value, ttl }
244
- : fail(pretty, '--priority applies only to MX records.', '--priority 는 MX 레코드에만 씁니다.');
235
+ : { error: '--priority applies only to MX records.' };
245
236
  }
246
237
  if (rawPriority === undefined)
247
- return fail(pretty, '--priority is required for MX records.', '--priority 를 지정하세요. MX 레코드는 우선순위가 필요합니다.');
248
- if (!PRIORITY.test(rawPriority) || Number(rawPriority) > 65535) {
249
- return fail(pretty, `--priority must be an integer from 0 to 65535: ${rawPriority}`, `--priority 에는 0부터 65535 사이 정수를 지정하세요: ${rawPriority}`);
250
- }
238
+ return { error: '--priority is required for MX records.' };
239
+ if (!PRIORITY.test(rawPriority) || Number(rawPriority) > 65535)
240
+ return { error: `--priority must be an integer from 0 to 65535: ${rawPriority}` };
251
241
  return { type: recordType, name, value, ttl, priority: Number(rawPriority) };
252
242
  }
253
243
  const getWithToken = (url, token, deps, spinner) => request(url, { method: 'GET', headers: { authorization: `Bearer ${token}` } }, deps, spinner);
@@ -262,16 +252,15 @@ function dnsFailure(result, notFound, conflict, failures = {}, succeeded = accep
262
252
  if (result.status === 401)
263
253
  return LOGIN_EXPIRED;
264
254
  if (result.status === 403)
265
- return { code: 'login_required', message: 'The access token is not allowed to do this. Run deepdynamic login again.', display: '이 로그인으로는 할 수 없습니다. deepdynamic login 으로 다시 로그인하세요.' };
255
+ return plainFailure('login_required', 'The access token is not allowed to do this. Run deepdynamic login again.');
266
256
  if (result.status === 404) {
267
257
  const code = result.body?.code;
268
258
  return typeof code === 'string' && Object.hasOwn(NOT_FOUND, code) ? NOT_FOUND[code] : notFound;
269
259
  }
270
260
  if (result.status === 400)
271
- return { code: 'invalid_arguments', message: 'The server rejected the request. Check the arguments against the command help.', display: '요청 내용을 확인하세요.' };
272
- if (result.status === 409) {
273
- return conflict ?? { code: 'site_unavailable', message: 'The project name cannot be used as a site address.', display: '이 프로젝트로는 사이트를 연결할 수 없습니다.' };
274
- }
261
+ return plainFailure('invalid_arguments', 'The server rejected the request. Check the arguments against the command help.');
262
+ if (result.status === 409)
263
+ return conflict ?? plainFailure('site_unavailable', 'The project name cannot be used as a site address.');
275
264
  return httpFailure(result.status);
276
265
  }
277
266
  async function applied(command, send, pretty, depth, deps) {
@@ -292,19 +281,19 @@ async function applied(command, send, pretty, depth, deps) {
292
281
  const failure = dnsFailure(result, send.notFound, send.conflict, send.failures, send.succeeded);
293
282
  if (failure) {
294
283
  return pretty
295
- ? prettyResult(1, depth, command, send.failed, [['서버', siteUrl], ['원인', failure.display]])
284
+ ? prettyResult(1, depth, command, send.failed, [['Server', siteUrl], ['Reason', failure.display]])
296
285
  : agentResult(1, { command, siteUrl, error: sendFailureError(result, failure) });
297
286
  }
298
287
  return send.done(result.body, siteUrl);
299
288
  }
300
289
  export async function rehearsed(command, args, pretty, depth, deps, plan, confirm) {
301
- const { usage, prettyUsage } = spec(command);
290
+ const { usage } = spec(command);
302
291
  const { args: plain, dryRun } = splitDryRun(args);
303
292
  const { args: rest, yes } = confirm ? splitYes(plain) : { args: plain, yes: false };
304
293
  const planned = plan(rest);
305
294
  if ('error' in planned) {
306
295
  return pretty
307
- ? prettyResult(2, depth, command, planned.error, [['사용법', prettyUsage]])
296
+ ? prettyResult(2, depth, command, planned.error, [['Usage', usage]])
308
297
  : agentResult(2, { command, error: { code: 'invalid_arguments', message: planned.error }, usage });
309
298
  }
310
299
  if (!dryRun)
@@ -319,35 +308,35 @@ const zoneOf = (body) => body.zone;
319
308
  const savedRecord = (zone, record) => [...zone.records].reverse().find((item) => item.type === record.type && item.name === record.name && item.value === record.value && item.priority === record.priority) ?? null;
320
309
  function changed(command, pretty, depth, message, rows, zone, siteUrl, extra) {
321
310
  return pretty
322
- ? prettyResult(0, depth, command, message, [['서버', siteUrl], ['도메인', zone.domain], ...rows, ...pendingRows(zone)])
311
+ ? prettyResult(0, depth, command, message, [['Server', siteUrl], ['Domain', zone.domain], ...rows, ...pendingRows(zone)])
323
312
  : agentResult(0, { command, siteUrl, applied: true, domain: zone.domain, ...extra, zone });
324
313
  }
325
314
  export async function runDnsList(args, pretty, depth, deps = defaultAuthDeps(pretty, depth)) {
326
315
  const command = 'dns';
327
316
  return rehearsed(command, args, pretty, depth, deps, (rest) => {
328
- const page = parsePage(rest, pretty);
317
+ const page = parsePage(rest);
329
318
  if (typeof page !== 'number')
330
319
  return page;
331
320
  const listUrl = (siteUrl) => `${new URL(DNS_PATH, siteUrl).href}?page=${page}`;
332
321
  return {
333
- steps: [{ stage: 'prepare_request', message: '관리 중인 도메인 목록 조회 요청을 준비하고 있습니다.' }],
322
+ steps: [{ stage: 'prepare_request', message: 'Preparing the request to list managed domains.' }],
334
323
  result: (siteUrl) => plannedRequest(command, pretty, depth, siteUrl, listUrl(siteUrl)),
335
324
  send: {
336
325
  method: 'GET',
337
326
  url: listUrl,
338
- spinner: '관리 중인 도메인을 불러오고 있습니다.',
339
- failed: '관리 중인 도메인을 불러오지 못했습니다.',
327
+ spinner: 'Loading managed domains.',
328
+ failed: 'Could not load managed domains.',
340
329
  notFound: httpFailure(404),
341
330
  done: (body, siteUrl) => {
342
331
  const { zones, ...paged } = body;
343
332
  const paging = pagination(paged, command);
344
333
  if (!pretty)
345
334
  return agentResult(0, { command, siteUrl, ...paging, zones });
346
- return prettyResult(0, depth, command, zones.length ? `관리 중인 도메인 ${zones.length}개를 불러왔습니다.` : '관리 중인 도메인이 없습니다. 도메인을 구입하면 여기서 레코드를 관리할 수 있습니다.', [
347
- ['서버', siteUrl],
335
+ return prettyResult(0, depth, command, zones.length ? `Loaded ${count(zones.length, 'managed domain')}.` : 'You have no managed domains. Once you buy a domain, you can manage its records here.', [
336
+ ['Server', siteUrl],
348
337
  ...zones.map((zone) => [
349
338
  zone.domain,
350
- [zone.project ?? NO_PROJECT, zoneState(zone), ...(zone.dnssec ? [`DNSSEC ${DNSSEC_STATES[zone.dnssec]}`] : []), `레코드 ${zone.records.length}개`].join(' · ')
339
+ [zone.project ?? NO_PROJECT, zoneState(zone), ...(zone.dnssec ? [`DNSSEC ${DNSSEC_STATES[zone.dnssec]}`] : []), count(zone.records.length, 'record')].join(' · ')
351
340
  ]),
352
341
  ...pageRows(paging)
353
342
  ]);
@@ -363,32 +352,32 @@ export async function runDnsRecords(args, pretty, depth, deps = defaultAuthDeps(
363
352
  if (typeof domain !== 'string')
364
353
  return domain;
365
354
  if (extra.length)
366
- return { error: unknownArgument(extra[0], pretty) };
355
+ return { error: unknownArgument(extra[0]) };
367
356
  return {
368
- steps: [CHECK_DOMAIN, { stage: 'prepare_request', message: '레코드 목록 조회 요청을 준비하고 있습니다.' }],
357
+ steps: [CHECK_DOMAIN, { stage: 'prepare_request', message: 'Preparing the request to list records.' }],
369
358
  result: (siteUrl) => plannedRequest(command, pretty, depth, siteUrl, recordsUrl(siteUrl, domain)),
370
359
  send: {
371
360
  method: 'GET',
372
361
  url: (siteUrl) => recordsUrl(siteUrl, domain),
373
- spinner: '레코드를 불러오고 있습니다.',
374
- failed: '레코드를 불러오지 못했습니다.',
362
+ spinner: 'Loading DNS records.',
363
+ failed: 'Could not load DNS records.',
375
364
  notFound: DOMAIN_NOT_FOUND,
376
365
  done: (body, siteUrl) => {
377
366
  const zone = zoneOf(body);
378
367
  if (!pretty)
379
368
  return agentResult(0, { command, siteUrl, zone });
380
- return prettyResult(0, depth, command, zone.records.length ? `${zone.domain} 레코드 ${zone.records.length}개를 불러왔습니다.` : `${zone.domain} 에는 아직 레코드가 없습니다.`, [
381
- ['서버', siteUrl],
382
- ['프로젝트', zone.project ?? NO_PROJECT],
383
- ['상태', zoneState(zone)],
369
+ return prettyResult(0, depth, command, zone.records.length ? `Loaded ${count(zone.records.length, 'record')} for ${zone.domain}.` : `${zone.domain} has no records yet.`, [
370
+ ['Server', siteUrl],
371
+ ['Project', zone.project ?? NO_PROJECT],
372
+ ['Status', zoneState(zone)],
384
373
  ...dnssecRows(zone),
385
- ['Google', zone.searchConsole ? `Search Console ${zone.searchConsole.connectedAt.slice(0, 10)} 등록` : 'Search Console 등록 전'],
374
+ ['Google', zone.searchConsole ? `Search Console registered ${zone.searchConsole.connectedAt.slice(0, 10)}` : 'Search Console not registered'],
386
375
  ['GA4', analyticsState(zone)],
387
376
  ...zone.records.map((record) => [
388
377
  record.id,
389
- `${record.type} ${hostName(record.name, zone.domain)} → ${record.value}${record.priority === undefined ? '' : ` (우선순위 ${record.priority})`} · TTL ${ttlLabel(record.ttl)}`
378
+ `${record.type} ${hostName(record.name, zone.domain)} → ${record.value}${record.priority === undefined ? '' : ` (priority ${record.priority})`} · TTL ${ttlLabel(record.ttl)}`
390
379
  ]),
391
- ...(zone.nameservers ? [['네임서버', zone.nameservers.join(', ')]] : [])
380
+ ...(zone.nameservers ? [['Nameservers', zone.nameservers.join(', ')]] : [])
392
381
  ]);
393
382
  }
394
383
  }
@@ -407,18 +396,18 @@ export async function runDnsAdd(args, pretty, depth, deps = defaultAuthDeps(pret
407
396
  const host = hostName(record.name, domain);
408
397
  return {
409
398
  steps: [CHECK_DOMAIN, CHECK_RECORD, DESCRIBE_RECORD, PREPARE_REQUEST],
410
- result: (siteUrl) => plannedChange(command, pretty, depth, siteUrl, { url: recordsUrl(siteUrl, domain), body: { ...record } }, 'DNS 레코드를 확인했습니다. 추가하지 않았습니다.', [['도메인', domain], ...recordRows(record, domain)], { domain, host, record }),
399
+ result: (siteUrl) => plannedChange(command, pretty, depth, siteUrl, { url: recordsUrl(siteUrl, domain), body: { ...record } }, 'Checked the DNS record without adding it.', [['Domain', domain], ...recordRows(record, domain)], { domain, host, record }),
411
400
  send: {
412
401
  method: 'POST',
413
402
  url: (siteUrl) => recordsUrl(siteUrl, domain),
414
403
  body: { ...record },
415
- spinner: '레코드를 추가하고 있습니다.',
416
- failed: '레코드를 추가하지 못했습니다.',
404
+ spinner: 'Adding the DNS record.',
405
+ failed: 'Could not add the DNS record.',
417
406
  notFound: DOMAIN_NOT_FOUND,
418
407
  done: (body, siteUrl) => {
419
408
  const zone = zoneOf(body);
420
409
  const saved = savedRecord(zone, record);
421
- return changed(command, pretty, depth, `${host} 레코드를 추가했습니다.`, [...(saved ? [['레코드 ID', saved.id]] : []), ...recordRows(record, domain, APPLIED_PROPAGATION)], zone, siteUrl, { host, record: saved ?? record });
410
+ return changed(command, pretty, depth, `Added the DNS record for ${host}.`, [...(saved ? [['Record ID', saved.id]] : []), ...recordRows(record, domain, APPLIED_PROPAGATION)], zone, siteUrl, { host, record: saved ?? record });
422
411
  }
423
412
  }
424
413
  };
@@ -430,7 +419,7 @@ export async function runDnsUpdate(args, pretty, depth, deps = defaultAuthDeps(p
430
419
  const domain = parseDomain(input, pretty);
431
420
  if (typeof domain !== 'string')
432
421
  return domain;
433
- const recordId = parseRecordId(id, pretty);
422
+ const recordId = parseRecordId(id);
434
423
  if (typeof recordId !== 'string')
435
424
  return recordId;
436
425
  const record = parseRecord(flags, domain, pretty);
@@ -439,15 +428,15 @@ export async function runDnsUpdate(args, pretty, depth, deps = defaultAuthDeps(p
439
428
  const host = hostName(record.name, domain);
440
429
  return {
441
430
  steps: [CHECK_DOMAIN, CHECK_RECORD_ID, CHECK_RECORD, DESCRIBE_RECORD, PREPARE_REQUEST],
442
- result: (siteUrl) => plannedChange(command, pretty, depth, siteUrl, { url: recordsUrl(siteUrl, domain, `/${encodeURIComponent(recordId)}`), body: { ...record } }, 'DNS 레코드를 확인했습니다. 수정하지 않았습니다.', [['도메인', domain], ['레코드 ID', recordId], ...recordRows(record, domain)], { domain, recordId, host, record }),
431
+ result: (siteUrl) => plannedChange(command, pretty, depth, siteUrl, { url: recordsUrl(siteUrl, domain, `/${encodeURIComponent(recordId)}`), body: { ...record } }, 'Checked the DNS record without updating it.', [['Domain', domain], ['Record ID', recordId], ...recordRows(record, domain)], { domain, recordId, host, record }),
443
432
  send: {
444
433
  method: 'POST',
445
434
  url: (siteUrl) => recordsUrl(siteUrl, domain, `/${encodeURIComponent(recordId)}`),
446
435
  body: { ...record },
447
- spinner: '레코드를 수정하고 있습니다.',
448
- failed: '레코드를 수정하지 못했습니다.',
436
+ spinner: 'Updating the DNS record.',
437
+ failed: 'Could not update the DNS record.',
449
438
  notFound: RECORD_NOT_FOUND,
450
- done: (body, siteUrl) => changed(command, pretty, depth, `${host} 레코드를 수정했습니다.`, [['레코드 ID', recordId], ...recordRows(record, domain, APPLIED_PROPAGATION)], zoneOf(body), siteUrl, { recordId, host, record: { id: recordId, ...record } })
439
+ done: (body, siteUrl) => changed(command, pretty, depth, `Updated the DNS record for ${host}.`, [['Record ID', recordId], ...recordRows(record, domain, APPLIED_PROPAGATION)], zoneOf(body), siteUrl, { recordId, host, record: { id: recordId, ...record } })
451
440
  }
452
441
  };
453
442
  });
@@ -458,41 +447,41 @@ export async function runDnsDelete(args, pretty, depth, deps = defaultAuthDeps(p
458
447
  const domain = parseDomain(input, pretty);
459
448
  if (typeof domain !== 'string')
460
449
  return domain;
461
- const recordId = parseRecordId(id, pretty);
450
+ const recordId = parseRecordId(id);
462
451
  if (typeof recordId !== 'string')
463
452
  return recordId;
464
453
  if (extra.length)
465
- return { error: unknownArgument(extra[0], pretty) };
454
+ return { error: unknownArgument(extra[0]) };
466
455
  return {
467
456
  confirmArgs: [domain, recordId],
468
- steps: [CHECK_DOMAIN, CHECK_RECORD_ID, { stage: 'review_impact', message: '삭제하면 달라지는 점을 정리하고 있습니다.' }, PREPARE_REQUEST],
469
- result: (siteUrl) => plannedChange(command, pretty, depth, siteUrl, { url: recordsUrl(siteUrl, domain, `/${encodeURIComponent(recordId)}/delete`), body: {} }, '삭제할 DNS 레코드를 확인했습니다. 삭제하지 않았습니다.', [
470
- ['도메인', domain],
471
- ['레코드 ID', recordId],
472
- ['삭제', '적용하면 이 레코드로 안내하던 길이 바로 사라집니다.'],
473
- ['주의', `사이트 연결 레코드라면 방문자가 사이트를 찾아오지 못합니다. 되살리려면 deepdynamic dns restore ${domain} --project <프로젝트> 를 씁니다.`],
474
- ['전파', PROPAGATION]
457
+ steps: [CHECK_DOMAIN, CHECK_RECORD_ID, { stage: 'review_impact', message: 'Reviewing the impact of the deletion.' }, PREPARE_REQUEST],
458
+ result: (siteUrl) => plannedChange(command, pretty, depth, siteUrl, { url: recordsUrl(siteUrl, domain, `/${encodeURIComponent(recordId)}/delete`), body: {} }, 'Checked the DNS record deletion without deleting it.', [
459
+ ['Domain', domain],
460
+ ['Record ID', recordId],
461
+ ['Impact', 'Once applied, the record is removed and stops routing traffic right away.'],
462
+ ['Warning', `If this record connects the site, visitors can no longer reach the site. To restore it, run deepdynamic dns restore ${domain} --project <project>.`],
463
+ ['Propagation', PROPAGATION]
475
464
  ], { domain, recordId }),
476
465
  send: {
477
466
  method: 'POST',
478
467
  url: (siteUrl) => recordsUrl(siteUrl, domain, `/${encodeURIComponent(recordId)}/delete`),
479
468
  body: {},
480
- spinner: '레코드를 삭제하고 있습니다.',
481
- failed: '레코드를 삭제하지 못했습니다.',
469
+ spinner: 'Deleting the DNS record.',
470
+ failed: 'Could not delete the DNS record.',
482
471
  notFound: RECORD_NOT_FOUND,
483
472
  done: (body, siteUrl) => {
484
473
  const zone = zoneOf(body);
485
- return changed(command, pretty, depth, '레코드를 삭제했습니다.', [
486
- ['레코드 ID', recordId],
487
- ...(zone.target && !zone.connected ? [['주의', `지금은 방문자가 이 도메인으로 사이트를 찾아오지 못합니다. 되살리려면 deepdynamic dns restore ${domain} --project <프로젝트> 를 씁니다.`]] : []),
488
- ['전파', APPLIED_PROPAGATION]
474
+ return changed(command, pretty, depth, 'Deleted the DNS record.', [
475
+ ['Record ID', recordId],
476
+ ...(zone.target && !zone.connected ? [['Warning', `Visitors cannot reach the site through this domain now. To restore it, run deepdynamic dns restore ${domain} --project <project>.`]] : []),
477
+ ['Propagation', APPLIED_PROPAGATION]
489
478
  ], zone, siteUrl, { recordId });
490
479
  }
491
480
  }
492
481
  };
493
482
  }, {
494
483
  message: 'Deleting removes the record from the DNS servers; if it connected the site, visitors can no longer reach it.',
495
- display: '삭제하면 이 레코드가 DNS 서버에서 사라집니다. 사용자에게 확인한 뒤 --yes 를 붙여 실행하세요.'
484
+ display: `Deleting removes this record from the DNS servers. ${CONFIRM_NEXT}`
496
485
  });
497
486
  }
498
487
  export async function runDnsRestore(args, pretty, depth, deps = defaultAuthDeps(pretty, depth)) {
@@ -501,20 +490,19 @@ export async function runDnsRestore(args, pretty, depth, deps = defaultAuthDeps(
501
490
  const domain = parseDomain(input, pretty);
502
491
  if (typeof domain !== 'string')
503
492
  return domain;
504
- const values = readFlags(flags, RESTORE_FLAGS, pretty);
493
+ const values = readFlags(flags, RESTORE_FLAGS);
505
494
  if ('error' in values)
506
495
  return values;
507
496
  const { '--project': project, '--name': rawName = 'www' } = values;
508
497
  if (project === undefined)
509
- return fail(pretty, '--project is required.', '--project 를 지정하세요.');
510
- if (!PROJECT.test(project)) {
511
- return fail(pretty, `Project names are 1-63 lowercase letters, digits or hyphens and start and end with a letter or digit: ${project}`, `프로젝트 이름은 영문 소문자·숫자로 시작하고 끝나는 1~63자의 소문자·숫자·하이픈입니다: ${project}`);
512
- }
513
- const name = parseName(rawName, domain, pretty);
498
+ return { error: '--project is required.' };
499
+ if (!PROJECT.test(project))
500
+ return { error: `Project names are 1-63 lowercase letters, digits or hyphens and start and end with a letter or digit: ${project}` };
501
+ const name = parseName(rawName, domain);
514
502
  if (typeof name !== 'string')
515
503
  return name;
516
504
  if (name === '@')
517
- return fail(pretty, '--name cannot be @ because a CNAME cannot be on the domain itself.', '--name 에 @ 는 쓸 수 없습니다. 도메인 자체에는 CNAME 을 만들 수 없습니다.');
505
+ return { error: '--name cannot be @ because a CNAME cannot be on the domain itself.' };
518
506
  const record = { type: 'CNAME', name, value: `${project}.${DNS_SITE_DOMAIN}`, ttl: 1 };
519
507
  const host = hostName(name, domain);
520
508
  const restoreUrl = (siteUrl) => new URL(`${DNS_PATH}/${encodeURIComponent(domain)}/restore`, siteUrl).href;
@@ -522,38 +510,38 @@ export async function runDnsRestore(args, pretty, depth, deps = defaultAuthDeps(
522
510
  confirmArgs: [domain, ...flags],
523
511
  steps: [
524
512
  CHECK_DOMAIN,
525
- { stage: 'check_project', message: '프로젝트 이름 형식을 확인하고 있습니다.' },
526
- { stage: 'build_record', message: '사이트 연결 CNAME 레코드를 만들고 있습니다.' },
527
- { stage: 'plan_cleanup', message: 'CNAME 과 겹치는 같은 이름 레코드의 처리를 정리하고 있습니다.' },
513
+ { stage: 'check_project', message: 'Checking the project name format.' },
514
+ { stage: 'build_record', message: 'Building the site CNAME record.' },
515
+ { stage: 'plan_cleanup', message: 'Planning the cleanup of same-name records that conflict with the CNAME.' },
528
516
  PREPARE_REQUEST
529
517
  ],
530
- result: (siteUrl) => plannedChange(command, pretty, depth, siteUrl, { url: restoreUrl(siteUrl), body: { project, name } }, '사이트 연결 복구를 확인했습니다. 복구하지 않았습니다.', [
531
- ['도메인', domain],
532
- ['프로젝트', project],
533
- ['추가', `CNAME ${host} → ${record.value}`],
518
+ result: (siteUrl) => plannedChange(command, pretty, depth, siteUrl, { url: restoreUrl(siteUrl), body: { project, name } }, 'Checked the site connection restore without restoring it.', [
519
+ ['Domain', domain],
520
+ ['Project', project],
521
+ ['Record', `CNAME ${host} → ${record.value}`],
534
522
  ['TTL', ttlLabel(record.ttl)],
535
- ['설명', describeRecord(record, domain)],
536
- ['정리', `${host} 의 다른 레코드는 CNAME 과 함께 쓸 수 없어 적용할 때 정리됩니다.`],
537
- ['전파', PROPAGATION]
523
+ ['Description', describeRecord(record, domain)],
524
+ ['Cleanup', `Other records of ${host} cannot coexist with a CNAME and are removed when applied.`],
525
+ ['Propagation', PROPAGATION]
538
526
  ], { domain, host, project, record, replacesSameName: true }),
539
527
  send: {
540
528
  method: 'POST',
541
529
  url: restoreUrl,
542
530
  body: { project, name },
543
- spinner: '사이트 연결을 복구하고 있습니다.',
544
- failed: '사이트 연결을 복구하지 못했습니다.',
531
+ spinner: 'Restoring the site connection.',
532
+ failed: 'Could not restore the site connection.',
545
533
  notFound: PROJECT_NOT_FOUND,
546
- done: (body, siteUrl) => changed(command, pretty, depth, `${host} 사이트 연결을 복구했습니다.`, [
547
- ['프로젝트', project],
548
- ['추가', `CNAME ${host} → ${record.value}`],
549
- ['정리', `${host} 의 다른 레코드는 CNAME 과 함께 쓸 수 없어 정리했습니다.`],
550
- ['전파', APPLIED_PROPAGATION]
534
+ done: (body, siteUrl) => changed(command, pretty, depth, `Restored the site connection for ${host}.`, [
535
+ ['Project', project],
536
+ ['Record', `CNAME ${host} → ${record.value}`],
537
+ ['Cleanup', `Other records of ${host} cannot coexist with a CNAME and were removed.`],
538
+ ['Propagation', APPLIED_PROPAGATION]
551
539
  ], zoneOf(body), siteUrl, { host, project, record })
552
540
  }
553
541
  };
554
542
  }, {
555
543
  message: 'Restoring replaces the other records of the same host and can move the domain to another project.',
556
- display: '복구하면 같은 이름의 다른 레코드가 정리되고 도메인이 다른 프로젝트로 옮겨질 수 있습니다. 사용자에게 확인한 뒤 --yes 를 붙여 실행하세요.'
544
+ display: `Restoring removes the other records of the same host and can move the domain to another project. ${CONFIRM_NEXT}`
557
545
  });
558
546
  }
559
547
  export async function runDnsSync(args, pretty, depth, deps = defaultAuthDeps(pretty, depth)) {
@@ -563,44 +551,44 @@ export async function runDnsSync(args, pretty, depth, deps = defaultAuthDeps(pre
563
551
  if (typeof domain !== 'string')
564
552
  return domain;
565
553
  if (extra.length)
566
- return { error: unknownArgument(extra[0], pretty) };
554
+ return { error: unknownArgument(extra[0]) };
567
555
  const syncUrl = (siteUrl) => new URL(`${DNS_PATH}/${encodeURIComponent(domain)}/sync`, siteUrl).href;
568
556
  return {
569
557
  confirmArgs: [domain],
570
- steps: [CHECK_DOMAIN, { stage: 'review_impact', message: '반영하면 달라지는 점을 정리하고 있습니다.' }, PREPARE_REQUEST],
571
- result: (siteUrl) => plannedChange(command, pretty, depth, siteUrl, { url: syncUrl(siteUrl), body: {} }, 'DNS 동기화를 확인했습니다. 반영하지 않았습니다.', [
572
- ['도메인', domain],
573
- ['반영', SYNC_EFFECT],
574
- ['주의', SYNC_WARNING],
575
- ['전파', PROPAGATION]
558
+ steps: [CHECK_DOMAIN, { stage: 'review_impact', message: 'Reviewing the impact of the sync.' }, PREPARE_REQUEST],
559
+ result: (siteUrl) => plannedChange(command, pretty, depth, siteUrl, { url: syncUrl(siteUrl), body: {} }, 'Checked the DNS sync without applying it.', [
560
+ ['Domain', domain],
561
+ ['Effect', SYNC_EFFECT],
562
+ ['Warning', SYNC_WARNING],
563
+ ['Propagation', PROPAGATION]
576
564
  ], { domain }),
577
565
  send: {
578
566
  method: 'POST',
579
567
  url: syncUrl,
580
568
  body: {},
581
- spinner: 'DNS 서버에 반영하고 있습니다.',
582
- failed: 'DNS 서버에 반영하지 못했습니다.',
569
+ spinner: 'Syncing the DNS servers.',
570
+ failed: 'Could not sync the DNS servers.',
583
571
  notFound: DOMAIN_NOT_FOUND,
584
572
  failures: {
585
573
  delegation_pending: {
586
574
  code: 'delegation_pending',
587
575
  message: `The registrar of this domain bought elsewhere does not point at the DeepDynamic nameservers yet, so the zone stays pending. Ask the user to set the nameservers in zone.nameservers of deepdynamic dns records ${domain} at the registrar where the domain was bought, then run this again a few minutes later.`,
588
- display: `도메인을 산 곳의 네임서버가 아직 딥다이나믹 네임서버로 바뀌지 않았습니다. deepdynamic dns records ${domain} 에 나온 네임서버로 바꾼 뒤 몇 분 지나 다시 실행하세요.`
576
+ display: `The registrar where the domain was bought does not use the DeepDynamic nameservers yet. Set the nameservers listed by deepdynamic dns records ${domain} there, then run this again a few minutes later.`
589
577
  }
590
578
  },
591
579
  done: (body, siteUrl) => {
592
580
  const zone = zoneOf(body);
593
- return changed(command, pretty, depth, `${zone.domain} 레코드를 DNS 서버에 반영했습니다.`, [
594
- ['상태', zoneState(zone)],
595
- ...(zone.nameservers ? [['네임서버', zone.nameservers.join(', ')]] : []),
596
- ['전파', APPLIED_PROPAGATION]
581
+ return changed(command, pretty, depth, `Synced the records of ${zone.domain} to the DNS servers.`, [
582
+ ['Status', zoneState(zone)],
583
+ ...(zone.nameservers ? [['Nameservers', zone.nameservers.join(', ')]] : []),
584
+ ['Propagation', APPLIED_PROPAGATION]
597
585
  ], zone, siteUrl, {});
598
586
  }
599
587
  }
600
588
  };
601
589
  }, {
602
590
  message: 'Syncing overwrites the DNS servers with the saved records, so records changed only on the DNS servers are removed.',
603
- display: '동기화하면 저장한 레코드로 DNS 서버를 덮어써 DNS 서버에서만 바꾼 레코드가 사라집니다. 사용자에게 확인한 뒤 --yes 를 붙여 실행하세요.'
591
+ display: `Syncing overwrites the DNS servers with the saved records, so records changed only on the DNS servers are removed. ${CONFIRM_NEXT}`
604
592
  });
605
593
  }
606
594
  export async function runDnsDnssec(args, pretty, depth, deps = defaultAuthDeps(pretty, depth)) {
@@ -610,44 +598,45 @@ export async function runDnsDnssec(args, pretty, depth, deps = defaultAuthDeps(p
610
598
  if (typeof domain !== 'string')
611
599
  return domain;
612
600
  if (state === undefined)
613
- return fail(pretty, 'Give on or off after the domain.', '도메인 뒤에 on 또는 off 를 지정하세요.');
601
+ return { error: 'Give on or off after the domain.' };
614
602
  if (state.startsWith('-'))
615
- return { error: unknownArgument(state, pretty) };
603
+ return { error: unknownArgument(state) };
616
604
  if (state !== 'on' && state !== 'off')
617
- return fail(pretty, `Give on or off after the domain: ${state}`, `도메인 뒤에는 on 또는 off 만 올 수 있습니다: ${state}`);
605
+ return { error: `Give on or off after the domain: ${state}` };
618
606
  if (extra.length)
619
- return { error: unknownArgument(extra[0], pretty) };
607
+ return { error: unknownArgument(extra[0]) };
620
608
  const enabled = state === 'on';
621
609
  const dnssecUrl = (siteUrl) => new URL(`${DNS_PATH}/${encodeURIComponent(domain)}/dnssec`, siteUrl).href;
622
610
  return {
623
611
  confirmArgs: [domain, state],
624
- steps: [CHECK_DOMAIN, { stage: 'check_state', message: '바꿀 DNSSEC 설정과 달라지는 점을 정리하고 있습니다.' }, PREPARE_REQUEST],
625
- result: (siteUrl) => plannedChange(command, pretty, depth, siteUrl, { url: dnssecUrl(siteUrl), body: { enabled } }, 'DNSSEC 변경을 확인했습니다. 바꾸지 않았습니다.', [
626
- ['도메인', domain],
627
- ['바꿀 설정', enabled ? 'DNSSEC 켜기' : 'DNSSEC 끄기'],
628
- ['반영', enabled ? DNSSEC_ON_EFFECT : DNSSEC_NOTES.disabling],
629
- ['대상', DNSSEC_SCOPE]
612
+ steps: [CHECK_DOMAIN, { stage: 'check_state', message: 'Reviewing the DNSSEC change and its impact.' }, PREPARE_REQUEST],
613
+ result: (siteUrl) => plannedChange(command, pretty, depth, siteUrl, { url: dnssecUrl(siteUrl), body: { enabled } }, 'Checked the DNSSEC change without applying it.', [
614
+ ['Domain', domain],
615
+ ['Change', enabled ? 'Turn DNSSEC on' : 'Turn DNSSEC off'],
616
+ ['Effect', enabled ? DNSSEC_ON_EFFECT : DNSSEC_NOTES.disabling],
617
+ ['Target', DNSSEC_SCOPE]
630
618
  ], { domain, enabled }),
631
619
  send: {
632
620
  method: 'POST',
633
621
  url: dnssecUrl,
634
622
  body: { enabled },
635
- spinner: enabled ? 'DNSSEC 을 켜고 있습니다.' : 'DNSSEC 을 끄고 있습니다.',
636
- failed: enabled ? 'DNSSEC 을 켜지 못했습니다.' : 'DNSSEC 을 끄지 못했습니다.',
623
+ spinner: enabled ? 'Turning DNSSEC on.' : 'Turning DNSSEC off.',
624
+ failed: enabled ? 'Could not turn DNSSEC on.' : 'Could not turn DNSSEC off.',
637
625
  notFound: DOMAIN_NOT_FOUND,
638
626
  failures: DNSSEC_FAILURES,
639
627
  done: (body, siteUrl) => {
640
628
  const zone = zoneOf(body);
641
- return changed(command, pretty, depth, `${zone.domain} DNSSEC 을 ${enabled ? '켰습니다' : '껐습니다'}.`, dnssecRows(zone, true), zone, siteUrl, { dnssec: zone.dnssec ?? null });
629
+ return changed(command, pretty, depth, `Turned DNSSEC ${enabled ? 'on' : 'off'} for ${zone.domain}.`, dnssecRows(zone, true), zone, siteUrl, { dnssec: zone.dnssec ?? null });
642
630
  }
643
631
  }
644
632
  };
645
633
  }, {
646
634
  message: 'Turning DNSSEC on or off changes the signing of the DNS zone and the DS record at the registrar; turning it off finishes only 2 days later.',
647
- display: 'DNSSEC 을 켜거나 끄면 DNS 서버의 존 서명과 도메인을 산 곳(등록처)의 DS 레코드가 바뀝니다. 끄면 2일 뒤에 서명이 해제됩니다. 사용자에게 확인한 뒤 --yes 를 붙여 실행하세요.'
635
+ display: `Turning DNSSEC on or off changes the zone signing on the DNS servers and the DS record at the registrar. Turning it off stops signing 2 days later. ${CONFIRM_NEXT}`
648
636
  });
649
637
  }
650
638
  const GOOGLE_NEXT = 'Open url in a browser signed in to the same DeepDynamic account within 10 minutes, pick the Google account that should own the Search Console property and allow both permissions. The browser then adds the ownership TXT record, verifies the domain and adds the sc-domain: property, and lands on /projects#dns with the result. Confirm with deepdynamic dns records <domain>: zone.searchConsole.connectedAt is set once it is done.';
639
+ const CONSENT_NOTICE = 'Open it within 10 minutes in a browser signed in to the same DeepDynamic account. When registration finishes, the browser returns to the DNS tab of the My Projects page.';
651
640
  export async function runDnsGoogle(args, pretty, depth, deps = defaultAuthDeps(pretty, depth)) {
652
641
  const command = 'dns google';
653
642
  return rehearsed(command, args, pretty, depth, deps, ([input, ...extra]) => {
@@ -655,42 +644,42 @@ export async function runDnsGoogle(args, pretty, depth, deps = defaultAuthDeps(p
655
644
  if (typeof domain !== 'string')
656
645
  return domain;
657
646
  if (extra.length)
658
- return { error: unknownArgument(extra[0], pretty) };
647
+ return { error: unknownArgument(extra[0]) };
659
648
  const googleUrl = (siteUrl) => new URL(`${DNS_PATH}/${encodeURIComponent(domain)}/google`, siteUrl).href;
660
649
  return {
661
650
  steps: [CHECK_DOMAIN, PREPARE_REQUEST],
662
- result: (siteUrl) => plannedChange(command, pretty, depth, siteUrl, { url: googleUrl(siteUrl), body: {} }, 'Google Search Console 등록 요청을 확인했습니다. 보내지 않았습니다.', [
663
- ['도메인', domain],
664
- ['진행', '받은 주소를 같은 딥다이나믹 계정으로 로그인한 브라우저에서 10분 안에 열어 Google 계정을 고르고 두 권한을 허용하면, 소유 확인 TXT 추가·소유 확인·Search Console 속성 추가까지 이어서 합니다.']
651
+ result: (siteUrl) => plannedChange(command, pretty, depth, siteUrl, { url: googleUrl(siteUrl), body: {} }, 'Checked the Google Search Console registration request without sending it.', [
652
+ ['Domain', domain],
653
+ ['Next', 'Open the returned URL within 10 minutes in a browser signed in to the same DeepDynamic account, pick a Google account and allow both permissions. The ownership TXT record is then added, the domain is verified and the Search Console property is added.']
665
654
  ], { domain }),
666
655
  send: {
667
656
  method: 'POST',
668
657
  url: googleUrl,
669
658
  body: {},
670
- spinner: 'Google 동의 주소를 만들고 있습니다.',
671
- failed: 'Google 동의 주소를 만들지 못했습니다.',
659
+ spinner: 'Creating the Google consent URL.',
660
+ failed: 'Could not create the Google consent URL.',
672
661
  notFound: DOMAIN_NOT_FOUND,
673
662
  failures: {
674
663
  zone_pending: {
675
664
  code: 'zone_pending',
676
665
  message: `The DNS zone of this domain is still pending, and Google can verify it only after the zone is ready. Check zone.status with deepdynamic dns records ${domain} and run this again once it is ready.`,
677
- display: `DNS 를 아직 준비하고 있습니다. deepdynamic dns records ${domain} 의 상태가 준비되면 다시 실행하세요.`
666
+ display: `DNS is still being set up. Run this again once deepdynamic dns records ${domain} shows that setup has finished.`
678
667
  },
679
668
  delegation_propagating: {
680
669
  code: 'delegation_propagating',
681
670
  message: 'Public DNS still shows the old nameservers for this domain (a freshly bought domain takes about 10 minutes at the registry), so Google could not see the ownership TXT yet. Wait about 10 minutes and run this again.',
682
- display: '네임서버 변경이 아직 인터넷에 퍼지는 중입니다. 도메인을 산 직후에는 10분쯤 걸리니 잠시 뒤 다시 실행하세요.'
671
+ display: 'The nameserver change is still propagating across the internet. Right after buying a domain this takes about 10 minutes, so run this again shortly.'
683
672
  }
684
673
  },
685
674
  done: (body, siteUrl) => {
686
675
  const url = body.url;
687
676
  return pretty
688
- ? prettyResult(0, depth, command, '브라우저에서 아래 주소를 열어 Google Search Console 등록을 마치세요.', [
689
- ['서버', siteUrl],
690
- ['도메인', domain],
691
- ['주소', url],
692
- ['안내', '같은 딥다이나믹 계정으로 로그인한 브라우저에서 10분 안에 여세요. 등록을 마치면 /projects 의 DNS 화면으로 돌아옵니다.'],
693
- ['확인', `deepdynamic dns records ${domain} 의 Google 항목`]
677
+ ? prettyResult(0, depth, command, 'Open the URL below in a browser to finish the Google Search Console registration.', [
678
+ ['Server', siteUrl],
679
+ ['Domain', domain],
680
+ ['URL', url],
681
+ ['Notice', CONSENT_NOTICE],
682
+ ['Check', `Google row of deepdynamic dns records ${domain}`]
694
683
  ])
695
684
  : agentResult(0, { command, siteUrl, domain, url, next: GOOGLE_NEXT.replace('<domain>', domain) });
696
685
  }
@@ -699,14 +688,14 @@ export async function runDnsGoogle(args, pretty, depth, deps = defaultAuthDeps(p
699
688
  });
700
689
  }
701
690
  const ANALYTICS_NEXT = 'Open url in a browser signed in to the same DeepDynamic account within 10 minutes, pick the Google account that should own the GA4 property and allow the Google Analytics edit permission. The browser then creates a new GA4 property named after the domain with a web data stream for https://<siteName>.<domain> under the first Google Analytics account of that Google account, adds the Google tag to the domain and its site host, and lands on /projects#dns with the result. Confirm with deepdynamic dns records <domain>: zone.analytics.measurementId is set once it is done.';
702
- const ANALYTICS_START = '받은 주소를 같은 딥다이나믹 계정으로 로그인한 브라우저에서 10분 안에 열어 Google 계정을 고르고 Google Analytics 수정 권한을 허용하면, 그 Google 계정의 첫 GA 계정에 도메인 이름의 GA4 속성과 웹 스트림을 새로 만들고 사이트에 Google 태그를 넣습니다.';
703
- const ANALYTICS_OFF_EFFECT = '도메인과 사이트 호스트의 HTML 에 Google 태그를 더 이상 넣지 않습니다. GA4 속성은 Google 에 그대로 남습니다.';
704
- const ANALYTICS_OFF_WARNING = '다시 등록하면 새 GA4 속성을 만들어 지금까지의 방문 기록과 이어지지 않습니다.';
691
+ const ANALYTICS_START = 'Open the returned URL within 10 minutes in a browser signed in to the same DeepDynamic account, pick a Google account and allow the Google Analytics edit permission. A new GA4 property named after the domain and a web stream are then created under the first Google Analytics account of that Google account, and the Google tag is added to the site.';
692
+ const ANALYTICS_OFF_EFFECT = 'Stops adding the Google tag to the HTML of the domain and the site host. The GA4 property stays in Google.';
693
+ const ANALYTICS_OFF_WARNING = 'Registering again creates a new GA4 property that does not continue the visit data collected so far.';
705
694
  const ANALYTICS_FAILURES = {
706
695
  no_project: {
707
696
  code: 'no_project',
708
697
  message: 'The domain is not connected to a project, so there is no site to add the Google tag to. Connect one with deepdynamic dns restore <domain> --project <name> --yes, then run this again.',
709
- display: '프로젝트에 연결되지 않은 도메인입니다. deepdynamic dns restore 로 프로젝트를 먼저 연결한 뒤 다시 실행하세요.'
698
+ display: 'The domain is not connected to a project. Connect one with deepdynamic dns restore first, then run this again.'
710
699
  }
711
700
  };
712
701
  export async function runDnsAnalytics(args, pretty, depth, deps = defaultAuthDeps(pretty, depth)) {
@@ -717,35 +706,32 @@ export async function runDnsAnalytics(args, pretty, depth, deps = defaultAuthDep
717
706
  const domain = parseDomain(input, pretty);
718
707
  if (typeof domain !== 'string')
719
708
  return domain;
720
- if (extra.length) {
721
- return extra[0].startsWith('-')
722
- ? { error: unknownArgument(extra[0], pretty) }
723
- : fail(pretty, `Only off can follow the domain: ${extra[0]}`, `도메인 뒤에는 off 만 올 수 있습니다: ${extra[0]}`);
724
- }
709
+ if (extra.length)
710
+ return { error: extra[0].startsWith('-') ? unknownArgument(extra[0]) : `Only off can follow the domain: ${extra[0]}` };
725
711
  const analyticsUrl = (siteUrl) => new URL(`${DNS_PATH}/${encodeURIComponent(domain)}/analytics`, siteUrl).href;
726
712
  return {
727
713
  steps: [CHECK_DOMAIN, PREPARE_REQUEST],
728
- result: (siteUrl) => plannedChange(command, pretty, depth, siteUrl, { url: analyticsUrl(siteUrl), body: {} }, 'Google Analytics 등록 요청을 확인했습니다. 보내지 않았습니다.', [
729
- ['도메인', domain],
730
- ['진행', ANALYTICS_START]
714
+ result: (siteUrl) => plannedChange(command, pretty, depth, siteUrl, { url: analyticsUrl(siteUrl), body: {} }, 'Checked the Google Analytics registration request without sending it.', [
715
+ ['Domain', domain],
716
+ ['Next', ANALYTICS_START]
731
717
  ], { domain }),
732
718
  send: {
733
719
  method: 'POST',
734
720
  url: analyticsUrl,
735
721
  body: {},
736
- spinner: 'Google 동의 주소를 만들고 있습니다.',
737
- failed: 'Google 동의 주소를 만들지 못했습니다.',
722
+ spinner: 'Creating the Google consent URL.',
723
+ failed: 'Could not create the Google consent URL.',
738
724
  notFound: DOMAIN_NOT_FOUND,
739
725
  failures: ANALYTICS_FAILURES,
740
726
  done: (body, siteUrl) => {
741
727
  const url = body.url;
742
728
  return pretty
743
- ? prettyResult(0, depth, command, '브라우저에서 아래 주소를 열어 Google Analytics 등록을 마치세요.', [
744
- ['서버', siteUrl],
745
- ['도메인', domain],
746
- ['주소', url],
747
- ['안내', '같은 딥다이나믹 계정으로 로그인한 브라우저에서 10분 안에 여세요. 등록을 마치면 /projects 의 DNS 화면으로 돌아옵니다.'],
748
- ['확인', `deepdynamic dns records ${domain} 의 GA4 항목`]
729
+ ? prettyResult(0, depth, command, 'Open the URL below in a browser to finish the Google Analytics registration.', [
730
+ ['Server', siteUrl],
731
+ ['Domain', domain],
732
+ ['URL', url],
733
+ ['Notice', CONSENT_NOTICE],
734
+ ['Check', `GA4 row of deepdynamic dns records ${domain}`]
749
735
  ])
750
736
  : agentResult(0, { command, siteUrl, domain, url, next: ANALYTICS_NEXT.replaceAll('<domain>', domain) });
751
737
  }
@@ -760,32 +746,32 @@ function runDnsAnalyticsOff(args, pretty, depth, deps) {
760
746
  if (typeof domain !== 'string')
761
747
  return domain;
762
748
  if (extra.length)
763
- return { error: unknownArgument(extra[0], pretty) };
749
+ return { error: unknownArgument(extra[0]) };
764
750
  const disconnectUrl = (siteUrl) => new URL(`${DNS_PATH}/${encodeURIComponent(domain)}/analytics/disconnect`, siteUrl).href;
765
751
  return {
766
752
  confirmArgs: [domain, 'off'],
767
- steps: [CHECK_DOMAIN, { stage: 'review_impact', message: '해제하면 달라지는 점을 정리하고 있습니다.' }, PREPARE_REQUEST],
768
- result: (siteUrl) => plannedChange(command, pretty, depth, siteUrl, { url: disconnectUrl(siteUrl), body: {} }, 'Google Analytics 해제를 확인했습니다. 바꾸지 않았습니다.', [
769
- ['도메인', domain],
770
- ['바꿀 설정', 'Google 태그 제거'],
771
- ['반영', ANALYTICS_OFF_EFFECT],
772
- ['주의', ANALYTICS_OFF_WARNING]
753
+ steps: [CHECK_DOMAIN, { stage: 'review_impact', message: 'Reviewing the impact of removing Google Analytics.' }, PREPARE_REQUEST],
754
+ result: (siteUrl) => plannedChange(command, pretty, depth, siteUrl, { url: disconnectUrl(siteUrl), body: {} }, 'Checked the Google Analytics removal without applying it.', [
755
+ ['Domain', domain],
756
+ ['Change', 'Remove the Google tag'],
757
+ ['Effect', ANALYTICS_OFF_EFFECT],
758
+ ['Warning', ANALYTICS_OFF_WARNING]
773
759
  ], { domain }),
774
760
  send: {
775
761
  method: 'POST',
776
762
  url: disconnectUrl,
777
763
  body: {},
778
- spinner: '사이트에서 Google 태그를 빼고 있습니다.',
779
- failed: 'Google Analytics 를 해제하지 못했습니다.',
764
+ spinner: 'Removing the Google tag from the site.',
765
+ failed: 'Could not remove Google Analytics.',
780
766
  notFound: DOMAIN_NOT_FOUND,
781
767
  done: (body, siteUrl) => {
782
768
  const zone = zoneOf(body);
783
- return changed(command, pretty, depth, `${zone.domain} 사이트에서 Google 태그를 제거했습니다.`, [['GA4', analyticsState(zone)], ['안내', 'GA4 속성은 Google 에 그대로 남습니다. 다시 등록하면 새 속성을 만듭니다.']], zone, siteUrl, { analytics: zone.analytics ?? null });
769
+ return changed(command, pretty, depth, `Removed the Google tag from the ${zone.domain} site.`, [['GA4', analyticsState(zone)], ['Notice', 'The GA4 property stays in Google. Registering again creates a new property.']], zone, siteUrl, { analytics: zone.analytics ?? null });
784
770
  }
785
771
  }
786
772
  };
787
773
  }, {
788
774
  message: 'Removing stops adding the Google tag to the site, so visits are no longer recorded. The GA4 property stays in Google, and registering again creates a new property that does not continue the old data.',
789
- display: '해제하면 사이트에 Google 태그를 더 이상 넣지 않아 방문 기록이 쌓이지 않습니다. GA4 속성은 Google 에 남지만 다시 등록하면 새 속성을 만듭니다. 사용자에게 확인한 뒤 --yes 를 붙여 실행하세요.'
775
+ display: `Removing stops adding the Google tag to the site, so visits are no longer recorded. The GA4 property stays in Google, but registering again creates a new property. ${CONFIRM_NEXT}`
790
776
  });
791
777
  }